Skip to content

Commit

Permalink
r/aws_ecs_cluster: deprecate the capacity_providers & default_capacit…
Browse files Browse the repository at this point in the history
…y_provider_strategy attributes
  • Loading branch information
roberth-k authored and anGie44 committed Jan 28, 2022
1 parent 2e358de commit baea1dc
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
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

0 comments on commit baea1dc

Please sign in to comment.