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

Add Certificate Authority Resource (Certificate Authority Service) #4382

Merged

Conversation

connorsmith-w
Copy link
Contributor

@connorsmith-w connorsmith-w commented Jan 11, 2021

hashicorp/terraform-provider-google#7657

Adds "google_privateca_certificate_authority" (name is duplicated because "Certificate Authority" is also the product name)

See https://cloud.google.com/certificate-authority-service/docs/reference/rest/v1beta1/projects.locations.certificateAuthorities for resource documentation.

Notes:

  • This change doesn't implement support for subordinate CAs, which require additional customization because they must be activated.

Customizations:

  • Use POST :scheduleDelete to delete the resource (delete is not supported)
  • On pre_delete, POST :disable to disable the resources (required for scheduling deletion)
  • Check resource deletion by checking that status is DELETION_PENDING

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

`google_privateca_certificate_authority`

@google-cla google-cla bot added the cla: yes label Jan 11, 2021
@modular-magician
Copy link
Collaborator

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.

@ScottSuarez, please review this PR or find an appropriate assignee.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 361 insertions(+))
Terraform Beta: Diff ( 8 files changed, 1857 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 8 files changed, 258 insertions(+))

@drebes
Copy link
Member

drebes commented Jan 11, 2021

Hi, I have some ongoing work for Private CA here, however I didn't have much time to progress recently. Would you like to pick up this work?

@connorsmith-w
Copy link
Contributor Author

@drebes Updated to use "privateca" as the base name as discussed out of band.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 710 insertions(+))
Terraform Beta: Diff ( 11 files changed, 3698 insertions(+), 2 deletions(-))
TF OiCS: Diff ( 16 files changed, 516 insertions(+))

1 similar comment
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 710 insertions(+))
Terraform Beta: Diff ( 11 files changed, 3698 insertions(+), 2 deletions(-))
TF OiCS: Diff ( 16 files changed, 516 insertions(+))

In Certificate Authority Service (privateca).

See
https://cloud.google.com/certificate-authority-service/docs/reference/rest/v1beta1/projects.locations.certificateAuthorities
for resource documentation.

Notes:
- This change doesn't implement support for subordinate CAs, which require
  additional customization because they must be activated.

Customizations:
- Use POST :scheduleDelete to delete the resource (delete is not supported)
- On pre_delete, POST :disable to disable the resources (required for scheduling
  deletd)
- Check resource deletion by checking that status is DELETION_PENDING
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 361 insertions(+))
Terraform Beta: Diff ( 8 files changed, 1857 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 8 files changed, 258 insertions(+))

Copy link
Contributor

@ScottSuarez ScottSuarez left a comment

Choose a reason for hiding this comment

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

adding some comments... mainly just discrepancies between the live docs and your code. Some fields are stated as required in the docs and not included as parameters for the resource. I'm sure you know what you're doing though

products/privateca/api.yaml Show resolved Hide resolved
products/privateca/api.yaml Show resolved Hide resolved
products/privateca/api.yaml Show resolved Hide resolved
products/privateca/api.yaml Show resolved Hide resolved
products/privateca/api.yaml Show resolved Hide resolved
products/privateca/api.yaml Outdated Show resolved Hide resolved
products/privateca/api.yaml Show resolved Hide resolved
products/privateca/api.yaml Show resolved Hide resolved
products/privateca/api.yaml Show resolved Hide resolved
products/privateca/api.yaml Outdated Show resolved Hide resolved
@ScottSuarez
Copy link
Contributor

