Skip to content
Merged
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
32 changes: 32 additions & 0 deletions sg-demo-8723/terraform/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Source: https://github.com/github/gitignore/blob/main/Terraform.gitignore
# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log
crash.*.log

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Ignore transient lock info files created by terraform apply
.terraform.tfstate.lock.info

# Include override files you do wish to add to version control using negated pattern
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*

# Ignore CLI configuration files
.terraformrc
terraform.rc

7 changes: 7 additions & 0 deletions sg-demo-8723/terraform/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"app_stack_name": "sales-demo",
"iac_type": "Terraform",
"provider": "aws",
"multi_env": false,
"exporter": "terraform"
}
3 changes: 3 additions & 0 deletions sg-demo-8723/terraform/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# README
This is a readme file for IaC generated with StackGen.
You can modify your appStack -> [here](http://demo.cloud.stackgen.com/appstacks/d8070f24-e7ff-4414-80c9-305894c61a7b)
8 changes: 8 additions & 0 deletions sg-demo-8723/terraform/backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
backend "s3" {
bucket = "drift-detect-tfstates"
key = "sd-test-demo.tfstate"
region = "us-east-2"
encrypt = "true"
}
}
65 changes: 65 additions & 0 deletions sg-demo-8723/terraform/modules.tf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"module": {
"stackgen_19ce20e7-23b8-5eec-9eed-9b8ff05adec8": {
"availability_zone": "eu-west-1a",
"cidr_block": "112.10.3.0/26",
"map_public_ip_on_launch": false,
"source": "./modules/aws_subnet",
"tags": {
"Name": "sg-vpc4-5subnets-public-3"
},
"vpc_id": "${module.stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1.id}"
},
"stackgen_2df86e4d-6319-535b-9462-69c4f185be7f": {
"availability_zone": "eu-west-1b",
"cidr_block": "112.10.2.0/26",
"map_public_ip_on_launch": false,
"source": "./modules/aws_subnet",
"tags": {
"Name": "sg-vpc4-5subnets-public-2"
},
"vpc_id": "${module.stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1.id}"
},
"stackgen_7481e4a5-1f5b-5d2b-a1be-ad3c45069aa9": {
"availability_zone": "eu-west-1a",
"cidr_block": "112.10.5.0/24",
"map_public_ip_on_launch": false,
"source": "./modules/aws_subnet",
"tags": {
"Name": "sg-vpc4-5subnets-public-5"
},
"vpc_id": "${module.stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1.id}"
},
"stackgen_880746c1-14ec-54f2-b021-718f7663d4e1": {
"availability_zone": "eu-west-1b",
"cidr_block": "112.10.0.0/24",
"map_public_ip_on_launch": false,
"source": "./modules/aws_subnet",
"tags": {
"Name": "sg-vpc4-5subnets-public-4"
},
"vpc_id": "${module.stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1.id}"
},
"stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1": {
"cidr_block": "112.10.0.0/16",
"enable_dns_hostnames": true,
"enable_dns_support": true,
"enable_network_address_usage_metrics": false,
"instance_tenancy": "default",
"source": "./modules/aws_vpc",
"tags": {
"Name": "sg-vpc4-5subnets"
}
},
"stackgen_e46b0268-d537-5202-9c0c-c031f1877081": {
"availability_zone": "eu-west-1a",
"cidr_block": "112.10.1.0/24",
"map_public_ip_on_launch": false,
"source": "./modules/aws_subnet",
"tags": {
"Name": "sg-vpc4-5subnets-public-1"
},
"vpc_id": "${module.stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1.id}"
}
}
}
9 changes: 9 additions & 0 deletions sg-demo-8723/terraform/modules/aws_subnet/aws_subnet.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "aws_subnet" "this" {
vpc_id = var.vpc_id
availability_zone = var.availability_zone
cidr_block = var.cidr_block
map_public_ip_on_launch = var.map_public_ip_on_launch

tags = var.tags

}
14 changes: 14 additions & 0 deletions sg-demo-8723/terraform/modules/aws_subnet/outputs.tf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"output": {
"arn": {
"description": "The value of the arn output",
"sensitive": false,
"value": "${aws_subnet.this.arn}"
},
"id": {
"description": "The value of the id output",
"sensitive": false,
"value": "${aws_subnet.this.id}"
}
}
}
40 changes: 40 additions & 0 deletions sg-demo-8723/terraform/modules/aws_subnet/variables.tf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"variable": {
"vpc_id": [
{
"description": "The VPC ID",
"type": "string",
"nullable": false
}
],
"cidr_block": [
{
"description": "The CIDR block for the subnet",
"type": "string",
"nullable": true
}
],
"availability_zone": [
{
"description": "The availability zone",
"type": "string",
"nullable": true
}
],
"tags": [
{
"description": "The tags to apply to the subnet",
"type": "map(string)",
"nullable": true
}
],
"map_public_ip_on_launch":[
{
"description": "Specify true to indicate that instances launched into the subnet should be assigned a public IP address.",
"type": "bool",
"nullable": true,
"default": false
}
]
}
}
8 changes: 8 additions & 0 deletions sg-demo-8723/terraform/modules/aws_vpc/aws_vpc.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "aws_vpc" "this" {
cidr_block = var.cidr_block
instance_tenancy = var.instance_tenancy
enable_dns_support = var.enable_dns_support
enable_dns_hostnames = var.enable_dns_hostnames
enable_network_address_usage_metrics = var.enable_network_address_usage_metrics
tags = var.tags
}
19 changes: 19 additions & 0 deletions sg-demo-8723/terraform/modules/aws_vpc/outputs.tf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"output": {
"arn": {
"description": "The value of the arn output",
"sensitive": false,
"value": "${aws_vpc.this.arn}"
},
"id": {
"description": "The value of the id output",
"sensitive": false,
"value": "${aws_vpc.this.id}"
},
"vpc_id": {
"description": "The value of the vpc_id output",
"sensitive": false,
"value": "${aws_vpc.this.id}"
}
}
}
47 changes: 47 additions & 0 deletions sg-demo-8723/terraform/modules/aws_vpc/variables.tf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"variable": {
"cidr_block": [
{
"description": "The IPv4 CIDR block for the VPC.",
"nullable": false,
"type": "string"
}
],
"instance_tenancy": [
{
"description": "The IPv4 CIDR block for the VPC.",
"default": "default",
"type": "string"
}
],
"enable_dns_support": [
{
"description": "A boolean flag to enable/disable DNS support in the VPC.",
"default": true,
"type": "bool"
}
],
"enable_network_address_usage_metrics": [
{
"description": "Indicates whether Network Address Usage metrics are enabled for your VPC.",
"default": false,
"type": "bool"
}
],
"enable_dns_hostnames": [
{
"description": "A boolean flag to enable/disable DNS hostnames in the VPC.",
"default": false,
"type": "bool"
}
],
"tags": [
{
"description": "The tags to apply to the subnet",
"type": "map(string)",
"nullable": true,
"default": {}
}
]
}
}
30 changes: 30 additions & 0 deletions sg-demo-8723/terraform/moves.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
moved {
from = aws_subnet.public[3]
to = module.stackgen_880746c1-14ec-54f2-b021-718f7663d4e1.aws_subnet.this
}

