Skip to content

Add new resource support for apigee keystore aliases pkcs format#7519

Merged
shuyama1 merged 17 commits into
GoogleCloudPlatform:mainfrom
anuhyapolisetti:add-resource/apigee-aliases-pkcs
Mar 31, 2023
Merged

Add new resource support for apigee keystore aliases pkcs format#7519
shuyama1 merged 17 commits into
GoogleCloudPlatform:mainfrom
anuhyapolisetti:add-resource/apigee-aliases-pkcs

Conversation

@anuhyapolisetti

@anuhyapolisetti anuhyapolisetti commented Mar 23, 2023

Copy link
Copy Markdown
Contributor

Add new resource support for apigee keystore aliases pkcs format

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).
  • [X ] 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).
  • Generated Terraform providers, and ran make test and make lint in the generated providers to ensure it passes unit and linter tests.
  • [X ] Ran relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • [X ] Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

`google_apigee_keystore_aliases_pkcs`

@anuhyapolisetti anuhyapolisetti requested a review from a team as a code owner March 23, 2023 13:16
@anuhyapolisetti anuhyapolisetti requested review from shuyama1 and removed request for a team March 23, 2023 13:16
@shuyama1

Copy link
Copy Markdown
Member

/gcbrun

@modular-magician

Copy link
Copy Markdown
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.

