From 06091b574521c9743d008c6a2f40761b724c2259 Mon Sep 17 00:00:00 2001 From: Christopher Haar Date: Fri, 21 Jul 2023 11:34:52 +0200 Subject: [PATCH] fix(cloudwatchlogggroup): fix name_prefix causes recreate issue Signed-off-by: Christopher Haar --- config/cloudwatchlogs/config.go | 8 ++++++++ examples/cloudwatchlogs/group.yaml | 1 + 2 files changed, 9 insertions(+) diff --git a/config/cloudwatchlogs/config.go b/config/cloudwatchlogs/config.go index 30b3e664f1..76aa2837b1 100644 --- a/config/cloudwatchlogs/config.go +++ b/config/cloudwatchlogs/config.go @@ -47,4 +47,12 @@ func Configure(p *config.Provider) { Extractor: common.PathTerraformIDExtractor, } }) + + p.AddResourceConfigurator("aws_cloudwatch_log_group", func(r *config.Resource) { + config.MarkAsRequired(r.TerraformResource, "name") + r.LateInitializer = config.LateInitializer{ + IgnoredFields: []string{"name_prefix"}, + } + }) + } diff --git a/examples/cloudwatchlogs/group.yaml b/examples/cloudwatchlogs/group.yaml index a50cca7921..d5609c1139 100644 --- a/examples/cloudwatchlogs/group.yaml +++ b/examples/cloudwatchlogs/group.yaml @@ -5,6 +5,7 @@ metadata: spec: forProvider: region: us-west-1 + retentionInDays: 5 tags: Application: serviceA Environment: production