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

Allow subordinate CA data sources in all states #12511

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/6496.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
privateca: fixed an issue that blocked subordinate CA data sources when `state` was not `AWAITING_USER_ACTIVATION`
```
4 changes: 2 additions & 2 deletions google/data_source_certificate_authority.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ func dataSourcePrivatecaCertificateAuthorityRead(d *schema.ResourceData, meta in
return err
}

// pem_csr is only applicable for SUBORDINATE CertificateAuthorities
if d.Get("type") == "SUBORDINATE" {
// pem_csr is only applicable for SUBORDINATE CertificateAuthorities when their state is AWAITING_USER_ACTIVATION
if d.Get("type") == "SUBORDINATE" && d.Get("state") == "AWAITING_USER_ACTIVATION" {
url, err := replaceVars(d, config, "{{PrivatecaBasePath}}projects/{{project}}/locations/{{location}}/caPools/{{pool}}/certificateAuthorities/{{certificate_authority_id}}:fetch")
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions website/docs/d/privateca_certificate_authority.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: |-
---
# google_privateca_certificate_authority

Get info about a Google Cloud IAP Client.
Get info about a Google CAS Certificate Authority.

## Example Usage

Expand Down Expand Up @@ -42,4 +42,4 @@ The following arguments are supported:

See [google_privateca_certificate_authority](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/privateca_certificate_authority) resource for details of the available attributes.

* `pem_csr` - The PEM-encoded signed certificate signing request (CSR). This is only set on subordinate certificate authorities.
* `pem_csr` - The PEM-encoded signed certificate signing request (CSR). This is only set on subordinate certificate authorities that are awaiting user activation.