Terraform GA: Diff ( 5 files changed, 927 insertions(+))
Terraform Beta: Diff ( 5 files changed, 927 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2522
Passed tests 2249
Skipped tests: 264
Affected tests: 9

Action taken

Found 9 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccFirebaserulesRelease_BasicRelease|TestAccDataCatalogTag_update|TestAccDataCatalogTag_dataCatalogEntryTagFalseExample|TestAccDataCatalogTag_dataCatalogEntryGroupTagExample|TestAccDataCatalogTag_dataCatalogEntryTagBasicExample|TestAccDataSourceGoogleCloudAssetResourcesSearchAll_basic|TestAccDataSourceDnsManagedZone_basic|TestAccApigeeEnvKeystoreAliasesPkcs_apigeeKeystoreAliasesPkcsExample|TestAccNetworkServicesGateway_update

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccDataCatalogTag_update[Debug log]
TestAccDataCatalogTag_dataCatalogEntryTagFalseExample[Debug log]
TestAccDataCatalogTag_dataCatalogEntryGroupTagExample[Debug log]
TestAccDataCatalogTag_dataCatalogEntryTagBasicExample[Debug log]
TestAccNetworkServicesGateway_update[Debug log]

Tests failed during RECORDING mode:
TestAccDataSourceGoogleCloudAssetResourcesSearchAll_basic[Error message] [Debug log]
TestAccDataSourceDnsManagedZone_basic[Error message] [Debug log]
TestAccApigeeEnvKeystoreAliasesPkcs_apigeeKeystoreAliasesPkcsExample[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

@shuyama1

Copy link
Copy Markdown
Member

/gcbrun

@modular-magician

Copy link
Copy Markdown
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.

Terraform GA: Diff ( 5 files changed, 927 insertions(+))
Terraform Beta: Diff ( 5 files changed, 927 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2524
Passed tests 2250
Skipped tests: 264
Affected tests: 10

Action taken

Found 10 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccNetworkServicesGateway_update|TestAccDataCatalogTag_update|TestAccDataCatalogTag_dataCatalogEntryTagFalseExample|TestAccDataCatalogTag_dataCatalogEntryGroupTagExample|TestAccDataCatalogTag_dataCatalogEntryTagBasicExample|TestAccFirebaserulesRelease_BasicRelease|TestAccApigeeEnvKeystoreAliasesPkcs_apigeeKeystoreAliasesPkcsExample|TestAccDataSourceGoogleCloudAssetResourcesSearchAll_basic|TestAccDataSourceDnsManagedZone_basic|TestAccComposerEnvironment_withEncryptionConfigComposer1

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests passed during RECORDING mode:
TestAccNetworkServicesGateway_update[Debug log]
TestAccDataCatalogTag_update[Debug log]
TestAccDataCatalogTag_dataCatalogEntryTagFalseExample[Debug log]
TestAccDataCatalogTag_dataCatalogEntryGroupTagExample[Debug log]
TestAccDataCatalogTag_dataCatalogEntryTagBasicExample[Debug log]
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccApigeeEnvKeystoreAliasesPkcs_apigeeKeystoreAliasesPkcsExample[Debug log]
TestAccComposerEnvironment_withEncryptionConfigComposer1[Debug log]

Tests failed during RECORDING mode:
TestAccDataSourceGoogleCloudAssetResourcesSearchAll_basic[Error message] [Debug log]
TestAccDataSourceDnsManagedZone_basic[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

@shuyama1

Copy link
Copy Markdown
Member

/gcbrun

@modular-magician

Copy link
Copy Markdown
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.

Terraform GA: Diff ( 5 files changed, 927 insertions(+))
Terraform Beta: Diff ( 5 files changed, 927 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2570
Passed tests 2290
Skipped tests: 267
Affected tests: 13

Action taken

Found 13 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccFirebaserulesRelease_BasicRelease|TestAccNetworkServicesGateway_update|TestAccFrameworkProviderBasePath_setBasePath|TestAccFrameworkProviderMeta_setModuleName|TestAccComputeInstanceFromRegionTemplate_basic|TestAccComposerEnvironment_withEncryptionConfigComposer2|TestAccComposerEnvironment_withEncryptionConfigComposer1|TestAccApigeeEnvKeystoreAliasPkcs12_apigeeEnvKeystoreAliasPkcs12Example|TestAccDataSourceGoogleFirebaseAppleAppConfig|TestAccDataSourceDnsManagedZone_basic|TestAccDataSourceDNSKeys_noDnsSec|TestAccDataSourceDnsRecordSet_basic|TestAccDataSourceDNSKeys_basic

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccNetworkServicesGateway_update[Debug log]
TestAccFrameworkProviderBasePath_setBasePath[Debug log]
TestAccFrameworkProviderMeta_setModuleName[Debug log]
TestAccComputeInstanceFromRegionTemplate_basic[Debug log]
TestAccDataSourceGoogleFirebaseAppleAppConfig[Debug log]
TestAccDataSourceDnsManagedZone_basic[Debug log]
TestAccDataSourceDNSKeys_noDnsSec[Debug log]
TestAccDataSourceDnsRecordSet_basic[Debug log]
TestAccDataSourceDNSKeys_basic[Debug log]

Tests failed during RECORDING mode:
TestAccComposerEnvironment_withEncryptionConfigComposer2[Error message] [Debug log]
TestAccComposerEnvironment_withEncryptionConfigComposer1[Error message] [Debug log]
TestAccApigeeEnvKeystoreAliasPkcs12_apigeeEnvKeystoreAliasPkcs12Example[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

@shuyama1

Copy link
Copy Markdown
Member

/gcbrun

@modular-magician

Copy link
Copy Markdown
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.

Terraform GA: Diff ( 5 files changed, 927 insertions(+))
Terraform Beta: Diff ( 5 files changed, 927 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2570
Passed tests 2293
Skipped tests: 267
Affected tests: 10

Action taken

Found 10 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccComputeInstanceFromRegionTemplate_basic|TestAccComposerEnvironment_withEncryptionConfigComposer1|TestAccApigeeEnvKeystoreAliasPkcs12_apigeeEnvKeystoreAliasPkcs12Example|TestAccFrameworkProviderMeta_setModuleName|TestAccFrameworkProviderBasePath_setBasePath|TestAccDataSourceDnsManagedZone_basic|TestAccDataSourceDNSKeys_noDnsSec|TestAccDataSourceDNSKeys_basic|TestAccDataSourceDnsRecordSet_basic|TestAccDataSourceGoogleFirebaseAppleAppConfig

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests passed during RECORDING mode:
TestAccComputeInstanceFromRegionTemplate_basic[Debug log]
TestAccComposerEnvironment_withEncryptionConfigComposer1[Debug log]
TestAccApigeeEnvKeystoreAliasPkcs12_apigeeEnvKeystoreAliasPkcs12Example[Debug log]
TestAccFrameworkProviderMeta_setModuleName[Debug log]
TestAccFrameworkProviderBasePath_setBasePath[Debug log]
TestAccDataSourceDnsManagedZone_basic[Debug log]
TestAccDataSourceDNSKeys_noDnsSec[Debug log]
TestAccDataSourceDNSKeys_basic[Debug log]
TestAccDataSourceDnsRecordSet_basic[Debug log]
TestAccDataSourceGoogleFirebaseAppleAppConfig[Debug log]

All tests passed
View the build log or the debug log for each test

@shuyama1

Copy link
Copy Markdown
Member

/gcbrun

@modular-magician

Copy link
Copy Markdown
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.

Terraform GA: Diff ( 5 files changed, 927 insertions(+))
Terraform Beta: Diff ( 5 files changed, 927 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2584
Passed tests 2304
Skipped tests: 267
Affected tests: 13

Action taken

Found 13 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccFirebaseWebApp_firebaseWebAppFull|TestAccFirebaseWebApp_firebaseWebAppBasicExample|TestAccApigeeEnvKeystoreAliasPkcs12_apigeeEnvKeystoreAliasPkcs12Example|TestAccComposerEnvironment_withEncryptionConfigComposer2|TestAccComposerEnvironment_UpdateComposerV2WithTriggerer|TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample|TestAccDataSourceDnsRecordSet_basic|TestAccDataSourceDnsManagedZone_basic|TestAccDataSourceDNSKeys_noDnsSec|TestAccDataSourceDNSKeys_basic|TestAccFrameworkProviderBasePath_setBasePath|TestAccFrameworkProviderMeta_setModuleName|TestAccDataSourceGoogleFirebaseAppleAppConfig

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaseWebApp_firebaseWebAppFull[Debug log]
TestAccFirebaseWebApp_firebaseWebAppBasicExample[Debug log]
TestAccApigeeEnvKeystoreAliasPkcs12_apigeeEnvKeystoreAliasPkcs12Example[Debug log]
TestAccComposerEnvironment_withEncryptionConfigComposer2[Debug log]
TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample[Debug log]
TestAccDataSourceDnsRecordSet_basic[Debug log]
TestAccDataSourceDnsManagedZone_basic[Debug log]
TestAccDataSourceDNSKeys_noDnsSec[Debug log]
TestAccDataSourceDNSKeys_basic[Debug log]
TestAccFrameworkProviderBasePath_setBasePath[Debug log]
TestAccFrameworkProviderMeta_setModuleName[Debug log]
TestAccDataSourceGoogleFirebaseAppleAppConfig[Debug log]

Tests failed during RECORDING mode:
TestAccComposerEnvironment_UpdateComposerV2WithTriggerer[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

Comment on lines +70 to +71
Optional: true,
Computed: true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Optional: true,
Computed: true,
Computed: true,

Discussed offline: sounds like certs_info and all its subfields are output-only, please change them from optional+computed to computed. Also please change other fields if they're also output-only.
Optional+computed in Terraform: still a field that user can specify, but it will be treated as output-only field if users does not specify explicitly.

Comment on lines +110 to +116
environment = google_apigee_environment.apigee_environment_keystore.name
org_id = google_apigee_organization.apigee_org.name
keystore = google_apigee_env_keystore.apigee_environment_keystore_alias.name
alias = "tf-test%{random_suffix}"
file = "./test-fixtures/apigee/keyStore.p12"
filehash = filemd5("./test-fixtures/apigee/keyStore.p12")
password = sensitive("abcd")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Only nit here: some mixed using of tabs and spaces. We'd use spaces for resource configuraion.

},
},
},
"password": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this also output-only? If so, remove optional: true, otherwise, since we don't have a update function for this resource (I assume this resource is immutable), we need to add Forcenew. Or consider adding update functionality for this resource.

},
"password": {
Type: schema.TypeString,
Optional: true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

computed and forcenew can be set at the same time. Consider:

  1. if the field is output-only: only Computed:true
  2. if the field is a input field + immutable: Optional: true + ForceNew: true
  3. if the field is a input field + updatable: Optional: true + adding a update function for the resource

@shuyama1

Copy link
Copy Markdown
Member

/gcbrun

@shuyama1

Copy link
Copy Markdown
Member

/gcbrun

@modular-magician

Copy link
Copy Markdown
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.

Terraform GA: Diff ( 5 files changed, 913 insertions(+))
Terraform Beta: Diff ( 5 files changed, 913 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2584
Passed tests 2304
Skipped tests: 268
Affected tests: 12

Action taken

Found 12 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccFirebaseWebApp_firebaseWebAppFull|TestAccFirebaseWebApp_firebaseWebAppBasicExample|TestAccComposerEnvironment_withEncryptionConfigComposer2|TestAccApigeeEnvKeystoreAliasPkcs12_apigeeEnvKeystoreAliasPkcs12Example|TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample|TestAccDataSourceDnsManagedZone_basic|TestAccFrameworkProviderMeta_setModuleName|TestAccDataSourceDNSKeys_noDnsSec|TestAccDataSourceDNSKeys_basic|TestAccDataSourceGoogleFirebaseAppleAppConfig|TestAccDataSourceDnsRecordSet_basic|TestAccFrameworkProviderBasePath_setBasePath

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaseWebApp_firebaseWebAppFull[Debug log]
TestAccFirebaseWebApp_firebaseWebAppBasicExample[Debug log]
TestAccComposerEnvironment_withEncryptionConfigComposer2[Debug log]
TestAccApigeeEnvKeystoreAliasPkcs12_apigeeEnvKeystoreAliasPkcs12Example[Debug log]
TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample[Debug log]
TestAccDataSourceDnsManagedZone_basic[Debug log]
TestAccFrameworkProviderMeta_setModuleName[Debug log]
TestAccDataSourceDNSKeys_noDnsSec[Debug log]
TestAccDataSourceDNSKeys_basic[Debug log]
TestAccDataSourceGoogleFirebaseAppleAppConfig[Debug log]
TestAccDataSourceDnsRecordSet_basic[Debug log]
TestAccFrameworkProviderBasePath_setBasePath[Debug log]

All tests passed
View the build log or the debug log for each test

@rileykarson

Copy link
Copy Markdown
Member

@shuyama1 watch out for the resource name in the changelog entry! This resource is called google_apigee_env_keystore_alias_pkcs12 but the changelog called it google_apigee_keystore_aliases_pkcs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants