From 9e739986c44aa768a6acfcc633997092b0f1154a Mon Sep 17 00:00:00 2001 From: sbx_user1051 Date: Sun, 23 Apr 2023 18:15:10 +0000 Subject: [PATCH] Update requested for Proton - environment/test4 --- test4/.proton/deployment-metadata.json | 10 ++++++++ test4/config.tf | 25 +++++++++++++++++++ test4/outputs.tf | 19 ++++++++++++++ test4/proton.auto.tfvars.json | 14 +++++++++++ test4/proton.environment.variables.tf | 20 +++++++++++++++ test4/vpc.tf | 34 ++++++++++++++++++++++++++ 6 files changed, 122 insertions(+) create mode 100644 test4/.proton/deployment-metadata.json create mode 100644 test4/config.tf create mode 100644 test4/outputs.tf create mode 100644 test4/proton.auto.tfvars.json create mode 100644 test4/proton.environment.variables.tf create mode 100644 test4/vpc.tf diff --git a/test4/.proton/deployment-metadata.json b/test4/.proton/deployment-metadata.json new file mode 100644 index 0000000..75a8588 --- /dev/null +++ b/test4/.proton/deployment-metadata.json @@ -0,0 +1,10 @@ +{ + "deploymentId" : "fcca70e4-6549-4472-a70f-5e548992cf40", + "isResourceDeleted" : false, + "resourceMetadata" : { + "arn" : "arn:aws:proton:us-west-2:526918413291:environment/test4", + "templateArn" : "arn:aws:proton:us-west-2:526918413291:environment-template/sample-vpc-environment-template", + "templateMajorVersion" : "1", + "templateMinorVersion" : "2" + } +} \ No newline at end of file diff --git a/test4/config.tf b/test4/config.tf new file mode 100644 index 0000000..e985bd8 --- /dev/null +++ b/test4/config.tf @@ -0,0 +1,25 @@ +/* +This file is managed by AWS Proton. Any changes made directly to this file will be overwritten the next time AWS Proton performs an update. + +To manage this resource, see AWS Proton Resource: arn:aws:proton:us-west-2:526918413291:environment/test4 + +If the resource is no longer accessible within AWS Proton, it may have been deleted and may require manual cleanup. +*/ + +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.0" + } + } + + backend "s3" {} +} + +# Configure the AWS Provider +provider "aws" {} + +variable "aws_region" { + type = string +} diff --git a/test4/outputs.tf b/test4/outputs.tf new file mode 100644 index 0000000..fb8057f --- /dev/null +++ b/test4/outputs.tf @@ -0,0 +1,19 @@ +/* +This file is managed by AWS Proton. Any changes made directly to this file will be overwritten the next time AWS Proton performs an update. + +To manage this resource, see AWS Proton Resource: arn:aws:proton:us-west-2:526918413291:environment/test4 + +If the resource is no longer accessible within AWS Proton, it may have been deleted and may require manual cleanup. +*/ + +output "vpc_arn" { + value = module.vpc.vpc_arn +} + +output "subnet_id" { + value = one(module.vpc.private_subnets) # there is a known issue with terraform lists as outputs for proton +} + +output "security_group_id" { + value = module.vpc.default_security_group_id +} \ No newline at end of file diff --git a/test4/proton.auto.tfvars.json b/test4/proton.auto.tfvars.json new file mode 100644 index 0000000..6647b51 --- /dev/null +++ b/test4/proton.auto.tfvars.json @@ -0,0 +1,14 @@ +{ + "environment" : { + "name" : "test4", + "inputs" : { + "vpc_name" : "vpc-lambda" + } + }, + "proton_tags" : { + "proton:account" : "526918413291", + "proton:template" : "arn:aws:proton:us-west-2:526918413291:environment-template/sample-vpc-environment-template", + "proton:environment" : "arn:aws:proton:us-west-2:526918413291:environment/test4" + }, + "//" : "arn:aws:proton:us-west-2:526918413291:environment/test4" +} \ No newline at end of file diff --git a/test4/proton.environment.variables.tf b/test4/proton.environment.variables.tf new file mode 100644 index 0000000..6a8db26 --- /dev/null +++ b/test4/proton.environment.variables.tf @@ -0,0 +1,20 @@ +/* +This file is managed by AWS Proton. Any changes made directly to this file will be overwritten the next time AWS Proton performs an update. + +To manage this resource, see AWS Proton Resource: arn:aws:proton:us-west-2:526918413291:environment/test4 + +If the resource is no longer accessible within AWS Proton, it may have been deleted and may require manual cleanup. +*/ + +variable "environment" { + type = object({ + inputs = any + name = string + }) + default = null +} + +variable "proton_tags" { + type = map(string) + default = null +} diff --git a/test4/vpc.tf b/test4/vpc.tf new file mode 100644 index 0000000..55bba8b --- /dev/null +++ b/test4/vpc.tf @@ -0,0 +1,34 @@ +/* +This file is managed by AWS Proton. Any changes made directly to this file will be overwritten the next time AWS Proton performs an update. + +To manage this resource, see AWS Proton Resource: arn:aws:proton:us-west-2:526918413291:environment/test4 + +If the resource is no longer accessible within AWS Proton, it may have been deleted and may require manual cleanup. +*/ + +module "vpc" { + source = "terraform-aws-modules/vpc/aws" + + name = var.environment.inputs.vpc_name + cidr = "10.0.0.0/16" + + azs = ["${var.aws_region}b"] + private_subnets = ["10.0.1.0/24"] + public_subnets = ["10.0.101.0/24"] + + enable_nat_gateway = true + enable_vpn_gateway = false + enable_ipv6 = true + assign_ipv6_address_on_creation = true + private_subnet_assign_ipv6_address_on_creation = false + public_subnet_ipv6_prefixes = [0] + private_subnet_ipv6_prefixes = [1] + + tags = { + Terraform = "true" + Environment = var.environment.name + Provisioning = "via-proton" + Owner = "Demo-EEM-TFC" + } +} +