1. Packages
  2. AWS Native
  3. API Docs
  4. ecr
  5. RegistryPolicy

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.100.0 published on Wednesday, Mar 27, 2024 by Pulumi

aws-native.ecr.RegistryPolicy

Explore with Pulumi AI

aws-native logo

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.100.0 published on Wednesday, Mar 27, 2024 by Pulumi

    The AWS::ECR::RegistryPolicy resource creates or updates the permissions policy for a private registry. A private registry policy is used to specify permissions for another AWS-account and is used when configuring cross-account replication. For more information, see Registry permissions in the Amazon Elastic Container Registry User Guide.

    Example Usage

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var testRegistryPolicy = new AwsNative.Ecr.RegistryPolicy("testRegistryPolicy", new()
        {
            PolicyText = 
            {
                { "version", "2012-10-17" },
                { "statement", new[]
                {
                    
                    {
                        { "sid", "UpdatedRegistryPolicy" },
                        { "effect", "Allow" },
                        { "principal", 
                        {
                            { "aws", "arn:aws:iam::210987654321:root" },
                        } },
                        { "action", new[]
                        {
                            "ecr:CreateRepository",
                            "ecr:ReplicateImage",
                        } },
                        { "resource", "arn:aws:ecr:us-west-2:123456789012:repository/*" },
                    },
                } },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/ecr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecr.NewRegistryPolicy(ctx, "testRegistryPolicy", &ecr.RegistryPolicyArgs{
    			PolicyText: pulumi.Any{
    				Version: "2012-10-17",
    				Statement: []map[string]interface{}{
    					map[string]interface{}{
    						"sid":    "UpdatedRegistryPolicy",
    						"effect": "Allow",
    						"principal": map[string]interface{}{
    							"aws": "arn:aws:iam::210987654321:root",
    						},
    						"action": []string{
    							"ecr:CreateRepository",
    							"ecr:ReplicateImage",
    						},
    						"resource": "arn:aws:ecr:us-west-2:123456789012:repository/*",
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    test_registry_policy = aws_native.ecr.RegistryPolicy("testRegistryPolicy", policy_text={
        "version": "2012-10-17",
        "statement": [{
            "sid": "UpdatedRegistryPolicy",
            "effect": "Allow",
            "principal": {
                "aws": "arn:aws:iam::210987654321:root",
            },
            "action": [
                "ecr:CreateRepository",
                "ecr:ReplicateImage",
            ],
            "resource": "arn:aws:ecr:us-west-2:123456789012:repository/*",
        }],
    })
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const testRegistryPolicy = new aws_native.ecr.RegistryPolicy("testRegistryPolicy", {policyText: {
        version: "2012-10-17",
        statement: [{
            sid: "UpdatedRegistryPolicy",
            effect: "Allow",
            principal: {
                aws: "arn:aws:iam::210987654321:root",
            },
            action: [
                "ecr:CreateRepository",
                "ecr:ReplicateImage",
            ],
            resource: "arn:aws:ecr:us-west-2:123456789012:repository/*",
        }],
    }});
    

    Coming soon!

    Create RegistryPolicy Resource

    new RegistryPolicy(name: string, args: RegistryPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def RegistryPolicy(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       policy_text: Optional[Any] = None)
    @overload
    def RegistryPolicy(resource_name: str,
                       args: RegistryPolicyArgs,
                       opts: Optional[ResourceOptions] = None)
    func NewRegistryPolicy(ctx *Context, name string, args RegistryPolicyArgs, opts ...ResourceOption) (*RegistryPolicy, error)
    public RegistryPolicy(string name, RegistryPolicyArgs args, CustomResourceOptions? opts = null)
    public RegistryPolicy(String name, RegistryPolicyArgs args)
    public RegistryPolicy(String name, RegistryPolicyArgs args, CustomResourceOptions options)
    
    type: aws-native:ecr:RegistryPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args RegistryPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args RegistryPolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args RegistryPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RegistryPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RegistryPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    RegistryPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The RegistryPolicy resource accepts the following input properties:

    PolicyText object

    The JSON policy text for your registry.

    Search the CloudFormation User Guide for AWS::ECR::RegistryPolicy for more information about the expected schema for this property.

    PolicyText interface{}

    The JSON policy text for your registry.

    Search the CloudFormation User Guide for AWS::ECR::RegistryPolicy for more information about the expected schema for this property.

    policyText Object

    The JSON policy text for your registry.

    Search the CloudFormation User Guide for AWS::ECR::RegistryPolicy for more information about the expected schema for this property.

    policyText any

    The JSON policy text for your registry.

    Search the CloudFormation User Guide for AWS::ECR::RegistryPolicy for more information about the expected schema for this property.

    policy_text Any

    The JSON policy text for your registry.

    Search the CloudFormation User Guide for AWS::ECR::RegistryPolicy for more information about the expected schema for this property.

    policyText Any

    The JSON policy text for your registry.

    Search the CloudFormation User Guide for AWS::ECR::RegistryPolicy for more information about the expected schema for this property.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the RegistryPolicy resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    RegistryId string
    Id string
    The provider-assigned unique ID for this managed resource.
    RegistryId string
    id String
    The provider-assigned unique ID for this managed resource.
    registryId String
    id string
    The provider-assigned unique ID for this managed resource.
    registryId string
    id str
    The provider-assigned unique ID for this managed resource.
    registry_id str
    id String
    The provider-assigned unique ID for this managed resource.
    registryId String

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo

    AWS Native is in preview. AWS Classic is fully supported.

    AWS Native v0.100.0 published on Wednesday, Mar 27, 2024 by Pulumi