Skip to content

Commit bc87dda

Browse files
committed
clear repo
1 parent bc2ddde commit bc87dda

File tree

7 files changed

+33
-41
lines changed

7 files changed

+33
-41
lines changed

lambda_code/Makefile

+5-30
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,15 @@ ENV = dev
44
test:
55
pytest -s .
66

7-
.PHONY: invoke_lambda
8-
invoke_lambda:
7+
.PHONY: invoke
8+
invoke:
99
aws lambda invoke --function-name ${ENV}-youtube-comment-sentiment-analysis --cli-binary-format raw-in-base64-out --payload file://events/event.json output.json && cat output.json
1010

1111
.ONESHELL:
12-
.PHONY: build-lambda
13-
build-lambda:
14-
cd function
12+
.PHONY: build
13+
build:
1514
mkdir -p .build
1615
cp -r src/* .build/
1716
uv pip compile pyproject.toml -o .build/requirements.txt
1817
uv pip install -r .build/requirements.txt --target .build --python-platform x86_64-manylinux_2_40 --only-binary=:all:
19-
cd .build && rm -rf *.dist-info *.egg-info __pycache__
20-
21-
.PHONY: terraform-init
22-
terraform-init:
23-
terraform -chdir=terraform init
24-
25-
.PHONY: validate
26-
terraform-validate:
27-
terraform -chdir=terraform validate
28-
29-
.PHONY: terraform-plan
30-
terraform-plan:
31-
terraform -chdir=terraform plan
32-
33-
.PHONY: terraform-apply
34-
terraform-apply:
35-
terraform -chdir=terraform apply -auto-approve
36-
37-
.PHONY: terraform-destroy
38-
terraform-destroy:
39-
terraform -chdir=terraform destroy
40-
41-
.PHONY: terraform-workspace
42-
workspace:
43-
terraform -chdir=terraform workspace select -or-create ${ENV}
18+
cd .build && rm -rf *.dist-info *.egg-info __pycache__

project.code-workspace

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
"path": "."
66
},
77
{
8-
"name": "⭐️ Lambda Code",
9-
"path": "lambda_code"
8+
"name": "🚀 Continuous Deployment",
9+
"path": ".github/workflows"
1010
},
1111
{
12-
"name": "🚀 Terraform",
12+
"name": "🏠 Infrastructure",
1313
"path": "terraform"
14+
},
15+
{
16+
"name": "⭐️ Lambda Code",
17+
"path": "lambda_code"
1418
}
1519
],
1620
}

terraform/main.tf

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ module "lambda" {
1414
module "s3" {
1515
source = "./modules/s3"
1616
bucket_name = "${local.env}-youtube-comment-storage"
17-
env = local.env
1817
service_name = var.service_name
18+
env = local.env
1919
}
2020

2121
module "glue" {
2222
source = "./modules/glue"
23-
env = local.env
2423
database_name = "${local.env}_youtube_comment_db"
2524
table_name = "${local.env}_youtube_comment_analytics"
2625
bucket_name = module.s3.bucket_name

terraform/modules/glue/outputs.tf

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ output "database_name" {
22
value = aws_glue_catalog_database.database.name
33
}
44

5+
output "database_arn" {
6+
value = aws_glue_catalog_database.database.arn
7+
}
8+
59
output "table_name" {
610
value = aws_glue_catalog_table.table.name
711
}
12+
13+
output "table_arn" {
14+
value = aws_glue_catalog_table.table.arn
15+
}

terraform/modules/glue/variables.tf

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
variable "env" {
2-
type = string
3-
}
4-
51
variable "bucket_name" {
62
type = string
73
}

terraform/modules/sfn/variables.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ variable "state_machine_name" {
22
type = string
33
}
44

5-
variable "lambda_arn" {
5+
variable "state_machine_arn" {
66
type = string
7-
}
87

8+
}

terraform/outputs.tf

+10
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,17 @@ output "glue_database_name" {
2323
value = module.glue.database_name
2424
}
2525

26+
output "glue_database_arn" {
27+
description = "ARN of the Glue database"
28+
value = module.glue.database_arn
29+
}
30+
2631
output "glue_table_name" {
2732
description = "Name of the Glue table"
2833
value = module.glue.table_name
2934
}
35+
36+
output "glue_table_arn" {
37+
description = "ARN of the Glue table"
38+
value = module.glue.table_arn
39+
}

0 commit comments

Comments
 (0)