Skip to content

Commit

Permalink
fix: scan lambda issue due to count
Browse files Browse the repository at this point in the history
  • Loading branch information
billmetangmo committed Aug 30, 2024
1 parent 7a1e2e1 commit 84b3d2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/deploy_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
paths:
- 'infra/api/**.py'
- 'infra/**.tf'
- 'html/**'
- '.github/workflows/deploy_push.yml'
- 'requirements.txt'
Expand Down Expand Up @@ -114,6 +115,11 @@ jobs:
run: |
cd infra
tfcmt apply -- terraform apply -auto-approve -no-color
if [ "$(terraform workspace show)" == "default" ]; then
echo "Deleting aws_lambda_function.scan resource as workspace is default"
terraform destroy --target aws_lambda_function.scan
terraform destroy --target aws_cloudwatch_event_target.target
fi
- name: Website URL
id: websiteUrl
run: |
Expand Down
1 change: 0 additions & 1 deletion infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ resource "aws_lambda_function" "lambda" {
}

resource "aws_lambda_function" "scan" {
count = terraform.workspace == "mtchoun-mouh-master" ? 1 : 0
filename = data.archive_file.lambda_zip.output_path
function_name = (terraform.workspace == "mtchoun-mouh-master") ? "scan_user_consulcam" : "${terraform.workspace}-scan_user_consulcam"
role = data.aws_iam_role.role.arn
Expand Down

0 comments on commit 84b3d2a

Please sign in to comment.