Skip to content

Implementing License Manager TF resource - configuration#17401

Open
pabloem wants to merge 14 commits into
GoogleCloudPlatform:mainfrom
pabloem:lima-tf-config-w-deactivation
Open

Implementing License Manager TF resource - configuration#17401
pabloem wants to merge 14 commits into
GoogleCloudPlatform:mainfrom
pabloem:lima-tf-config-w-deactivation

Conversation

@pabloem
Copy link
Copy Markdown

@pabloem pabloem commented May 3, 2026

`google_license_manager_configuration`

Support for:

  • Creation
  • Update license count
  • Update active / inactive (deactivate / reactivate calls)
  • Deletion - TODO figure out what to do about this.

Result from custom test:

❯ GOOGLE_ZONE=us-central1-a GOOGLE_REGION=us-central1 GOOGLE_PROJECT=pabloem-cloud-licensemanager GOOGLE_USE_DEFAULT_CREDENTIALS=true TF_ACC=true go test ./google/services/licensemanager -run=TestAccLicenseManagerConfiguration_lifecycle -v       
=== RUN   TestAccLicenseManagerConfiguration_lifecycle
=== PAUSE TestAccLicenseManagerConfiguration_lifecycle
=== CONT  TestAccLicenseManagerConfiguration_lifecycle
--- PASS: TestAccLicenseManagerConfiguration_lifecycle (67.10s)
PASS
ok      github.com/hashicorp/terraform-provider-google/google/services/licensemanager   67.790s

Note: Teamcity failure seems unrelated to my change (I fixed the licensemanager key appearing and now it;s only 'client') - see below @c2thorn

TeamCity service file is missing services present in the provider: [client]

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label May 3, 2026
@pabloem pabloem changed the title Testing follow up from https://github.com/GoogleCloudPlatform/magic-modules/pull/17400 Implementing License Manager TF resource - configuration May 4, 2026
@pabloem pabloem marked this pull request as ready for review May 4, 2026 18:58
@github-actions github-actions Bot requested a review from c2thorn May 4, 2026 18:58
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@c2thorn, 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.

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label May 5, 2026
@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented May 5, 2026

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit ecc411b:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 15 files changed, 1545 insertions(+)
google-beta provider View Diff 13 files changed, 1535 insertions(+)
terraform-google-conversion View Diff 4 files changed, 238 insertions(+)
Open in Cloud Shell View Diff 4 files changed, 107 insertions(+)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_license_manager_configuration (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_license_manager_configuration" "primary" {
  active           = # value needed
  configuration_id = # value needed
  labels           = # value needed
  licensecount     = # value needed
  location         = # value needed
  product          = # value needed
}

Missing service labels

The following new resources do not have corresponding service labels:

  • google_license_manager_configuration

If you believe this detection to be incorrect please raise the concern with your reviewer. Googlers: This error is safe to ignore once you've completed go/fix-missing-service-labels.
An override-missing-service-label label can be added to allow merging.

Test report

Analytics

Total Tests Passed Skipped Affected
6397 5726 655 16
Affected Service Packages
  • All service packages are affected

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 16 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccApigeeOrganization_apigeeOrganizationCloudBasicDisableVpcPeeringTestExample
  • TestAccApigeeOrganization_apigeeOrganizationCloudFullDisableVpcPeeringTestExample
  • TestAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample
  • TestAccCloudRunService_cloudRunServiceGpuExample
  • TestAccContainerCluster_updateVersion
  • TestAccContainerNodePool_withHostMaintenancePolicy
  • TestAccDataSourceGoogleCloudRunService_basic
  • TestAccDataSourceGoogleCloudRunService_optionalProject
  • TestAccDataformConfig_update
  • TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample
  • TestAccDataprocMetastoreService_dataprocMetastoreServicePrivateServiceConnectExample
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample
  • TestAccLicenseManagerConfiguration_licensemanagerConfigurationBasicExample
  • TestAccLicenseManagerConfiguration_lifecycle
  • TestAccManagedKafkaConnector_managedkafkaConnectorBasicExample
  • TestAccPubsubSubscription_pubsubSubscriptionTagsExample

