diff --git a/infrastructure/app/locals.tf b/infrastructure/app/locals.tf new file mode 100644 index 0000000..4076ed8 --- /dev/null +++ b/infrastructure/app/locals.tf @@ -0,0 +1,15 @@ +locals { + service_name = "lambda-boilerplate" +} + +locals { + service_longname = "${var.env_name}_${local.service_name}" +} + +locals { + common_tags = { + stack_name = local.service_longname + environment_name = var.env_name + commit_sha = var.commit_sha + } +} diff --git a/infrastructure/app/app.tf b/infrastructure/app/main.tf similarity index 88% rename from infrastructure/app/app.tf rename to infrastructure/app/main.tf index 5bc2ee8..8759888 100644 --- a/infrastructure/app/app.tf +++ b/infrastructure/app/main.tf @@ -1,18 +1,5 @@ -terraform { - required_version = ">=1.0" - - required_providers { - aws = "4.34.0" - } -} - -provider "aws" { - profile = "default" - region = var.aws_region -} - resource "aws_iam_role" "lambda_role" { - name = "lambda_role" + name = "${local.service_longname}_lambda-role" assume_role_policy = <