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

r/aws_ecs_cluster: deprecate capacity provider attributes #22783

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/22783.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:note
resource/aws_ecs_cluster: The `capacity_providers` and `default_capacity_provider_strategy` arguments have been deprecated. Use the `aws_ecs_cluster_capacity_providers` resource instead.
```
14 changes: 8 additions & 6 deletions internal/service/ecs/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ func ResourceCluster() *schema.Resource {
Computed: true,
},
"capacity_providers": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
Type: schema.TypeSet,
Optional: true,
Computed: true,
Deprecated: "Use the aws_ecs_cluster_capacity_providers resource instead",
Elem: &schema.Schema{
Type: schema.TypeString,
},
Expand Down Expand Up @@ -114,9 +115,10 @@ func ResourceCluster() *schema.Resource {
},
},
"default_capacity_provider_strategy": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
Type: schema.TypeSet,
Optional: true,
Computed: true,
Deprecated: "Use the aws_ecs_cluster_capacity_providers resource instead",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"base": {
Expand Down
34 changes: 31 additions & 3 deletions website/docs/r/ecs_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ resource "aws_ecs_cluster" "foo" {
}
```

## Example W/Log Configuration
### Example with Log Configuration

```terraform
resource "aws_kms_key" "example" {
Expand Down Expand Up @@ -54,13 +54,41 @@ resource "aws_ecs_cluster" "test" {
}
```

### Example with Capacity Providers

```terraform
resource "aws_ecs_cluster" "example" {
name = "example"
}

resource "aws_ecs_cluster_capacity_providers" "example" {
cluster_name = aws_ecs_cluster.example.name

capacity_providers = [aws_ecs_capacity_provider.example.name]

default_capacity_provider_strategy {
base = 1
weight = 100
capacity_provider = aws_ecs_capacity_provider.example.name
}
}

resource "aws_ecs_capacity_provider" "example" {
name = "example"

auto_scaling_group_provider {
auto_scaling_group_arn = aws_autoscaling_group.example.arn
}
}
```

## Argument Reference

The following arguments are supported:

* `capacity_providers` - (Optional) List of short names of one or more capacity providers to associate with the cluster. Valid values also include `FARGATE` and `FARGATE_SPOT`.
* `capacity_providers` - (Optional, **Deprecated** use the `aws_ecs_cluster_capacity_providers` resource instead) List of short names of one or more capacity providers to associate with the cluster. Valid values also include `FARGATE` and `FARGATE_SPOT`.
* `configuration` - (Optional) The execute command configuration for the cluster. Detailed below.
* `default_capacity_provider_strategy` - (Optional) Configuration block for capacity provider strategy to use by default for the cluster. Can be one or more. Detailed below.
* `default_capacity_provider_strategy` - (Optional, **Deprecated** use the `aws_ecs_cluster_capacity_providers` resource instead) Configuration block for capacity provider strategy to use by default for the cluster. Can be one or more. Detailed below.
* `name` - (Required) Name of the cluster (up to 255 letters, numbers, hyphens, and underscores)
* `setting` - (Optional) Configuration block(s) with cluster settings. For example, this can be used to enable CloudWatch Container Insights for a cluster. Detailed below.
* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
Expand Down