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

Add support for Policy Documents for ECR Lifecycle Policies #6765

Closed
Ray-B opened this issue Dec 7, 2018 · 3 comments
Closed

Add support for Policy Documents for ECR Lifecycle Policies #6765

Ray-B opened this issue Dec 7, 2018 · 3 comments
Labels
new-data-source Introduces a new data source. service/ecr Issues and PRs that pertain to the ecr service.

Comments

@Ray-B
Copy link

Ray-B commented Dec 7, 2018

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Would be good to allow ECR lifecycle policies to make use of IAM policy document data blocks.

This would allow for policies to be validated (fail as early as possible), rather than having to wait until an apply to see if they are valid, etc.

Perhaps an iam policy document isn't the best resource? Do we need a different one?

New or Affected Resource(s)

Data aws_iam_policy_document
Resource aws_ecr_lifecycle_policy

Potential Terraform Configuration

Example:

resource "aws_ecr_lifecycle_policy" "neato-lifecycle-policy" {
  repository = "${aws_ecr_repository.neato-repository.name}"

  policy = "${data.aws_iam_policy_document.neato-repository-lifecycle-policy-doc.json}"
}

data "aws_iam_policy_document" "neato-repository-lifecycle-policy-doc" {
  rules = [
    {
      rulePriority = 10
      description  = "Keep last 25 master images"

      selection = {
        tagStatus     = "tagged"
        tagPrefixList = ["m-"]
        countType     = "imageCountMoreThan"
        countNumber   = 50
      }

      action = {
        type = "expire"
      }
    },
  ]
}
@bflad
Copy link
Contributor

bflad commented Dec 7, 2018

Likely relevant 😉 #6133

@bflad bflad added new-data-source Introduces a new data source. service/ecr Issues and PRs that pertain to the ecr service. labels Dec 7, 2018
@Ray-B
Copy link
Author

Ray-B commented Dec 7, 2018

yep, looks like a duplicate. Closing

@Ray-B Ray-B closed this as completed Dec 7, 2018
@ghost
Copy link

ghost commented Apr 1, 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 Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-data-source Introduces a new data source. service/ecr Issues and PRs that pertain to the ecr service.
Projects
None yet
Development

No branches or pull requests

2 participants