Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Kit Ewbank <Kit_Ewbank@hotmail.com>
  • Loading branch information
DrFaust92 and ewbankkit authored Jun 14, 2021
1 parent 84d8a3e commit 39c4883
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion aws/internal/service/ecs/finder/finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func CluserByARN(conn *ecs.ECS, arn string) (*ecs.DescribeClustersOutput, error) {
func ClusterByARN(conn *ecs.ECS, arn string) (*ecs.DescribeClustersOutput, error) {
input := &ecs.DescribeClustersInput{
Clusters: []*string{aws.String(arn)},
Include: []*string{aws.String(ecs.ClusterFieldTags), aws.String(ecs.ClusterFieldConfigurations)},
Expand Down
2 changes: 1 addition & 1 deletion aws/internal/service/ecs/waiter/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func ServiceStatus(conn *ecs.ECS, id, cluster string) resource.StateRefreshFunc

func ClusterStatus(conn *ecs.ECS, arn string) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
output, err := finder.CluserByARN(conn, arn)
output, err := finder.ClusterByARN(conn, arn)

if tfawserr.ErrCodeEquals(err, ecs.ErrCodeClusterNotFoundException) {
return nil, ClusterStatusNone, nil
Expand Down
4 changes: 2 additions & 2 deletions aws/resource_aws_ecs_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func resourceAwsEcsClusterRead(d *schema.ResourceData, meta interface{}) error {
var out *ecs.DescribeClustersOutput
err := resource.Retry(2*time.Minute, func() *resource.RetryError {
var err error
out, err = finder.CluserByARN(conn, d.Id())
out, err = finder.ClusterByARN(conn, d.Id())

if err != nil {
return resource.NonRetryableError(err)
Expand All @@ -256,7 +256,7 @@ func resourceAwsEcsClusterRead(d *schema.ResourceData, meta interface{}) error {
return nil
})
if isResourceTimeoutError(err) {
out, err = finder.CluserByARN(conn, d.Id())
out, err = finder.ClusterByARN(conn, d.Id())
}

if isResourceNotFoundError(err) {
Expand Down
4 changes: 2 additions & 2 deletions aws/resource_aws_ecs_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ func testAccCheckAWSEcsClusterDestroy(s *terraform.State) error {
continue
}

out, err := finder.CluserByARN(conn, rs.Primary.ID)
out, err := finder.ClusterByARN(conn, rs.Primary.ID)

if err != nil {
return err
Expand All @@ -416,7 +416,7 @@ func testAccCheckAWSEcsClusterExists(resourceName string, cluster *ecs.Cluster)
}

conn := testAccProvider.Meta().(*AWSClient).ecsconn
output, err := finder.CluserByARN(conn, rs.Primary.ID)
output, err := finder.ClusterByARN(conn, rs.Primary.ID)

if err != nil {
return fmt.Errorf("error reading ECS Cluster (%s): %w", rs.Primary.ID, err)
Expand Down

0 comments on commit 39c4883

Please sign in to comment.