/gcbrun

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=166875"

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 361 insertions(+))
Terraform Beta: Diff ( 7 files changed, 1859 insertions(+), 2 deletions(-))
TF OiCS: Diff ( 8 files changed, 258 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccInstanceTemplateDatasource_filter|TestAccInstanceTemplateDatasource_filter_mostRecent|TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccApigeeOrganization_apigeeOrganizationCloudBasicTestExample|TestAccApigeeOrganization_apigeeOrganizationCloudFullTestExample|TestAccContainerCluster_withPrivateClusterConfigMissingCidrBlock|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthorityBasicExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthorityFullExample You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=166877"

connorsmith-w and others added 2 commits January 13, 2021 11:18
Co-authored-by: Scott Suarez <ScottSuarez@google.com>
Co-authored-by: Scott Suarez <ScottSuarez@google.com>
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 361 insertions(+))
Terraform Beta: Diff ( 7 files changed, 1860 insertions(+), 2 deletions(-))
TF OiCS: Diff ( 8 files changed, 258 insertions(+))

connorsmith-w and others added 2 commits January 13, 2021 11:28
Co-authored-by: Scott Suarez <ScottSuarez@google.com>
Co-authored-by: Scott Suarez <ScottSuarez@google.com>
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 361 insertions(+))
Terraform Beta: Diff ( 7 files changed, 1860 insertions(+), 2 deletions(-))
TF OiCS: Diff ( 8 files changed, 258 insertions(+))

1 similar comment
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 361 insertions(+))
Terraform Beta: Diff ( 7 files changed, 1860 insertions(+), 2 deletions(-))
TF OiCS: Diff ( 8 files changed, 258 insertions(+))

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 361 insertions(+))
Terraform Beta: Diff ( 8 files changed, 1861 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 8 files changed, 258 insertions(+))

@connorsmith-w
Copy link
Contributor Author

@ScottSuarez marked more fields required (now that I understand what input and required mean :) ), added createtime/updateTime, and addressed other comments. Thank you for the thorough review!

@ScottSuarez
Copy link
Contributor

