Skip to content

Commit 5718a59

Browse files
Commit by Dhairya Anilbhai Dudhatra
1 parent 65dacb7 commit 5718a59

10 files changed

Lines changed: 143 additions & 0 deletions

File tree

stackgen_iac/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+

stackgen_iac/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": "untitled-appStack-2fb49a54",
3+
"iac_type": "Terraform",
4+
"provider": "aws",
5+
"multi_env": false,
6+
"exporter": "terraform"
7+
}

stackgen_iac/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://appcd.local/appstacks/60b59299-441d-4c9f-9bbe-fd973f74b4b4)

stackgen_iac/terraform/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module "stackgen_16cb0083-c1d1-44e9-a26b-6fbcf0206dea" {
2+
source = "./modules/aws_api_gateway_http_api"
3+
name = "demo"
4+
stage_name = "dev"
5+
tags = {}
6+
}
7+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
resource "aws_apigatewayv2_api" "this" {
2+
name = var.name
3+
protocol_type = "HTTP"
4+
tags = var.tags
5+
}
6+
7+
resource "aws_apigatewayv2_stage" "this" {
8+
api_id = aws_apigatewayv2_api.this.id
9+
name = var.stage_name
10+
auto_deploy = true
11+
}
12+
13+
14+
15+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"output": {
3+
"apigateway_id": {
4+
"description": "The value of the apigateway_id output",
5+
"sensitive": false,
6+
"value": "${aws_apigatewayv2_api.this.id}"
7+
},
8+
"arn": {
9+
"description": "The value of the arn output",
10+
"sensitive": false,
11+
"value": "${aws_apigatewayv2_api.this.arn}"
12+
}
13+
}
14+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"variable": {
3+
"name": [
4+
{
5+
"description": "The name of the API",
6+
"nullable": false,
7+
"type": "string"
8+
}
9+
],
10+
"stage_name": [
11+
{
12+
"default": "dev",
13+
"description": "The name of the stage",
14+
"nullable": false,
15+
"type": "string"
16+
}
17+
],
18+
"tags": [
19+
{
20+
"description": "A map of tags to add to all resources",
21+
"type": "map(string)",
22+
"nullable": true
23+
}
24+
]
25+
}
26+
}

stackgen_iac/terraform/outputs.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
output "aws_api_gateway_http_api_stackgen_16cb0083-c1d1-44e9-a26b-6fbcf0206dea_apigateway_id" {
2+
value = module.stackgen_16cb0083-c1d1-44e9-a26b-6fbcf0206dea.apigateway_id
3+
sensitive = false
4+
}
5+
6+
output "aws_api_gateway_http_api_stackgen_16cb0083-c1d1-44e9-a26b-6fbcf0206dea_arn" {
7+
value = module.stackgen_16cb0083-c1d1-44e9-a26b-6fbcf0206dea.arn
8+
sensitive = false
9+
}
10+
11+
12+
################################################################################
13+

stackgen_iac/terraform/provider.tf

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
terraform {
2+
required_version = ">= 1.0.0, < 2.0.0"
3+
4+
required_providers {
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = "~> 5.0"
8+
}
9+
10+
awscc = { // AWS Cloud Control
11+
source = "hashicorp/awscc"
12+
version = "~> 1.0"
13+
}
14+
}
15+
}
16+
17+
provider "awscc" {
18+
region = var.region
19+
}
20+
21+
provider "aws" {
22+
region = var.region
23+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
variable "region" {
2+
description = "AWS region in which the project needs to be setup (us-east-1, ca-west-1, eu-west-3, etc)"
3+
}

0 commit comments

Comments
 (0)