Skip to content

Pull Request by appcd-e2e #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
32 changes: 32 additions & 0 deletions a2a-agentic-directory-1/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 a2a-agentic-directory-1/terraform/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"app_stack_name": "another-appstack-3823",
"iac_type": "Terraform",
"provider": "aws",
"multi_env": false,
"exporter": "terraform"
}
3 changes: 3 additions & 0 deletions a2a-agentic-directory-1/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://main.dev.stackgen.com/appstacks/25944a89-c81e-48b1-abaf-bbb9e9bd611c)
88 changes: 88 additions & 0 deletions a2a-agentic-directory-1/terraform/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
module "stackgen_32e26297-c006-4fee-94e9-b7b3e93281ee" {
source = "./modules/aws_iam_role"
assume_role_policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"lambda.amazonaws.com\"},\"Action\":\"sts:AssumeRole\"}]}"
}

module "stackgen_392c67f8-2d55-59ea-a942-d91ecc986c83" {
source = "./modules/aws_lambda"
architecture = "x86_64"
authorization_type = "NONE"
cors = []
create_function_url = false
description = null
environment_variables = {}
event_source_arn = null
event_source_mapping = []
filename = null
function_name = "stackgen_87e517-function"
handler = "main.lambda_handler"
image_uri = null
log_format = null
log_group_name = module.stackgen_55b44ffd-94ed-557f-88bd-1d56734f5519.name
memory_size = 128
role = module.stackgen_47096752-05d0-57b8-b350-a13e9b5a7c19.arn
runtime = "python3.8"
s3_bucket = null
s3_key = null
s3_object_version = null
system_log_level = null
tags = null
timeout = 3
}

module "stackgen_47096752-05d0-57b8-b350-a13e9b5a7c19" {
source = "./modules/aws_iam_role"
assume_role_policy = "{\"Version\": \"2012-10-17\",\"Statement\": [{\"Action\": \"sts:AssumeRole\",\"Effect\": \"Allow\",\"Principal\": {\"Service\": \"lambda.amazonaws.com\"}}]}"
description = "IAM role for Lambda function to access DynamoDB and CloudWatch Logs."
force_detach_policies = true
inline_policy = []
max_session_duration = 3600
name = "lambda_dynamodb_cloudwatch_role"
path = "/"
permissions_boundary = null
tags = {}
}

module "stackgen_55b44ffd-94ed-557f-88bd-1d56734f5519" {
source = "./modules/aws_cloudwatch_log_group"
name = "/aws/lambda/stackgen_87e517-function"
retention_in_days = "30"
tags = {}
}

module "stackgen_7c4f5b9f-d3a0-4d3e-b141-fac7497f304d" {
source = "./modules/aws_iam_role_policy"
name = "Writer-stackgen_f61eb3"
policy = "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"CloudwatchLogGroup55b44ffd94ed557f88bd1d56734f55190\",\n \"Action\": [\n \"logs:CreateLogGroup\"\n ],\n \"Effect\": \"Allow\",\n \"Resource\": [\n \"${module.stackgen_55b44ffd-94ed-557f-88bd-1d56734f5519.arn}\"\n ]\n },\n {\n \"Sid\": \"CloudwatchLogGroup55b44ffd94ed557f88bd1d56734f55191\",\n \"Action\": [\n \"logs:CreateLogStream\",\n \"logs:PutLogEvents\"\n ],\n \"Effect\": \"Allow\",\n \"Resource\": [\n \"${module.stackgen_55b44ffd-94ed-557f-88bd-1d56734f5519.arn}:*\"\n ]\n }\n ]\n}"
role = module.stackgen_47096752-05d0-57b8-b350-a13e9b5a7c19.name
role_type = "Writer"
}

module "stackgen_cb0995de-c5ce-4f72-8c69-7f61cb3326fe" {
source = "./modules/aws_cloudwatch_log_group"
name = "my-log-group"
retention_in_days = 30
tags = {
environment = "production"
}
}

