terraform-aws-lambda-builder
terraform-aws-lambda-builder copied to clipboard
Terraform plan / Terraform apply breaks in CI system
Hi Raymond
Egor again. We're facing the following issue during terraform apply
stage:
`[terragrunt] 2020/10/08 03:22:32 Running command: terraform apply -input=false --auto-approve /tmp/cci-extras/workspace/terraform.plan module.identify_unprocessed_grids_lambda_function.aws_s3_bucket_object.source_zip_file[0]: Creating...
Error: Error opening S3 bucket object source (.terraform/modules/identify_unprocessed_grids_lambda_function/zip_files/aws-ap-southeast-2-288871573946-ga_sb_default_identify_unprocessed_grids.zip): open .terraform/modules/identify_unprocessed_grids_lambda_function/zip_files/aws-ap-southeast-2-288871573946-ga_sb_default_identify_unprocessed_grids.zip: no such file or directory
on .terraform/modules/identify_unprocessed_grids_lambda_function/main.tf line 53, in resource "aws_s3_bucket_object" "source_zip_file": 53: resource "aws_s3_bucket_object" "source_zip_file" {
[terragrunt] 2020/10/08 03:22:42 Hit multiple errors: exit status 1
Exited with code exit status 1
CircleCI received exit code 1 `
The reason here is that plan
and apply
stages are separated with approval stage in between. Terraform plan file is transferred between stages as part of CI process, however, zip files complied with LAMBDA builder are quite hard to move as they sit under .terraform/modules. Would you accept our pull request if we externalised zip_files_dir
and made it configurable via variable?
This way we'd be able to store all outputs in a specific folder so we could move them between stages.
Cheers Egor