From 41348d36b3fee6bc5cd58fed18c1210401ea128e Mon Sep 17 00:00:00 2001 From: Sebastian Czech Date: Wed, 18 Dec 2024 22:31:19 +0100 Subject: [PATCH] feat: Define default name for VPC endpoint (#1151) * feat: Define default name for VPC endpoint * Change default name Co-authored-by: Bryant Biggs * Remove not require qoute * fix: Go back to key --------- Co-authored-by: Bryant Biggs --- .pre-commit-config.yaml | 2 +- modules/vpc-endpoints/main.tf | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a6cd36943..b348aea04 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.96.1 + rev: v1.96.2 hooks: - id: terraform_fmt - id: terraform_docs diff --git a/modules/vpc-endpoints/main.tf b/modules/vpc-endpoints/main.tf index fbd5642a9..dbc5717db 100644 --- a/modules/vpc-endpoints/main.tf +++ b/modules/vpc-endpoints/main.tf @@ -44,7 +44,11 @@ resource "aws_vpc_endpoint" "this" { } } - tags = merge(var.tags, try(each.value.tags, {})) + tags = merge( + var.tags, + { "Name" = replace(each.key, ".", "-") }, + try(each.value.tags, {}), + ) timeouts { create = try(var.timeouts.create, "10m")