Skip to content

Conversation

@ahmed-laiq
Copy link
Contributor

@ahmed-laiq ahmed-laiq commented May 13, 2025

Add Terraform support for configuring Classic ALB migration feature. The support is added for the global backend-service and global forwarding rule. This feature allows gradual and controlled migration to the External Managed LB from Classic LB. The global forwarding rule config changes applies to all the backend bucket attached to the forwarding rule.

Fixes: hashicorp/terraform-provider-google#22760

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

compute: added `external_managed_migration_state` and `external_managed_migration_testing_percentage` to `google_compute_backend_service` resource.
compute: added `external_managed_backend_bucket_migration_state` and `external_managed_backend_bucket_migration_testing_percentage` to `google_compute_global_forwarding_rule` resource.
compute: added update support for `load_balancing_scheme` in `google_compute_backend_service` and `google_compute_global_forwarding_rule` resources to allow migrating between classic and global external ALB

@github-actions github-actions bot requested a review from rileykarson May 13, 2025 14:35
@github-actions
Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run. Googlers: see go/terraform-auto-test-runs to set up automatic test runs.

@rileykarson, 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
Copy link
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.

google provider: Diff ( 8 files changed, 506 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 8 files changed, 506 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 40 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1189
Passed tests: 1101
Skipped tests: 84
Affected tests: 4

Click here to see the affected service packages
  • compute

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeBackendService_updateCanaryMigration
  • TestAccComputeBackendService_withBackendAndPreference
  • TestAccComputeBackendService_withLogConfig
  • TestAccComputeGlobalForwardingRule_updateCanaryMigration

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeBackendService_updateCanaryMigration [Debug log]
TestAccComputeGlobalForwardingRule_updateCanaryMigration [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccComputeBackendService_withBackendAndPreference [Error message] [Debug log]
TestAccComputeBackendService_withLogConfig [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@modular-magician
Copy link
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.

google provider: Diff ( 8 files changed, 521 insertions(+), 12 deletions(-))
google-beta provider: Diff ( 8 files changed, 521 insertions(+), 12 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 40 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1189
Passed tests: 1103
Skipped tests: 84
Affected tests: 2

Click here to see the affected service packages
  • compute

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeBackendService_withBackendAndPreference
  • TestAccComputeBackendService_withLogConfig

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeBackendService_withBackendAndPreference [Debug log]
TestAccComputeBackendService_withLogConfig [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

Generally looks good- just a few comments on tests.

},
{
Config: testAccComputeBackendService_withLogConfig3(serviceName, checkName, "INCLUDE_ALL_OPTIONAL", true),
Config: testAccComputeBackendService_withLogConfig3(serviceName2, checkName2, "INCLUDE_ALL_OPTIONAL", true),
Copy link
Member

Choose a reason for hiding this comment

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

Same as above- let's break the different loadBalancingSchemes into separate test cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment on lines 2719 to 2720
Config: testAccComputeBackendService_withCanaryMigration(
serviceName, checkName, "updated-to-prepare", "PREPARE"),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Config: testAccComputeBackendService_withCanaryMigration(
serviceName, checkName, "updated-to-prepare", "PREPARE"),
Config: testAccComputeBackendService_withCanaryMigration( serviceName, checkName, "updated-to-prepare", "PREPARE"),
ConfigPlanChecks: resource.ConfigPlanChecks{
PreApply: []plancheck.PlanCheck{
plancheck.ExpectResourceAction("google_compute_backend_service.foobar", plancheck.ResourceActionUpdate),
},
},

This is optional, but you could add the following to each Config step after the first to ensure that we update the resource rather than recreate it. We need to do that automatically in the future!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@github-actions github-actions bot requested a review from rileykarson May 13, 2025 23:10
Apply suggestions from code review

Co-authored-by: Riley Karson <[email protected]>
@modular-magician
Copy link
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.

google provider: Diff ( 8 files changed, 617 insertions(+), 14 deletions(-))
google-beta provider: Diff ( 8 files changed, 617 insertions(+), 14 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 40 insertions(+))

@modular-magician
Copy link
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.

google provider: Diff ( 8 files changed, 617 insertions(+), 14 deletions(-))
google-beta provider: Diff ( 8 files changed, 617 insertions(+), 14 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 40 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1192
Passed tests: 1103
Skipped tests: 84
Affected tests: 5

Click here to see the affected service packages
  • compute

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeBackendService_withBackendAndPreferenceExternalManaged
  • TestAccComputeBackendService_withBackendAndPreferenceInternalManaged
  • TestAccComputeBackendService_withBackendAndPreferenceInternalSelfManaged
  • TestAccComputeBackendService_withLogConfig
  • TestAccComputeBackendService_withLogConfigMode

Get to know how VCR tests work

1 similar comment
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1192
Passed tests: 1103
Skipped tests: 84
Affected tests: 5

Click here to see the affected service packages
  • compute

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeBackendService_withBackendAndPreferenceExternalManaged
  • TestAccComputeBackendService_withBackendAndPreferenceInternalManaged
  • TestAccComputeBackendService_withBackendAndPreferenceInternalSelfManaged
  • TestAccComputeBackendService_withLogConfig
  • TestAccComputeBackendService_withLogConfigMode

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeBackendService_withBackendAndPreferenceExternalManaged [Debug log]
TestAccComputeBackendService_withBackendAndPreferenceInternalManaged [Debug log]
TestAccComputeBackendService_withBackendAndPreferenceInternalSelfManaged [Debug log]
TestAccComputeBackendService_withLogConfig [Debug log]
TestAccComputeBackendService_withLogConfigMode [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeBackendService_withBackendAndPreferenceExternalManaged [Debug log]
TestAccComputeBackendService_withBackendAndPreferenceInternalManaged [Debug log]
TestAccComputeBackendService_withBackendAndPreferenceInternalSelfManaged [Debug log]
TestAccComputeBackendService_withLogConfig [Debug log]
TestAccComputeBackendService_withLogConfigMode [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request May 20, 2025
NandiniAgrawal15 pushed a commit to NandiniAgrawal15/magic-modules that referenced this pull request Jun 5, 2025
jingqizz pushed a commit to jingqizz/magic-modules that referenced this pull request Jul 9, 2025
NandiniAgrawal15 pushed a commit to NandiniAgrawal15/magic-modules that referenced this pull request Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Google compute backend service and forwarding rule: Add Class ALB migration feature support.

3 participants