Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logging_project_bucket_config: support "no preference" for enable_analytics setting. #19126

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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