Skip to content

Commit

Permalink
Merge pull request #156 from proactiveops/fix-tags
Browse files Browse the repository at this point in the history
Further tag cleanups
  • Loading branch information
skwashd authored Oct 28, 2024
2 parents a4318bf + 4670472 commit 03e3f99
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions picofun/templates/main.tf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ locals {
{% for subnet in subnets -%} "{{ subnet }}",
{% endfor %}]
{% endif %}
tags = merge(
{
"generated_by" = "picofun"
},{% if tags|length > 0 %}
{ {% for tag in tags -%}
{{ tag }} = "{{ tags[tag] }}",
{% endfor %} },{%- endif %}
var.tags
)
}
{% if subnets|length > 0 %}
data "aws_subnet" "this" {
Expand All @@ -50,7 +41,7 @@ resource "aws_security_group" "lambda" {
description = "Security group for pf-{{ namespace }} lambda functions"
vpc_id = data.aws_subnet.this[local.subnet_ids[0]].vpc_id

tags = local.tags
tags = var.tags
}
{% endif %}
resource "null_resource" "layer" {
Expand Down Expand Up @@ -121,7 +112,7 @@ resource "aws_lambda_function" "this" {
mode = "Active"
}
{% endif %}
tags = local.tags
tags = var.tags
}

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

tags = local.tags
tags = var.tags
}

data "aws_iam_policy_document" "lambda_assume_role" {
Expand Down Expand Up @@ -168,7 +159,7 @@ resource "aws_cloudwatch_log_group" "lambda" {

retention_in_days = 14

tags = local.tags
tags = var.tags
}

output "lambda_function_arns" {
Expand Down

0 comments on commit 03e3f99

Please sign in to comment.