Last active
September 8, 2022 15:17
-
-
Save apr-1985/aef082f4ca7494b35a164251c72a51c3 to your computer and use it in GitHub Desktop.
Medium: Managing AWS Lambda Code Outside of Terraform
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data "archive_file" "bootstrap_lambda" { | |
| type = "zip" | |
| output_path = "${path.module}/lambda_function_payload.zip" | |
| source { | |
| content = "hello" | |
| filename = "bootstrap.txt" | |
| } | |
| } | |
| resource "aws_lambda_function" "my_lambda" { | |
| filename = data.archive_file.bootstrap_lambda.output_path | |
| function_name = var.lambda_name | |
| role = aws_iam_role.lambda_exec.arn | |
| handler = var.entrypoint | |
| runtime = var.runtime | |
| source_code_hash = data.archive_file.bootstrap_lambda.output_base64sha256 | |
| reserved_concurrent_executions = var.concurrent_executions | |
| memory_size = var.memory_size | |
| timeout = var.timeout | |
| environment { | |
| variables = local.all_lambda_environment_variables | |
| } | |
| tags = local.tags | |
| lifecycle { | |
| ignore_changes = [source_code_hash, ] | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment