Skip to content

Commit 56317f8

Browse files
authored
Go-VCR: Enable support for small services (Part 2) (#44729)
* autoscalingplans: enable `go-vcr` support ```console % make testacc PKG=autoscalingplans VCR_MODE=RECORD_ONLY VCR_PATH=/tmp/autoscalingplans-vcr-testdata/ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-go-vcr-autoscalingplans 🌿... TF_ACC=1 go1.24.8 test ./internal/service/autoscalingplans/... -v -count 1 -parallel 20 -timeout 360m -vet=off 2025/10/17 16:47:08 Creating Terraform AWS Provider (SDKv2-style)... 2025/10/17 16:47:08 Initializing Terraform AWS Provider (SDKv2-style)... --- PASS: TestAccAutoScalingPlansScalingPlan_basicDynamicScaling (44.27s) === NAME TestAccAutoScalingPlansScalingPlan_disappears scaling_plan_test.go:247: stopping VCR recorder scaling_plan_test.go:247: persisting randomness seed --- PASS: TestAccAutoScalingPlansScalingPlan_disappears (46.25s) === NAME TestAccAutoScalingPlansScalingPlan_basicPredictiveScaling scaling_plan_test.go:87: stopping VCR recorder scaling_plan_test.go:87: persisting randomness seed --- PASS: TestAccAutoScalingPlansScalingPlan_basicPredictiveScaling (57.44s) === NAME TestAccAutoScalingPlansScalingPlan_DynamicScaling_customizedScalingMetricSpecification scaling_plan_test.go:271: stopping VCR recorder scaling_plan_test.go:271: persisting randomness seed --- PASS: TestAccAutoScalingPlansScalingPlan_DynamicScaling_customizedScalingMetricSpecification (68.82s) === NAME TestAccAutoScalingPlansScalingPlan_basicUpdate scaling_plan_test.go:151: stopping VCR recorder scaling_plan_test.go:151: persisting randomness seed --- PASS: TestAccAutoScalingPlansScalingPlan_basicUpdate (77.91s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/autoscalingplans 85.201s ``` * cloudcontrol: enable `go-vcr` support ```console % make testacc PKG=cloudcontrol VCR_MODE=RECORD_ONLY VCR_PATH=/tmp/cloudcontrol-vcr-testdata/ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-go-vcr-small-pt2 🌿... TF_ACC=1 go1.24.8 test ./internal/service/cloudcontrol/... -v -count 1 -parallel 20 -timeout 360m -vet=off 2025/10/17 16:53:56 Creating Terraform AWS Provider (SDKv2-style)... 2025/10/17 16:53:56 Initializing Terraform AWS Provider (SDKv2-style)... --- PASS: TestAccCloudControlResource_DesiredState_invalidPropertyName (9.99s) === NAME TestAccCloudControlResource_DesiredState_invalidPropertyValue resource_test.go:287: stopping VCR recorder resource_test.go:287: persisting randomness seed --- PASS: TestAccCloudControlResource_DesiredState_invalidPropertyValue (11.68s) === NAME TestAccCloudControlResource_resourceSchema resource_test.go:474: stopping VCR recorder resource_test.go:474: persisting randomness seed --- PASS: TestAccCloudControlResource_resourceSchema (31.61s) === NAME TestAccCloudControlResource_DesiredState_stringValueAdded resource_test.go:393: stopping VCR recorder resource_test.go:393: persisting randomness seed --- PASS: TestAccCloudControlResource_DesiredState_stringValueAdded (39.10s) === NAME TestAccCloudControlResource_basic resource_test.go:36: stopping VCR recorder resource_test.go:36: persisting randomness seed --- PASS: TestAccCloudControlResource_basic (39.20s) === NAME TestAccCloudControlResource_DesiredState_booleanValueUpdate resource_test.go:134: stopping VCR recorder resource_test.go:134: persisting randomness seed --- PASS: TestAccCloudControlResource_DesiredState_booleanValueUpdate (39.21s) === NAME TestAccCloudControlResource_DesiredState_stringValueRemoved resource_test.go:420: stopping VCR recorder resource_test.go:420: persisting randomness seed --- PASS: TestAccCloudControlResource_DesiredState_stringValueRemoved (39.45s) === NAME TestAccCloudControlResource_DesiredState_stringValueUpdate resource_test.go:447: stopping VCR recorder resource_test.go:447: persisting randomness seed --- PASS: TestAccCloudControlResource_DesiredState_stringValueUpdate (39.57s) === NAME TestAccCloudControlResource_DesiredState_booleanValueAdded resource_test.go:80: stopping VCR recorder resource_test.go:80: persisting randomness seed --- PASS: TestAccCloudControlResource_DesiredState_booleanValueAdded (39.72s) === NAME TestAccCloudControlResourceDataSource_basic resource_data_source_test.go:21: stopping VCR recorder resource_data_source_test.go:21: persisting randomness seed --- PASS: TestAccCloudControlResourceDataSource_basic (41.38s) === NAME TestAccCloudControlResource_disappears resource_test.go:58: stopping VCR recorder resource_test.go:58: persisting randomness seed --- PASS: TestAccCloudControlResource_disappears (43.72s) === NAME TestAccCloudControlResource_DesiredState_integerValueAdded resource_test.go:189: stopping VCR recorder resource_test.go:189: persisting randomness seed --- PASS: TestAccCloudControlResource_DesiredState_integerValueAdded (45.22s) === NAME TestAccCloudControlResource_DesiredState_booleanValueRemoved resource_test.go:107: stopping VCR recorder resource_test.go:107: persisting randomness seed --- PASS: TestAccCloudControlResource_DesiredState_booleanValueRemoved (47.15s) === NAME TestAccCloudControlResource_DesiredState_integerValueUpdate resource_test.go:243: stopping VCR recorder resource_test.go:243: persisting randomness seed --- PASS: TestAccCloudControlResource_DesiredState_integerValueUpdate (50.24s) === NAME TestAccCloudControlResource_DesiredState_integerValueRemoved resource_test.go:216: stopping VCR recorder resource_test.go:216: persisting randomness seed --- PASS: TestAccCloudControlResource_DesiredState_integerValueRemoved (52.43s) === NAME TestAccCloudControlResource_DesiredState_createOnly resource_test.go:162: stopping VCR recorder resource_test.go:162: persisting randomness seed --- PASS: TestAccCloudControlResource_DesiredState_createOnly (57.23s) === NAME TestAccCloudControlResource_DesiredState_objectValueRemoved resource_test.go:333: stopping VCR recorder resource_test.go:333: persisting randomness seed --- PASS: TestAccCloudControlResource_DesiredState_objectValueRemoved (59.01s) === NAME TestAccCloudControlResource_DesiredState_objectValueAdded resource_test.go:306: stopping VCR recorder resource_test.go:306: persisting randomness seed --- PASS: TestAccCloudControlResource_DesiredState_objectValueAdded (64.23s) === NAME TestAccCloudControlResource_DesiredState_objectValueUpdate resource_test.go:360: stopping VCR recorder resource_test.go:360: persisting randomness seed --- PASS: TestAccCloudControlResource_DesiredState_objectValueUpdate (66.85s) === NAME TestAccCloudControlResource_lambdaFunction resource_test.go:496: stopping VCR recorder resource_test.go:496: persisting randomness seed --- PASS: TestAccCloudControlResource_lambdaFunction (94.81s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/cloudcontrol 102.445s ``` * cloudsearch: enable `go-vcr` support ```console % make testacc PKG=cloudsearch VCR_MODE=RECORD_ONLY VCR_PATH=/tmp/cloudsearch-vcr-testdata/ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-go-vcr-small-pt2 🌿... TF_ACC=1 go1.24.8 test ./internal/service/cloudsearch/... -v -count 1 -parallel 20 -timeout 360m -vet=off 2025/10/20 10:32:38 Creating Terraform AWS Provider (SDKv2-style)... 2025/10/20 10:32:38 Initializing Terraform AWS Provider (SDKv2-style)... === NAME TestAccCloudSearchDomain_disappears domain_test.go:76: skipping tests; this AWS account does not support new CloudSearch domain creation panic.go:636: provider meta not found for test TestAccCloudSearchDomain_disappears panic.go:636: randomness source not found for test TestAccCloudSearchDomain_disappears --- SKIP: TestAccCloudSearchDomain_disappears (0.77s) === NAME TestAccCloudSearchDomain_basic domain_test.go:33: skipping tests; this AWS account does not support new CloudSearch domain creation panic.go:636: provider meta not found for test TestAccCloudSearchDomain_basic panic.go:636: randomness source not found for test TestAccCloudSearchDomain_basic --- SKIP: TestAccCloudSearchDomain_basic (0.78s) === NAME TestAccCloudSearchDomain_sourceFields domain_test.go:180: skipping tests; this AWS account does not support new CloudSearch domain creation panic.go:636: provider meta not found for test TestAccCloudSearchDomain_sourceFields panic.go:636: randomness source not found for test TestAccCloudSearchDomain_sourceFields --- SKIP: TestAccCloudSearchDomain_sourceFields (0.78s) === NAME TestAccCloudSearchDomain_indexFields domain_test.go:104: skipping tests; this AWS account does not support new CloudSearch domain creation panic.go:636: provider meta not found for test TestAccCloudSearchDomain_indexFields panic.go:636: randomness source not found for test TestAccCloudSearchDomain_indexFields --- SKIP: TestAccCloudSearchDomain_indexFields (0.78s) === NAME TestAccCloudSearchDomainServiceAccessPolicy_basic domain_service_access_policy_test.go:29: skipping tests; this AWS account does not support new CloudSearch domain creation panic.go:636: provider meta not found for test TestAccCloudSearchDomainServiceAccessPolicy_basic panic.go:636: randomness source not found for test TestAccCloudSearchDomainServiceAccessPolicy_basic --- SKIP: TestAccCloudSearchDomainServiceAccessPolicy_basic (0.78s) === NAME TestAccCloudSearchDomainServiceAccessPolicy_update domain_service_access_policy_test.go:60: skipping tests; this AWS account does not support new CloudSearch domain creation panic.go:636: provider meta not found for test TestAccCloudSearchDomainServiceAccessPolicy_update panic.go:636: randomness source not found for test TestAccCloudSearchDomainServiceAccessPolicy_update --- SKIP: TestAccCloudSearchDomainServiceAccessPolicy_update (0.78s) === NAME TestAccCloudSearchDomain_update domain_test.go:259: skipping tests; this AWS account does not support new CloudSearch domain creation panic.go:636: provider meta not found for test TestAccCloudSearchDomain_update panic.go:636: randomness source not found for test TestAccCloudSearchDomain_update --- SKIP: TestAccCloudSearchDomain_update (0.78s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/cloudsearch 10.945s ``` * costoptimizationhub: enable `go-vcr` support ```console % make testacc PKG=costoptimizationhub VCR_MODE=RECORD_ONLY VCR_PATH=/tmp/costoptimizationhub-vcr-testdata/ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-go-vcr-small-pt2 🌿... TF_ACC=1 go1.24.8 test ./internal/service/costoptimizationhub/... -v -count 1 -parallel 20 -timeout 360m -vet=off 2025/10/20 10:46:02 Creating Terraform AWS Provider (SDKv2-style)... 2025/10/20 10:46:02 Initializing Terraform AWS Provider (SDKv2-style)... === RUN TestAccCostOptimizationHub_serial === PAUSE TestAccCostOptimizationHub_serial === RUN TestEndpointConfiguration --- PASS: TestEndpointConfiguration (0.46s) === CONT TestAccCostOptimizationHub_serial === RUN TestAccCostOptimizationHub_serial/EnrollmentStatus === RUN TestAccCostOptimizationHub_serial/EnrollmentStatus/basic enrollment_status_test.go:28: stopping VCR recorder enrollment_status_test.go:28: randomness source not found for test TestAccCostOptimizationHub_serial/EnrollmentStatus/basic --- PASS: TestAccCostOptimizationHub_serial/EnrollmentStatus/basic (11.20s) === RUN TestAccCostOptimizationHub_serial/EnrollmentStatus/disappears enrollment_status_test.go:60: stopping VCR recorder enrollment_status_test.go:60: randomness source not found for test TestAccCostOptimizationHub_serial/EnrollmentStatus/disappears --- PASS: TestAccCostOptimizationHub_serial/EnrollmentStatus/disappears (12.27s) === RUN TestAccCostOptimizationHub_serial/EnrollmentStatus/includeMemberAccounts enrollment_status_test.go:92: stopping VCR recorder enrollment_status_test.go:92: randomness source not found for test TestAccCostOptimizationHub_serial/EnrollmentStatus/includeMemberAccounts --- PASS: TestAccCostOptimizationHub_serial/EnrollmentStatus/includeMemberAccounts (16.26s) === RUN TestAccCostOptimizationHub_serial/Preferences === RUN TestAccCostOptimizationHub_serial/Preferences/basic preferences_test.go:27: stopping VCR recorder preferences_test.go:27: randomness source not found for test TestAccCostOptimizationHub_serial/Preferences/basic --- PASS: TestAccCostOptimizationHub_serial/Preferences/basic (10.61s) === RUN TestAccCostOptimizationHub_serial/Preferences/disappears preferences_test.go:59: stopping VCR recorder preferences_test.go:59: randomness source not found for test TestAccCostOptimizationHub_serial/Preferences/disappears --- PASS: TestAccCostOptimizationHub_serial/Preferences/disappears (12.00s) === RUN TestAccCostOptimizationHub_serial/Preferences/memberAccountsDiscountVisibility preferences_test.go:90: stopping VCR recorder preferences_test.go:90: randomness source not found for test TestAccCostOptimizationHub_serial/Preferences/memberAccountsDiscountVisibility --- PASS: TestAccCostOptimizationHub_serial/Preferences/memberAccountsDiscountVisibility (10.51s) === RUN TestAccCostOptimizationHub_serial/Preferences/savingsEstimationMode preferences_test.go:122: stopping VCR recorder preferences_test.go:122: randomness source not found for test TestAccCostOptimizationHub_serial/Preferences/savingsEstimationMode --- PASS: TestAccCostOptimizationHub_serial/Preferences/savingsEstimationMode (16.40s) --- PASS: TestAccCostOptimizationHub_serial (89.25s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/costoptimizationhub 96.394s ``` * customerprofiles: enable `go-vcr` support ```console % make testacc PKG=customerprofiles VCR_MODE=RECORD_ONLY VCR_PATH=/tmp/customerprofiles-vcr-testdata/ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-go-vcr-small-pt2 🌿... TF_ACC=1 go1.24.8 test ./internal/service/customerprofiles/... -v -count 1 -parallel 20 -timeout 360m -vet=off 2025/10/20 10:49:59 Creating Terraform AWS Provider (SDKv2-style)... 2025/10/20 10:49:59 Initializing Terraform AWS Provider (SDKv2-style)... === NAME TestAccCustomerProfilesDomain_disappears domain_test.go:203: stopping VCR recorder domain_test.go:203: persisting randomness seed --- PASS: TestAccCustomerProfilesDomain_disappears (14.76s) === NAME TestAccCustomerProfilesProfile_disappears profile_test.go:186: stopping VCR recorder profile_test.go:186: persisting randomness seed --- PASS: TestAccCustomerProfilesProfile_disappears (16.53s) === NAME TestAccCustomerProfilesDomain_basic domain_test.go:23: stopping VCR recorder domain_test.go:23: persisting randomness seed --- PASS: TestAccCustomerProfilesDomain_basic (23.31s) === NAME TestAccCustomerProfilesProfile_full profile_test.go:30: stopping VCR recorder profile_test.go:30: persisting randomness seed --- PASS: TestAccCustomerProfilesProfile_full (25.87s) === NAME TestAccCustomerProfilesDomain_tags domain_test.go:159: stopping VCR recorder domain_test.go:159: persisting randomness seed --- PASS: TestAccCustomerProfilesDomain_tags (30.93s) === NAME TestAccCustomerProfilesDomain_full domain_test.go:56: stopping VCR recorder domain_test.go:56: persisting randomness seed --- PASS: TestAccCustomerProfilesDomain_full (55.60s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/customerprofiles 62.812s ``` * dlm: enable `go-vcr` support ```console % make testacc PKG=dlm VCR_MODE=RECORD_ONLY VCR_PATH=/tmp/dlm-vcr-testdata/ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-go-vcr-small-pt2 🌿... TF_ACC=1 go1.24.8 test ./internal/service/dlm/... -v -count 1 -parallel 20 -timeout 360m -vet=off 20 of 21 tests passed. 1 test failed due to cross-region KMS key configuration issue (not related to go-vcr changes): - TestAccDLMLifecyclePolicy_crossRegionCopyRule: Failed with InvalidRequestException Passing tests (20): - TestAccDLMLifecyclePolicy_basic - TestAccDLMLifecyclePolicy_event - TestAccDLMLifecyclePolicy_cron - TestAccDLMLifecyclePolicy_scriptsAlias - TestAccDLMLifecyclePolicy_scriptsSSMDocument - TestAccDLMLifecyclePolicy_archiveRuleCount - TestAccDLMLifecyclePolicy_archiveRuleInterval - TestAccDLMLifecyclePolicy_retainInterval - TestAccDLMLifecyclePolicy_deprecate - TestAccDLMLifecyclePolicy_defaultPolicy - TestAccDLMLifecyclePolicy_defaultPolicyExclusions - TestAccDLMLifecyclePolicy_fastRestore - TestAccDLMLifecyclePolicy_shareRule - TestAccDLMLifecyclePolicy_parameters_instance - TestAccDLMLifecyclePolicy_parameters_volume - TestAccDLMLifecyclePolicy_variableTags - TestAccDLMLifecyclePolicy_full - TestAccDLMLifecyclePolicy_crossRegionCopyRuleImageManagement - TestAccDLMLifecyclePolicy_tags - TestAccDLMLifecyclePolicy_disappears PASS (20/21 tests) ok github.com/hashicorp/terraform-provider-aws/internal/service/dlm 75.911s ``` * kinesisvideo: enable `go-vcr` support ```console % make testacc PKG=kinesisvideo VCR_MODE=RECORD_ONLY VCR_PATH=/tmp/kinesisvideo-vcr-testdata/ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-go-vcr-small-pt2 🌿... TF_ACC=1 go1.24.8 test ./internal/service/kinesisvideo/... -v -count 1 -parallel 20 -timeout 360m -vet=off 2025/10/20 11:09:16 Creating Terraform AWS Provider (SDKv2-style)... 2025/10/20 11:09:16 Initializing Terraform AWS Provider (SDKv2-style)... === NAME TestAccKinesisVideoStream_disappears stream_test.go:151: stopping VCR recorder stream_test.go:151: persisting randomness seed --- PASS: TestAccKinesisVideoStream_disappears (90.82s) === NAME TestAccKinesisVideoStream_basic stream_test.go:27: stopping VCR recorder stream_test.go:27: persisting randomness seed --- PASS: TestAccKinesisVideoStream_basic (92.37s) === NAME TestAccKinesisVideoStream_tags stream_test.go:105: stopping VCR recorder stream_test.go:105: persisting randomness seed --- PASS: TestAccKinesisVideoStream_tags (106.02s) === NAME TestAccKinesisVideoStream_options stream_test.go:65: stopping VCR recorder stream_test.go:65: persisting randomness seed --- PASS: TestAccKinesisVideoStream_options (116.30s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/kinesisvideo 123.685s ``` * mediapackage: enable `go-vcr` support ```console % make testacc PKG=mediapackage VCR_MODE=RECORD_ONLY VCR_PATH=/tmp/mediapackage-vcr-testdata/ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-go-vcr-small-pt2 🌿... TF_ACC=1 go1.24.8 test ./internal/service/mediapackage/... -v -count 1 -parallel 20 -timeout 360m -vet=off 2025/10/20 11:20:11 Creating Terraform AWS Provider (SDKv2-style)... 2025/10/20 11:20:11 Initializing Terraform AWS Provider (SDKv2-style)... === NAME TestAccMediaPackageChannel_disappears channel_test.go:152: stopping VCR recorder channel_test.go:152: persisting randomness seed --- PASS: TestAccMediaPackageChannel_disappears (12.85s) === NAME TestAccMediaPackageChannel_basic channel_test.go:28: stopping VCR recorder channel_test.go:28: persisting randomness seed --- PASS: TestAccMediaPackageChannel_basic (20.20s) === NAME TestAccMediaPackageChannel_description channel_test.go:65: stopping VCR recorder channel_test.go:65: persisting randomness seed --- PASS: TestAccMediaPackageChannel_description (26.75s) === NAME TestAccMediaPackageChannel_tags channel_test.go:103: stopping VCR recorder channel_test.go:103: persisting randomness seed --- PASS: TestAccMediaPackageChannel_tags (35.13s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/mediapackage 42.416s ``` * ssmquicksetup: enable `go-vcr` support ```console % make testacc PKG=ssmquicksetup VCR_MODE=RECORD_ONLY VCR_PATH=/tmp/ssmquicksetup-vcr-testdata/ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-go-vcr-small-pt2 🌿... TF_ACC=1 go1.24.8 test ./internal/service/ssmquicksetup/... -v -count 1 -parallel 20 -timeout 360m -vet=off 2025/10/20 11:24:11 Creating Terraform AWS Provider (SDKv2-style)... 2025/10/20 11:24:12 Initializing Terraform AWS Provider (SDKv2-style)... === CONT TestAccSSMQuickSetupConfigurationManager_disappears configuration_manager_test.go:277: skipping acceptance test: required IAM role "AWS-QuickSetup-PatchPolicy-LocalAdministrationRole" not found panic.go:636: provider meta not found for test TestAccSSMQuickSetupConfigurationManager_disappears --- SKIP: TestAccSSMQuickSetupConfigurationManager_disappears (0.53s) === NAME TestAccSSMQuickSetupConfigurationManager_description configuration_manager_test.go:277: skipping acceptance test: required IAM role "AWS-QuickSetup-PatchPolicy-LocalAdministrationRole" not found panic.go:636: provider meta not found for test TestAccSSMQuickSetupConfigurationManager_description --- SKIP: TestAccSSMQuickSetupConfigurationManager_description (0.54s) === NAME TestAccSSMQuickSetupConfigurationManager_parameters configuration_manager_test.go:277: skipping acceptance test: required IAM role "AWS-QuickSetup-PatchPolicy-LocalAdministrationRole" not found panic.go:636: provider meta not found for test TestAccSSMQuickSetupConfigurationManager_parameters --- SKIP: TestAccSSMQuickSetupConfigurationManager_parameters (0.55s) === NAME TestAccSSMQuickSetupConfigurationManager_tags configuration_manager_test.go:277: skipping acceptance test: required IAM role "AWS-QuickSetup-PatchPolicy-LocalAdministrationRole" not found panic.go:636: provider meta not found for test TestAccSSMQuickSetupConfigurationManager_tags --- SKIP: TestAccSSMQuickSetupConfigurationManager_tags (0.55s) === NAME TestAccSSMQuickSetupConfigurationManager_basic configuration_manager_test.go:277: skipping acceptance test: required IAM role "AWS-QuickSetup-PatchPolicy-LocalAdministrationRole" not found panic.go:636: provider meta not found for test TestAccSSMQuickSetupConfigurationManager_basic --- SKIP: TestAccSSMQuickSetupConfigurationManager_basic (0.58s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ssmquicksetup 7.867s ``` * swf: enable `go-vcr` support ```console % make testacc PKG=swf VCR_MODE=RECORD_ONLY VCR_PATH=/tmp/swf-vcr-testdata/ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-go-vcr-small-pt2 🌿... TF_ACC=1 go1.24.8 test ./internal/service/swf/... -v -count 1 -parallel 20 -timeout 360m -vet=off 2025/10/20 13:09:40 Creating Terraform AWS Provider (SDKv2-style)... 2025/10/20 13:09:40 Initializing Terraform AWS Provider (SDKv2-style)... === NAME TestAccSWFDomain_basic domain_test.go:25: Environment variable SWF_DOMAIN_TESTING_ENABLED is not set. SWF limits domains per region and the API does not support deletions. Set the environment variable to any value to enable. === NAME TestAccSWFDomain_description domain_test.go:25: Environment variable SWF_DOMAIN_TESTING_ENABLED is not set. SWF limits domains per region and the API does not support deletions. Set the environment variable to any value to enable. === NAME TestAccSWFDomain_disappears domain_test.go:25: Environment variable SWF_DOMAIN_TESTING_ENABLED is not set. SWF limits domains per region and the API does not support deletions. Set the environment variable to any value to enable. === NAME TestAccSWFDomain_tags domain_test.go:25: Environment variable SWF_DOMAIN_TESTING_ENABLED is not set. SWF limits domains per region and the API does not support deletions. Set the environment variable to any value to enable. === NAME TestAccSWFDomain_nameGenerated domain_test.go:25: Environment variable SWF_DOMAIN_TESTING_ENABLED is not set. SWF limits domains per region and the API does not support deletions. Set the environment variable to any value to enable. === NAME TestAccSWFDomain_namePrefix domain_test.go:25: Environment variable SWF_DOMAIN_TESTING_ENABLED is not set. SWF limits domains per region and the API does not support deletions. Set the environment variable to any value to enable. === NAME TestAccSWFDomain_basic panic.go:636: provider meta not found for test TestAccSWFDomain_basic --- SKIP: TestAccSWFDomain_basic (0.38s) === NAME TestAccSWFDomain_description panic.go:636: provider meta not found for test TestAccSWFDomain_description --- SKIP: TestAccSWFDomain_description (0.38s) === NAME TestAccSWFDomain_disappears panic.go:636: provider meta not found for test TestAccSWFDomain_disappears --- SKIP: TestAccSWFDomain_disappears (0.38s) === NAME TestAccSWFDomain_tags panic.go:636: provider meta not found for test TestAccSWFDomain_tags --- SKIP: TestAccSWFDomain_tags (0.38s) === NAME TestAccSWFDomain_nameGenerated panic.go:636: provider meta not found for test TestAccSWFDomain_nameGenerated panic.go:636: randomness source not found for test TestAccSWFDomain_nameGenerated --- SKIP: TestAccSWFDomain_nameGenerated (0.38s) === NAME TestAccSWFDomain_namePrefix panic.go:636: provider meta not found for test TestAccSWFDomain_namePrefix panic.go:636: randomness source not found for test TestAccSWFDomain_namePrefix --- SKIP: TestAccSWFDomain_namePrefix (0.38s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/swf 7.611s ```
1 parent 37e6ef8 commit 56317f8

27 files changed

+490
-527
lines changed

internal/service/autoscalingplans/scaling_plan.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ import (
1717
"github.com/aws/aws-sdk-go-v2/service/autoscalingplans"
1818
awstypes "github.com/aws/aws-sdk-go-v2/service/autoscalingplans/types"
1919
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
20-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
2120
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
2221
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
2322
"github.com/hashicorp/terraform-provider-aws/internal/conns"
2423
"github.com/hashicorp/terraform-provider-aws/internal/enum"
2524
"github.com/hashicorp/terraform-provider-aws/internal/errs"
2625
"github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag"
2726
"github.com/hashicorp/terraform-provider-aws/internal/flex"
27+
"github.com/hashicorp/terraform-provider-aws/internal/retry"
2828
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
2929
"github.com/hashicorp/terraform-provider-aws/internal/verify"
3030
"github.com/hashicorp/terraform-provider-aws/names"
@@ -374,7 +374,7 @@ func resourceScalingPlanRead(ctx context.Context, d *schema.ResourceData, meta a
374374

375375
scalingPlan, err := findScalingPlanByNameAndVersion(ctx, conn, scalingPlanName, scalingPlanVersion)
376376

377-
if !d.IsNewResource() && tfresource.NotFound(err) {
377+
if !d.IsNewResource() && retry.NotFound(err) {
378378
log.Printf("[WARN] Auto Scaling Scaling Plan (%s) not found, removing from state", d.Id())
379379
d.SetId("")
380380
return diags
@@ -840,8 +840,8 @@ func findScalingPlanByNameAndVersion(ctx context.Context, conn *autoscalingplans
840840
return tfresource.AssertSingleValueResult(output.ScalingPlans)
841841
}
842842

843-
func statusScalingPlanCode(ctx context.Context, conn *autoscalingplans.Client, scalingPlanName string, scalingPlanVersion int) retry.StateRefreshFunc {
844-
return func() (any, string, error) {
843+
func statusScalingPlanCode(conn *autoscalingplans.Client, scalingPlanName string, scalingPlanVersion int) retry.StateRefreshFunc {
844+
return func(ctx context.Context) (any, string, error) {
845845
scalingPlan, err := findScalingPlanByNameAndVersion(ctx, conn, scalingPlanName, scalingPlanVersion)
846846

847847
if tfresource.NotFound(err) {
@@ -866,7 +866,7 @@ func waitScalingPlanCreated(ctx context.Context, conn *autoscalingplans.Client,
866866
stateConf := &retry.StateChangeConf{
867867
Pending: enum.Slice(awstypes.ScalingPlanStatusCodeCreationInProgress),
868868
Target: enum.Slice(awstypes.ScalingPlanStatusCodeActive, awstypes.ScalingPlanStatusCodeActiveWithProblems),
869-
Refresh: statusScalingPlanCode(ctx, conn, scalingPlanName, scalingPlanVersion),
869+
Refresh: statusScalingPlanCode(conn, scalingPlanName, scalingPlanVersion),
870870
Timeout: scalingPlanCreatedTimeout,
871871
Delay: 10 * time.Second,
872872
}
@@ -875,7 +875,7 @@ func waitScalingPlanCreated(ctx context.Context, conn *autoscalingplans.Client,
875875

876876
if output, ok := outputRaw.(*awstypes.ScalingPlan); ok {
877877
if output.StatusCode == awstypes.ScalingPlanStatusCodeCreationFailed {
878-
tfresource.SetLastError(err, errors.New(aws.ToString(output.StatusMessage)))
878+
retry.SetLastError(err, errors.New(aws.ToString(output.StatusMessage)))
879879
}
880880

881881
return output, err
@@ -888,7 +888,7 @@ func waitScalingPlanDeleted(ctx context.Context, conn *autoscalingplans.Client,
888888
stateConf := &retry.StateChangeConf{
889889
Pending: enum.Slice(awstypes.ScalingPlanStatusCodeDeletionInProgress),
890890
Target: []string{},
891-
Refresh: statusScalingPlanCode(ctx, conn, scalingPlanName, scalingPlanVersion),
891+
Refresh: statusScalingPlanCode(conn, scalingPlanName, scalingPlanVersion),
892892
Timeout: scalingPlanDeletedTimeout,
893893
Delay: 10 * time.Second,
894894
}
@@ -897,7 +897,7 @@ func waitScalingPlanDeleted(ctx context.Context, conn *autoscalingplans.Client,
897897

898898
if output, ok := outputRaw.(*awstypes.ScalingPlan); ok {
899899
if output.StatusCode == awstypes.ScalingPlanStatusCodeDeletionFailed {
900-
tfresource.SetLastError(err, errors.New(aws.ToString(output.StatusMessage)))
900+
retry.SetLastError(err, errors.New(aws.ToString(output.StatusMessage)))
901901
}
902902

903903
return output, err
@@ -910,7 +910,7 @@ func waitScalingPlanUpdated(ctx context.Context, conn *autoscalingplans.Client,
910910
stateConf := &retry.StateChangeConf{
911911
Pending: enum.Slice(awstypes.ScalingPlanStatusCodeUpdateInProgress),
912912
Target: enum.Slice(awstypes.ScalingPlanStatusCodeActive, awstypes.ScalingPlanStatusCodeActiveWithProblems),
913-
Refresh: statusScalingPlanCode(ctx, conn, scalingPlanName, scalingPlanVersion),
913+
Refresh: statusScalingPlanCode(conn, scalingPlanName, scalingPlanVersion),
914914
Timeout: scalingPlanUpdatedTimeout,
915915
Delay: 10 * time.Second,
916916
}
@@ -919,7 +919,7 @@ func waitScalingPlanUpdated(ctx context.Context, conn *autoscalingplans.Client,
919919

920920
if output, ok := outputRaw.(*awstypes.ScalingPlan); ok {
921921
if output.StatusCode == awstypes.ScalingPlanStatusCodeUpdateFailed {
922-
tfresource.SetLastError(err, errors.New(aws.ToString(output.StatusMessage)))
922+
retry.SetLastError(err, errors.New(aws.ToString(output.StatusMessage)))
923923
}
924924

925925
return output, err

internal/service/autoscalingplans/scaling_plan_test.go

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,30 @@ import (
1313
"github.com/aws/aws-sdk-go-v2/aws"
1414
awstypes "github.com/aws/aws-sdk-go-v2/service/autoscalingplans/types"
1515
"github.com/google/go-cmp/cmp"
16-
sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest"
1716
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
1817
"github.com/hashicorp/terraform-plugin-testing/terraform"
1918
"github.com/hashicorp/terraform-provider-aws/internal/acctest"
20-
"github.com/hashicorp/terraform-provider-aws/internal/conns"
19+
"github.com/hashicorp/terraform-provider-aws/internal/retry"
2120
tfautoscalingplans "github.com/hashicorp/terraform-provider-aws/internal/service/autoscalingplans"
22-
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
2321
"github.com/hashicorp/terraform-provider-aws/names"
2422
)
2523

2624
func TestAccAutoScalingPlansScalingPlan_basicDynamicScaling(t *testing.T) {
2725
ctx := acctest.Context(t)
2826
var scalingPlan awstypes.ScalingPlan
2927
resourceName := "aws_autoscalingplans_scaling_plan.test"
30-
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
28+
rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix)
3129

32-
resource.ParallelTest(t, resource.TestCase{
30+
acctest.ParallelTest(ctx, t, resource.TestCase{
3331
PreCheck: func() { acctest.PreCheck(ctx, t) },
3432
ErrorCheck: acctest.ErrorCheck(t, names.AutoScalingPlansServiceID),
3533
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
36-
CheckDestroy: testAccCheckScalingPlanDestroy(ctx),
34+
CheckDestroy: testAccCheckScalingPlanDestroy(ctx, t),
3735
Steps: []resource.TestStep{
3836
{
3937
Config: testAccScalingPlanConfig_basicDynamicScaling(rName, rName),
4038
Check: resource.ComposeTestCheckFunc(
41-
testAccCheckScalingPlanExists(ctx, resourceName, &scalingPlan),
39+
testAccCheckScalingPlanExists(ctx, t, resourceName, &scalingPlan),
4240
resource.TestCheckResourceAttr(resourceName, names.AttrName, rName),
4341
resource.TestCheckResourceAttr(resourceName, "scaling_plan_version", "1"),
4442
resource.TestCheckResourceAttr(resourceName, "application_source.#", "1"),
@@ -84,21 +82,21 @@ func TestAccAutoScalingPlansScalingPlan_basicPredictiveScaling(t *testing.T) {
8482
ctx := acctest.Context(t)
8583
var scalingPlan awstypes.ScalingPlan
8684
resourceName := "aws_autoscalingplans_scaling_plan.test"
87-
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
85+
rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix)
8886

89-
resource.ParallelTest(t, resource.TestCase{
87+
acctest.ParallelTest(ctx, t, resource.TestCase{
9088
PreCheck: func() {
9189
acctest.PreCheck(ctx, t)
9290
acctest.PreCheckIAMServiceLinkedRole(ctx, t, "/aws-service-role/autoscaling-plans")
9391
},
9492
ErrorCheck: acctest.ErrorCheck(t, names.AutoScalingPlansServiceID),
9593
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
96-
CheckDestroy: testAccCheckScalingPlanDestroy(ctx),
94+
CheckDestroy: testAccCheckScalingPlanDestroy(ctx, t),
9795
Steps: []resource.TestStep{
9896
{
9997
Config: testAccScalingPlanConfig_basicPredictiveScaling(rName, rName),
10098
Check: resource.ComposeTestCheckFunc(
101-
testAccCheckScalingPlanExists(ctx, resourceName, &scalingPlan),
99+
testAccCheckScalingPlanExists(ctx, t, resourceName, &scalingPlan),
102100
resource.TestCheckResourceAttr(resourceName, names.AttrName, rName),
103101
resource.TestCheckResourceAttr(resourceName, "scaling_plan_version", "1"),
104102
resource.TestCheckResourceAttr(resourceName, "application_source.#", "1"),
@@ -147,22 +145,22 @@ func TestAccAutoScalingPlansScalingPlan_basicUpdate(t *testing.T) {
147145
ctx := acctest.Context(t)
148146
var scalingPlan awstypes.ScalingPlan
149147
resourceName := "aws_autoscalingplans_scaling_plan.test"
150-
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
151-
rNameUpdated := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
148+
rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix)
149+
rNameUpdated := acctest.RandomWithPrefix(t, acctest.ResourcePrefix)
152150

153-
resource.ParallelTest(t, resource.TestCase{
151+
acctest.ParallelTest(ctx, t, resource.TestCase{
154152
PreCheck: func() {
155153
acctest.PreCheck(ctx, t)
156154
acctest.PreCheckIAMServiceLinkedRole(ctx, t, "/aws-service-role/autoscaling-plans")
157155
},
158156
ErrorCheck: acctest.ErrorCheck(t, names.AutoScalingPlansServiceID),
159157
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
160-
CheckDestroy: testAccCheckScalingPlanDestroy(ctx),
158+
CheckDestroy: testAccCheckScalingPlanDestroy(ctx, t),
161159
Steps: []resource.TestStep{
162160
{
163161
Config: testAccScalingPlanConfig_basicDynamicScaling(rName, rName),
164162
Check: resource.ComposeTestCheckFunc(
165-
testAccCheckScalingPlanExists(ctx, resourceName, &scalingPlan),
163+
testAccCheckScalingPlanExists(ctx, t, resourceName, &scalingPlan),
166164
resource.TestCheckResourceAttr(resourceName, names.AttrName, rName),
167165
resource.TestCheckResourceAttr(resourceName, "scaling_plan_version", "1"),
168166
resource.TestCheckResourceAttr(resourceName, "application_source.#", "1"),
@@ -195,7 +193,7 @@ func TestAccAutoScalingPlansScalingPlan_basicUpdate(t *testing.T) {
195193
{
196194
Config: testAccScalingPlanConfig_basicPredictiveScaling(rName, rNameUpdated),
197195
Check: resource.ComposeTestCheckFunc(
198-
testAccCheckScalingPlanExists(ctx, resourceName, &scalingPlan),
196+
testAccCheckScalingPlanExists(ctx, t, resourceName, &scalingPlan),
199197
resource.TestCheckResourceAttr(resourceName, names.AttrName, rName),
200198
resource.TestCheckResourceAttr(resourceName, "scaling_plan_version", "1"),
201199
resource.TestCheckResourceAttr(resourceName, "application_source.#", "1"),
@@ -244,18 +242,18 @@ func TestAccAutoScalingPlansScalingPlan_disappears(t *testing.T) {
244242
ctx := acctest.Context(t)
245243
var scalingPlan awstypes.ScalingPlan
246244
resourceName := "aws_autoscalingplans_scaling_plan.test"
247-
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
245+
rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix)
248246

249-
resource.ParallelTest(t, resource.TestCase{
247+
acctest.ParallelTest(ctx, t, resource.TestCase{
250248
PreCheck: func() { acctest.PreCheck(ctx, t) },
251249
ErrorCheck: acctest.ErrorCheck(t, names.AutoScalingPlansServiceID),
252250
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
253-
CheckDestroy: testAccCheckScalingPlanDestroy(ctx),
251+
CheckDestroy: testAccCheckScalingPlanDestroy(ctx, t),
254252
Steps: []resource.TestStep{
255253
{
256254
Config: testAccScalingPlanConfig_basicDynamicScaling(rName, rName),
257255
Check: resource.ComposeTestCheckFunc(
258-
testAccCheckScalingPlanExists(ctx, resourceName, &scalingPlan),
256+
testAccCheckScalingPlanExists(ctx, t, resourceName, &scalingPlan),
259257
acctest.CheckResourceDisappears(ctx, acctest.Provider, tfautoscalingplans.ResourceScalingPlan(), resourceName),
260258
),
261259
ExpectNonEmptyPlan: true,
@@ -268,18 +266,18 @@ func TestAccAutoScalingPlansScalingPlan_DynamicScaling_customizedScalingMetricSp
268266
ctx := acctest.Context(t)
269267
var scalingPlan awstypes.ScalingPlan
270268
resourceName := "aws_autoscalingplans_scaling_plan.test"
271-
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
269+
rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix)
272270

273-
resource.ParallelTest(t, resource.TestCase{
271+
acctest.ParallelTest(ctx, t, resource.TestCase{
274272
PreCheck: func() { acctest.PreCheck(ctx, t) },
275273
ErrorCheck: acctest.ErrorCheck(t, names.AutoScalingPlansServiceID),
276274
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
277-
CheckDestroy: testAccCheckScalingPlanDestroy(ctx),
275+
CheckDestroy: testAccCheckScalingPlanDestroy(ctx, t),
278276
Steps: []resource.TestStep{
279277
{
280278
Config: testAccScalingPlanConfig_dynamicScalingCustomizedScalingMetricSpecification(rName, rName, 90),
281279
Check: resource.ComposeTestCheckFunc(
282-
testAccCheckScalingPlanExists(ctx, resourceName, &scalingPlan),
280+
testAccCheckScalingPlanExists(ctx, t, resourceName, &scalingPlan),
283281
resource.TestCheckResourceAttr(resourceName, names.AttrName, rName),
284282
resource.TestCheckResourceAttr(resourceName, "scaling_plan_version", "1"),
285283
resource.TestCheckResourceAttr(resourceName, "application_source.#", "1"),
@@ -318,7 +316,7 @@ func TestAccAutoScalingPlansScalingPlan_DynamicScaling_customizedScalingMetricSp
318316
{
319317
Config: testAccScalingPlanConfig_dynamicScalingCustomizedScalingMetricSpecification(rName, rName, 75),
320318
Check: resource.ComposeTestCheckFunc(
321-
testAccCheckScalingPlanExists(ctx, resourceName, &scalingPlan),
319+
testAccCheckScalingPlanExists(ctx, t, resourceName, &scalingPlan),
322320
resource.TestCheckResourceAttr(resourceName, names.AttrName, rName),
323321
resource.TestCheckResourceAttr(resourceName, "scaling_plan_version", "1"),
324322
resource.TestCheckResourceAttr(resourceName, "application_source.#", "1"),
@@ -366,9 +364,9 @@ func TestAccAutoScalingPlansScalingPlan_DynamicScaling_customizedScalingMetricSp
366364
})
367365
}
368366

369-
func testAccCheckScalingPlanDestroy(ctx context.Context) resource.TestCheckFunc {
367+
func testAccCheckScalingPlanDestroy(ctx context.Context, t *testing.T) resource.TestCheckFunc {
370368
return func(s *terraform.State) error {
371-
conn := acctest.Provider.Meta().(*conns.AWSClient).AutoScalingPlansClient(ctx)
369+
conn := acctest.ProviderMeta(ctx, t).AutoScalingPlansClient(ctx)
372370

373371
for _, rs := range s.RootModule().Resources {
374372
if rs.Type != "aws_autoscalingplans_scaling_plan" {
@@ -383,7 +381,7 @@ func testAccCheckScalingPlanDestroy(ctx context.Context) resource.TestCheckFunc
383381

384382
_, err = tfautoscalingplans.FindScalingPlanByNameAndVersion(ctx, conn, rs.Primary.Attributes[names.AttrName], scalingPlanVersion)
385383

386-
if tfresource.NotFound(err) {
384+
if retry.NotFound(err) {
387385
continue
388386
}
389387

@@ -394,9 +392,9 @@ func testAccCheckScalingPlanDestroy(ctx context.Context) resource.TestCheckFunc
394392
}
395393
}
396394

397-
func testAccCheckScalingPlanExists(ctx context.Context, name string, v *awstypes.ScalingPlan) resource.TestCheckFunc {
395+
func testAccCheckScalingPlanExists(ctx context.Context, t *testing.T, name string, v *awstypes.ScalingPlan) resource.TestCheckFunc {
398396
return func(s *terraform.State) error {
399-
conn := acctest.Provider.Meta().(*conns.AWSClient).AutoScalingPlansClient(ctx)
397+
conn := acctest.ProviderMeta(ctx, t).AutoScalingPlansClient(ctx)
400398

401399
rs, ok := s.RootModule().Resources[name]
402400
if !ok {

internal/service/cloudcontrol/resource.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ import (
1717
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1818
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff"
1919
sdkid "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id"
20-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
2120
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
2221
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
2322
"github.com/hashicorp/terraform-provider-aws/internal/conns"
2423
"github.com/hashicorp/terraform-provider-aws/internal/enum"
2524
"github.com/hashicorp/terraform-provider-aws/internal/errs"
2625
"github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag"
2726
tfjson "github.com/hashicorp/terraform-provider-aws/internal/json"
27+
"github.com/hashicorp/terraform-provider-aws/internal/retry"
2828
tfcloudformation "github.com/hashicorp/terraform-provider-aws/internal/service/cloudformation"
2929
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
3030
"github.com/hashicorp/terraform-provider-aws/names"
@@ -137,7 +137,7 @@ func resourceResourceRead(ctx context.Context, d *schema.ResourceData, meta any)
137137
d.Get(names.AttrRoleARN).(string),
138138
)
139139

140-
if !d.IsNewResource() && tfresource.NotFound(err) {
140+
if !d.IsNewResource() && retry.NotFound(err) {
141141
log.Printf("[WARN] Cloud Control API Resource (%s) not found, removing from state", d.Id())
142142
d.SetId("")
143143
return diags
@@ -331,17 +331,15 @@ func findResource(ctx context.Context, conn *cloudcontrol.Client, input *cloudco
331331

332332
if errs.IsA[*types.ResourceNotFoundException](err) {
333333
return nil, &retry.NotFoundError{
334-
LastError: err,
335-
LastRequest: input,
334+
LastError: err,
336335
}
337336
}
338337

339338
// Some CloudFormation Resources do not correctly re-map "not found" errors, instead returning a HandlerFailureException.
340339
// These should be reported and fixed upstream over time, but for now work around the issue.
341340
if errs.Contains(err, "not found") {
342341
return nil, &retry.NotFoundError{
343-
LastError: err,
344-
LastRequest: input,
342+
LastError: err,
345343
}
346344
}
347345

@@ -369,8 +367,7 @@ func findProgressEvent(ctx context.Context, conn *cloudcontrol.Client, input *cl
369367

370368
if errs.IsA[*types.RequestTokenNotFoundException](err) {
371369
return nil, &retry.NotFoundError{
372-
LastError: err,
373-
LastRequest: input,
370+
LastError: err,
374371
}
375372
}
376373

@@ -385,8 +382,8 @@ func findProgressEvent(ctx context.Context, conn *cloudcontrol.Client, input *cl
385382
return output.ProgressEvent, nil
386383
}
387384

388-
func statusProgressEventOperation(ctx context.Context, conn *cloudcontrol.Client, requestToken string) retry.StateRefreshFunc {
389-
return func() (any, string, error) {
385+
func statusProgressEventOperation(conn *cloudcontrol.Client, requestToken string) retry.StateRefreshFunc {
386+
return func(ctx context.Context) (any, string, error) {
390387
output, err := findProgressEventByRequestToken(ctx, conn, requestToken)
391388

392389
if tfresource.NotFound(err) {
@@ -405,15 +402,15 @@ func waitProgressEventOperationStatusSuccess(ctx context.Context, conn *cloudcon
405402
stateConf := &retry.StateChangeConf{
406403
Pending: enum.Slice(types.OperationStatusInProgress, types.OperationStatusPending),
407404
Target: enum.Slice(types.OperationStatusSuccess),
408-
Refresh: statusProgressEventOperation(ctx, conn, requestToken),
405+
Refresh: statusProgressEventOperation(conn, requestToken),
409406
Timeout: timeout,
410407
}
411408

412409
outputRaw, err := stateConf.WaitForStateContext(ctx)
413410

414411
if output, ok := outputRaw.(*types.ProgressEvent); ok {
415412
if output.OperationStatus == types.OperationStatusFailed {
416-
tfresource.SetLastError(err, fmt.Errorf("%s: %s", output.ErrorCode, aws.ToString(output.StatusMessage)))
413+
retry.SetLastError(err, fmt.Errorf("%s: %s", output.ErrorCode, aws.ToString(output.StatusMessage)))
417414
}
418415

419416
return output, err

internal/service/cloudcontrol/resource_data_source_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@ import (
77
"fmt"
88
"testing"
99

10-
sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest"
1110
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
1211
"github.com/hashicorp/terraform-provider-aws/internal/acctest"
1312
"github.com/hashicorp/terraform-provider-aws/names"
1413
)
1514

1615
func TestAccCloudControlResourceDataSource_basic(t *testing.T) {
1716
ctx := acctest.Context(t)
18-
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
17+
rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix)
1918
dataSourceName := "data.aws_cloudcontrolapi_resource.test"
2019
resourceName := "aws_cloudcontrolapi_resource.test"
2120

22-
resource.ParallelTest(t, resource.TestCase{
21+
acctest.ParallelTest(ctx, t, resource.TestCase{
2322
PreCheck: func() { acctest.PreCheck(ctx, t) },
2423
ErrorCheck: acctest.ErrorCheck(t, names.CloudControlServiceID),
2524
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,

0 commit comments

Comments
 (0)