From 49706d347ce64d89e0112afd4e27532d4f199754 Mon Sep 17 00:00:00 2001 From: "hashicorp-copywrite[bot]" <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Date: Wed, 5 Apr 2023 16:45:06 -0400 Subject: [PATCH] [COMPLIANCE] Add Copyright and License Headers (#85) * [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 Co-authored-by: josh --- .copywrite.hcl | 25 +++++++++++++++++++ examples/existing-vpc/main.tf | 3 +++ examples/hcp-ec2-demo/main.tf | 3 +++ examples/hcp-ec2-demo/output.tf | 3 +++ examples/hcp-ec2-demo/providers.tf | 3 +++ examples/hcp-ec2-demo/variables.tf | 3 +++ examples/hcp-ecs-demo/main.tf | 3 +++ examples/hcp-ecs-demo/output.tf | 3 +++ examples/hcp-ecs-demo/providers.tf | 3 +++ examples/hcp-ecs-demo/variables.tf | 3 +++ examples/hcp-eks-demo/main.tf | 3 +++ examples/hcp-eks-demo/output.tf | 3 +++ examples/hcp-eks-demo/providers.tf | 3 +++ examples/hcp-eks-demo/variables.tf | 3 +++ hcp-ui-templates/ec2-existing-vpc/main.tf | 3 +++ hcp-ui-templates/ec2/main.tf | 3 +++ hcp-ui-templates/ecs-existing-vpc/main.tf | 3 +++ hcp-ui-templates/ecs/main.tf | 3 +++ hcp-ui-templates/eks-existing-vpc/main.tf | 3 +++ hcp-ui-templates/eks/main.tf | 3 +++ main.tf | 3 +++ modules/ec2-demo-app/intentions.tf | 3 +++ modules/ec2-demo-app/nomad.tf | 3 +++ .../templates/hashicups-frontend-v2.nomad | 3 +++ .../templates/hashicups-frontend.nomad | 3 +++ .../ec2-demo-app/templates/hashicups.nomad | 3 +++ modules/ec2-demo-app/templates/ingress.nomad | 3 +++ modules/hcp-ec2-client/main.tf | 3 +++ modules/hcp-ec2-client/output.tf | 3 +++ modules/hcp-ec2-client/services.tf | 3 +++ modules/hcp-ec2-client/templates/setup.sh | 3 +++ modules/hcp-ec2-client/templates/user_data.sh | 3 +++ modules/hcp-ec2-client/variables.tf | 3 +++ modules/hcp-ecs-client/intentions.tf | 3 +++ modules/hcp-ecs-client/loadbalancer.tf | 3 +++ modules/hcp-ecs-client/main.tf | 3 +++ modules/hcp-ecs-client/output.tf | 3 +++ modules/hcp-ecs-client/services.tf | 3 +++ modules/hcp-ecs-client/variables.tf | 3 +++ modules/hcp-eks-client/main.tf | 3 +++ modules/hcp-eks-client/output.tf | 3 +++ modules/hcp-eks-client/providers.tf | 3 +++ modules/hcp-eks-client/variables.tf | 3 +++ modules/k8s-demo-app/main.tf | 3 +++ modules/k8s-demo-app/output.tf | 3 +++ modules/k8s-demo-app/services/frontend.yaml | 3 +++ modules/k8s-demo-app/services/ingress.yaml | 3 +++ modules/k8s-demo-app/services/intentions.yaml | 3 +++ modules/k8s-demo-app/services/nginx.yaml | 3 +++ modules/k8s-demo-app/services/payments.yaml | 3 +++ .../k8s-demo-app/services/product-api-db.yaml | 3 +++ .../k8s-demo-app/services/product-api.yaml | 3 +++ modules/k8s-demo-app/services/public-api.yaml | 3 +++ output.tf | 3 +++ scripts/dummy_data.sh | 3 +++ scripts/generate_ui_templates.sh | 7 +++++- scripts/hashicups_version.sh | 3 +++ scripts/module_version.sh | 3 +++ scripts/terraform_fmt.sh | 3 +++ scripts/toggle_dev.sh | 3 +++ test/examples/examples_test.go | 3 +++ test/examples/local_sources.go | 3 +++ test/hcp/hcp_test.go | 3 +++ test/hcp/testdata/ec2-existing-vpc.golden | 3 +++ test/hcp/testdata/ec2.golden | 3 +++ test/hcp/testdata/ecs-existing-vpc.golden | 3 +++ test/hcp/testdata/ecs.golden | 3 +++ test/hcp/testdata/eks-existing-vpc.golden | 3 +++ test/hcp/testdata/eks.golden | 3 +++ variables.tf | 3 +++ 70 files changed, 235 insertions(+), 1 deletion(-) create mode 100644 .copywrite.hcl diff --git a/.copywrite.hcl b/.copywrite.hcl new file mode 100644 index 0000000..d702caf --- /dev/null +++ b/.copywrite.hcl @@ -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", + ] +} diff --git a/examples/existing-vpc/main.tf b/examples/existing-vpc/main.tf index 168d6f0..47fcbb7 100644 --- a/examples/existing-vpc/main.tf +++ b/examples/existing-vpc/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + terraform { required_providers { aws = { diff --git a/examples/hcp-ec2-demo/main.tf b/examples/hcp-ec2-demo/main.tf index 35d367b..69c543a 100644 --- a/examples/hcp-ec2-demo/main.tf +++ b/examples/hcp-ec2-demo/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + data "aws_availability_zones" "available" { filter { name = "zone-type" diff --git a/examples/hcp-ec2-demo/output.tf b/examples/hcp-ec2-demo/output.tf index ed0c5a2..e320bcb 100644 --- a/examples/hcp-ec2-demo/output.tf +++ b/examples/hcp-ec2-demo/output.tf @@ -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 diff --git a/examples/hcp-ec2-demo/providers.tf b/examples/hcp-ec2-demo/providers.tf index fba7e68..b096242 100644 --- a/examples/hcp-ec2-demo/providers.tf +++ b/examples/hcp-ec2-demo/providers.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + terraform { required_providers { aws = { diff --git a/examples/hcp-ec2-demo/variables.tf b/examples/hcp-ec2-demo/variables.tf index e5d9d60..9e1a239 100644 --- a/examples/hcp-ec2-demo/variables.tf +++ b/examples/hcp-ec2-demo/variables.tf @@ -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" diff --git a/examples/hcp-ecs-demo/main.tf b/examples/hcp-ecs-demo/main.tf index 960e0d4..4c2e638 100644 --- a/examples/hcp-ecs-demo/main.tf +++ b/examples/hcp-ecs-demo/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + data "aws_availability_zones" "available" { filter { name = "zone-type" diff --git a/examples/hcp-ecs-demo/output.tf b/examples/hcp-ecs-demo/output.tf index ed03a54..910923a 100644 --- a/examples/hcp-ecs-demo/output.tf +++ b/examples/hcp-ecs-demo/output.tf @@ -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 diff --git a/examples/hcp-ecs-demo/providers.tf b/examples/hcp-ecs-demo/providers.tf index 081af96..9051231 100644 --- a/examples/hcp-ecs-demo/providers.tf +++ b/examples/hcp-ecs-demo/providers.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + terraform { required_providers { aws = { diff --git a/examples/hcp-ecs-demo/variables.tf b/examples/hcp-ecs-demo/variables.tf index d4d6538..abb8089 100644 --- a/examples/hcp-ecs-demo/variables.tf +++ b/examples/hcp-ecs-demo/variables.tf @@ -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" diff --git a/examples/hcp-eks-demo/main.tf b/examples/hcp-eks-demo/main.tf index 62958ff..ac64ef1 100644 --- a/examples/hcp-eks-demo/main.tf +++ b/examples/hcp-eks-demo/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + data "aws_availability_zones" "available" { filter { name = "zone-type" diff --git a/examples/hcp-eks-demo/output.tf b/examples/hcp-eks-demo/output.tf index 44d8af3..3a44b12 100644 --- a/examples/hcp-eks-demo/output.tf +++ b/examples/hcp-eks-demo/output.tf @@ -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 diff --git a/examples/hcp-eks-demo/providers.tf b/examples/hcp-eks-demo/providers.tf index 1951966..aa1a79b 100644 --- a/examples/hcp-eks-demo/providers.tf +++ b/examples/hcp-eks-demo/providers.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + terraform { required_providers { aws = { diff --git a/examples/hcp-eks-demo/variables.tf b/examples/hcp-eks-demo/variables.tf index 1c3c2a6..01f450f 100644 --- a/examples/hcp-eks-demo/variables.tf +++ b/examples/hcp-eks-demo/variables.tf @@ -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" diff --git a/hcp-ui-templates/ec2-existing-vpc/main.tf b/hcp-ui-templates/ec2-existing-vpc/main.tf index 4a841e0..5c6f730 100644 --- a/hcp-ui-templates/ec2-existing-vpc/main.tf +++ b/hcp-ui-templates/ec2-existing-vpc/main.tf @@ -10,6 +10,7 @@ locals { ssm = true } + terraform { required_providers { aws = { @@ -40,6 +41,7 @@ provider "nomad" { } + resource "hcp_hvn" "main" { hvn_id = local.hvn_id cloud_provider = "aws" @@ -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 diff --git a/hcp-ui-templates/ec2/main.tf b/hcp-ui-templates/ec2/main.tf index 999f11a..e7e6dda 100644 --- a/hcp-ui-templates/ec2/main.tf +++ b/hcp-ui-templates/ec2/main.tf @@ -7,6 +7,7 @@ locals { ssm = true } + terraform { required_providers { aws = { @@ -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" @@ -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 diff --git a/hcp-ui-templates/ecs-existing-vpc/main.tf b/hcp-ui-templates/ecs-existing-vpc/main.tf index 21df194..5402ae4 100644 --- a/hcp-ui-templates/ecs-existing-vpc/main.tf +++ b/hcp-ui-templates/ecs-existing-vpc/main.tf @@ -12,6 +12,7 @@ locals { private_subnet2 = "{{ .PrivateSubnet2 }}" } + terraform { required_providers { aws = { @@ -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" @@ -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 diff --git a/hcp-ui-templates/ecs/main.tf b/hcp-ui-templates/ecs/main.tf index 07f5eb2..41d6189 100644 --- a/hcp-ui-templates/ecs/main.tf +++ b/hcp-ui-templates/ecs/main.tf @@ -6,6 +6,7 @@ locals { install_demo_app = true } + terraform { required_providers { aws = { @@ -30,6 +31,7 @@ provider "consul" { token = hcp_consul_cluster_root_token.token.secret_id } + data "aws_availability_zones" "available" { filter { name = "zone-type" @@ -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 diff --git a/hcp-ui-templates/eks-existing-vpc/main.tf b/hcp-ui-templates/eks-existing-vpc/main.tf index 2428a37..82f0664 100644 --- a/hcp-ui-templates/eks-existing-vpc/main.tf +++ b/hcp-ui-templates/eks-existing-vpc/main.tf @@ -10,6 +10,7 @@ locals { install_eks_cluster = true } + terraform { required_providers { aws = { @@ -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 @@ -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 diff --git a/hcp-ui-templates/eks/main.tf b/hcp-ui-templates/eks/main.tf index 33baeaa..140c911 100644 --- a/hcp-ui-templates/eks/main.tf +++ b/hcp-ui-templates/eks/main.tf @@ -7,6 +7,7 @@ locals { install_eks_cluster = true } + terraform { required_providers { aws = { @@ -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" @@ -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 diff --git a/main.tf b/main.tf index 889c442..330ede0 100644 --- a/main.tf +++ b/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + terraform { required_version = ">= 1.0.0" required_providers { diff --git a/modules/ec2-demo-app/intentions.tf b/modules/ec2-demo-app/intentions.tf index a0a01f3..44c4287 100644 --- a/modules/ec2-demo-app/intentions.tf +++ b/modules/ec2-demo-app/intentions.tf @@ -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" diff --git a/modules/ec2-demo-app/nomad.tf b/modules/ec2-demo-app/nomad.tf index 3b36dd3..38c56b3 100644 --- a/modules/ec2-demo-app/nomad.tf +++ b/modules/ec2-demo-app/nomad.tf @@ -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 diff --git a/modules/ec2-demo-app/templates/hashicups-frontend-v2.nomad b/modules/ec2-demo-app/templates/hashicups-frontend-v2.nomad index b4c80b7..af788b1 100644 --- a/modules/ec2-demo-app/templates/hashicups-frontend-v2.nomad +++ b/modules/ec2-demo-app/templates/hashicups-frontend-v2.nomad @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + variable "frontend_port" { type = number default = 3001 diff --git a/modules/ec2-demo-app/templates/hashicups-frontend.nomad b/modules/ec2-demo-app/templates/hashicups-frontend.nomad index 2f3020b..04f6dca 100644 --- a/modules/ec2-demo-app/templates/hashicups-frontend.nomad +++ b/modules/ec2-demo-app/templates/hashicups-frontend.nomad @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + variable "frontend_port" { type = number default = 3000 diff --git a/modules/ec2-demo-app/templates/hashicups.nomad b/modules/ec2-demo-app/templates/hashicups.nomad index 880561a..4fd68a8 100644 --- a/modules/ec2-demo-app/templates/hashicups.nomad +++ b/modules/ec2-demo-app/templates/hashicups.nomad @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + variable "public_api_port" { type = number default = 7070 diff --git a/modules/ec2-demo-app/templates/ingress.nomad b/modules/ec2-demo-app/templates/ingress.nomad index 70714ce..745b0e2 100644 --- a/modules/ec2-demo-app/templates/ingress.nomad +++ b/modules/ec2-demo-app/templates/ingress.nomad @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + job "ingress-demo" { datacenters = ["dc1"] diff --git a/modules/hcp-ec2-client/main.tf b/modules/hcp-ec2-client/main.tf index 2a0f62c..b6bba5f 100644 --- a/modules/hcp-ec2-client/main.tf +++ b/modules/hcp-ec2-client/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + data "aws_ami" "ubuntu" { most_recent = true diff --git a/modules/hcp-ec2-client/output.tf b/modules/hcp-ec2-client/output.tf index fb6da16..af2abd6 100644 --- a/modules/hcp-ec2-client/output.tf +++ b/modules/hcp-ec2-client/output.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + output "host_id" { value = aws_instance.host.id } diff --git a/modules/hcp-ec2-client/services.tf b/modules/hcp-ec2-client/services.tf index 856d865..e96a58c 100644 --- a/modules/hcp-ec2-client/services.tf +++ b/modules/hcp-ec2-client/services.tf @@ -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 diff --git a/modules/hcp-ec2-client/templates/setup.sh b/modules/hcp-ec2-client/templates/setup.sh index 5af821d..f355e91 100755 --- a/modules/hcp-ec2-client/templates/setup.sh +++ b/modules/hcp-ec2-client/templates/setup.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + set -ex start_service () { diff --git a/modules/hcp-ec2-client/templates/user_data.sh b/modules/hcp-ec2-client/templates/user_data.sh index 8b39521..475a4a6 100644 --- a/modules/hcp-ec2-client/templates/user_data.sh +++ b/modules/hcp-ec2-client/templates/user_data.sh @@ -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 diff --git a/modules/hcp-ec2-client/variables.tf b/modules/hcp-ec2-client/variables.tf index 79cccb4..4ad8f3b 100644 --- a/modules/hcp-ec2-client/variables.tf +++ b/modules/hcp-ec2-client/variables.tf @@ -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) diff --git a/modules/hcp-ecs-client/intentions.tf b/modules/hcp-ecs-client/intentions.tf index f1a92e6..cdb61f6 100644 --- a/modules/hcp-ecs-client/intentions.tf +++ b/modules/hcp-ecs-client/intentions.tf @@ -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" diff --git a/modules/hcp-ecs-client/loadbalancer.tf b/modules/hcp-ecs-client/loadbalancer.tf index 0190558..ca5946b 100644 --- a/modules/hcp-ecs-client/loadbalancer.tf +++ b/modules/hcp-ecs-client/loadbalancer.tf @@ -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 diff --git a/modules/hcp-ecs-client/main.tf b/modules/hcp-ecs-client/main.tf index d191682..5d3153b 100644 --- a/modules/hcp-ecs-client/main.tf +++ b/modules/hcp-ecs-client/main.tf @@ -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 diff --git a/modules/hcp-ecs-client/output.tf b/modules/hcp-ecs-client/output.tf index 03aac0c..e855085 100644 --- a/modules/hcp-ecs-client/output.tf +++ b/modules/hcp-ecs-client/output.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + output "hashicups_url" { value = aws_lb.ingress.dns_name } diff --git a/modules/hcp-ecs-client/services.tf b/modules/hcp-ecs-client/services.tf index b0a1df6..6846148 100644 --- a/modules/hcp-ecs-client/services.tf +++ b/modules/hcp-ecs-client/services.tf @@ -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" diff --git a/modules/hcp-ecs-client/variables.tf b/modules/hcp-ecs-client/variables.tf index f1468ff..b3bc225 100644 --- a/modules/hcp-ecs-client/variables.tf +++ b/modules/hcp-ecs-client/variables.tf @@ -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" diff --git a/modules/hcp-eks-client/main.tf b/modules/hcp-eks-client/main.tf index b0f420c..95760ce 100644 --- a/modules/hcp-eks-client/main.tf +++ b/modules/hcp-eks-client/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + locals { // consul client agents will not be installed starting chart version 1.0.0. diff --git a/modules/hcp-eks-client/output.tf b/modules/hcp-eks-client/output.tf index fbbd10b..f9747c7 100644 --- a/modules/hcp-eks-client/output.tf +++ b/modules/hcp-eks-client/output.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + output "helm_values_file" { description = "The filename of the generated kubectl config. Will block on cluster creation until the cluster is really ready." value = abspath(local_file.helm_values.filename) diff --git a/modules/hcp-eks-client/providers.tf b/modules/hcp-eks-client/providers.tf index bc97d12..b788673 100644 --- a/modules/hcp-eks-client/providers.tf +++ b/modules/hcp-eks-client/providers.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + terraform { required_providers { kubernetes = { diff --git a/modules/hcp-eks-client/variables.tf b/modules/hcp-eks-client/variables.tf index 87bbe01..f418d5f 100644 --- a/modules/hcp-eks-client/variables.tf +++ b/modules/hcp-eks-client/variables.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + /* * * Required Variables diff --git a/modules/k8s-demo-app/main.tf b/modules/k8s-demo-app/main.tf index 6eed12f..ece9cc9 100644 --- a/modules/k8s-demo-app/main.tf +++ b/modules/k8s-demo-app/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + terraform { required_providers { kubernetes = { diff --git a/modules/k8s-demo-app/output.tf b/modules/k8s-demo-app/output.tf index 50c9265..f779905 100644 --- a/modules/k8s-demo-app/output.tf +++ b/modules/k8s-demo-app/output.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + output "hashicups_url" { value = "http://${data.kubernetes_service.ingress.status[0].load_balancer[0].ingress[0].hostname}" } diff --git a/modules/k8s-demo-app/services/frontend.yaml b/modules/k8s-demo-app/services/frontend.yaml index df2b6d5..a429609 100644 --- a/modules/k8s-demo-app/services/frontend.yaml +++ b/modules/k8s-demo-app/services/frontend.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + --- apiVersion: v1 kind: Service diff --git a/modules/k8s-demo-app/services/ingress.yaml b/modules/k8s-demo-app/services/ingress.yaml index 7ff6bf1..5b1b0dd 100644 --- a/modules/k8s-demo-app/services/ingress.yaml +++ b/modules/k8s-demo-app/services/ingress.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + --- apiVersion: consul.hashicorp.com/v1alpha1 kind: IngressGateway diff --git a/modules/k8s-demo-app/services/intentions.yaml b/modules/k8s-demo-app/services/intentions.yaml index 2d8c011..da98f4e 100644 --- a/modules/k8s-demo-app/services/intentions.yaml +++ b/modules/k8s-demo-app/services/intentions.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + --- apiVersion: consul.hashicorp.com/v1alpha1 kind: ServiceIntentions diff --git a/modules/k8s-demo-app/services/nginx.yaml b/modules/k8s-demo-app/services/nginx.yaml index 4b84858..a22f6d2 100644 --- a/modules/k8s-demo-app/services/nginx.yaml +++ b/modules/k8s-demo-app/services/nginx.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + --- apiVersion: v1 kind: Service diff --git a/modules/k8s-demo-app/services/payments.yaml b/modules/k8s-demo-app/services/payments.yaml index 7e2379f..eec1bda 100644 --- a/modules/k8s-demo-app/services/payments.yaml +++ b/modules/k8s-demo-app/services/payments.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + --- apiVersion: v1 kind: Service diff --git a/modules/k8s-demo-app/services/product-api-db.yaml b/modules/k8s-demo-app/services/product-api-db.yaml index 59e744c..2b71837 100644 --- a/modules/k8s-demo-app/services/product-api-db.yaml +++ b/modules/k8s-demo-app/services/product-api-db.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + --- apiVersion: v1 kind: Service diff --git a/modules/k8s-demo-app/services/product-api.yaml b/modules/k8s-demo-app/services/product-api.yaml index 04eb370..39ca84c 100644 --- a/modules/k8s-demo-app/services/product-api.yaml +++ b/modules/k8s-demo-app/services/product-api.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + --- apiVersion: v1 kind: Service diff --git a/modules/k8s-demo-app/services/public-api.yaml b/modules/k8s-demo-app/services/public-api.yaml index 197fb01..2d22034 100644 --- a/modules/k8s-demo-app/services/public-api.yaml +++ b/modules/k8s-demo-app/services/public-api.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + --- apiVersion: v1 kind: Service diff --git a/output.tf b/output.tf index 3a60f48..8c7c776 100644 --- a/output.tf +++ b/output.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + output "security_group_id" { description = "Newly created AWS security group that allow Consul client communication, if 'security_group_ids' was not provided." value = length(var.security_group_ids) == 0 ? aws_security_group.hcp_consul[0].id : "" diff --git a/scripts/dummy_data.sh b/scripts/dummy_data.sh index 9161b33..0003760 100755 --- a/scripts/dummy_data.sh +++ b/scripts/dummy_data.sh @@ -1,4 +1,7 @@ #!/bin/bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + if [ ! -f examples/existing-vpc/output.json ]; then cd examples/existing-vpc/ diff --git a/scripts/generate_ui_templates.sh b/scripts/generate_ui_templates.sh index 2a38a95..35d7ea0 100755 --- a/scripts/generate_ui_templates.sh +++ b/scripts/generate_ui_templates.sh @@ -1,11 +1,16 @@ #!/bin/bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + generate_base_terraform () { cat examples/hcp-$1-demo/{providers,main,output}.tf \ | sed -e '/provider_meta/,+2d' \ | sed -e 's/var/local/g' \ | sed -e 's/local\.tier/"development"/g' \ - | sed -e 's/local\.hvn_cidr_block/"172.25.32.0\/20"/g' + | sed -e 's/local\.hvn_cidr_block/"172.25.32.0\/20"/g' \ + | sed -e '/Copyright/d' \ + | sed -e '/License/d' } generate_base_existing_vpc_terraform () { diff --git a/scripts/hashicups_version.sh b/scripts/hashicups_version.sh index 870485d..b833b76 100755 --- a/scripts/hashicups_version.sh +++ b/scripts/hashicups_version.sh @@ -1,4 +1,7 @@ #!/bin/bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + # https://github.com/hashicorp-demoapp/hashicups-setups/blob/main/docker-compose-deployment/docker-compose.yaml FRONTEND_VERSION="v1.0.2" diff --git a/scripts/module_version.sh b/scripts/module_version.sh index 4588beb..4437f0d 100755 --- a/scripts/module_version.sh +++ b/scripts/module_version.sh @@ -1,4 +1,7 @@ #!/bin/bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + old="0\.12\.0" new=0.12.1 diff --git a/scripts/terraform_fmt.sh b/scripts/terraform_fmt.sh index 9e78bd2..c58e5cd 100755 --- a/scripts/terraform_fmt.sh +++ b/scripts/terraform_fmt.sh @@ -1 +1,4 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + find . -type f -name "*.tf" -not -path '*/.terraform/*' -exec terraform fmt -write {} \; diff --git a/scripts/toggle_dev.sh b/scripts/toggle_dev.sh index e790ac8..90601b6 100755 --- a/scripts/toggle_dev.sh +++ b/scripts/toggle_dev.sh @@ -1,4 +1,7 @@ #!/bin/bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + file () { echo "examples/hcp-$1-demo/main.tf" diff --git a/test/examples/examples_test.go b/test/examples/examples_test.go index 1be5f1d..1fd6b00 100644 --- a/test/examples/examples_test.go +++ b/test/examples/examples_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package examples import ( diff --git a/test/examples/local_sources.go b/test/examples/local_sources.go index 0cf277f..46d16c4 100644 --- a/test/examples/local_sources.go +++ b/test/examples/local_sources.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package examples import ( diff --git a/test/hcp/hcp_test.go b/test/hcp/hcp_test.go index 8e8ef5c..f70584a 100644 --- a/test/hcp/hcp_test.go +++ b/test/hcp/hcp_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package hcp import ( diff --git a/test/hcp/testdata/ec2-existing-vpc.golden b/test/hcp/testdata/ec2-existing-vpc.golden index 6a8102f..3bdccca 100644 --- a/test/hcp/testdata/ec2-existing-vpc.golden +++ b/test/hcp/testdata/ec2-existing-vpc.golden @@ -10,6 +10,7 @@ locals { ssm = true } + terraform { required_providers { aws = { @@ -40,6 +41,7 @@ provider "nomad" { } + resource "hcp_hvn" "main" { hvn_id = local.hvn_id cloud_provider = "aws" @@ -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 diff --git a/test/hcp/testdata/ec2.golden b/test/hcp/testdata/ec2.golden index ac8ed51..613c8c0 100644 --- a/test/hcp/testdata/ec2.golden +++ b/test/hcp/testdata/ec2.golden @@ -7,6 +7,7 @@ locals { ssm = true } + terraform { required_providers { aws = { @@ -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" @@ -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 diff --git a/test/hcp/testdata/ecs-existing-vpc.golden b/test/hcp/testdata/ecs-existing-vpc.golden index f17e290..2504664 100644 --- a/test/hcp/testdata/ecs-existing-vpc.golden +++ b/test/hcp/testdata/ecs-existing-vpc.golden @@ -12,6 +12,7 @@ locals { private_subnet2 = "subnet-5aa8d55f44387908d" } + terraform { required_providers { aws = { @@ -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" @@ -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 diff --git a/test/hcp/testdata/ecs.golden b/test/hcp/testdata/ecs.golden index 65eaf5b..cdcb89b 100644 --- a/test/hcp/testdata/ecs.golden +++ b/test/hcp/testdata/ecs.golden @@ -6,6 +6,7 @@ locals { install_demo_app = true } + terraform { required_providers { aws = { @@ -30,6 +31,7 @@ provider "consul" { token = hcp_consul_cluster_root_token.token.secret_id } + data "aws_availability_zones" "available" { filter { name = "zone-type" @@ -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 diff --git a/test/hcp/testdata/eks-existing-vpc.golden b/test/hcp/testdata/eks-existing-vpc.golden index 9446f2b..4da32bb 100644 --- a/test/hcp/testdata/eks-existing-vpc.golden +++ b/test/hcp/testdata/eks-existing-vpc.golden @@ -10,6 +10,7 @@ locals { install_eks_cluster = true } + terraform { required_providers { aws = { @@ -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 @@ -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 diff --git a/test/hcp/testdata/eks.golden b/test/hcp/testdata/eks.golden index 1425bdd..345e72a 100644 --- a/test/hcp/testdata/eks.golden +++ b/test/hcp/testdata/eks.golden @@ -7,6 +7,7 @@ locals { install_eks_cluster = true } + terraform { required_providers { aws = { @@ -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" @@ -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 diff --git a/variables.tf b/variables.tf index c530212..3d5daf4 100644 --- a/variables.tf +++ b/variables.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + /* * * Required Variables