module "stackgen_f0ed6411-1f8b-4363-a8c2-8f6868b90e1d" {
source = "./modules/aws_dynamodb"
attribute = [{
name = "attribute1"
type = "type1"
}]
billing_mode = "PROVISIONED"
global_secondary_indexes = []
hash_key = "string"
local_secondary_indexes = []
point_in_time_recovery_enabled = true
read_capacity = null
server_side_encryption_enabled = true
table_name = "string"
tags = {}
ttl = []
write_capacity = null
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "aws_cloudwatch_log_group" "this" {
name = var.name
retention_in_days = var.retention_in_days

tags = var.tags
}




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_cloudwatch_log_group.this.arn}"
},
"name": {
"description": "The value of the name output",
"sensitive": false,
"value": "${aws_cloudwatch_log_group.this.name}"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"variable": {
"name": [
{
"description": "The name of the log group",
"type": "string",
"nullable": true
}
],
"retention_in_days": [
{
"description": "The number of days to retain log events",
"type": "number",
"nullable": true,
"default": 7
}
],
"tags": [
{
"description": "A map of tags to add to all resources",
"default": {},
"type": "map(string)",
"nullable": true
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
locals {
hasStreaming = var.stream_view_type != "None"
}

# Create DynamoDB table
resource "aws_dynamodb_table" "this" {
name = var.table_name
billing_mode = var.billing_mode
read_capacity = var.read_capacity
write_capacity = var.write_capacity
hash_key = var.hash_key
range_key = var.range_key

stream_enabled = local.hasStreaming
stream_view_type = local.hasStreaming ? var.stream_view_type : null

dynamic "attribute" {
for_each = var.attribute
content {
name = attribute.value.name
type = attribute.value.type
}
}

dynamic "global_secondary_index" {
for_each = var.global_secondary_indexes
content {
name = global_secondary_index.value.name
hash_key = global_secondary_index.value.hash_key
range_key = global_secondary_index.value.range_key
projection_type = global_secondary_index.value.projection_type
read_capacity = global_secondary_index.value.read_capacity
write_capacity = global_secondary_index.value.write_capacity
}
}

dynamic "local_secondary_index" {
for_each = var.local_secondary_indexes
content {
name = local_secondary_index.value.name
range_key = local_secondary_index.value.range_key
projection_type = local_secondary_index.value.projection_type
}
}

point_in_time_recovery {
enabled = var.point_in_time_recovery_enabled
}

server_side_encryption {
enabled = var.server_side_encryption_enabled
}

tags = var.tags

dynamic "ttl" {
for_each = var.ttl
content {
attribute_name = ttl.value.attribute_name
enabled = ttl.value.enabled
}
}
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"output": {
"arn": {
"description": "The value of the arn output",
"sensitive": false,
"value": "${aws_dynamodb_table.this.arn}"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"variable": {
"billing_mode": [
{
"description": "The billing mode of the DynamoDB table",
"type": "string",
"default": "PROVISIONED"
}
],
"write_capacity": [
{
"default": 1,
"description": "Number of write units for this table. If the billing_mode is PROVISIONED, this field is required.",
"type": "number",
"nullable": true
}
],
"read_capacity": [
{
"default": 1,
"description": "Number of read units for this table. If the billing_mode is PROVISIONED, this field is required.",
"type": "number",
"nullable": true
}
],
"table_name": [
{
"description": "The name of the DynamoDB table",
"type": "string",
"default": "my-table"
}
],
"hash_key": [
{
"description": "The hash key of the DynamoDB table",
"type": "string",
"default": "id"
}
],
"range_key": [
{
"description": "The range key of the DynamoDB table",
"type": "string",
"default": "",
"nullable": true
}
],
"attribute": [
{
"description": "The attribute of the DynamoDB table",
"type": "list(object({ name: string, type: string }))",
"default": [
{
"name": "id",
"type": "S"
}
]
}
],
"global_secondary_indexes": [
{
"description": "A list of maps representing the global secondary indexes",
"type": "list(object({ name: string, hash_key: string, range_key: string, projection_type: string, read_capacity: number, write_capacity: number }))",
"default": [],
"nullable": true
}
],
"local_secondary_indexes": [
{
"description": "A list of maps representing the local secondary indexes",
"type": "list(object({ name: string, range_key: string, projection_type: string }))",
"default": [],
"nullable": true
}
],
"ttl": [
{
"description": "A map representing the TTL settings",
"type": "list(object({ attribute_name: string, enabled: bool }))",
"default": [],
"nullable": true
}
],
"tags": [
{
"description": "A map of tags to apply to the resources",
"type": "map(string)",
"default": {},
"nullable": true
}
],
"stream_view_type": [
{
"description": "Indicates the DynamoDB Streams settings for the table. Set to `None` to disable streaming.",
"type": "string",
"default": "NEW_IMAGE",
"nullable": true
}
],
"point_in_time_recovery_enabled": [
{
"description": "Indicates whether point in time recovery is to be enabled (true) or disabled (false)",
"type": "bool",
"default": true
}
],
"server_side_encryption_enabled": [
{
"description": "Indicates whether server side encryption is to be enabled (true) or disabled (false)",
"type": "bool",
"default": true
}
]
}
}
Loading