Terraform-provider-aws: Add support for ECS capacity providers

Created on 5 Dec 2019  ·  3Comments  ·  Source: hashicorp/terraform-provider-aws

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Based on this announcement, we want to add support for ECS capacity providers.

New or Affected Resource(s)

  • aws_ecs_cluster (add support for PutClusterCapacityProviders in update method, plus default_capacity_provider_strategy and capacity_providers arguments in schema)
  • awc_ecs_service (add capacity_provider_strategy to schema)
  • aws_ecs_capacity_provider (new resource)

Potential Terraform Configuration

New Resource: aws_ecs_capacity_provider

Create: CreateCapacityProvider
Read: DescribeCapacityProvider
Update: UpdateCapacityProvider
Delete: DeleteCapacityProvider

resource "aws_ecs_capacity_provider" "example" {
  name = "example" # Type: TypeString, Required: true
  tags = {}        # Type: TypeMap, Required: true

  auto_scaling_group_provider {         # Type: TypeList, Required: true, MaxItems: 1, Elem: *schema.Resource
    auto_scaling_group_arn = ""         # Type: TypeString, Required: true
    managed_termination_protection = "" # Type: TypeString, Required: true

    managed_scaling {               # Type: TypeList, Required: true, MaxItems: 1, Elem: *schema.Resource
      maximum_scaling_step_size = 1 # Type: TypeInt, Optional: true, Default: 10000
      minimum_scaling_step_size = 1 # Type: TypeInt, Optional: true, Default: 1
      status = ""                   # Type: TypeString, Optional: true (maybe Default: ENABLED)
      target_capacity = 1           # Type: TypeInt, Optional: true
    }
  }
}

Updated Resource: aws_ecs_cluster

(Only showing new arguments/API calls)

Update: PutClusterCapacityProviders

resource "aws_ecs_cluster" "example" {
  capacity_providers = [""] # Type: TypeList, Optional: true, Elem: *schema.Schema TypeString

  default_capacity_provider_strategy { # Type: TypeList, Optional: true, MaxItems: 1, Elem: *schema.Resource
    base = 1                           # Type: TypeInt, Optional: true,
    capacity_provider = ""             # Type: TypeString, Required: true
    weight = 1                         # Type: TypeInt, Optional: true
  }
}

Updated Resource: aws_ecs_service

(Only showing new arguments, no new API calls)

resource "aws_ecs_service" "example" {
  capacity_provider_strategy { # Type: TypeSet, Optional: true, Elem: *schema.Resource
    base = 1                   # Type: TypeInt, Optional: true,
    capacity_provider = ""     # Type: TypeString, Required: true
    weight = 1                 # Type: TypeInt, Optional: true
  }
}

References

enhancement servicecs

Most helpful comment

Initial support for ECS Capacity Providers has been merged and will release with version 2.42.0 of the Terraform AWS Provider, shortly. This was a great effort by a few folks including @ryndaniels, @aeschright, @gdavison so kudos to those involved in making this happen. 🚀

All 3 comments

Initial support for ECS Capacity Providers has been merged and will release with version 2.42.0 of the Terraform AWS Provider, shortly. This was a great effort by a few folks including @ryndaniels, @aeschright, @gdavison so kudos to those involved in making this happen. 🚀

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!

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!

Was this page helpful?
0 / 5 - 0 ratings