Skip to content

Commit

Permalink
[COMPLIANCE] Add Copyright and License Headers (#85)
Browse files Browse the repository at this point in the history
* [COMPLIANCE] Add Copyright and License Headers

* add copyright to test files

* Remove all template/test lines with license/copyright headers

* exempt generated files from copyright headers autogeneration

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Ronald Ekambi <[email protected]>
Co-authored-by: josh <[email protected]>
  • Loading branch information
3 people authored Apr 5, 2023
1 parent caf1406 commit 49706d3
Show file tree
Hide file tree
Showing 70 changed files with 235 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .copywrite.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
schema_version = 1

project {
license = "MPL-2.0"
copyright_year = 2021

# (OPTIONAL) A list of globs that should not have copyright/license headers.
# Supports doublestar glob patterns for more flexibility in defining which
# files or folders should be ignored
header_ignore = [
# tests file and generated files
"hcp-ui-templates/ec2-existing-vpc/main.tf",
"hcp-ui-templates/ec2/main.tf",
"hcp-ui-templates/ecs-existing-vpc/main.tf",
"hcp-ui-templates/ecs/main.tf",
"hcp-ui-templates/eks-existing-vpc/main.tf",
"hcp-ui-templates/eks/main.tf",
"test/hcp/testdata/ec2-existing-vpc.golden",
"test/hcp/testdata/ec2.golden",
"test/hcp/testdata/ecs-existing-vpc.golden",
"test/hcp/testdata/ecs.golden",
"test/hcp/testdata/eks-existing-vpc.golden",
"test/hcp/testdata/eks.golden",
]
}
3 changes: 3 additions & 0 deletions examples/existing-vpc/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_providers {
aws = {
Expand Down
3 changes: 3 additions & 0 deletions examples/hcp-ec2-demo/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

data "aws_availability_zones" "available" {
filter {
name = "zone-type"
Expand Down
3 changes: 3 additions & 0 deletions examples/hcp-ec2-demo/output.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 "consul_root_token" {
value = hcp_consul_cluster_root_token.token.secret_id
sensitive = true
Expand Down
3 changes: 3 additions & 0 deletions examples/hcp-ec2-demo/providers.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_providers {
aws = {
Expand Down
3 changes: 3 additions & 0 deletions examples/hcp-ec2-demo/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 "cluster_id" {
type = string
description = "The name of your HCP Consul cluster"
Expand Down
3 changes: 3 additions & 0 deletions examples/hcp-ecs-demo/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

data "aws_availability_zones" "available" {
filter {
name = "zone-type"
Expand Down
3 changes: 3 additions & 0 deletions examples/hcp-ecs-demo/output.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 "consul_root_token" {
value = hcp_consul_cluster_root_token.token.secret_id
sensitive = true
Expand Down
3 changes: 3 additions & 0 deletions examples/hcp-ecs-demo/providers.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_providers {
aws = {
Expand Down
3 changes: 3 additions & 0 deletions examples/hcp-ecs-demo/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 "cluster_id" {
type = string
description = "The name of your HCP Consul cluster"
Expand Down
3 changes: 3 additions & 0 deletions examples/hcp-eks-demo/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

data "aws_availability_zones" "available" {
filter {
name = "zone-type"
Expand Down
3 changes: 3 additions & 0 deletions examples/hcp-eks-demo/output.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 "consul_root_token" {
value = hcp_consul_cluster_root_token.token.secret_id
sensitive = true
Expand Down
3 changes: 3 additions & 0 deletions examples/hcp-eks-demo/providers.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_providers {
aws = {
Expand Down
3 changes: 3 additions & 0 deletions examples/hcp-eks-demo/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 "cluster_id" {
type = string
description = "The name of your HCP Consul cluster"
Expand Down
3 changes: 3 additions & 0 deletions hcp-ui-templates/ec2-existing-vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ locals {
ssm = true
}


terraform {
required_providers {
aws = {
Expand Down Expand Up @@ -40,6 +41,7 @@ provider "nomad" {
}



resource "hcp_hvn" "main" {
hvn_id = local.hvn_id
cloud_provider = "aws"
Expand Down Expand Up @@ -114,6 +116,7 @@ module "hashicups" {
module.aws_ec2_consul_client
]
}

output "consul_root_token" {
value = hcp_consul_cluster_root_token.token.secret_id
sensitive = true
Expand Down
3 changes: 3 additions & 0 deletions hcp-ui-templates/ec2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ locals {
ssm = true
}


terraform {
required_providers {
aws = {
Expand Down Expand Up @@ -36,6 +37,7 @@ provider "nomad" {
http_auth = "nomad:${hcp_consul_cluster_root_token.token.secret_id}"
}


data "aws_availability_zones" "available" {
filter {
name = "zone-type"
Expand Down Expand Up @@ -129,6 +131,7 @@ module "hashicups" {
module.aws_ec2_consul_client
]
}

output "consul_root_token" {
value = hcp_consul_cluster_root_token.token.secret_id
sensitive = true
Expand Down
3 changes: 3 additions & 0 deletions hcp-ui-templates/ecs-existing-vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ locals {
private_subnet2 = "{{ .PrivateSubnet2 }}"
}


terraform {
required_providers {
aws = {
Expand All @@ -36,6 +37,7 @@ provider "consul" {
token = hcp_consul_cluster_root_token.token.secret_id
}


resource "hcp_hvn" "main" {
hvn_id = local.hvn_id
cloud_provider = "aws"
Expand Down Expand Up @@ -85,6 +87,7 @@ module "aws_ecs_cluster" {
security_group_id = module.aws_hcp_consul.security_group_id
vpc_id = local.vpc_id
}

output "consul_root_token" {
value = hcp_consul_cluster_root_token.token.secret_id
sensitive = true
Expand Down
3 changes: 3 additions & 0 deletions hcp-ui-templates/ecs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ locals {
install_demo_app = true
}


terraform {
required_providers {
aws = {
Expand All @@ -30,6 +31,7 @@ provider "consul" {
token = hcp_consul_cluster_root_token.token.secret_id
}


data "aws_availability_zones" "available" {
filter {
name = "zone-type"
Expand Down Expand Up @@ -100,6 +102,7 @@ module "aws_ecs_cluster" {
security_group_id = module.aws_hcp_consul.security_group_id
vpc_id = module.vpc.vpc_id
}

output "consul_root_token" {
value = hcp_consul_cluster_root_token.token.secret_id
sensitive = true
Expand Down
3 changes: 3 additions & 0 deletions hcp-ui-templates/eks-existing-vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ locals {
install_eks_cluster = true
}


terraform {
required_providers {
aws = {
Expand Down Expand Up @@ -64,6 +65,7 @@ provider "kubectl" {
token = local.install_eks_cluster ? data.aws_eks_cluster_auth.cluster[0].token : ""
load_config_file = false
}

data "aws_eks_cluster" "cluster" {
count = local.install_eks_cluster ? 1 : 0
name = module.eks[0].cluster_id
Expand Down Expand Up @@ -156,6 +158,7 @@ module "demo_app" {

depends_on = [module.eks_consul_client]
}

output "consul_root_token" {
value = hcp_consul_cluster_root_token.token.secret_id
sensitive = true
Expand Down
3 changes: 3 additions & 0 deletions hcp-ui-templates/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ locals {
install_eks_cluster = true
}


terraform {
required_providers {
aws = {
Expand Down Expand Up @@ -61,6 +62,7 @@ provider "kubectl" {
token = local.install_eks_cluster ? data.aws_eks_cluster_auth.cluster[0].token : ""
load_config_file = false
}

data "aws_availability_zones" "available" {
filter {
name = "zone-type"
Expand Down Expand Up @@ -174,6 +176,7 @@ module "demo_app" {

depends_on = [module.eks_consul_client]
}

output "consul_root_token" {
value = hcp_consul_cluster_root_token.token.secret_id
sensitive = true
Expand Down
3 changes: 3 additions & 0 deletions 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 = ">= 1.0.0"
required_providers {
Expand Down
3 changes: 3 additions & 0 deletions modules/ec2-demo-app/intentions.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

resource "consul_config_entry" "service_intentions_deny" {
name = "*"
kind = "service-intentions"
Expand Down
3 changes: 3 additions & 0 deletions modules/ec2-demo-app/nomad.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

resource "nomad_job" "hashicups" {
jobspec = file("${path.module}/templates/hashicups.nomad")
deregister_on_destroy = false
Expand Down
3 changes: 3 additions & 0 deletions modules/ec2-demo-app/templates/hashicups-frontend-v2.nomad
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 "frontend_port" {
type = number
default = 3001
Expand Down
3 changes: 3 additions & 0 deletions modules/ec2-demo-app/templates/hashicups-frontend.nomad
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 "frontend_port" {
type = number
default = 3000
Expand Down
3 changes: 3 additions & 0 deletions modules/ec2-demo-app/templates/hashicups.nomad
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 "public_api_port" {
type = number
default = 7070
Expand Down
3 changes: 3 additions & 0 deletions modules/ec2-demo-app/templates/ingress.nomad
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

job "ingress-demo" {

datacenters = ["dc1"]
Expand Down
3 changes: 3 additions & 0 deletions modules/hcp-ec2-client/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

data "aws_ami" "ubuntu" {
most_recent = true

Expand Down
3 changes: 3 additions & 0 deletions modules/hcp-ec2-client/output.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 "host_id" {
value = aws_instance.host.id
}
Expand Down
3 changes: 3 additions & 0 deletions modules/hcp-ec2-client/services.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

# This is needed for a tutorial on blue green deployments.
# This helps show the functionality to make it happen and
# hide some of the complexity like service defaults
Expand Down
3 changes: 3 additions & 0 deletions modules/hcp-ec2-client/templates/setup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

set -ex

start_service () {
Expand Down
3 changes: 3 additions & 0 deletions modules/hcp-ec2-client/templates/user_data.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0


cd /home/ubuntu
echo "${setup}" | base64 -d | zcat > setup.sh
Expand Down
3 changes: 3 additions & 0 deletions modules/hcp-ec2-client/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 "allowed_http_cidr_blocks" {
description = "A list of CIDR-formatted IP address ranges from which the EC2 Instances will allow connections over 8080"
type = list(string)
Expand Down
3 changes: 3 additions & 0 deletions modules/hcp-ecs-client/intentions.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

resource "consul_config_entry" "service_intentions_deny" {
name = "*"
kind = "service-intentions"
Expand Down
3 changes: 3 additions & 0 deletions modules/hcp-ecs-client/loadbalancer.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

resource "aws_lb" "ingress" {
name = "${local.secret_prefix}-ingress"
internal = false
Expand Down
3 changes: 3 additions & 0 deletions modules/hcp-ecs-client/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

locals {
secret_prefix = random_id.id.dec
scope = random_id.id.dec
Expand Down
3 changes: 3 additions & 0 deletions modules/hcp-ecs-client/output.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 "hashicups_url" {
value = aws_lb.ingress.dns_name
}
3 changes: 3 additions & 0 deletions modules/hcp-ecs-client/services.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 "acl-controller" {
source = "hashicorp/consul-ecs/aws//modules/acl-controller"
version = "0.4.2"
Expand Down
3 changes: 3 additions & 0 deletions modules/hcp-ecs-client/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 "private_subnet_ids" {
type = list(string)
description = "The private subnet IDs to create ECS services in"
Expand Down
Loading

0 comments on commit 49706d3

Please sign in to comment.