moved {
from = aws_subnet.public[0]
to = module.stackgen_e46b0268-d537-5202-9c0c-c031f1877081.aws_subnet.this
}

moved {
from = aws_vpc.main
to = module.stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1.aws_vpc.this
}

moved {
from = aws_subnet.public[2]
to = module.stackgen_19ce20e7-23b8-5eec-9eed-9b8ff05adec8.aws_subnet.this
}

moved {
from = aws_subnet.public[1]
to = module.stackgen_2df86e4d-6319-535b-9462-69c4f185be7f.aws_subnet.this
}

moved {
from = aws_subnet.public[4]
to = module.stackgen_7481e4a5-1f5b-5d2b-a1be-ad3c45069aa9.aws_subnet.this
}

65 changes: 65 additions & 0 deletions sg-demo-8723/terraform/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
output "aws_subnet_stackgen_880746c1-14ec-54f2-b021-718f7663d4e1_arn" {
value = module.stackgen_880746c1-14ec-54f2-b021-718f7663d4e1.arn
sensitive = false
}

output "aws_subnet_stackgen_880746c1-14ec-54f2-b021-718f7663d4e1_id" {
value = module.stackgen_880746c1-14ec-54f2-b021-718f7663d4e1.id
sensitive = false
}

output "aws_subnet_stackgen_e46b0268-d537-5202-9c0c-c031f1877081_arn" {
value = module.stackgen_e46b0268-d537-5202-9c0c-c031f1877081.arn
sensitive = false
}

output "aws_subnet_stackgen_e46b0268-d537-5202-9c0c-c031f1877081_id" {
value = module.stackgen_e46b0268-d537-5202-9c0c-c031f1877081.id
sensitive = false
}

output "aws_subnet_stackgen_19ce20e7-23b8-5eec-9eed-9b8ff05adec8_arn" {
value = module.stackgen_19ce20e7-23b8-5eec-9eed-9b8ff05adec8.arn
sensitive = false
}

output "aws_subnet_stackgen_19ce20e7-23b8-5eec-9eed-9b8ff05adec8_id" {
value = module.stackgen_19ce20e7-23b8-5eec-9eed-9b8ff05adec8.id
sensitive = false
}

output "aws_subnet_stackgen_2df86e4d-6319-535b-9462-69c4f185be7f_arn" {
value = module.stackgen_2df86e4d-6319-535b-9462-69c4f185be7f.arn
sensitive = false
}

output "aws_subnet_stackgen_2df86e4d-6319-535b-9462-69c4f185be7f_id" {
value = module.stackgen_2df86e4d-6319-535b-9462-69c4f185be7f.id
sensitive = false
}

output "aws_subnet_stackgen_7481e4a5-1f5b-5d2b-a1be-ad3c45069aa9_arn" {
value = module.stackgen_7481e4a5-1f5b-5d2b-a1be-ad3c45069aa9.arn
sensitive = false
}

output "aws_subnet_stackgen_7481e4a5-1f5b-5d2b-a1be-ad3c45069aa9_id" {
value = module.stackgen_7481e4a5-1f5b-5d2b-a1be-ad3c45069aa9.id
sensitive = false
}

output "aws_vpc_stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1_arn" {
value = module.stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1.arn
sensitive = false
}

output "aws_vpc_stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1_id" {
value = module.stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1.id
sensitive = false
}

output "aws_vpc_stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1_vpc_id" {
value = module.stackgen_cdda596c-e26d-521e-ad04-42444c83b5f1.vpc_id
sensitive = false
}

23 changes: 23 additions & 0 deletions sg-demo-8723/terraform/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
terraform {
required_version = ">= 1.0.0, < 2.0.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}

awscc = { // AWS Cloud Control
source = "hashicorp/awscc"
version = "~> 1.0"
}
}
}

provider "awscc" {
region = var.region
}

provider "aws" {
region = var.region
}
3 changes: 3 additions & 0 deletions sg-demo-8723/terraform/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
variable "region" {
description = "AWS region in which the project needs to be setup (us-east-1, ca-west-1, eu-west-3, etc)"
}
Loading