Show / Hide Table of Contents

Class RepositoryPolicy

Provides an Elastic Container Registry Repository Policy.

Note that currently only one policy may be applied to a repository.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var foo = new Aws.Ecr.Repository("foo", new Aws.Ecr.RepositoryArgs
    {
    });
    var foopolicy = new Aws.Ecr.RepositoryPolicy("foopolicy", new Aws.Ecr.RepositoryPolicyArgs
    {
        Policy = @"{
""Version"": ""2008-10-17"",
""Statement"": [
    {
        ""Sid"": ""new policy"",
        ""Effect"": ""Allow"",
        ""Principal"": ""*"",
        ""Action"": [
            ""ecr:GetDownloadUrlForLayer"",
            ""ecr:BatchGetImage"",
            ""ecr:BatchCheckLayerAvailability"",
            ""ecr:PutImage"",
            ""ecr:InitiateLayerUpload"",
            ""ecr:UploadLayerPart"",
            ""ecr:CompleteLayerUpload"",
            ""ecr:DescribeRepositories"",
            ""ecr:GetRepositoryPolicy"",
            ""ecr:ListImages"",
            ""ecr:DeleteRepository"",
            ""ecr:BatchDeleteImage"",
            ""ecr:SetRepositoryPolicy"",
            ""ecr:DeleteRepositoryPolicy""
        ]
    }
]
}

",
        Repository = foo.Name,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
RepositoryPolicy
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Ecr
Assembly: Pulumi.Aws.dll
Syntax
public class RepositoryPolicy : CustomResource

Constructors

View Source

RepositoryPolicy(String, RepositoryPolicyArgs, CustomResourceOptions)

Create a RepositoryPolicy resource with the given unique name, arguments, and options.

Declaration
public RepositoryPolicy(string name, RepositoryPolicyArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

RepositoryPolicyArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Policy

The policy document. This is a JSON formatted string.

Declaration
public Output<string> Policy { get; }
Property Value
Type Description
Output<System.String>
View Source

RegistryId

The registry ID where the repository was created.

Declaration
public Output<string> RegistryId { get; }
Property Value
Type Description
Output<System.String>
View Source

Repository

Name of the repository to apply the policy.

Declaration
public Output<string> Repository { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, RepositoryPolicyState, CustomResourceOptions)

Get an existing RepositoryPolicy resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static RepositoryPolicy Get(string name, Input<string> id, RepositoryPolicyState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

RepositoryPolicyState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
RepositoryPolicy
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.