Skip to content

Add Observability Organization Settings Resource#16543

Open
leowonderful wants to merge 19 commits intoGoogleCloudPlatform:mainfrom
leowonderful:observability-organization-settings-resource
Open

Add Observability Organization Settings Resource#16543
leowonderful wants to merge 19 commits intoGoogleCloudPlatform:mainfrom
leowonderful:observability-organization-settings-resource

Conversation

@leowonderful
Copy link

Description:

This PR introduces the google_observability_organization_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#26242

Release Note Template for Downstream PRs (will be copied)

`google_observability_organization_settings` (beta)
`google_observability_organization_settings` (beta)

@github-actions github-actions bot requested a review from slevenick February 26, 2026 15:45
@github-actions
Copy link

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

@slevenick, 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 ( 7 files changed, 359 insertions(+))
google-beta provider: Diff ( 10 files changed, 1221 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 135 insertions(+))

Missing doc report (experimental)

The following data sources are missing documents:

  • google_observability_organization_settings, expect file /website/docs/d/observability_organization_settings.html.markdown to exist.

Errors

google provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

@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 ( 7 files changed, 359 insertions(+))
google-beta provider: Diff ( 10 files changed, 1221 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 135 insertions(+))

Missing doc report (experimental)

The following data sources are missing documents:

  • google_observability_organization_settings, expect file /website/docs/d/observability_organization_settings.html.markdown to exist.

Errors

google provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

@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
  • TestAccObservabilityOrganizationSettings_observabilityOrganizationSettingsBasicExample
  • TestAccObservabilityOrganizationSettings_observabilityOrganizationSettingsBasicGlobalExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests analytics

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

Click here to see the affected service packages
  • observability

Action taken

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

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccObservabilityOrganizationSettings_observabilityOrganizationSettingsBasicExample [Debug log]
TestAccObservabilityOrganizationSettings_observabilityOrganizationSettingsBasicGlobalExample [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, 358 insertions(+))
google-beta provider: Diff ( 10 files changed, 1221 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 135 insertions(+))

Missing doc report (experimental)

The following data sources are missing documents:

  • google_observability_organization_settings, expect file /website/docs/d/observability_organization_settings.html.markdown to exist.

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccObservabilityOrganizationSettings_observabilityOrganizationSettingsBasicExample [Debug log]
TestAccObservabilityOrganizationSettings_observabilityOrganizationSettingsBasicGlobalExample [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccObservabilityOrganizationSettings_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

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 ( 6 files changed, 358 insertions(+))
google-beta provider: Diff ( 10 files changed, 1221 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 ( 6 files changed, 358 insertions(+))
google-beta provider: Diff ( 10 files changed, 1200 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 ( 6 files changed, 360 insertions(+))
google-beta provider: Diff ( 10 files changed, 1218 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

provider = "google-beta"
organization = "%{org_id}"
location = "%{location}"
kms_key_name = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

"" is an odd thing to specify, should this be omitted instead?

Copy link
Author

@leowonderful leowonderful Feb 27, 2026

Choose a reason for hiding this comment

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

Is it? My intent was to allow users to also unset fields as needed, we do support this on the API level by accepting empty strings for the kms_key_name and default_storage_location fields to effectively unset them.

If this is highly unusual then I could consider doing away with allowing this.

Copy link
Contributor

Choose a reason for hiding this comment

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

In general it's good to be able to do, but it's a bit odd in the data source test to be specifying this

Copy link
Author

Choose a reason for hiding this comment

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

OK gotcha. I need the resource because I'm trying to keep the Check step tidy by using CheckDataSourceStateMatchesResourceState instead of hardcoding attributes to check, this was just a simple way to initialize the resource in a valid way.

The other way I can initialize the resource validly is by setting default_storage_location, which I've done now. Hopefully this makes more sense?

}

# Add a delay to allow the service account to propagate
resource "time_sleep" "wait_for_sa_propagation" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Calling the read on the org settings datasource causes the SA to be created? That seems like a very weird pattern

Copy link
Author

@leowonderful leowonderful Feb 27, 2026

Choose a reason for hiding this comment

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

I added this sleep because I observed lazy provisioning, i.e. if we immediately fetch the SA right after reading the datasource, it might not actually be fully propagated yet

This would cause google_kms_crypto_key_iam_member to fail, claiming the principal didn't exist

So doing the read seems to trigger backend creation of the service account, then we have to wait a bit before it can be referenced in IAM

@github-actions github-actions bot requested a review from slevenick February 27, 2026 21:00
@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, 360 insertions(+))
google-beta provider: Diff ( 10 files changed, 1216 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

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 Organization Settings resource

3 participants