Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions test4/.proton/deployment-metadata.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
25 changes: 25 additions & 0 deletions test4/config.tf
Original file line number Diff line number Diff line change
@@ -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
}
19 changes: 19 additions & 0 deletions test4/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
14 changes: 14 additions & 0 deletions test4/proton.auto.tfvars.json
Original file line number Diff line number Diff line change
@@ -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"
}
20 changes: 20 additions & 0 deletions test4/proton.environment.variables.tf
Original file line number Diff line number Diff line change
@@ -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
}
34 changes: 34 additions & 0 deletions test4/vpc.tf
Original file line number Diff line number Diff line change
@@ -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"
}
}