diff --git a/examples/complete/README.md b/examples/complete/README.md index d065466..2278a22 100644 --- a/examples/complete/README.md +++ b/examples/complete/README.md @@ -1,12 +1,10 @@ -# Terraform Module Example - -## Complete Example +# Example: Complete This is an example of using the Terraform Docker Artifact Package module to package a TypeScript app into a Docker image, extract the compiled JavaScript file, and use it as the source code for an AWS Lambda function. -### Prerequisites +## Prerequisites - Terraform installed on your local machine - Docker installed on your local machine diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 3d6d53c..f3e0d4d 100755 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -1,3 +1,7 @@ +locals { + tags = { tf-module = "cruxstack/yopass/aws", tf-module-example = "complete" } +} + module "artifact_packager" { source = "../../" @@ -8,14 +12,15 @@ module "artifact_packager" { } resource "aws_lambda_function" "this" { - function_name = "tf-example-echo-app" - + function_name = "tfexample-complete-echo-app" runtime = "nodejs18.x" handler = "index.handler" filename = module.artifact_packager.artifact_package_path source_code_hash = filebase64sha256(module.artifact_packager.artifact_package_path) role = aws_iam_role.this.arn + tags = local.tags + depends_on = [ module.artifact_packager, ] @@ -40,4 +45,6 @@ resource "aws_iam_role" "this" { managed_policy_arns = [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" ] + + tags = local.tags }