/gcbrun

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 372 insertions(+))
Terraform Beta: Diff ( 7 files changed, 1903 insertions(+), 2 deletions(-))
TF OiCS: Diff ( 8 files changed, 258 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=166923"

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 372 insertions(+))
Terraform Beta: Diff ( 7 files changed, 1903 insertions(+), 2 deletions(-))
TF OiCS: Diff ( 8 files changed, 258 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceComputeNetworkEndpointGroup|TestAccDataSourceComputeLbIpRanges_basic|TestAccDataSourceGoogleCloudRunLocations_basic|TestAccDataSourceCloudIdentityGroupMemberships_basic|TestAccDataSourceGoogleCloudRunService_basic|TestAccDataSourceGoogleCloudRunService_optionalProject|TestAccDataSourceCloudIdentityGroups_basic|TestAccDataSourceGameServicesGameServerDeploymentRollout_basic|TestAccDataSourceDnsManagedZone_basic|TestAccDataSourceDNSKeys_noDnsSec|TestAccDataSourceDNSKeys_basic|TestAccDataSourceGoogleActiveFolder_default|TestAccDataSourceGoogleActiveFolder_space|TestAccDataSourceGoogleAppEngineDefaultServiceAccount_basic|TestAccDataSourceGoogleBigqueryDefaultServiceAccount_basic|TestAccDataSourceGoogleBillingAccount_byFullName|TestAccDataSourceGoogleBillingAccount_byDisplayName|TestAccDataSourceGoogleBillingAccount_byShortName|TestAccDataSourceGoogleActiveFolder_dash|TestAccDataSourceGoogleBillingAccount_byFullNameClosed|TestAccDataSourceGoogleClientConfig_basic|TestAccDataSourceGoogleClientOpenIDUserinfo_basic|TestAccDataSourceComposerEnvironment_basic|TestAccDataSourceGoogleCloudFunctionsFunction_basic|TestAccDataSourceComputeBackendBucket_basic|TestAccDataSourceComputeAddress|TestAccDataSourceComputeBackendService_basic|TestAccDataSourceComposerImageVersions_basic|TestAccDataSourceGoogleComputeDefaultServiceAccount_basic|TestAccInstanceTemplateDatasource_filter_mostRecent|TestAccDataSourceGoogleForwardingRule|TestAccInstanceTemplateDatasource_filter|TestAccDataSourceComputeGlobalAddress|TestAccDataSourceComputeImageFilter|TestAccDataSourceComputeImage|TestAccDataSourceGoogleComputeInstanceGroup_basic|TestAccDataSourceGoogleComputeInstanceGroup_fromIGM|TestAccDataSourceGoogleComputeInstanceGroup_withNamedPort|TestAccInstanceTemplateDatasource_name|TestAccDataSourceComputeInstanceSerialPort_basic|TestAccDataSourceComputeSslCertificate|TestAccDataSourceComputeNodeTypes_basic|TestAccDataSourceGoogleNetwork|TestAccDataSourceComputeInstance_basic|TestAccDataSourceComputeRegionSslCertificate|TestAccComputeRegions_basic|TestAccDataSourceGoogleSslPolicy|TestAccDataSourceComputeResourcePolicy|TestAccDataSourceComputeRouter|TestAccDataSourceGoogleSubnetwork|TestAccComputeZones_filter|TestAccDataSourceGoogleVpnGateway|TestAccComputeZones_basic|TestAccContainerClusterDatasource_zonal|TestAccContainerEngineVersions_basic|TestAccContainerClusterDatasource_regional|TestAccDataSourceGoogleFolder_byShortName|TestAccDataSourceGoogleFolderOrganizationPolicy_basic|TestAccDataSourceGoogleFolder_byFullName|TestAccContainerEngineVersions_filtered|TestAccDataSourceGoogleGlobalForwardingRule|TestAccDataSourceIAMRole|TestAccDataSourceGoogleFolder_byFullNameNotFound|TestAccDataSourceGoogleIamTestablePermissions_basic|TestAccDataSourceGoogleFolder_lookupOrganization|TestAccDataSourceGoogleNetblockIpRanges_basic|TestAccDataSourceGoogleKmsCryptoKey_basic|TestAccDataSourceGoogleMonitoringUptimeCheckIps_basic|TestAccDataSourceGoogleOrganization_byShortName|TestAccDataSourceGoogleKmsKeyRing_basic|TestAccDataSourceGoogleOrganization_byFullName|TestAccDataKmsSecretCiphertext_basic|TestAccDataSourceGoogleOrganization_byDomain|TestAccDataSourceGoogleProjectOrganizationPolicy_basic|TestAccDataSourceGoogleKmsCryptoKeyVersion_basic|TestAccDataSourceGoogleProjects_basic|TestAccDataSourceGoogleProject_basic|TestAccRedisInstanceDatasource_basic|TestAccDataSourceGoogleServiceAccountIdToken_basic|TestAccDataSourceGoogleSQLCaCerts_basic|TestAccDatasourceGoogleServiceAccount_basic|TestAccDatasourceGoogleServiceAccountKey_basic|TestAccDataSourceGoogleServiceAccountAccessToken_basic|TestAccDataSourceGoogleStorageProjectServiceAccount_basic|TestAccDataSourceGoogleServiceAccountIdToken_impersonation|TestAccDataSourceGoogleStorageTransferProjectServiceAccount_basic|TestAccDataSourceIAMBetaWorkloadIdentityPoolProvider_basic|TestAccDataSourceIAMBetaWorkloadIdentityPool_basic|TestAccDataSourceGoogleMonitoringNotificationChannel_byDisplayName|TestAccDataSourceGoogleMonitoringNotificationChannel_byDisplayNameAndType|TestAccDataSourceGoogleMonitoringNotificationChannel_byTypeAndLabel|TestAccDataSourceGoogleMonitoringNotificationChannel_ErrorNoDisplayNameOrType|TestAccDataSourceGoogleMonitoringNotificationChannel_ErrorNotUnique|TestAccDataSourceGoogleMonitoringNotificationChannel_UserLabel|TestAccDataSourceGoogleMonitoringNotificationChannel_ErrorNotFound|TestAccDataSourceMonitoringService_AppEngine|TestAccDataSourceGooglePubsubTopic_basic|TestAccDatasourceSecretManagerSecretVersion_latest|TestAccDatasourceSecretManagerSecretVersion_basic|TestAccDataSourceGooglePubsubTopic_optionalProject You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=166924"

@connorsmith-w
Copy link
Contributor Author

It seems terraform did not like having "required: true" set for fields which also have a default_value. Fixed (and verified that local test passes for me).

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 375 insertions(+))
Terraform Beta: Diff ( 7 files changed, 1909 insertions(+), 2 deletions(-))
TF OiCS: Diff ( 8 files changed, 261 insertions(+))

