Skip to content

Commit 03e3f99

Browse files
authored
Merge pull request #156 from proactiveops/fix-tags
Further tag cleanups
2 parents a4318bf + 4670472 commit 03e3f99

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

picofun/templates/main.tf.j2

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,6 @@ locals {
2828
{% for subnet in subnets -%} "{{ subnet }}",
2929
{% endfor %}]
3030
{% endif %}
31-
tags = merge(
32-
{
33-
"generated_by" = "picofun"
34-
},{% if tags|length > 0 %}
35-
{ {% for tag in tags -%}
36-
{{ tag }} = "{{ tags[tag] }}",
37-
{% endfor %} },{%- endif %}
38-
var.tags
39-
)
4031
}
4132
{% if subnets|length > 0 %}
4233
data "aws_subnet" "this" {
@@ -50,7 +41,7 @@ resource "aws_security_group" "lambda" {
5041
description = "Security group for pf-{{ namespace }} lambda functions"
5142
vpc_id = data.aws_subnet.this[local.subnet_ids[0]].vpc_id
5243

53-
tags = local.tags
44+
tags = var.tags
5445
}
5546
{% endif %}
5647
resource "null_resource" "layer" {
@@ -121,7 +112,7 @@ resource "aws_lambda_function" "this" {
121112
mode = "Active"
122113
}
123114
{% endif %}
124-
tags = local.tags
115+
tags = var.tags
125116
}
126117

127118
resource "aws_iam_role" "lambda" {
@@ -130,7 +121,7 @@ resource "aws_iam_role" "lambda" {
130121
assume_role_policy = data.aws_iam_policy_document.lambda_assume_role.json
131122
permissions_boundary = {{ '"{}"'.format(role_permissions_boundary) if role_permissions_boundary else "null" }}
132123

133-
tags = local.tags
124+
tags = var.tags
134125
}
135126

136127
data "aws_iam_policy_document" "lambda_assume_role" {
@@ -168,7 +159,7 @@ resource "aws_cloudwatch_log_group" "lambda" {
168159

169160
retention_in_days = 14
170161

171-
tags = local.tags
162+
tags = var.tags
172163
}
173164

174165
output "lambda_function_arns" {

0 commit comments

Comments
 (0)