-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resource/ecs_service: fix crash when importing non-existing service #3672
Conversation
Not currently for most (any?) resources, but maybe we should given scenarios like this. 😄 I was able to generate the panic on master:
With an additional // Test non-existent resource import
{
ResourceName: resourceName,
ImportStateId: fmt.Sprintf("%s/nonexistent", clusterName),
ImportState: true,
ImportStateVerify: false,
}, Assuming this works, I can add this to the PR so we can have verification, otherwise the fix looks fine. 👍 |
👍Please feel free to add the verification |
Huzzah! 😂 With naive implementation above:
Modified:
Returns:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! 🚀
31 tests passed (all tests)
=== RUN TestAccAWSEcsDataSource_ecsTaskDefinition
--- PASS: TestAccAWSEcsDataSource_ecsTaskDefinition (16.76s)
=== RUN TestAccAWSEcsService_withPlacementConstraints_emptyExpression
--- PASS: TestAccAWSEcsService_withPlacementConstraints_emptyExpression (17.10s)
=== RUN TestAccAWSEcsCluster_basic
--- PASS: TestAccAWSEcsCluster_basic (19.20s)
=== RUN TestAccAWSEcsCluster_importBasic
--- PASS: TestAccAWSEcsCluster_importBasic (20.78s)
=== RUN TestAccAWSEcsTaskDefinition_withScratchVolume
--- PASS: TestAccAWSEcsTaskDefinition_withScratchVolume (6.78s)
=== RUN TestAccAWSEcsService_withDeploymentValues
--- PASS: TestAccAWSEcsService_withDeploymentValues (26.49s)
=== RUN TestAccAWSEcsService_withEcsClusterName
--- PASS: TestAccAWSEcsService_withEcsClusterName (26.46s)
=== RUN TestAccAWSEcsTaskDefinition_basic
--- PASS: TestAccAWSEcsTaskDefinition_basic (10.70s)
=== RUN TestAccAWSEcsTaskDefinition_constraint
--- PASS: TestAccAWSEcsTaskDefinition_constraint (7.69s)
=== RUN TestAccAWSEcsService_withFamilyAndRevision
--- PASS: TestAccAWSEcsService_withFamilyAndRevision (35.47s)
=== RUN TestAccAWSEcsDataSource_ecsContainerDefinition
--- PASS: TestAccAWSEcsDataSource_ecsContainerDefinition (36.20s)
=== RUN TestAccAWSEcsTaskDefinition_withTaskRoleArn
--- PASS: TestAccAWSEcsTaskDefinition_withTaskRoleArn (10.71s)
=== RUN TestAccAWSEcsTaskDefinition_withNetworkMode
--- PASS: TestAccAWSEcsTaskDefinition_withNetworkMode (12.51s)
=== RUN TestAccAWSEcsDataSource_ecsCluster
--- PASS: TestAccAWSEcsDataSource_ecsCluster (39.48s)
=== RUN TestAccAWSEcsService_withARN
--- PASS: TestAccAWSEcsService_withARN (40.15s)
=== RUN TestAccAWSEcsTaskDefinition_changeVolumesForcesNewResource
--- PASS: TestAccAWSEcsTaskDefinition_changeVolumesForcesNewResource (14.10s)
=== RUN TestAccAWSEcsTaskDefinition_Fargate
--- PASS: TestAccAWSEcsTaskDefinition_Fargate (7.41s)
=== RUN TestAccAWSEcsService_withUnnormalizedPlacementStrategy
--- PASS: TestAccAWSEcsService_withUnnormalizedPlacementStrategy (43.30s)
=== RUN TestAccAWSEcsTaskDefinition_arrays
--- PASS: TestAccAWSEcsTaskDefinition_arrays (9.26s)
=== RUN TestAccAWSEcsService_withRenamedCluster
--- PASS: TestAccAWSEcsService_withRenamedCluster (45.18s)
=== RUN TestAccAWSEcsService_withPlacementConstraints
--- PASS: TestAccAWSEcsService_withPlacementConstraints (46.70s)
=== RUN TestAccAWSEcsTaskDefinition_ExecutionRole
--- PASS: TestAccAWSEcsTaskDefinition_ExecutionRole (12.90s)
=== RUN TestAccAWSEcsService_importBasic
--- PASS: TestAccAWSEcsService_importBasic (49.70s)
=== RUN TestAccAWSEcsService_withPlacementStrategy
--- PASS: TestAccAWSEcsService_withPlacementStrategy (52.23s)
=== RUN TestAccAWSEcsTaskDefinition_withEcsService
--- PASS: TestAccAWSEcsTaskDefinition_withEcsService (70.24s)
=== RUN TestAccAWSEcsService_withLaunchTypeEC2AndNetworkConfiguration
--- PASS: TestAccAWSEcsService_withLaunchTypeEC2AndNetworkConfiguration (81.10s)
=== RUN TestAccAWSEcsService_withIamRole
--- PASS: TestAccAWSEcsService_withIamRole (123.60s)
=== RUN TestAccAWSEcsService_withAlb
--- PASS: TestAccAWSEcsService_withAlb (225.05s)
=== RUN TestAccAWSEcsService_healthCheckGracePeriodSeconds
--- PASS: TestAccAWSEcsService_healthCheckGracePeriodSeconds (231.43s)
=== RUN TestAccAWSEcsService_withLbChanges
--- PASS: TestAccAWSEcsService_withLbChanges (245.53s)
=== RUN TestAccAWSEcsService_withLaunchTypeFargate
--- PASS: TestAccAWSEcsService_withLaunchTypeFargate (247.18s)
This has been released in version 1.11.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Fix #3671
One thing unsure though. Do we test such scenario as import error?