@ScottSuarez
Copy link
Contributor

ahh cool cool, thanks for checking that ! sorry for the confusion I suppose we both learned something here ;)

/gcbrun

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=167106"

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 375 insertions(+))
Terraform Beta: Diff ( 7 files changed, 1909 insertions(+), 2 deletions(-))
TF OiCS: Diff ( 8 files changed, 261 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccInstanceTemplateDatasource_filter|TestAccInstanceTemplateDatasource_filter_mostRecent|TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccApigeeOrganization_apigeeOrganizationCloudBasicTestExample|TestAccApigeeOrganization_apigeeOrganizationCloudFullTestExample|TestAccCloudRunService_cloudRunServiceMultipleEnvironmentVariablesExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthorityBasicExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthorityFullExample You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=167113"

@connorsmith-w
Copy link
Contributor Author

@ScottSuarez do you know why generate-diffs may be failing? I don't seem to have the read ACL for it.

@ScottSuarez
Copy link
Contributor

@ScottSuarez do you know why generate-diffs may be failing? I don't seem to have the read ACL for it.

i'm looking now... looks like linter rules. I'm asking my colleges

@ScottSuarez
Copy link
Contributor

linting was broken for a 7m period due to a bad merge

/gcbrun

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=167242"

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 375 insertions(+))
Terraform Beta: Diff ( 7 files changed, 1909 insertions(+), 2 deletions(-))
TF OiCS: Diff ( 8 files changed, 261 insertions(+))

@ScottSuarez
Copy link
Contributor

/gcbrun

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=167303"

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 375 insertions(+))
Terraform Beta: Diff ( 7 files changed, 1909 insertions(+), 2 deletions(-))
TF OiCS: Diff ( 8 files changed, 261 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccCloudRunServiceIamBindingGenerated|TestAccCloudRunServiceIamMemberGenerated|TestAccCloudRunServiceIamPolicyGenerated|TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccApigeeOrganization_apigeeOrganizationCloudBasicTestExample|TestAccApigeeOrganization_apigeeOrganizationCloudFullTestExample|TestAccCloudRunDomainMapping_cloudRunDomainMappingBasicExample|TestAccCloudRunService_cloudRunServiceBasicExample|TestAccCloudRunService_cloudRunServiceMultipleEnvironmentVariablesExample|TestAccCloudRunService_cloudRunServiceSqlExample|TestAccCloudRunService_cloudRunServiceNoauthExample|TestAccComputeHealthCheck_tcp_update|TestAccComputeHealthCheck_typeTransition|TestAccComputeRegionBackendService_basic|TestAccComputeRegionNetworkEndpointGroup_regionNetworkEndpointGroupCloudrunExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthorityBasicExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthorityFullExample You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=167306"

@ScottSuarez
Copy link
Contributor

/gcbrun

had to enable the api on our test product. rerunning

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=167311"

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 375 insertions(+))
Terraform Beta: Diff ( 7 files changed, 1909 insertions(+), 2 deletions(-))
TF OiCS: Diff ( 8 files changed, 261 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccApigeeOrganization_apigeeOrganizationCloudBasicTestExample|TestAccApigeeOrganization_apigeeOrganizationCloudFullTestExample|TestAccCloudRunService_cloudRunServiceMultipleEnvironmentVariablesExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthorityBasicExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthorityFullExample You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=167319"

@drebes
Copy link
Member

drebes commented Jan 17, 2021

It would be great if we could hold release for this until #4407 is also merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants