Skip to content
Closed
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 stackgen_iac/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 stackgen_iac/terraform/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"app_stack_name": "untitled-appStack-2fb49a54",
"iac_type": "Terraform",
"provider": "aws",
"multi_env": false,
"exporter": "terraform"
}
3 changes: 3 additions & 0 deletions stackgen_iac/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://appcd.local/appstacks/60b59299-441d-4c9f-9bbe-fd973f74b4b4)
7 changes: 7 additions & 0 deletions stackgen_iac/terraform/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module "stackgen_16cb0083-c1d1-44e9-a26b-6fbcf0206dea" {
source = "./modules/aws_api_gateway_http_api"
name = "demo"
stage_name = "dev"
tags = {}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "aws_apigatewayv2_api" "this" {
name = var.name
protocol_type = "HTTP"
tags = var.tags
}

resource "aws_apigatewayv2_stage" "this" {
api_id = aws_apigatewayv2_api.this.id
name = var.stage_name
auto_deploy = true
}




Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"output": {
"apigateway_id": {
"description": "The value of the apigateway_id output",
"sensitive": false,
"value": "${aws_apigatewayv2_api.this.id}"
},
"arn": {
"description": "The value of the arn output",
"sensitive": false,
"value": "${aws_apigatewayv2_api.this.arn}"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"variable": {
"name": [
{
"description": "The name of the API",
"nullable": false,
"type": "string"
}
],
"stage_name": [
{
"default": "dev",
"description": "The name of the stage",
"nullable": false,
"type": "string"
}
],
"tags": [
{
"description": "A map of tags to add to all resources",
"type": "map(string)",
"nullable": true
}
]
}
}
13 changes: 13 additions & 0 deletions stackgen_iac/terraform/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
output "aws_api_gateway_http_api_stackgen_16cb0083-c1d1-44e9-a26b-6fbcf0206dea_apigateway_id" {
value = module.stackgen_16cb0083-c1d1-44e9-a26b-6fbcf0206dea.apigateway_id
sensitive = false
}

output "aws_api_gateway_http_api_stackgen_16cb0083-c1d1-44e9-a26b-6fbcf0206dea_arn" {
value = module.stackgen_16cb0083-c1d1-44e9-a26b-6fbcf0206dea.arn
sensitive = false
}


################################################################################

23 changes: 23 additions & 0 deletions stackgen_iac/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 stackgen_iac/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)"
}