1. Packages
  2. AWS
  3. API Docs
  4. ecr
  5. RepositoryCreationTemplate
AWS v6.77.1 published on Friday, Apr 18, 2025 by Pulumi

aws.ecr.RepositoryCreationTemplate

Explore with Pulumi AI

Provides an Elastic Container Registry Repository Creation Template.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = aws.iam.getPolicyDocument({
    statements: [{
        sid: "new policy",
        effect: "Allow",
        principals: [{
            type: "AWS",
            identifiers: ["123456789012"],
        }],
        actions: [
            "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",
        ],
    }],
});
const exampleRepositoryCreationTemplate = new aws.ecr.RepositoryCreationTemplate("example", {
    prefix: "example",
    description: "An example template",
    imageTagMutability: "IMMUTABLE",
    customRoleArn: "arn:aws:iam::123456789012:role/example",
    appliedFors: ["PULL_THROUGH_CACHE"],
    encryptionConfigurations: [{
        encryptionType: "AES256",
    }],
    repositoryPolicy: example.then(example => example.json),
    lifecyclePolicy: `{
  "rules": [
    {
      "rulePriority": 1,
      "description": "Expire images older than 14 days",
      "selection": {
        "tagStatus": "untagged",
        "countType": "sinceImagePushed",
        "countUnit": "days",
        "countNumber": 14
      },
      "action": {
        "type": "expire"
      }
    }
  ]
}
`,
    resourceTags: {
        Foo: "Bar",
    },
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.iam.get_policy_document(statements=[{
    "sid": "new policy",
    "effect": "Allow",
    "principals": [{
        "type": "AWS",
        "identifiers": ["123456789012"],
    }],
    "actions": [
        "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",
    ],
}])
example_repository_creation_template = aws.ecr.RepositoryCreationTemplate("example",
    prefix="example",
    description="An example template",
    image_tag_mutability="IMMUTABLE",
    custom_role_arn="arn:aws:iam::123456789012:role/example",
    applied_fors=["PULL_THROUGH_CACHE"],
    encryption_configurations=[{
        "encryption_type": "AES256",
    }],
    repository_policy=example.json,
    lifecycle_policy="""{
  "rules": [
    {
      "rulePriority": 1,
      "description": "Expire images older than 14 days",
      "selection": {
        "tagStatus": "untagged",
        "countType": "sinceImagePushed",
        "countUnit": "days",
        "countNumber": 14
      },
      "action": {
        "type": "expire"
      }
    }
  ]
}
""",
    resource_tags={
        "Foo": "Bar",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecr"
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
			Statements: []iam.GetPolicyDocumentStatement{
				{
					Sid:    pulumi.StringRef("new policy"),
					Effect: pulumi.StringRef("Allow"),
					Principals: []iam.GetPolicyDocumentStatementPrincipal{
						{
							Type: "AWS",
							Identifiers: []string{
								"123456789012",
							},
						},
					},
					Actions: []string{
						"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",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		_, err = ecr.NewRepositoryCreationTemplate(ctx, "example", &ecr.RepositoryCreationTemplateArgs{
			Prefix:             pulumi.String("example"),
			Description:        pulumi.String("An example template"),
			ImageTagMutability: pulumi.String("IMMUTABLE"),
			CustomRoleArn:      pulumi.String("arn:aws:iam::123456789012:role/example"),
			AppliedFors: pulumi.StringArray{
				pulumi.String("PULL_THROUGH_CACHE"),
			},
			EncryptionConfigurations: ecr.RepositoryCreationTemplateEncryptionConfigurationArray{
				&ecr.RepositoryCreationTemplateEncryptionConfigurationArgs{
					EncryptionType: pulumi.String("AES256"),
				},
			},
			RepositoryPolicy: pulumi.String(example.Json),
			LifecyclePolicy: pulumi.String(`{
  "rules": [
    {
      "rulePriority": 1,
      "description": "Expire images older than 14 days",
      "selection": {
        "tagStatus": "untagged",
        "countType": "sinceImagePushed",
        "countUnit": "days",
        "countNumber": 14
      },
      "action": {
        "type": "expire"
      }
    }
  ]
}
`),
			ResourceTags: pulumi.StringMap{
				"Foo": pulumi.String("Bar"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = Aws.Iam.GetPolicyDocument.Invoke(new()
    {
        Statements = new[]
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
            {
                Sid = "new policy",
                Effect = "Allow",
                Principals = new[]
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
                    {
                        Type = "AWS",
                        Identifiers = new[]
                        {
                            "123456789012",
                        },
                    },
                },
                Actions = new[]
                {
                    "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",
                },
            },
        },
    });

    var exampleRepositoryCreationTemplate = new Aws.Ecr.RepositoryCreationTemplate("example", new()
    {
        Prefix = "example",
        Description = "An example template",
        ImageTagMutability = "IMMUTABLE",
        CustomRoleArn = "arn:aws:iam::123456789012:role/example",
        AppliedFors = new[]
        {
            "PULL_THROUGH_CACHE",
        },
        EncryptionConfigurations = new[]
        {
            new Aws.Ecr.Inputs.RepositoryCreationTemplateEncryptionConfigurationArgs
            {
                EncryptionType = "AES256",
            },
        },
        RepositoryPolicy = example.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
        LifecyclePolicy = @"{
  ""rules"": [
    {
      ""rulePriority"": 1,
      ""description"": ""Expire images older than 14 days"",
      ""selection"": {
        ""tagStatus"": ""untagged"",
        ""countType"": ""sinceImagePushed"",
        ""countUnit"": ""days"",
        ""countNumber"": 14
      },
      ""action"": {
        ""type"": ""expire""
      }
    }
  ]
}
",
        ResourceTags = 
        {
            { "Foo", "Bar" },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.ecr.RepositoryCreationTemplate;
import com.pulumi.aws.ecr.RepositoryCreationTemplateArgs;
import com.pulumi.aws.ecr.inputs.RepositoryCreationTemplateEncryptionConfigurationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
            .statements(GetPolicyDocumentStatementArgs.builder()
                .sid("new policy")
                .effect("Allow")
                .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                    .type("AWS")
                    .identifiers("123456789012")
                    .build())
                .actions(                
                    "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")
                .build())
            .build());

        var exampleRepositoryCreationTemplate = new RepositoryCreationTemplate("exampleRepositoryCreationTemplate", RepositoryCreationTemplateArgs.builder()
            .prefix("example")
            .description("An example template")
            .imageTagMutability("IMMUTABLE")
            .customRoleArn("arn:aws:iam::123456789012:role/example")
            .appliedFors("PULL_THROUGH_CACHE")
            .encryptionConfigurations(RepositoryCreationTemplateEncryptionConfigurationArgs.builder()
                .encryptionType("AES256")
                .build())
            .repositoryPolicy(example.json())
            .lifecyclePolicy("""
{
  "rules": [
    {
      "rulePriority": 1,
      "description": "Expire images older than 14 days",
      "selection": {
        "tagStatus": "untagged",
        "countType": "sinceImagePushed",
        "countUnit": "days",
        "countNumber": 14
      },
      "action": {
        "type": "expire"
      }
    }
  ]
}
            """)
            .resourceTags(Map.of("Foo", "Bar"))
            .build());

    }
}
Copy
resources:
  exampleRepositoryCreationTemplate:
    type: aws:ecr:RepositoryCreationTemplate
    name: example
    properties:
      prefix: example
      description: An example template
      imageTagMutability: IMMUTABLE
      customRoleArn: arn:aws:iam::123456789012:role/example
      appliedFors:
        - PULL_THROUGH_CACHE
      encryptionConfigurations:
        - encryptionType: AES256
      repositoryPolicy: ${example.json}
      lifecyclePolicy: |
        {
          "rules": [
            {
              "rulePriority": 1,
              "description": "Expire images older than 14 days",
              "selection": {
                "tagStatus": "untagged",
                "countType": "sinceImagePushed",
                "countUnit": "days",
                "countNumber": 14
              },
              "action": {
                "type": "expire"
              }
            }
          ]
        }        
      resourceTags:
        Foo: Bar
variables:
  example:
    fn::invoke:
      function: aws:iam:getPolicyDocument
      arguments:
        statements:
          - sid: new policy
            effect: Allow
            principals:
              - type: AWS
                identifiers:
                  - '123456789012'
            actions:
              - 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
Copy

Create RepositoryCreationTemplate Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new RepositoryCreationTemplate(name: string, args: RepositoryCreationTemplateArgs, opts?: CustomResourceOptions);
@overload
def RepositoryCreationTemplate(resource_name: str,
                               args: RepositoryCreationTemplateArgs,
                               opts: Optional[ResourceOptions] = None)

@overload
def RepositoryCreationTemplate(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               applied_fors: Optional[Sequence[str]] = None,
                               prefix: Optional[str] = None,
                               custom_role_arn: Optional[str] = None,
                               description: Optional[str] = None,
                               encryption_configurations: Optional[Sequence[RepositoryCreationTemplateEncryptionConfigurationArgs]] = None,
                               image_tag_mutability: Optional[str] = None,
                               lifecycle_policy: Optional[str] = None,
                               repository_policy: Optional[str] = None,
                               resource_tags: Optional[Mapping[str, str]] = None)
func NewRepositoryCreationTemplate(ctx *Context, name string, args RepositoryCreationTemplateArgs, opts ...ResourceOption) (*RepositoryCreationTemplate, error)
public RepositoryCreationTemplate(string name, RepositoryCreationTemplateArgs args, CustomResourceOptions? opts = null)
public RepositoryCreationTemplate(String name, RepositoryCreationTemplateArgs args)
public RepositoryCreationTemplate(String name, RepositoryCreationTemplateArgs args, CustomResourceOptions options)
type: aws:ecr:RepositoryCreationTemplate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RepositoryCreationTemplateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RepositoryCreationTemplateArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RepositoryCreationTemplateArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RepositoryCreationTemplateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RepositoryCreationTemplateArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var repositoryCreationTemplateResource = new Aws.Ecr.RepositoryCreationTemplate("repositoryCreationTemplateResource", new()
{
    AppliedFors = new[]
    {
        "string",
    },
    Prefix = "string",
    CustomRoleArn = "string",
    Description = "string",
    EncryptionConfigurations = new[]
    {
        new Aws.Ecr.Inputs.RepositoryCreationTemplateEncryptionConfigurationArgs
        {
            EncryptionType = "string",
            KmsKey = "string",
        },
    },
    ImageTagMutability = "string",
    LifecyclePolicy = "string",
    RepositoryPolicy = "string",
    ResourceTags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := ecr.NewRepositoryCreationTemplate(ctx, "repositoryCreationTemplateResource", &ecr.RepositoryCreationTemplateArgs{
	AppliedFors: pulumi.StringArray{
		pulumi.String("string"),
	},
	Prefix:        pulumi.String("string"),
	CustomRoleArn: pulumi.String("string"),
	Description:   pulumi.String("string"),
	EncryptionConfigurations: ecr.RepositoryCreationTemplateEncryptionConfigurationArray{
		&ecr.RepositoryCreationTemplateEncryptionConfigurationArgs{
			EncryptionType: pulumi.String("string"),
			KmsKey:         pulumi.String("string"),
		},
	},
	ImageTagMutability: pulumi.String("string"),
	LifecyclePolicy:    pulumi.String("string"),
	RepositoryPolicy:   pulumi.String("string"),
	ResourceTags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var repositoryCreationTemplateResource = new RepositoryCreationTemplate("repositoryCreationTemplateResource", RepositoryCreationTemplateArgs.builder()
    .appliedFors("string")
    .prefix("string")
    .customRoleArn("string")
    .description("string")
    .encryptionConfigurations(RepositoryCreationTemplateEncryptionConfigurationArgs.builder()
        .encryptionType("string")
        .kmsKey("string")
        .build())
    .imageTagMutability("string")
    .lifecyclePolicy("string")
    .repositoryPolicy("string")
    .resourceTags(Map.of("string", "string"))
    .build());
Copy
repository_creation_template_resource = aws.ecr.RepositoryCreationTemplate("repositoryCreationTemplateResource",
    applied_fors=["string"],
    prefix="string",
    custom_role_arn="string",
    description="string",
    encryption_configurations=[{
        "encryption_type": "string",
        "kms_key": "string",
    }],
    image_tag_mutability="string",
    lifecycle_policy="string",
    repository_policy="string",
    resource_tags={
        "string": "string",
    })
Copy
const repositoryCreationTemplateResource = new aws.ecr.RepositoryCreationTemplate("repositoryCreationTemplateResource", {
    appliedFors: ["string"],
    prefix: "string",
    customRoleArn: "string",
    description: "string",
    encryptionConfigurations: [{
        encryptionType: "string",
        kmsKey: "string",
    }],
    imageTagMutability: "string",
    lifecyclePolicy: "string",
    repositoryPolicy: "string",
    resourceTags: {
        string: "string",
    },
});
Copy
type: aws:ecr:RepositoryCreationTemplate
properties:
    appliedFors:
        - string
    customRoleArn: string
    description: string
    encryptionConfigurations:
        - encryptionType: string
          kmsKey: string
    imageTagMutability: string
    lifecyclePolicy: string
    prefix: string
    repositoryPolicy: string
    resourceTags:
        string: string
Copy

RepositoryCreationTemplate Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The RepositoryCreationTemplate resource accepts the following input properties:

AppliedFors This property is required. List<string>
Which features this template applies to. Must contain one or more of PULL_THROUGH_CACHE or REPLICATION.
Prefix
This property is required.
Changes to this property will trigger replacement.
string
The repository name prefix to match against. Use ROOT to match any prefix that doesn't explicitly match another template.
CustomRoleArn string
A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
Description string
The description for this template.
EncryptionConfigurations List<RepositoryCreationTemplateEncryptionConfiguration>
Encryption configuration for any created repositories. See below for schema.
ImageTagMutability string
The tag mutability setting for any created repositories. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
LifecyclePolicy string
The lifecycle policy document to apply to any created repositories. See more details about Policy Parameters in the official AWS docs. Consider using the aws.ecr.getLifecyclePolicyDocument data_source to generate/manage the JSON document used for the lifecycle_policy argument.
RepositoryPolicy string
ResourceTags Dictionary<string, string>
A map of tags to assign to any created repositories.
AppliedFors This property is required. []string
Which features this template applies to. Must contain one or more of PULL_THROUGH_CACHE or REPLICATION.
Prefix
This property is required.
Changes to this property will trigger replacement.
string
The repository name prefix to match against. Use ROOT to match any prefix that doesn't explicitly match another template.
CustomRoleArn string
A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
Description string
The description for this template.
EncryptionConfigurations []RepositoryCreationTemplateEncryptionConfigurationArgs
Encryption configuration for any created repositories. See below for schema.
ImageTagMutability string
The tag mutability setting for any created repositories. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
LifecyclePolicy string
The lifecycle policy document to apply to any created repositories. See more details about Policy Parameters in the official AWS docs. Consider using the aws.ecr.getLifecyclePolicyDocument data_source to generate/manage the JSON document used for the lifecycle_policy argument.
RepositoryPolicy string
ResourceTags map[string]string
A map of tags to assign to any created repositories.
appliedFors This property is required. List<String>
Which features this template applies to. Must contain one or more of PULL_THROUGH_CACHE or REPLICATION.
prefix
This property is required.
Changes to this property will trigger replacement.
String
The repository name prefix to match against. Use ROOT to match any prefix that doesn't explicitly match another template.
customRoleArn String
A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
description String
The description for this template.
encryptionConfigurations List<RepositoryCreationTemplateEncryptionConfiguration>
Encryption configuration for any created repositories. See below for schema.
imageTagMutability String
The tag mutability setting for any created repositories. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
lifecyclePolicy String
The lifecycle policy document to apply to any created repositories. See more details about Policy Parameters in the official AWS docs. Consider using the aws.ecr.getLifecyclePolicyDocument data_source to generate/manage the JSON document used for the lifecycle_policy argument.
repositoryPolicy String
resourceTags Map<String,String>
A map of tags to assign to any created repositories.
appliedFors This property is required. string[]
Which features this template applies to. Must contain one or more of PULL_THROUGH_CACHE or REPLICATION.
prefix
This property is required.
Changes to this property will trigger replacement.
string
The repository name prefix to match against. Use ROOT to match any prefix that doesn't explicitly match another template.
customRoleArn string
A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
description string
The description for this template.
encryptionConfigurations RepositoryCreationTemplateEncryptionConfiguration[]
Encryption configuration for any created repositories. See below for schema.
imageTagMutability string
The tag mutability setting for any created repositories. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
lifecyclePolicy string
The lifecycle policy document to apply to any created repositories. See more details about Policy Parameters in the official AWS docs. Consider using the aws.ecr.getLifecyclePolicyDocument data_source to generate/manage the JSON document used for the lifecycle_policy argument.
repositoryPolicy string
resourceTags {[key: string]: string}
A map of tags to assign to any created repositories.
applied_fors This property is required. Sequence[str]
Which features this template applies to. Must contain one or more of PULL_THROUGH_CACHE or REPLICATION.
prefix
This property is required.
Changes to this property will trigger replacement.
str
The repository name prefix to match against. Use ROOT to match any prefix that doesn't explicitly match another template.
custom_role_arn str
A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
description str
The description for this template.
encryption_configurations Sequence[RepositoryCreationTemplateEncryptionConfigurationArgs]
Encryption configuration for any created repositories. See below for schema.
image_tag_mutability str
The tag mutability setting for any created repositories. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
lifecycle_policy str
The lifecycle policy document to apply to any created repositories. See more details about Policy Parameters in the official AWS docs. Consider using the aws.ecr.getLifecyclePolicyDocument data_source to generate/manage the JSON document used for the lifecycle_policy argument.
repository_policy str
resource_tags Mapping[str, str]
A map of tags to assign to any created repositories.
appliedFors This property is required. List<String>
Which features this template applies to. Must contain one or more of PULL_THROUGH_CACHE or REPLICATION.
prefix
This property is required.
Changes to this property will trigger replacement.
String
The repository name prefix to match against. Use ROOT to match any prefix that doesn't explicitly match another template.
customRoleArn String
A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
description String
The description for this template.
encryptionConfigurations List<Property Map>
Encryption configuration for any created repositories. See below for schema.
imageTagMutability String
The tag mutability setting for any created repositories. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
lifecyclePolicy String
The lifecycle policy document to apply to any created repositories. See more details about Policy Parameters in the official AWS docs. Consider using the aws.ecr.getLifecyclePolicyDocument data_source to generate/manage the JSON document used for the lifecycle_policy argument.
repositoryPolicy String
resourceTags Map<String>
A map of tags to assign to any created repositories.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
RegistryId string
The registry ID the repository creation template applies to.
Id string
The provider-assigned unique ID for this managed resource.
RegistryId string
The registry ID the repository creation template applies to.
id String
The provider-assigned unique ID for this managed resource.
registryId String
The registry ID the repository creation template applies to.
id string
The provider-assigned unique ID for this managed resource.
registryId string
The registry ID the repository creation template applies to.
id str
The provider-assigned unique ID for this managed resource.
registry_id str
The registry ID the repository creation template applies to.
id String
The provider-assigned unique ID for this managed resource.
registryId String
The registry ID the repository creation template applies to.

Look up Existing RepositoryCreationTemplate Resource

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

public static get(name: string, id: Input<ID>, state?: RepositoryCreationTemplateState, opts?: CustomResourceOptions): RepositoryCreationTemplate
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        applied_fors: Optional[Sequence[str]] = None,
        custom_role_arn: Optional[str] = None,
        description: Optional[str] = None,
        encryption_configurations: Optional[Sequence[RepositoryCreationTemplateEncryptionConfigurationArgs]] = None,
        image_tag_mutability: Optional[str] = None,
        lifecycle_policy: Optional[str] = None,
        prefix: Optional[str] = None,
        registry_id: Optional[str] = None,
        repository_policy: Optional[str] = None,
        resource_tags: Optional[Mapping[str, str]] = None) -> RepositoryCreationTemplate
func GetRepositoryCreationTemplate(ctx *Context, name string, id IDInput, state *RepositoryCreationTemplateState, opts ...ResourceOption) (*RepositoryCreationTemplate, error)
public static RepositoryCreationTemplate Get(string name, Input<string> id, RepositoryCreationTemplateState? state, CustomResourceOptions? opts = null)
public static RepositoryCreationTemplate get(String name, Output<String> id, RepositoryCreationTemplateState state, CustomResourceOptions options)
resources:  _:    type: aws:ecr:RepositoryCreationTemplate    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AppliedFors List<string>
Which features this template applies to. Must contain one or more of PULL_THROUGH_CACHE or REPLICATION.
CustomRoleArn string
A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
Description string
The description for this template.
EncryptionConfigurations List<RepositoryCreationTemplateEncryptionConfiguration>
Encryption configuration for any created repositories. See below for schema.
ImageTagMutability string
The tag mutability setting for any created repositories. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
LifecyclePolicy string
The lifecycle policy document to apply to any created repositories. See more details about Policy Parameters in the official AWS docs. Consider using the aws.ecr.getLifecyclePolicyDocument data_source to generate/manage the JSON document used for the lifecycle_policy argument.
Prefix Changes to this property will trigger replacement. string
The repository name prefix to match against. Use ROOT to match any prefix that doesn't explicitly match another template.
RegistryId string
The registry ID the repository creation template applies to.
RepositoryPolicy string
ResourceTags Dictionary<string, string>
A map of tags to assign to any created repositories.
AppliedFors []string
Which features this template applies to. Must contain one or more of PULL_THROUGH_CACHE or REPLICATION.
CustomRoleArn string
A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
Description string
The description for this template.
EncryptionConfigurations []RepositoryCreationTemplateEncryptionConfigurationArgs
Encryption configuration for any created repositories. See below for schema.
ImageTagMutability string
The tag mutability setting for any created repositories. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
LifecyclePolicy string
The lifecycle policy document to apply to any created repositories. See more details about Policy Parameters in the official AWS docs. Consider using the aws.ecr.getLifecyclePolicyDocument data_source to generate/manage the JSON document used for the lifecycle_policy argument.
Prefix Changes to this property will trigger replacement. string
The repository name prefix to match against. Use ROOT to match any prefix that doesn't explicitly match another template.
RegistryId string
The registry ID the repository creation template applies to.
RepositoryPolicy string
ResourceTags map[string]string
A map of tags to assign to any created repositories.
appliedFors List<String>
Which features this template applies to. Must contain one or more of PULL_THROUGH_CACHE or REPLICATION.
customRoleArn String
A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
description String
The description for this template.
encryptionConfigurations List<RepositoryCreationTemplateEncryptionConfiguration>
Encryption configuration for any created repositories. See below for schema.
imageTagMutability String
The tag mutability setting for any created repositories. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
lifecyclePolicy String
The lifecycle policy document to apply to any created repositories. See more details about Policy Parameters in the official AWS docs. Consider using the aws.ecr.getLifecyclePolicyDocument data_source to generate/manage the JSON document used for the lifecycle_policy argument.
prefix Changes to this property will trigger replacement. String
The repository name prefix to match against. Use ROOT to match any prefix that doesn't explicitly match another template.
registryId String
The registry ID the repository creation template applies to.
repositoryPolicy String
resourceTags Map<String,String>
A map of tags to assign to any created repositories.
appliedFors string[]
Which features this template applies to. Must contain one or more of PULL_THROUGH_CACHE or REPLICATION.
customRoleArn string
A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
description string
The description for this template.
encryptionConfigurations RepositoryCreationTemplateEncryptionConfiguration[]
Encryption configuration for any created repositories. See below for schema.
imageTagMutability string
The tag mutability setting for any created repositories. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
lifecyclePolicy string
The lifecycle policy document to apply to any created repositories. See more details about Policy Parameters in the official AWS docs. Consider using the aws.ecr.getLifecyclePolicyDocument data_source to generate/manage the JSON document used for the lifecycle_policy argument.
prefix Changes to this property will trigger replacement. string
The repository name prefix to match against. Use ROOT to match any prefix that doesn't explicitly match another template.
registryId string
The registry ID the repository creation template applies to.
repositoryPolicy string
resourceTags {[key: string]: string}
A map of tags to assign to any created repositories.
applied_fors Sequence[str]
Which features this template applies to. Must contain one or more of PULL_THROUGH_CACHE or REPLICATION.
custom_role_arn str
A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
description str
The description for this template.
encryption_configurations Sequence[RepositoryCreationTemplateEncryptionConfigurationArgs]
Encryption configuration for any created repositories. See below for schema.
image_tag_mutability str
The tag mutability setting for any created repositories. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
lifecycle_policy str
The lifecycle policy document to apply to any created repositories. See more details about Policy Parameters in the official AWS docs. Consider using the aws.ecr.getLifecyclePolicyDocument data_source to generate/manage the JSON document used for the lifecycle_policy argument.
prefix Changes to this property will trigger replacement. str
The repository name prefix to match against. Use ROOT to match any prefix that doesn't explicitly match another template.
registry_id str
The registry ID the repository creation template applies to.
repository_policy str
resource_tags Mapping[str, str]
A map of tags to assign to any created repositories.
appliedFors List<String>
Which features this template applies to. Must contain one or more of PULL_THROUGH_CACHE or REPLICATION.
customRoleArn String
A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
description String
The description for this template.
encryptionConfigurations List<Property Map>
Encryption configuration for any created repositories. See below for schema.
imageTagMutability String
The tag mutability setting for any created repositories. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
lifecyclePolicy String
The lifecycle policy document to apply to any created repositories. See more details about Policy Parameters in the official AWS docs. Consider using the aws.ecr.getLifecyclePolicyDocument data_source to generate/manage the JSON document used for the lifecycle_policy argument.
prefix Changes to this property will trigger replacement. String
The repository name prefix to match against. Use ROOT to match any prefix that doesn't explicitly match another template.
registryId String
The registry ID the repository creation template applies to.
repositoryPolicy String
resourceTags Map<String>
A map of tags to assign to any created repositories.

Supporting Types

RepositoryCreationTemplateEncryptionConfiguration
, RepositoryCreationTemplateEncryptionConfigurationArgs

EncryptionType string
The encryption type to use for any created repositories. Valid values are AES256 or KMS. Defaults to AES256.
KmsKey string
The ARN of the KMS key to use when encryption_type is KMS. If not specified, uses the default AWS managed key for ECR.
EncryptionType string
The encryption type to use for any created repositories. Valid values are AES256 or KMS. Defaults to AES256.
KmsKey string
The ARN of the KMS key to use when encryption_type is KMS. If not specified, uses the default AWS managed key for ECR.
encryptionType String
The encryption type to use for any created repositories. Valid values are AES256 or KMS. Defaults to AES256.
kmsKey String
The ARN of the KMS key to use when encryption_type is KMS. If not specified, uses the default AWS managed key for ECR.
encryptionType string
The encryption type to use for any created repositories. Valid values are AES256 or KMS. Defaults to AES256.
kmsKey string
The ARN of the KMS key to use when encryption_type is KMS. If not specified, uses the default AWS managed key for ECR.
encryption_type str
The encryption type to use for any created repositories. Valid values are AES256 or KMS. Defaults to AES256.
kms_key str
The ARN of the KMS key to use when encryption_type is KMS. If not specified, uses the default AWS managed key for ECR.
encryptionType String
The encryption type to use for any created repositories. Valid values are AES256 or KMS. Defaults to AES256.
kmsKey String
The ARN of the KMS key to use when encryption_type is KMS. If not specified, uses the default AWS managed key for ECR.

Import

Using pulumi import, import the ECR Repository Creating Templates using the prefix. For example:

$ pulumi import aws:ecr/repositoryCreationTemplate:RepositoryCreationTemplate example example
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.