Skip to content

Add Observability Folder Settings Resource#16542

Merged
rileykarson merged 28 commits intoGoogleCloudPlatform:mainfrom
leowonderful:observability-folder-settings-resource
Mar 4, 2026
Merged

Add Observability Folder Settings Resource#16542
rileykarson merged 28 commits intoGoogleCloudPlatform:mainfrom
leowonderful:observability-folder-settings-resource

Conversation

@leowonderful
Copy link
Contributor

Description:

This PR introduces the google_observability_folder_settings resource to Magic Modules for the google-beta provider, part of the broader Observability Settings surface for customers to manage observability compliance configurations across the project, folder and organization structures.

Fixes hashicorp/terraform-provider-google#26239

Release Note Template for Downstream PRs (will be copied)

`google_observability_folder_settings` (beta)
`google_observability_folder_settings` (beta)

@github-actions github-actions bot requested a review from rileykarson February 26, 2026 14:59
@github-actions
Copy link

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@rileykarson, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 6 files changed, 387 insertions(+))
google-beta provider: Diff ( 10 files changed, 1340 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 135 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 7
Passed tests: 2
Skipped tests: 0
Affected tests: 5

Click here to see the affected service packages
  • observability

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccObservabilityFolderSettings_datasource
  • TestAccObservabilityFolderSettings_globalUpdate
  • TestAccObservabilityFolderSettings_observabilityFolderSettingsBasicExample
  • TestAccObservabilityFolderSettings_observabilityFolderSettingsBasicGlobalExample
  • TestAccObservabilityFolderSettings_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccObservabilityFolderSettings_datasource [Debug log]
TestAccObservabilityFolderSettings_globalUpdate [Debug log]
TestAccObservabilityFolderSettings_observabilityFolderSettingsBasicExample [Debug log]
TestAccObservabilityFolderSettings_observabilityFolderSettingsBasicGlobalExample [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccObservabilityFolderSettings_update [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 6 files changed, 387 insertions(+))
google-beta provider: Diff ( 10 files changed, 1352 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 135 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 7
Passed tests: 6
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • observability

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccObservabilityFolderSettings_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 6 files changed, 387 insertions(+))
google-beta provider: Diff ( 10 files changed, 1352 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 135 insertions(+))

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccObservabilityFolderSettings_update [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 7
Passed tests: 7
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • observability

🟢 All tests passed!

View the build log

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 7
Passed tests: 5
Skipped tests: 0
Affected tests: 2

Click here to see the affected service packages
  • observability

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccObservabilityFolderSettings_datasource
  • TestAccObservabilityFolderSettings_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccObservabilityFolderSettings_datasource [Debug log]
TestAccObservabilityFolderSettings_update [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccObservabilityFolderSettings_datasource [Debug log]
TestAccObservabilityFolderSettings_update [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 6 files changed, 389 insertions(+))
google-beta provider: Diff ( 10 files changed, 1370 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 135 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 7
Passed tests: 7
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • observability

🟢 All tests passed!

View the build log

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 5 files changed, 284 insertions(+))
google-beta provider: Diff ( 9 files changed, 1265 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 135 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 12
Passed tests: 12
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • observability

🟢 All tests passed!

View the build log

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 6 files changed, 290 insertions(+), 94 deletions(-))
google-beta provider: Diff ( 10 files changed, 1291 insertions(+), 12 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 135 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 12
Passed tests: 12
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • observability

🟢 All tests passed!

View the build log

@leowonderful
Copy link
Contributor Author

@rileykarson Hi! Could you please take a look at this PR? Thank you :)

@@ -0,0 +1,14 @@
var masks []string
if !d.GetRawConfig().GetAttr("default_storage_location").IsNull() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking for explicit set-ness in config will guard against nulling these values out, but will also create a permadiff because Terraform expects the values out to be null/zero if unset. Can you walk through why we want to guard on being set here vs just setting both values in a fixed update mask?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two reasons, the first is that we never allow users to update both resource fields (kmsKeyName and defaultStorageLocation). The second is because I want to allow setting a field to "".

Very briefly:

  • You can't set kmsKeyName if the Settings is in the global region.
  • You can't set defaultStorageLocation if the Settings is not in the global region.

You can set either one of these fields in a Settings resource, but not both. When I used the default fixed update mask the API would complain that both fields were included as update masks, this is why I needed to make a custom pre_create and pre_update in the first place.

Second, I wanted the explicit set-ness check of ...IsNull() to allow explicit clears by setting a field to the empty string "". Originally I just had this check as GetOk but this didn't work because it treated "" as being unset.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no pre_update in this change- just confirming, are you seeing the results you expect w/o one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll note there's no pre_update atm, but it does appear to work as intended.

@github-actions github-actions bot requested a review from rileykarson March 3, 2026 19:40
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 6 files changed, 292 insertions(+), 5 deletions(-))
google-beta provider: Diff ( 11 files changed, 1279 insertions(+), 9 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 135 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 12
Passed tests: 12
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • observability

🟢 All tests passed!

View the build log

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 5 files changed, 284 insertions(+))
google-beta provider: Diff ( 9 files changed, 1267 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 135 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 17
Passed tests: 12
Skipped tests: 0
Affected tests: 5

Click here to see the affected service packages
  • observability

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccObservabilityProjectSettings_datasource
  • TestAccObservabilityProjectSettings_globalUpdate
  • TestAccObservabilityProjectSettings_observabilityProjectSettingsBasicExample
  • TestAccObservabilityProjectSettings_observabilityProjectSettingsBasicGlobalExample
  • TestAccObservabilityProjectSettings_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccObservabilityProjectSettings_datasource [Debug log]
TestAccObservabilityProjectSettings_globalUpdate [Debug log]
TestAccObservabilityProjectSettings_observabilityProjectSettingsBasicExample [Debug log]
TestAccObservabilityProjectSettings_observabilityProjectSettingsBasicGlobalExample [Debug log]
TestAccObservabilityProjectSettings_update [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

@rileykarson rileykarson added this pull request to the merge queue Mar 4, 2026
Merged via the queue into GoogleCloudPlatform:main with commit d09be34 Mar 4, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Terraform support for Observability Project Settings resource

3 participants