Skip to content

Commit

Permalink
logging_project_bucket_config: support "no preference" for enable_ana…
Browse files Browse the repository at this point in the history
…lytics setting. (#11430) (#19126)

[upstream:90589fba9e124d25ece290f144942815c267daf5]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Aug 14, 2024
1 parent 79dc8ac commit 11092fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/11430.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
logging: changed enable_analytics parsing to "no preference" in analytics if omitted, instead of explicitly disabling analytics.
```
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func resourceLoggingProjectBucketConfigAcquireOrCreate(parentType string, iDFunc
UserAgent: userAgent,
})
if res == nil {
log.Printf("[DEGUG] Loggin Bucket not exist %s", id)
log.Printf("[DEBUG] Logging Bucket does not exist %s", id)
// we need to pass the id in here because we don't want to set it in state
// until we know there won't be any errors on create
return resourceLoggingProjectBucketConfigCreate(d, meta, id)
Expand All @@ -214,7 +214,11 @@ func resourceLoggingProjectBucketConfigCreate(d *schema.ResourceData, meta inter
obj["description"] = d.Get("description")
obj["locked"] = d.Get("locked")
obj["retentionDays"] = d.Get("retention_days")
obj["analyticsEnabled"] = d.Get("enable_analytics")
// Only set analyticsEnabled if it has been explicitly preferenced.
analyticsRawValue := d.GetRawConfig().GetAttr("enable_analytics")
if !analyticsRawValue.IsNull() {
obj["analyticsEnabled"] = analyticsRawValue.True()
}
obj["cmekSettings"] = expandCmekSettings(d.Get("cmek_settings"))
obj["indexConfigs"] = expandIndexConfigs(d.Get("index_configs"))

Expand Down

0 comments on commit 11092fa

Please sign in to comment.