Skip to content

Commit

Permalink
address review comments of #22672
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth-k committed Jan 26, 2022
1 parent 5f2b92e commit f4c7937
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
9 changes: 3 additions & 6 deletions internal/service/ecs/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,12 @@ func resourceClusterRead(d *schema.ResourceData, meta interface{}) error {
ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig

var cluster *ecs.Cluster
err := resource.Retry(2*time.Minute, func() *resource.RetryError {
err := resource.Retry(clusterReadTimeout, func() *resource.RetryError {
var err error
cluster, err = FindClusterByNameOrARN(context.Background(), conn, d.Id())

if tfresource.NotFound(err) {
if d.IsNewResource() {
return resource.RetryableError(err)
}
return resource.NonRetryableError(err)
if d.IsNewResource() && tfresource.NotFound(err) {
return resource.RetryableError(err)
}

if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/service/ecs/cluster_capacity_providers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func TestAccECSClusterCapacityProviders_destroy(t *testing.T) {
})
}

func TestAccECSClusterCapacityProviders_update_capacityProviders(t *testing.T) {
func TestAccECSClusterCapacityProviders_Update_capacityProviders(t *testing.T) {
var cluster ecs.Cluster
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_ecs_cluster_capacity_providers.test"
Expand Down Expand Up @@ -203,7 +203,7 @@ func TestAccECSClusterCapacityProviders_update_capacityProviders(t *testing.T) {
})
}

func TestAccECSClusterCapacityProviders_update_defaultCapacityProviderStrategy(t *testing.T) {
func TestAccECSClusterCapacityProviders_Update_defaultStrategy(t *testing.T) {
var cluster ecs.Cluster
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_ecs_cluster_capacity_providers.test"
Expand Down
1 change: 1 addition & 0 deletions internal/service/ecs/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const (
clusterAvailableTimeout = 10 * time.Minute
clusterDeleteTimeout = 10 * time.Minute
clusterAvailableDelay = 10 * time.Second
clusterReadTimeout = 2 * time.Second

taskSetCreateTimeout = 10 * time.Minute
taskSetDeleteTimeout = 10 * time.Minute
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/ecs_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: |-

Provides an ECS cluster.

~> **NOTE on Clusters and Cluster Capacity Providers:** Terraform provides both a standalone [`aws_ecs_cluster_capacity_providers`](ecs_cluster_capacity_providers.html) resource, as well as allowing the capacity providers and default strategies to be managed in-line by the [`aws_ecs_cluster`](ecs_cluster.html) resource. You cannot use a Cluster with in-line capacity providers in conjunction with the Capacity Providers resource, as doing so will cause a conflict and will lead to mutual overwrites.
~> **NOTE on Clusters and Cluster Capacity Providers:** Terraform provides both a standalone [`aws_ecs_cluster_capacity_providers`](/docs/providers/aws/r/ecs_cluster_capacity_providers.html) resource, as well as allowing the capacity providers and default strategies to be managed in-line by the `aws_ecs_cluster` resource. You cannot use a Cluster with in-line capacity providers in conjunction with the Capacity Providers resource, nor use more than one Capacity Providers resource with a single Cluster, as doing so will cause a conflict and will lead to mutual overwrites.

## Example Usage

Expand Down
6 changes: 3 additions & 3 deletions website/docs/r/ecs_cluster_capacity_providers.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Manages the capacity providers of an ECS Cluster.

More information about capacity providers can be found in the [ECS User Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-capacity-providers.html).

~> **NOTE on Clusters and Cluster Capacity Providers:** Terraform provides both a standalone [`aws_ecs_cluster_capacity_providers`](ecs_cluster_capacity_providers.html) resource, as well as allowing the capacity providers and default strategies to be managed in-line by the [`aws_ecs_cluster`](ecs_cluster.html) resource. You cannot use a Cluster with in-line capacity providers in conjunction with the Capacity Providers resource, as doing so will cause a conflict and will lead to mutual overwrites.
~> **NOTE on Clusters and Cluster Capacity Providers:** Terraform provides both a standalone `aws_ecs_cluster_capacity_providers` resource, as well as allowing the capacity providers and default strategies to be managed in-line by the [`aws_ecs_cluster`](/docs/providers/aws/r/ecs_cluster.html) resource. You cannot use a Cluster with in-line capacity providers in conjunction with the Capacity Providers resource, nor use more than one Capacity Providers resource with a single Cluster, as doing so will cause a conflict and will lead to mutual overwrites.

## Example Usage

Expand All @@ -21,8 +21,8 @@ resource "aws_ecs_cluster" "example" {
name = "my-cluster"
}
resource "aws_ecs_cluster_capacity_providers" "test" {
cluster_name = aws_ecs_cluster.test.name
resource "aws_ecs_cluster_capacity_providers" "example" {
cluster_name = aws_ecs_cluster.example.name
capacity_providers = ["FARGATE"]
Expand Down

0 comments on commit f4c7937

Please sign in to comment.