View the build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccDataformConfig_update
❌ Error · Log - TestAccApigeeOrganization_apigeeOrganizationCloudBasicDisableVpcPeeringTestExample
❌ Error · Log - TestAccApigeeOrganization_apigeeOrganizationCloudFullDisableVpcPeeringTestExample
❌ Error · Log - TestAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample
❌ Error · Log - TestAccCloudRunService_cloudRunServiceGpuExample
❌ Error · Log - TestAccContainerCluster_updateVersion
❌ Error · Log - TestAccContainerNodePool_withHostMaintenancePolicy
❌ Error · Log - TestAccDataSourceGoogleCloudRunService_basic
❌ Error · Log - TestAccDataSourceGoogleCloudRunService_optionalProject
❌ Error · Log - TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample
❌ Error · Log - TestAccDataprocMetastoreService_dataprocMetastoreServicePrivateServiceConnectExample
❌ Error · Log - TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample
❌ Error · Log - TestAccLicenseManagerConfiguration_licensemanagerConfigurationBasicExample
❌ Error · Log - TestAccLicenseManagerConfiguration_lifecycle
❌ Error · Log - TestAccManagedKafkaConnector_managedkafkaConnectorBasicExample
❌ Error · Log - TestAccPubsubSubscription_pubsubSubscriptionTagsExample

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the build log or the debug logs folder for detailed results.

@pabloem, @c2thorn VCR tests complete for ecc411b!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

@c2thorn This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@c2thorn
Copy link
Copy Markdown
Member

c2thorn commented May 7, 2026

API was not enabled, restarting

@c2thorn
Copy link
Copy Markdown
Member

c2thorn commented May 7, 2026

/gcbrun

@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels May 7, 2026
@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented May 7, 2026

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit ecc411b:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 15 files changed, 1545 insertions(+)
google-beta provider View Diff 13 files changed, 1535 insertions(+)
terraform-google-conversion View Diff 4 files changed, 238 insertions(+)
Open in Cloud Shell View Diff 4 files changed, 107 insertions(+)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_license_manager_configuration (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_license_manager_configuration" "primary" {
  active           = # value needed
  configuration_id = # value needed
  labels           = # value needed
  licensecount     = # value needed
  location         = # value needed
  product          = # value needed
}

Missing service labels

The following new resources do not have corresponding service labels:

  • google_license_manager_configuration

If you believe this detection to be incorrect please raise the concern with your reviewer. Googlers: This error is safe to ignore once you've completed go/fix-missing-service-labels.
An override-missing-service-label label can be added to allow merging.

Test report

Analytics

Total Tests Passed Skipped Affected
6403 5729 655 19
Affected Service Packages
  • All service packages are affected

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 19 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccApigeeOrganization_apigeeOrganizationCloudBasicDisableVpcPeeringTestExample
  • TestAccApigeeOrganization_apigeeOrganizationCloudFullDisableVpcPeeringTestExample
  • TestAccArtifactRegistryRule_artifactRegistryRuleBasicExample
  • TestAccArtifactRegistryRule_artifactRegistryRuleFullExample
  • TestAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample
  • TestAccCloudRunService_cloudRunServiceGpuExample
  • TestAccComputeInstanceFromTemplate_DiskForceAttach
  • TestAccComputeOrganizationSecurityPolicy_organizationSecurityPolicyWithAdvancedOptionsExample
  • TestAccComputeSecurityPolicyRule_securityPolicyRuleWithBodyExcludeExample
  • TestAccContainerCluster_updateVersion
  • TestAccContainerNodePool_withHostMaintenancePolicy
  • TestAccDataSourceGoogleCloudRunService_basic
  • TestAccDataSourceGoogleCloudRunService_optionalProject
  • TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample
  • TestAccDataprocMetastoreService_dataprocMetastoreServicePrivateServiceConnectExample
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample
  • TestAccLicenseManagerConfiguration_licensemanagerConfigurationBasicExample
  • TestAccManagedKafkaConnector_managedkafkaConnectorBasicExample
  • TestAccPubsubSubscription_pubsubSubscriptionTagsExample

