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

Add support for ECS capacity providers #11151

Merged
merged 22 commits into from
Dec 12, 2019
Merged

Add support for ECS capacity providers #11151

merged 22 commits into from
Dec 12, 2019

Conversation

ryndaniels
Copy link
Contributor

@ryndaniels ryndaniels commented Dec 5, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #11150
Release note for CHANGELOG:

FEATURES
* **New Resource:** `aws_ecs_capacity_provider`

ENHANCEMENTS
* resource/aws_ecs_cluster: Add support for ECS capacity providers
* resource/aws_ecs_service: Add support for ECS capacity providers

Output from acceptance testing:

make testacc TESTARGS="-run=TestAccAWSEcsCapacityProvider_"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -count 1 -parallel 20 -run=TestAccAWSEcsCapacityProvider_ -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSEcsCapacityProvider_basic
=== PAUSE TestAccAWSEcsCapacityProvider_basic
=== RUN   TestAccAWSEcsCapacityProvider_ManagedScaling
=== PAUSE TestAccAWSEcsCapacityProvider_ManagedScaling
=== RUN   TestAccAWSEcsCapacityProvider_ManagedScalingPartial
=== PAUSE TestAccAWSEcsCapacityProvider_ManagedScalingPartial
=== RUN   TestAccAWSEcsCapacityProvider_Tags
=== PAUSE TestAccAWSEcsCapacityProvider_Tags
=== CONT  TestAccAWSEcsCapacityProvider_basic
=== CONT  TestAccAWSEcsCapacityProvider_Tags
=== CONT  TestAccAWSEcsCapacityProvider_ManagedScalingPartial
=== CONT  TestAccAWSEcsCapacityProvider_ManagedScaling
--- PASS: TestAccAWSEcsCapacityProvider_ManagedScalingPartial (173.04s)
--- PASS: TestAccAWSEcsCapacityProvider_basic (173.08s)
--- PASS: TestAccAWSEcsCapacityProvider_ManagedScaling (173.81s)
--- PASS: TestAccAWSEcsCapacityProvider_Tags (243.38s)
PASS

make testacc TESTARGS="-run=TestAccAWSEcsService_withCapacityProviderStrategy"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -count 1 -parallel 20 -run=TestAccAWSEcsService_withCapacityProviderStrategy -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSEcsService_withCapacityProviderStrategy
=== PAUSE TestAccAWSEcsService_withCapacityProviderStrategy
=== CONT  TestAccAWSEcsService_withCapacityProviderStrategy
--- PASS: TestAccAWSEcsService_withCapacityProviderStrategy (268.72s)
PASS

make testacc TESTARGS="-run=TestAccAWSEcsCluster_CapacityProviders"      
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -count 1 -parallel 20 -run=TestAccAWSEcsCluster_CapacityProviders -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSEcsCluster_CapacityProviders
=== PAUSE TestAccAWSEcsCluster_CapacityProviders
=== RUN   TestAccAWSEcsCluster_CapacityProvidersUpdate
=== PAUSE TestAccAWSEcsCluster_CapacityProvidersUpdate
=== CONT  TestAccAWSEcsCluster_CapacityProviders
=== CONT  TestAccAWSEcsCluster_CapacityProvidersUpdate
--- PASS: TestAccAWSEcsCluster_CapacityProvidersUpdate (58.26s)
--- PASS: TestAccAWSEcsCluster_CapacityProviders (211.89s)
PASS

Screenshots:
Screenshot 2019-12-12 at 17 21 25
Screenshot 2019-12-12 at 17 22 00
Screenshot 2019-12-12 at 17 22 23

@ryndaniels ryndaniels requested a review from a team December 5, 2019 08:13
@ryndaniels ryndaniels self-assigned this Dec 5, 2019
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. provider Pertains to the provider itself, rather than any interaction with AWS. service/ecs Issues and PRs that pertain to the ecs service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Dec 5, 2019
@ghost ghost added the documentation Introduces or discusses updates to documentation. label Dec 6, 2019
@encryptblockr
Copy link

@ryndaniels seems this failed CI checks..have time to look into it?
will appreciate if this gets merged as many people need this
thanks!

@kevinkuszyk
Copy link

@ryndaniels I have some time at the moment if you need a hand with this?

However, I need to let you know, I don't know Go or the internals of how Terraform providers work, so I maybe more hinderance than help! Even if it's just the docs, I'd be happy to chip in with that.

@jverhoeks
Copy link
Contributor

@ryndaniels I have some time at the moment if you need a hand with this?

However, I need to let you know, I don't know Go or the internals of how Terraform providers work, so I maybe more hinderance than help! Even if it's just the docs, I'd be happy to chip in with that.

The error seems to be in the website. The aws.erb points to a /d (datasource) link while the pr only provides a /r (resource) document

@asheliahut
Copy link

Added A PR that pushes to this branch that fixes the test issues. and moves the link to the correct resource spot instead of lumping it into the data section. @ryndaniels
#11223

