-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Allow brand new setup for google_developer_connect_connection #12493
Conversation
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 4 Click here to see the affected service packages
Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @BBBmau, 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. |
@@ -99,6 +110,7 @@ properties: | |||
Represents an OAuth token of the account that authorized the Connection,and | |||
associated metadata. | |||
min_version: 'beta' | |||
default_from_api: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only concern is the inclusion of default_from_api: true
on these two properties. What is the reason for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, this requires some product knowledge, but let me try to explain. default_from_api: true
means if the user leave it unspecified, Terraforms defers to the server provided value instead of sending an empty value that wipes out the server side value. This option is designed for fields whose value can be both server-provided and user-supplied. Consider a typical config to set up a connection
resource "google_developer_connect_connection" "default" {
...
github_config {
github_app = "FIREBASE"
# Note the unspecified authorizer_credentials field
}
}
output "next_steps" {
description = "Follow the action_uri if present to continue setup"
value = google_developer_connect_connection.default.installation_state
}
- Run
terraform apply
, and the output will provide a URL for the user to visit for an OAuth flow - After the OAuth flow,
authorizer_credentials
is populated on the server side, but the Terraform configuration doesn't know about it - If the user runs
terraform apply
again on the same config, withoutdefault_from_api
, terraform will detect a diff and accidentally wipe out theauthorizer_credentials
- The correct behavior is that terraform will refresh to capture the
authorizer_credentials
populated outside of Terraform, and doesn't complain about a diff. - If the user wants to use another
authorizer_credentials
, they can do so and Terraform will send the new value to the server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation, this is all I needed!
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.