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",
},
});
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",
})
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
})
}
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" },
},
});
});
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.applyValue(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(Map.of("Foo", "Bar"))
.build());
}
}
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
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 string
- The unique name of the resource.
- args RepositoryCreationTemplateArgs
- 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 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 string
- The unique name of the resource.
- args RepositoryCreationTemplateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RepositoryCreationTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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" },
},
});
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"),
},
})
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());
repository_creation_template_resource = aws.ecr.RepositoryCreationTemplate("repositoryCreationTemplateResource",
applied_fors=["string"],
prefix="string",
custom_role_arn="string",
description="string",
encryption_configurations=[{
"encryptionType": "string",
"kmsKey": "string",
}],
image_tag_mutability="string",
lifecycle_policy="string",
repository_policy="string",
resource_tags={
"string": "string",
})
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",
},
});
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
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
The RepositoryCreationTemplate resource accepts the following input properties:
- Applied
Fors List<string> - Which features this template applies to. Must contain one or more of
PULL_THROUGH_CACHE
orREPLICATION
. - Prefix string
- The repository name prefix to match against. Use
ROOT
to match any prefix that doesn't explicitly match another template. - Custom
Role stringArn - A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
- Description string
- The description for this template.
- Encryption
Configurations List<RepositoryCreation Template Encryption Configuration> - Encryption configuration for any created repositories. See below for schema.
- Image
Tag stringMutability - The tag mutability setting for any created repositories. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - Lifecycle
Policy 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 thelifecycle_policy
argument. - Repository
Policy string - Dictionary<string, string>
- A map of tags to assign to any created repositories.
- Applied
Fors []string - Which features this template applies to. Must contain one or more of
PULL_THROUGH_CACHE
orREPLICATION
. - Prefix string
- The repository name prefix to match against. Use
ROOT
to match any prefix that doesn't explicitly match another template. - Custom
Role stringArn - A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
- Description string
- The description for this template.
- Encryption
Configurations []RepositoryCreation Template Encryption Configuration Args - Encryption configuration for any created repositories. See below for schema.
- Image
Tag stringMutability - The tag mutability setting for any created repositories. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - Lifecycle
Policy 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 thelifecycle_policy
argument. - Repository
Policy string - map[string]string
- A map of tags to assign to any created repositories.
- applied
Fors List<String> - Which features this template applies to. Must contain one or more of
PULL_THROUGH_CACHE
orREPLICATION
. - prefix String
- The repository name prefix to match against. Use
ROOT
to match any prefix that doesn't explicitly match another template. - custom
Role StringArn - A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
- description String
- The description for this template.
- encryption
Configurations List<RepositoryCreation Template Encryption Configuration> - Encryption configuration for any created repositories. See below for schema.
- image
Tag StringMutability - The tag mutability setting for any created repositories. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - lifecycle
Policy 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 thelifecycle_policy
argument. - repository
Policy String - Map<String,String>
- A map of tags to assign to any created repositories.
- applied
Fors string[] - Which features this template applies to. Must contain one or more of
PULL_THROUGH_CACHE
orREPLICATION
. - prefix string
- The repository name prefix to match against. Use
ROOT
to match any prefix that doesn't explicitly match another template. - custom
Role stringArn - A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
- description string
- The description for this template.
- encryption
Configurations RepositoryCreation Template Encryption Configuration[] - Encryption configuration for any created repositories. See below for schema.
- image
Tag stringMutability - The tag mutability setting for any created repositories. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - lifecycle
Policy 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 thelifecycle_policy
argument. - repository
Policy string - {[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
orREPLICATION
. - prefix str
- The repository name prefix to match against. Use
ROOT
to match any prefix that doesn't explicitly match another template. - custom_
role_ strarn - 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[RepositoryCreation Template Encryption Configuration Args] - Encryption configuration for any created repositories. See below for schema.
- image_
tag_ strmutability - The tag mutability setting for any created repositories. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - 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 thelifecycle_policy
argument. - repository_
policy str - Mapping[str, str]
- A map of tags to assign to any created repositories.
- applied
Fors List<String> - Which features this template applies to. Must contain one or more of
PULL_THROUGH_CACHE
orREPLICATION
. - prefix String
- The repository name prefix to match against. Use
ROOT
to match any prefix that doesn't explicitly match another template. - custom
Role StringArn - A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
- description String
- The description for this template.
- encryption
Configurations List<Property Map> - Encryption configuration for any created repositories. See below for schema.
- image
Tag StringMutability - The tag mutability setting for any created repositories. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - lifecycle
Policy 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 thelifecycle_policy
argument. - repository
Policy String - 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.
- Registry
Id string - The registry ID the repository creation template applies to.
- Id string
- The provider-assigned unique ID for this managed resource.
- Registry
Id string - The registry ID the repository creation template applies to.
- id String
- The provider-assigned unique ID for this managed resource.
- registry
Id String - The registry ID the repository creation template applies to.
- id string
- The provider-assigned unique ID for this managed resource.
- registry
Id 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.
- registry
Id 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)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Applied
Fors List<string> - Which features this template applies to. Must contain one or more of
PULL_THROUGH_CACHE
orREPLICATION
. - Custom
Role stringArn - A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
- Description string
- The description for this template.
- Encryption
Configurations List<RepositoryCreation Template Encryption Configuration> - Encryption configuration for any created repositories. See below for schema.
- Image
Tag stringMutability - The tag mutability setting for any created repositories. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - Lifecycle
Policy 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 thelifecycle_policy
argument. - Prefix string
- The repository name prefix to match against. Use
ROOT
to match any prefix that doesn't explicitly match another template. - Registry
Id string - The registry ID the repository creation template applies to.
- Repository
Policy string - Dictionary<string, string>
- A map of tags to assign to any created repositories.
- Applied
Fors []string - Which features this template applies to. Must contain one or more of
PULL_THROUGH_CACHE
orREPLICATION
. - Custom
Role stringArn - A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
- Description string
- The description for this template.
- Encryption
Configurations []RepositoryCreation Template Encryption Configuration Args - Encryption configuration for any created repositories. See below for schema.
- Image
Tag stringMutability - The tag mutability setting for any created repositories. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - Lifecycle
Policy 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 thelifecycle_policy
argument. - Prefix string
- The repository name prefix to match against. Use
ROOT
to match any prefix that doesn't explicitly match another template. - Registry
Id string - The registry ID the repository creation template applies to.
- Repository
Policy string - map[string]string
- A map of tags to assign to any created repositories.
- applied
Fors List<String> - Which features this template applies to. Must contain one or more of
PULL_THROUGH_CACHE
orREPLICATION
. - custom
Role StringArn - A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
- description String
- The description for this template.
- encryption
Configurations List<RepositoryCreation Template Encryption Configuration> - Encryption configuration for any created repositories. See below for schema.
- image
Tag StringMutability - The tag mutability setting for any created repositories. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - lifecycle
Policy 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 thelifecycle_policy
argument. - prefix String
- The repository name prefix to match against. Use
ROOT
to match any prefix that doesn't explicitly match another template. - registry
Id String - The registry ID the repository creation template applies to.
- repository
Policy String - Map<String,String>
- A map of tags to assign to any created repositories.
- applied
Fors string[] - Which features this template applies to. Must contain one or more of
PULL_THROUGH_CACHE
orREPLICATION
. - custom
Role stringArn - A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
- description string
- The description for this template.
- encryption
Configurations RepositoryCreation Template Encryption Configuration[] - Encryption configuration for any created repositories. See below for schema.
- image
Tag stringMutability - The tag mutability setting for any created repositories. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - lifecycle
Policy 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 thelifecycle_policy
argument. - prefix string
- The repository name prefix to match against. Use
ROOT
to match any prefix that doesn't explicitly match another template. - registry
Id string - The registry ID the repository creation template applies to.
- repository
Policy string - {[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
orREPLICATION
. - custom_
role_ strarn - 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[RepositoryCreation Template Encryption Configuration Args] - Encryption configuration for any created repositories. See below for schema.
- image_
tag_ strmutability - The tag mutability setting for any created repositories. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - 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 thelifecycle_policy
argument. - prefix 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 - Mapping[str, str]
- A map of tags to assign to any created repositories.
- applied
Fors List<String> - Which features this template applies to. Must contain one or more of
PULL_THROUGH_CACHE
orREPLICATION
. - custom
Role StringArn - A custom IAM role to use for repository creation. Required if using repository tags or KMS encryption.
- description String
- The description for this template.
- encryption
Configurations List<Property Map> - Encryption configuration for any created repositories. See below for schema.
- image
Tag StringMutability - The tag mutability setting for any created repositories. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - lifecycle
Policy 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 thelifecycle_policy
argument. - prefix String
- The repository name prefix to match against. Use
ROOT
to match any prefix that doesn't explicitly match another template. - registry
Id String - The registry ID the repository creation template applies to.
- repository
Policy String - Map<String>
- A map of tags to assign to any created repositories.
Supporting Types
RepositoryCreationTemplateEncryptionConfiguration, RepositoryCreationTemplateEncryptionConfigurationArgs
- Encryption
Type string - The encryption type to use for any created repositories. Valid values are
AES256
orKMS
. Defaults toAES256
. - Kms
Key string - The ARN of the KMS key to use when
encryption_type
isKMS
. If not specified, uses the default AWS managed key for ECR.
- Encryption
Type string - The encryption type to use for any created repositories. Valid values are
AES256
orKMS
. Defaults toAES256
. - Kms
Key string - The ARN of the KMS key to use when
encryption_type
isKMS
. If not specified, uses the default AWS managed key for ECR.
- encryption
Type String - The encryption type to use for any created repositories. Valid values are
AES256
orKMS
. Defaults toAES256
. - kms
Key String - The ARN of the KMS key to use when
encryption_type
isKMS
. If not specified, uses the default AWS managed key for ECR.
- encryption
Type string - The encryption type to use for any created repositories. Valid values are
AES256
orKMS
. Defaults toAES256
. - kms
Key string - The ARN of the KMS key to use when
encryption_type
isKMS
. 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
orKMS
. Defaults toAES256
. - kms_
key str - The ARN of the KMS key to use when
encryption_type
isKMS
. If not specified, uses the default AWS managed key for ECR.
- encryption
Type String - The encryption type to use for any created repositories. Valid values are
AES256
orKMS
. Defaults toAES256
. - kms
Key String - The ARN of the KMS key to use when
encryption_type
isKMS
. 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
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.