github.com/andresvia/terraform@v0.6.15-0.20160412045437-d51c75946785/website/source/docs/providers/aws/r/ecr_repository_policy.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_ecr_repository_policy"
     4  sidebar_current: "docs-aws-resource-ecr-repository-policy"
     5  description: |-
     6    Provides an ECR Repository Policy.
     7  ---
     8  
     9  # aws\_ecr\_repository\_policy
    10  
    11  Provides an ECR repository policy.
    12  
    13  Note that currently only one policy may be applied to a repository.
    14  
    15  ~> **NOTE on ECR Availability**: The EC2 Container Registry is not yet rolled out
    16  in all regions - available regions are listed  
    17  [the AWS Docs](https://docs.aws.amazon.com/general/latest/gr/rande.html#ecr_region).
    18  
    19  ## Example Usage
    20  
    21  ```
    22  resource "aws_ecr_repository" "foo" {
    23    name = "bar"
    24  }
    25  
    26  resource "aws_ecr_repository_policy" "foopolicy" {
    27    repository = "${aws_ecr_repository.foo.name}"
    28    policy = <<EOF
    29  {
    30      "Version": "2008-10-17",
    31      "Statement": [
    32          {
    33              "Sid": "new policy",
    34              "Effect": "Allow",
    35              "Principal": "*",
    36              "Action": [
    37                  "ecr:GetDownloadUrlForLayer",
    38                  "ecr:BatchGetImage",
    39                  "ecr:BatchCheckLayerAvailability",
    40                  "ecr:PutImage",
    41                  "ecr:InitiateLayerUpload",
    42                  "ecr:UploadLayerPart",
    43                  "ecr:CompleteLayerUpload",
    44                  "ecr:DescribeRepositories",
    45                  "ecr:GetRepositoryPolicy",
    46                  "ecr:ListImages",
    47                  "ecr:DeleteRepository",
    48                  "ecr:BatchDeleteImage",
    49                  "ecr:SetRepositoryPolicy",
    50                  "ecr:DeleteRepositoryPolicy"
    51              ]
    52          }
    53      ]
    54  }
    55  EOF
    56  }
    57  ```
    58  
    59  ## Argument Reference
    60  
    61  The following arguments are supported:
    62  
    63  * `repository` - (Required) Name of the repository to apply the policy.
    64  * `policy` - (Required) The policy document. This is a JSON formatted string.
    65  
    66  ## Attributes Reference
    67  
    68  The following attributes are exported:
    69  
    70  * `repository` - The name of the repository.
    71  * `registry_id` - The registry ID where the repository was created.