From 14fad01cf12e3def238d4124b5ac1e344550406c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 Apr 2019 17:04:29 -0400 Subject: [PATCH] ECR repository tag-on-create. --- aws/resource_aws_ecr_repository.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/aws/resource_aws_ecr_repository.go b/aws/resource_aws_ecr_repository.go index 40da3950232..52709fcf963 100644 --- a/aws/resource_aws_ecr_repository.go +++ b/aws/resource_aws_ecr_repository.go @@ -54,6 +54,7 @@ func resourceAwsEcrRepositoryCreate(d *schema.ResourceData, meta interface{}) er input := ecr.CreateRepositoryInput{ RepositoryName: aws.String(d.Get("name").(string)), + Tags: tagsFromMapECR(d.Get("tags").(map[string]interface{})), } log.Printf("[DEBUG] Creating ECR repository: %#v", input) @@ -67,12 +68,6 @@ func resourceAwsEcrRepositoryCreate(d *schema.ResourceData, meta interface{}) er log.Printf("[DEBUG] ECR repository created: %q", *repository.RepositoryArn) d.SetId(aws.StringValue(repository.RepositoryName)) - // ARN required for setting any tags. - d.Set("arn", repository.RepositoryArn) - - if err := setTagsECR(conn, d); err != nil { - return fmt.Errorf("error setting ECR repository tags: %s", err) - } return resourceAwsEcrRepositoryRead(d, meta) }