-
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
Misc improvements for Certificate Authority #4407
Conversation
Hello! I am a robot who works on Magic Modules PRs. I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. Thanks for your contribution! A human will be with you soon. @c2thorn, please review this PR or find an appropriate assignee. |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 3 files changed, 238 insertions(+), 12 deletions(-)) |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=167597" |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 3 files changed, 238 insertions(+), 12 deletions(-)) |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=167598" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccPrivatecaCertificateAuthorityIamBindingGenerated|TestAccPrivatecaCertificateAuthorityIamMemberGenerated|TestAccPrivatecaCertificateAuthorityIamPolicyGenerated|TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccCloudRunService_cloudRunServiceMultipleEnvironmentVariablesExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthorityCmekExample You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=167599" |
// the Google-managed project and the location of the CA. | ||
config := obj["config"].(map[string]interface{}) | ||
configReusableConfig := config["reusableConfig"].(map[string]interface{}) | ||
configReusableConfig["reusableConfig"] = fmt.Sprintf("projects/568668481468/locations/%s/reusableConfigs/%s", d.Get("location"), parts[0]) |
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.
Just to verify: this needs to be set to a fixed project number?
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.
Good point. The API takes both a project number or project ID (the corresponding project ID for that project number is privateca-data
), however the read call will always answer with the project number. So the point of passing the project number directly (instead of project ID) was to avoid a permadiff. But now that we have this custom encoder and the corresponding diff suppress function, we could pass the project ID itself since the diff suppress would only look into the suffix (the reusable config itself) when the user specifies only the short form. Would you prefer to have the project ID on the create call to make this more legible?
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.
Got it, I've seen that behavior in other APIs as well. I think it is fine as is, especially when the comment above clarifies the Google-managed project part. Thanks for explaining.
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 follow up on this @drebes. Aside from one question, this looks good to me. I'll get this merged in so both changes get released at the same time.
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)
This PR brings multiple UX improvements over the recently merged but unreleased #4382. As such it would be nice if
google_privateca_certificate_authority
release waits to be released with these changes:ForceNew
.disable_on_delete
that should be enabled to allow a CA to be deleted (same rationale offorce_destroy
ongoogle_storage_bucket
), and also only disable is the CA is in the enabled state.