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,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Ecr
Assembly: Pulumi.Aws.dll
Syntax
public class RepositoryPolicy : CustomResource
Constructors
View SourceRepositoryPolicy(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 SourcePolicy
The policy document. This is a JSON formatted string.
Declaration
public Output<string> Policy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RegistryId
The registry ID where the repository was created.
Declaration
public Output<string> RegistryId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Repository
Name of the repository to apply the policy.
Declaration
public Output<string> Repository { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(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 |