View the build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccArtifactRegistryRule_artifactRegistryRuleBasicExample
✅ Log TestAccArtifactRegistryRule_artifactRegistryRuleFullExample
✅ Log TestAccComputeOrganizationSecurityPolicy_organizationSecurityPolicyWithAdvancedOptionsExample
❌ Error · Log - TestAccApigeeOrganization_apigeeOrganizationCloudBasicDisableVpcPeeringTestExample
❌ Error · Log - TestAccApigeeOrganization_apigeeOrganizationCloudFullDisableVpcPeeringTestExample
❌ Error · Log - TestAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample
❌ Error · Log - TestAccCloudRunService_cloudRunServiceGpuExample
❌ Error · Log - TestAccComputeInstanceFromTemplate_DiskForceAttach
❌ Error · Log - TestAccComputeSecurityPolicyRule_securityPolicyRuleWithBodyExcludeExample
❌ Error · Log - TestAccContainerCluster_updateVersion
❌ Error · Log - TestAccContainerNodePool_withHostMaintenancePolicy
❌ Error · Log - TestAccDataSourceGoogleCloudRunService_basic
❌ Error · Log - TestAccDataSourceGoogleCloudRunService_optionalProject
❌ Error · Log - TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample
❌ Error · Log - TestAccDataprocMetastoreService_dataprocMetastoreServicePrivateServiceConnectExample
❌ Error · Log - TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample
❌ Error · Log - TestAccLicenseManagerConfiguration_licensemanagerConfigurationBasicExample
❌ Error · Log - TestAccManagedKafkaConnector_managedkafkaConnectorBasicExample
❌ Error · Log - TestAccPubsubSubscription_pubsubSubscriptionTagsExample

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the build log or the debug logs folder for detailed results.

@pabloem, @c2thorn VCR tests complete for ecc411b!

@pabloem
Copy link
Copy Markdown
Author

pabloem commented May 8, 2026

unable to see the error / log for our tests ... fwiw I was able to run it locally and it worked fine.

type: String
required: true
immutable: true
ignore_read: 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.

why are some of these fields ignore_read? Does the API not return values for them?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

we manipulate the fields in the go.tmpl files, so that's why they're marked as ignore_read. Isn't that the intention? The tests are working fine 🤔

location = "us-central1"
configuration_id = "{{index $.Vars "configuration_id"}}"
product = "{{index $.Vars "product"}}"
licensecount = {{index $.Vars "licensecount"}}
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.

I don't think you need a variable for each field here. They should be considered as id fields, the generator automatically appends a random suffix to them.

For example, we are getting this error:

    resource_license_manager_configuration_generated_test.go:67: Step 1/3 error: Error running pre-apply plan: exit status 1
        
        Error: Missing newline after argument
        
          on terraform_plugin_test.tf line 16, in resource "google_licensemanager_configuration" "example-configuration":
          16:   licensecount            = 10an4jxx3moe
        
        An argument definition must end with a newline.

Which i believe is due to the random suffix.

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.

looking at your example block variable values, I think configuration_id is the only one needing the use of a variable, the rest can be hardcoded in this template.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done thanks!

immutable: true
ignore_read: true
description: Name field (with URL) of the Product offered for SPLA.
- name: licensecount
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.

it's really licensecount instead of licenseCount ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

we have a complex nested field (currentBillingInfo.userCountBilling.userCount or currentBillingInfo.packCountBilling.packCount) - in this case, we decided to expose licensecount in the tf resource - does that make sense?

obj["product"] = fmt.Sprintf("projects/%s/locations/%s/products/%s", project, region, product)

if _, ok := obj["displayName"]; !ok {
obj["displayName"] = configurationId + "-terraform"
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.

Why is display Name not a configurable field?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

we discussed and decided to have a single name field that the user would have control over, so we derive others from that one. Does that make sense?

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label May 11, 2026
Copy link
Copy Markdown
Author

@pabloem pabloem left a comment

Choose a reason for hiding this comment

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

thanks ptal!

obj["product"] = fmt.Sprintf("projects/%s/locations/%s/products/%s", project, region, product)

if _, ok := obj["displayName"]; !ok {
obj["displayName"] = configurationId + "-terraform"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

we discussed and decided to have a single name field that the user would have control over, so we derive others from that one. Does that make sense?

location = "us-central1"
configuration_id = "{{index $.Vars "configuration_id"}}"
product = "{{index $.Vars "product"}}"
licensecount = {{index $.Vars "licensecount"}}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done thanks!

type: String
required: true
immutable: true
ignore_read: true
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

we manipulate the fields in the go.tmpl files, so that's why they're marked as ignore_read. Isn't that the intention? The tests are working fine 🤔

immutable: true
ignore_read: true
description: Name field (with URL) of the Product offered for SPLA.
- name: licensecount
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

we have a complex nested field (currentBillingInfo.userCountBilling.userCount or currentBillingInfo.packCountBilling.packCount) - in this case, we decided to expose licensecount in the tf resource - does that make sense?

@github-actions github-actions Bot requested a review from c2thorn May 11, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-approval Pull requests that need reviewer's approval to run presubmit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants