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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECR repository tag-on-create #8198

Merged
merged 1 commit into from
Apr 4, 2019
Merged
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
7 changes: 1 addition & 6 deletions aws/resource_aws_ecr_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
}
Expand Down