Move resource of capacity provider to resources
@ryndaniels ryndaniels removed the needs-triage Waiting for first response or review from a maintainer. label Dec 11, 2019
@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. labels Dec 12, 2019
@ryndaniels ryndaniels changed the title [WIP] first parts of ecs capacity providers Add support for ECS capacity providers Dec 12, 2019
@bflad bflad added this to the v2.42.0 milestone Dec 12, 2019
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.

Great work by everyone here! Let's 🚢 :shipit: ⛵️ 🚤 🚀

Output from acceptance testing:

--- PASS: TestAccAWSEcsCapacityProvider_basic (51.82s)
--- PASS: TestAccAWSEcsCapacityProvider_ManagedScaling (51.40s)
--- PASS: TestAccAWSEcsCapacityProvider_ManagedScalingPartial (50.89s)
--- PASS: TestAccAWSEcsCapacityProvider_Tags (48.65s)

--- PASS: TestAccAWSEcsCluster_basic (18.35s)
--- PASS: TestAccAWSEcsCluster_CapacityProviders (47.36s)
--- PASS: TestAccAWSEcsCluster_CapacityProvidersUpdate (42.21s)
--- PASS: TestAccAWSEcsCluster_containerInsights (30.41s)
--- PASS: TestAccAWSEcsCluster_disappears (15.21s)
--- PASS: TestAccAWSEcsCluster_Tags (30.47s)

--- PASS: TestAccAWSEcsService_basicImport (75.79s)
--- PASS: TestAccAWSEcsService_disappears (47.62s)
--- PASS: TestAccAWSEcsService_healthCheckGracePeriodSeconds (225.35s)
--- PASS: TestAccAWSEcsService_ManagedTags (43.18s)
--- PASS: TestAccAWSEcsService_PropagateTags (143.22s)
--- PASS: TestAccAWSEcsService_Tags (73.58s)
--- PASS: TestAccAWSEcsService_withAlb (234.20s)
--- PASS: TestAccAWSEcsService_withARN (61.39s)
--- PASS: TestAccAWSEcsService_withCapacityProviderStrategy (149.92s)
--- PASS: TestAccAWSEcsService_withDaemonSchedulingStrategy (42.84s)
--- PASS: TestAccAWSEcsService_withDaemonSchedulingStrategySetDeploymentMinimum (42.45s)
--- PASS: TestAccAWSEcsService_withDeploymentController_Type_CodeDeploy (267.66s)
--- PASS: TestAccAWSEcsService_withDeploymentMinimumZeroMaximumOneHundred (52.53s)
--- PASS: TestAccAWSEcsService_withDeploymentValues (65.89s)
--- PASS: TestAccAWSEcsService_withEcsClusterName (42.13s)
--- PASS: TestAccAWSEcsService_withFamilyAndRevision (81.38s)
--- PASS: TestAccAWSEcsService_withIamRole (53.19s)
--- PASS: TestAccAWSEcsService_withLaunchTypeEC2AndNetworkConfiguration (64.09s)
--- PASS: TestAccAWSEcsService_withLaunchTypeFargate (110.12s)
--- PASS: TestAccAWSEcsService_withLaunchTypeFargateAndPlatformVersion (110.09s)
--- PASS: TestAccAWSEcsService_withLbChanges (253.10s)
--- PASS: TestAccAWSEcsService_withMultipleTargetGroups (274.32s)
--- PASS: TestAccAWSEcsService_withPlacementConstraints (74.58s)
--- PASS: TestAccAWSEcsService_withPlacementConstraints_emptyExpression (63.35s)
--- PASS: TestAccAWSEcsService_withPlacementStrategy (234.52s)
--- PASS: TestAccAWSEcsService_withRenamedCluster (154.77s)
--- PASS: TestAccAWSEcsService_withReplicaSchedulingStrategy (63.00s)
--- PASS: TestAccAWSEcsService_withServiceRegistries (162.60s)
--- PASS: TestAccAWSEcsService_withServiceRegistries_container (153.10s)
--- PASS: TestAccAWSEcsService_withUnnormalizedPlacementStrategy (83.82s)

--- PASS: TestAccAWSEcsServiceDataSource_basic (74.69s)

@bflad bflad merged commit d6c69d3 into master Dec 12, 2019
@bflad bflad deleted the f-ecs-capacity-provider branch December 12, 2019 19:34
bflad added a commit that referenced this pull request Dec 12, 2019
@ghost
Copy link

ghost commented Dec 13, 2019

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

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@encryptblockr
Copy link

encryptblockr commented Dec 17, 2019

getting these errors with this push
using latest terraform and latest aws provider

$ terraform --version
Terraform v0.12.18
+ provider.aws v2.42.0
+ provider.template v2.1.2
Error: error creating capacity provider: ClientException: The managed termination protection setting for the capacity provider is invalid. To enable managed termination protection for a capacity provider, the Auto Scaling group must have instance protection from scale in enabled.

i have enabled protect_from_scale_in = true for the autoscaling group so not sure what the issue is

@ghost
Copy link

ghost commented Jan 12, 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 Jan 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/ecs Issues and PRs that pertain to the ecs service. size/XXL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for ECS capacity providers
7 participants