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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource/ecr_repository_policy: Support import #7974

Merged
merged 1 commit into from
Mar 17, 2019

Conversation

atsushi-ishibashi
Copy link
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #5921

Changes proposed in this pull request:

  • Support import

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSEcrRepositoryPolicy_'
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSEcrRepositoryPolicy_ -timeout 120m
=== RUN   TestAccAWSEcrRepositoryPolicy_basic
=== PAUSE TestAccAWSEcrRepositoryPolicy_basic
=== RUN   TestAccAWSEcrRepositoryPolicy_iam
=== PAUSE TestAccAWSEcrRepositoryPolicy_iam
=== CONT  TestAccAWSEcrRepositoryPolicy_basic
=== CONT  TestAccAWSEcrRepositoryPolicy_iam
--- PASS: TestAccAWSEcrRepositoryPolicy_basic (35.12s)
--- PASS: TestAccAWSEcrRepositoryPolicy_iam (47.19s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	47.238s

@ghost ghost added size/S Managed by automation to categorize the size of a PR. service/ecr Issues and PRs that pertain to the ecr service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. documentation Introduces or discusses updates to documentation. labels Mar 17, 2019
@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Mar 17, 2019
@bflad bflad added this to the v2.3.0 milestone Mar 17, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks @atsushi-ishibashi! 🚀

--- PASS: TestAccAWSEcrRepositoryPolicy_basic (13.35s)
--- PASS: TestAccAWSEcrRepositoryPolicy_iam (23.50s)

@@ -78,7 +81,6 @@ func resourceAwsEcrRepositoryPolicyRead(d *schema.ResourceData, meta interface{}

log.Printf("[DEBUG] Reading repository policy %s", d.Id())
out, err := conn.GetRepositoryPolicy(&ecr.GetRepositoryPolicyInput{
RegistryId: aws.String(d.Get("registry_id").(string)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the intention here is that ECR may eventually support more than one registry per AWS account, but that is not currently supported nor does the aws_ecr_repository resource import require the leading registry ID (e.g. AWS account ID). So this seems okay.

@@ -84,11 +96,6 @@ func testAccCheckAWSEcrRepositoryPolicyExists(name string) resource.TestCheckFun

func testAccAWSEcrRepositoryPolicy(randString string) string {
return fmt.Sprintf(`
# ECR initially only available in us-east-1
# https://aws.amazon.com/blogs/aws/ec2-container-registry-now-generally-available/
provider "aws" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ thanks for fixing this

@bflad bflad merged commit aa77431 into hashicorp:master Mar 17, 2019
bflad added a commit that referenced this pull request Mar 17, 2019
@bflad
Copy link
Contributor

bflad commented Mar 21, 2019

This has been released in version 2.3.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Mar 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/ecr Issues and PRs that pertain to the ecr service. size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resource aws_ecs_repository_policy doesn't support import
2 participants