Skip to content

Commit

Permalink
update gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
tinhtq committed Dec 2, 2024
1 parent 35d29b7 commit f7de045
Show file tree
Hide file tree
Showing 18 changed files with 58 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ python.zip
backend.tf
.DS_Store
.env
venv
lambda.zip
Empty file modified budget/deploy.sh
100755 → 100644
Empty file.
Empty file modified dop-c02/cloudformation/10-cfn-init/0-ec2-user-data.sh
100755 → 100644
Empty file.
Empty file modified dop-c02/cloudformation/10-cfn-init/1-ec2-user-data.yaml
100755 → 100644
Empty file.
Empty file modified dop-c02/cloudformation/10-cfn-init/2-cfn-init.yaml
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file modified dop-c02/cloudformation/13-stacksets/enable-aws-config.yaml
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
44 changes: 44 additions & 0 deletions eventbridge/trigger-event-bus/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
resource "aws_cloudwatch_event_bus" "trigger" {
name = "trigger-event-bridge"
}

data "archive_file" "lambda_zip" {
type = "zip"
source_file = "./lambda/main.py"
output_path = "./lambda/lambda.zip"
}

# IAM Role for Lambda
resource "aws_iam_role" "lambda_role" {
name = "lambda_role"

assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Action = "sts:AssumeRole"
Principal = {
Service = "lambda.amazonaws.com"
}
Effect = "Allow"
Sid = ""
},
]
})
}

# Lambda Function
resource "aws_lambda_function" "my_lambda" {
function_name = "event-bridge-integration"

# Use the zip file created by archive_file
filename = data.archive_file.lambda_zip.output_path
source_code_hash = data.archive_file.lambda_zip.output_base64sha256

role = aws_iam_role.lambda_role.arn
handler = "main.lambda_handler" # Ensure this matches the function in main.py
runtime = "python3.10" # Or another Python runtime version

memory_size = 128
timeout = 10
}
5 changes: 5 additions & 0 deletions eventbridge/trigger-event-bus/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
provider "aws" {
region = "us-east-1"
access_key = var.access_key
secret_key = var.secret_key
}
7 changes: 7 additions & 0 deletions eventbridge/trigger-event-bus/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
variable "access_key" {

}

variable "secret_key" {

}

0 comments on commit f7de045

Please sign in to comment.