Skip to content

Commit 65dacb7

Browse files
Merge pull request #16 from appcd-dev/stackgen_06d5fc06-0898-4c48-98d0-49ee8b3117b7
VPC and subnets added to IAC
2 parents 127d95e + 7291e3b commit 65dacb7

15 files changed

Lines changed: 373 additions & 0 deletions

File tree

sg-demo-8723/terraform/.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Source: https://github.com/github/gitignore/blob/main/Terraform.gitignore
2+
# Local .terraform directories
3+
**/.terraform/*
4+
5+
# .tfstate files
6+
*.tfstate
7+
*.tfstate.*
8+
9+
# Crash log files
10+
crash.log
11+
crash.*.log
12+
13+
# Ignore override files as they are usually used to override resources locally and so
14+
# are not checked in
15+
override.tf
16+
override.tf.json
17+
*_override.tf
18+
*_override.tf.json
19+
20+
# Ignore transient lock info files created by terraform apply
21+
.terraform.tfstate.lock.info
22+
23+
# Include override files you do wish to add to version control using negated pattern
24+
# !example_override.tf
25+
26+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
27+
# example: *tfplan*
28+
29+
# Ignore CLI configuration files
30+
.terraformrc
31+
terraform.rc
32+

sg-demo-8723/terraform/.metadata

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"app_stack_name": "sales-demo",
3+
"iac_type": "Terraform",
4+
"provider": "aws",
5+
"multi_env": false,
6+
"exporter": "terraform"
7+
}

sg-demo-8723/terraform/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# README
2+
This is a readme file for IaC generated with StackGen.
3+
You can modify your appStack -> [here](http://demo.cloud.stackgen.com/appstacks/d8070f24-e7ff-4414-80c9-305894c61a7b)

sg-demo-8723/terraform/backend.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
terraform {
2+
backend "s3" {
3+
bucket = "drift-detect-tfstates"
4+
key = "sd-test-demo.tfstate"
5+
region = "us-east-2"
6+
encrypt = "true"
7+
}
8+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"module": {
3+
"stackgen_19ce20e7-23b8-5eec-9eed-9b8ff05adec8": {
4+
"availability_zone": "eu-west-1a",
5+
"cidr_block": "112.10.3.0/26",
6+
"map_public_ip_on_launch": false,
7+
"source": "./modules/aws_subnet",
8+
"tags": {
9+
"Name": "sg-vpc4-5subnets-public-3"
10+
},
11+
"vpc_id": "${module.stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1.id}"
12+
},
13+
"stackgen_2df86e4d-6319-535b-9462-69c4f185be7f": {
14+
"availability_zone": "eu-west-1b",
15+
"cidr_block": "112.10.2.0/26",
16+
"map_public_ip_on_launch": false,
17+
"source": "./modules/aws_subnet",
18+
"tags": {
19+
"Name": "sg-vpc4-5subnets-public-2"
20+
},
21+
"vpc_id": "${module.stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1.id}"
22+
},
23+
"stackgen_7481e4a5-1f5b-5d2b-a1be-ad3c45069aa9": {
24+
"availability_zone": "eu-west-1a",
25+
"cidr_block": "112.10.5.0/24",
26+
"map_public_ip_on_launch": false,
27+
"source": "./modules/aws_subnet",
28+
"tags": {
29+
"Name": "sg-vpc4-5subnets-public-5"
30+
},
31+
"vpc_id": "${module.stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1.id}"
32+
},
33+
"stackgen_880746c1-14ec-54f2-b021-718f7663d4e1": {
34+
"availability_zone": "eu-west-1b",
35+
"cidr_block": "112.10.0.0/24",
36+
"map_public_ip_on_launch": false,
37+
"source": "./modules/aws_subnet",
38+
"tags": {
39+
"Name": "sg-vpc4-5subnets-public-4"
40+
},
41+
"vpc_id": "${module.stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1.id}"
42+
},
43+
"stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1": {
44+
"cidr_block": "112.10.0.0/16",
45+
"enable_dns_hostnames": true,
46+
"enable_dns_support": true,
47+
"enable_network_address_usage_metrics": false,
48+
"instance_tenancy": "default",
49+
"source": "./modules/aws_vpc",
50+
"tags": {
51+
"Name": "sg-vpc4-5subnets"
52+
}
53+
},
54+
"stackgen_e46b0268-d537-5202-9c0c-c031f1877081": {
55+
"availability_zone": "eu-west-1a",
56+
"cidr_block": "112.10.1.0/24",
57+
"map_public_ip_on_launch": false,
58+
"source": "./modules/aws_subnet",
59+
"tags": {
60+
"Name": "sg-vpc4-5subnets-public-1"
61+
},
62+
"vpc_id": "${module.stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1.id}"
63+
}
64+
}
65+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
resource "aws_subnet" "this" {
2+
vpc_id = var.vpc_id
3+
availability_zone = var.availability_zone
4+
cidr_block = var.cidr_block
5+
map_public_ip_on_launch = var.map_public_ip_on_launch
6+
7+
tags = var.tags
8+
9+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"output": {
3+
"arn": {
4+
"description": "The value of the arn output",
5+
"sensitive": false,
6+
"value": "${aws_subnet.this.arn}"
7+
},
8+
"id": {
9+
"description": "The value of the id output",
10+
"sensitive": false,
11+
"value": "${aws_subnet.this.id}"
12+
}
13+
}
14+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"variable": {
3+
"vpc_id": [
4+
{
5+
"description": "The VPC ID",
6+
"type": "string",
7+
"nullable": false
8+
}
9+
],
10+
"cidr_block": [
11+
{
12+
"description": "The CIDR block for the subnet",
13+
"type": "string",
14+
"nullable": true
15+
}
16+
],
17+
"availability_zone": [
18+
{
19+
"description": "The availability zone",
20+
"type": "string",
21+
"nullable": true
22+
}
23+
],
24+
"tags": [
25+
{
26+
"description": "The tags to apply to the subnet",
27+
"type": "map(string)",
28+
"nullable": true
29+
}
30+
],
31+
"map_public_ip_on_launch":[
32+
{
33+
"description": "Specify true to indicate that instances launched into the subnet should be assigned a public IP address.",
34+
"type": "bool",
35+
"nullable": true,
36+
"default": false
37+
}
38+
]
39+
}
40+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "aws_vpc" "this" {
2+
cidr_block = var.cidr_block
3+
instance_tenancy = var.instance_tenancy
4+
enable_dns_support = var.enable_dns_support
5+
enable_dns_hostnames = var.enable_dns_hostnames
6+
enable_network_address_usage_metrics = var.enable_network_address_usage_metrics
7+
tags = var.tags
8+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"output": {
3+
"arn": {
4+
"description": "The value of the arn output",
5+
"sensitive": false,
6+
"value": "${aws_vpc.this.arn}"
7+
},
8+
"id": {
9+
"description": "The value of the id output",
10+
"sensitive": false,
11+
"value": "${aws_vpc.this.id}"
12+
},
13+
"vpc_id": {
14+
"description": "The value of the vpc_id output",
15+
"sensitive": false,
16+
"value": "${aws_vpc.this.id}"
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)