Skip to content

Commit

Permalink
[COMPLIANCE] Add Copyright and License Headers
Browse files Browse the repository at this point in the history
  • Loading branch information
hashicorp-copywrite[bot] authored May 15, 2023
1 parent 38d077a commit ee59bf8
Show file tree
Hide file tree
Showing 172 changed files with 520 additions and 0 deletions.
3 changes: 3 additions & 0 deletions governance/first-generation/aws/sentinel.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

policy "restrict-aws-region" {
enforcement_level = "soft-mandatory"
}
3 changes: 3 additions & 0 deletions governance/first-generation/external/check_account.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0


#set -e

Expand Down
3 changes: 3 additions & 0 deletions governance/first-generation/external/check_account.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

terraform {
required_version = ">= 0.11.7"
}
Expand Down
3 changes: 3 additions & 0 deletions governance/second-generation/aws/sentinel.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

policy "enforce-mandatory-tags" {
enforcement_level = "advisory"
}
Expand Down
3 changes: 3 additions & 0 deletions governance/second-generation/azure/sentinel.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

policy "enforce-mandatory-tags" {
enforcement_level = "advisory"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

policy "check-external-http-api" {
enforcement_level = "advisory"
}
Expand Down
3 changes: 3 additions & 0 deletions governance/second-generation/cloud-agnostic/sentinel.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

policy "prohibited-datasources" {
enforcement_level = "advisory"
}
Expand Down
3 changes: 3 additions & 0 deletions governance/second-generation/gcp/sentinel.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

policy "enforce-mandatory-labels" {
enforcement_level = "advisory"
}
Expand Down
3 changes: 3 additions & 0 deletions governance/second-generation/vmware/sentinel.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

policy "restrict-vm-cpu-and-memory" {
enforcement_level = "advisory"
}
Expand Down
3 changes: 3 additions & 0 deletions infrastructure-as-code/aws-ec2-instance/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

terraform {
required_version = ">= 0.11.0"
}
Expand Down
3 changes: 3 additions & 0 deletions infrastructure-as-code/aws-ec2-instance/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

output "public_dns" {
value = "${aws_instance.ubuntu.public_dns}"
}
3 changes: 3 additions & 0 deletions infrastructure-as-code/aws-ec2-instance/variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

variable "aws_region" {
description = "AWS region"
default = "us-west-1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# These lambda functions return dictionaries of instances.
# Use them with other functions to take action on tagged, untagged
# or running instances.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# Checks the TTL of your instances, if expired can stop or terminate them.
resource "aws_lambda_function" "ASGReaper" {
filename = "./files/ASGReaper.zip"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# This lambda is intended to deal with untagged Auto Scaling Groups.
resource "aws_lambda_function" "ASGJanitor" {
filename = "./files/ASGJanitor.zip"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# These lambda functions return dictionaries of instances.
# Use them with other functions to take action on tagged, untagged
# or running instances.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# Checks the TTL of your instances, if expired can stop or terminate them.
resource "aws_lambda_function" "EC2Reaper" {
filename = "./files/EC2Reaper.zip"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# This lambda is intended to deal with untagged instances by either stopping
# and then terminating them according to your lifecycle policy.
resource "aws_lambda_function" "EC2Janitor" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# This function deals with ASGs that are untagged.
# TODO: Actually write the code to make it work.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# This function uses the getTaggedASGs.py function to fetch a list of properly tagged ASGs.
# It will then determine whether those ASGs have expired, and delete them if they have.
# Finally a message is sent to Slack or Email to notify your admins.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# This function deals with instances that are untagged. Use the environment variables
# sleepDays and reapDays to set your lifecycle policies.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# General purpose Lambda function for sending Slack messages, encrypted in transit.

import boto3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# Example functions for AWS reporting. Use as a base to build your own.

import boto3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

import boto3
import json
import logging
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# Gets a list of properly tagged ASGs and returns some info about them.

import boto3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

import boto3
import json
import logging
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# Gets a list of untagged ASGs and returns some info about them.

import boto3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

import boto3
import json
import logging
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# General purpose Lambda function for sending Slack messages, encrypted in transit.

import boto3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# General purpose Lambda function for sending Slack messages, encrypted in transit.

import boto3
Expand Down
3 changes: 3 additions & 0 deletions infrastructure-as-code/aws-lambda-ec2-lifecycles/iam_roles.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# IAM roles to allow Lambda functions to access different AWS resources.

# Fetch our own account id and region. Used in our IAM policy templates.
Expand Down
3 changes: 3 additions & 0 deletions infrastructure-as-code/aws-lambda-ec2-lifecycles/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# Terraform configurations for creating lambda functions to help manage
# your ec2 instance lifecycles. The data_collectors.tf and iam_roles.tf
# files are required. You may also use one or more of the following:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# Notify slack about the # of each instance type you have running.
resource "aws_lambda_function" "notifyInstanceUsage" {
filename = "./files/notifyInstanceUsage.zip"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# Notify about untagged instances and their key names.
resource "aws_lambda_function" "notifyUntaggedInstances" {
filename = "./files/notifyUntaggedInstances.zip"
Expand Down
3 changes: 3 additions & 0 deletions infrastructure-as-code/aws-lambda-ec2-lifecycles/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

3 changes: 3 additions & 0 deletions infrastructure-as-code/aws-lambda-ec2-lifecycles/variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

variable "region" {
default = "us-west-2"
description = "AWS Region"
Expand Down
3 changes: 3 additions & 0 deletions infrastructure-as-code/azure-vm/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

terraform {
required_version = ">= 0.11.1"
}
Expand Down
3 changes: 3 additions & 0 deletions infrastructure-as-code/dynamic-aws-creds-from-vault/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

terraform {
required_version = ">= 0.11.0"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

resource "aws_security_group_rule" "ssh" {
security_group_id = "${aws_security_group.egress_public.id}"
type = "ingress"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

resource "aws_security_group" "egress_public" {
name = "${var.environment_name}-egress_public"
description = "${var.environment_name}-egress_public"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

resource "aws_internet_gateway" "main" {
vpc_id = "${aws_vpc.main.id}"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

#
# Public
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

resource "aws_subnet" "public" {
count = "${length(var.vpc_cidrs_public)}"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

resource "aws_vpc" "main" {
cidr_block = "${var.vpc_cidr}"
enable_dns_hostnames = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# Outputs
output "vpc_id" {
value = "${aws_vpc.main.id}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# Required variables
variable "environment_name" {
description = "Environment Name"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

variable "name" { default = "dynamic-aws-creds-consumer" }
variable "path" { default = "../producer-workspace/terraform.tfstate" }
variable "ttl" { default = "1" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

variable "aws_access_key" { }
variable "aws_secret_key" { }
variable "name" { default = "dynamic-aws-creds-producer" }
Expand Down
3 changes: 3 additions & 0 deletions infrastructure-as-code/gcp-compute-instance/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

terraform {
required_version = ">= 0.11.1"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# `.tf` files that contain the word "gitignore" are ignored
# by git in the `.gitignore` file at the root of this repo.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

module "ssh_keypair_aws_override" {
source = "github.com/hashicorp-modules/ssh-keypair-aws"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

output "zREADME" {
value = <<README

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# ---------------------------------------------------------------------------------------------------------------------
# General Variables
# ---------------------------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# ---------------------------------------------------------------------------------------------------------------------
# General Variables
# ---------------------------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# `.tf` files that contain the word "gitignore" are ignored
# by git in the `.gitignore` file at the root of this repo.

Expand Down
3 changes: 3 additions & 0 deletions infrastructure-as-code/hashistack/dev/terraform-aws/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

module "ssh_keypair_aws" {
source = "github.com/hashicorp-modules/ssh-keypair-aws"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

output "zREADME" {
value = <<README

Expand Down
Loading

0 comments on commit ee59bf8

Please sign in to comment.