Skip to content
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/aws_ecs_task_definition: Treat INACTIVE task definitions as removed #5565

Merged
merged 1 commit into from
Aug 20, 2018

Conversation

ewilde
Copy link
Contributor

@ewilde ewilde commented Aug 15, 2018

Todo

  • Create acceptance test to verify deleting resource when task definition is INACTIVE

Description

If a task definition is marked as INACTIVE in ECS then terraform should
treat it as a deleted resource

Fixes hashicorp/terraform#3582

Output from acceptance testing:

=== RUN   TestAccAWSEcsTaskDefinition_basic
--- PASS: TestAccAWSEcsTaskDefinition_basic (40.59s)
=== RUN   TestAccAWSEcsTaskDefinition_withScratchVolume
--- PASS: TestAccAWSEcsTaskDefinition_withScratchVolume (24.57s)
=== RUN   TestAccAWSEcsTaskDefinition_withEcsService
--- PASS: TestAccAWSEcsTaskDefinition_withEcsService (74.65s)
=== RUN   TestAccAWSEcsTaskDefinition_withTaskRoleArn
--- PASS: TestAccAWSEcsTaskDefinition_withTaskRoleArn (28.97s)
=== RUN   TestAccAWSEcsTaskDefinition_withNetworkMode
--- PASS: TestAccAWSEcsTaskDefinition_withNetworkMode (25.93s)
=== RUN   TestAccAWSEcsTaskDefinition_constraint
--- PASS: TestAccAWSEcsTaskDefinition_constraint (26.89s)
=== RUN   TestAccAWSEcsTaskDefinition_changeVolumesForcesNewResource
--- PASS: TestAccAWSEcsTaskDefinition_changeVolumesForcesNewResource (49.10s)
=== RUN   TestAccAWSEcsTaskDefinition_arrays
--- PASS: TestAccAWSEcsTaskDefinition_arrays (27.20s)
=== RUN   TestAccAWSEcsTaskDefinition_Fargate
--- PASS: TestAccAWSEcsTaskDefinition_Fargate (26.15s)
=== RUN   TestAccAWSEcsTaskDefinition_ExecutionRole
--- PASS: TestAccAWSEcsTaskDefinition_ExecutionRole (37.77s)
=== RUN   TestValidateAwsEcsTaskDefinitionContainerDefinitions
--- PASS: TestValidateAwsEcsTaskDefinitionContainerDefinitions (0.00s)
PASS

Process finished with exit code 0

New acceptance test

=== RUN   TestAccAWSEcsTaskDefinition_Inactive
--- PASS: TestAccAWSEcsTaskDefinition_Inactive (37.50s)

@ghost ghost added the size/XS Managed by automation to categorize the size of a PR. label Aug 15, 2018
@ewilde ewilde force-pushed the task-def-inactive branch from cba7ff1 to e1e76a9 Compare August 15, 2018 22:24
@ghost ghost added the size/XS Managed by automation to categorize the size of a PR. label Aug 15, 2018
@bflad bflad added bug Addresses a defect in current functionality. service/ecs Issues and PRs that pertain to the ecs service. labels Aug 16, 2018
@ewilde ewilde changed the title Treat INACTIVE task definitions as removed [WIP] Treat INACTIVE task definitions as removed Aug 17, 2018
@ewilde ewilde force-pushed the task-def-inactive branch from e1e76a9 to f8686e0 Compare August 17, 2018 19:09
@ghost ghost added size/M Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Aug 17, 2018
If a task definition is marked as INACTIVE in ECS then terraform should
treat it as a deleted resource

Resolves:
hashicorp/terraform#3582 (comment)

Signed-off-by: Edward Wilde <[email protected]>
@ewilde ewilde force-pushed the task-def-inactive branch from f8686e0 to 1a4bfdb Compare August 18, 2018 06:01
@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label Aug 18, 2018
@ewilde ewilde changed the title [WIP] Treat INACTIVE task definitions as removed Treat INACTIVE task definitions as removed Aug 18, 2018
@ewilde ewilde changed the title Treat INACTIVE task definitions as removed resource/aws_ecs_task_definition: Treat INACTIVE task definitions as removed Aug 18, 2018
@bflad bflad added this to the v1.33.0 milestone Aug 20, 2018
Copy link
Contributor

@bflad bflad 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 @ewilde! 🚀

11 tests passed (all tests)
--- PASS: TestAccAWSEcsTaskDefinition_arrays (4.63s)
--- PASS: TestAccAWSEcsTaskDefinition_Fargate (4.70s)
--- PASS: TestAccAWSEcsTaskDefinition_constraint (4.76s)
--- PASS: TestAccAWSEcsTaskDefinition_withScratchVolume (4.80s)
--- PASS: TestAccAWSEcsTaskDefinition_changeVolumesForcesNewResource (7.12s)
--- PASS: TestAccAWSEcsTaskDefinition_Inactive (7.40s)
--- PASS: TestAccAWSEcsTaskDefinition_basic (7.42s)
--- PASS: TestAccAWSEcsTaskDefinition_withNetworkMode (8.49s)
--- PASS: TestAccAWSEcsTaskDefinition_ExecutionRole (11.29s)
--- PASS: TestAccAWSEcsTaskDefinition_withTaskRoleArn (13.43s)
--- PASS: TestAccAWSEcsTaskDefinition_withEcsService (32.91s)

@bflad bflad merged commit ae8b643 into hashicorp:master Aug 20, 2018
bflad added a commit that referenced this pull request Aug 20, 2018
@bflad
Copy link
Contributor

bflad commented Aug 22, 2018

This has been released in version 1.33.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 3, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ecs Issues and PRs that pertain to the ecs service. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

terraform-plan doesn't properly detect deletion of ecs_service
2 participants