awsx.ecr.Repository
Explore with Pulumi AI
A [Repository] represents an [aws.ecr.Repository] along with an associated [LifecyclePolicy] controlling how images are retained in the repo.
Docker images can be built and pushed to the repo using the [buildAndPushImage] method. This will call into the @pulumi/docker/buildAndPushImage
function using this repo as the appropriate destination registry.
Create Repository Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Repository(name: string, args?: RepositoryArgs, opts?: ComponentResourceOptions);
@overload
def Repository(resource_name: str,
args: Optional[RepositoryArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Repository(resource_name: str,
opts: Optional[ResourceOptions] = None,
encryption_configurations: Optional[Sequence[pulumi_aws.ecr.RepositoryEncryptionConfigurationArgs]] = None,
force_delete: Optional[bool] = None,
image_scanning_configuration: Optional[pulumi_aws.ecr.RepositoryImageScanningConfigurationArgs] = None,
image_tag_mutability: Optional[str] = None,
lifecycle_policy: Optional[LifecyclePolicyArgs] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewRepository(ctx *Context, name string, args *RepositoryArgs, opts ...ResourceOption) (*Repository, error)
public Repository(string name, RepositoryArgs? args = null, ComponentResourceOptions? opts = null)
public Repository(String name, RepositoryArgs args)
public Repository(String name, RepositoryArgs args, ComponentResourceOptions options)
type: awsx:ecr:Repository
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 RepositoryArgs
- The arguments to resource properties.
- opts ComponentResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RepositoryArgs
- 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 RepositoryArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RepositoryArgs
- The arguments to resource properties.
- opts ComponentResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RepositoryArgs
- The arguments to resource properties.
- options ComponentResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var repositoryResource = new Awsx.Ecr.Repository("repositoryResource", new()
{
EncryptionConfigurations = new[]
{
new Aws.Ecr.Inputs.RepositoryEncryptionConfigurationArgs
{
EncryptionType = "string",
KmsKey = "string",
},
},
ForceDelete = false,
ImageScanningConfiguration = new Aws.Ecr.Inputs.RepositoryImageScanningConfigurationArgs
{
ScanOnPush = false,
},
ImageTagMutability = "string",
LifecyclePolicy = new Awsx.Ecr.Inputs.LifecyclePolicyArgs
{
Rules = new()
{
new Awsx.Ecr.Inputs.LifecyclePolicyRuleArgs
{
TagStatus = Awsx.Ecr.LifecycleTagStatus.Any,
Description = "string",
MaximumAgeLimit = 0,
MaximumNumberOfImages = 0,
TagPrefixList = new()
{
"string",
},
},
},
Skip = false,
},
Name = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := ecr.NewRepository(ctx, "repositoryResource", &ecr.RepositoryArgs{
EncryptionConfigurations: ecr.RepositoryEncryptionConfigurationArray{
&ecr.RepositoryEncryptionConfigurationArgs{
EncryptionType: pulumi.String("string"),
KmsKey: pulumi.String("string"),
},
},
ForceDelete: pulumi.Bool(false),
ImageScanningConfiguration: &ecr.RepositoryImageScanningConfigurationArgs{
ScanOnPush: pulumi.Bool(false),
},
ImageTagMutability: pulumi.String("string"),
LifecyclePolicy: &ecr.LifecyclePolicyArgs{
Rules: ecr.LifecyclePolicyRuleArray{
&ecr.LifecyclePolicyRuleArgs{
TagStatus: ecr.LifecycleTagStatusAny,
Description: pulumi.String("string"),
MaximumAgeLimit: pulumi.Float64(0),
MaximumNumberOfImages: pulumi.Float64(0),
TagPrefixList: pulumi.StringArray{
pulumi.String("string"),
},
},
},
Skip: false,
},
Name: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var repositoryResource = new Repository("repositoryResource", RepositoryArgs.builder()
.encryptionConfigurations(RepositoryEncryptionConfigurationArgs.builder()
.encryptionType("string")
.kmsKey("string")
.build())
.forceDelete(false)
.imageScanningConfiguration(RepositoryImageScanningConfigurationArgs.builder()
.scanOnPush(false)
.build())
.imageTagMutability("string")
.lifecyclePolicy(LifecyclePolicyArgs.builder()
.rules(LifecyclePolicyRuleArgs.builder()
.tagStatus("any")
.description("string")
.maximumAgeLimit(0)
.maximumNumberOfImages(0)
.tagPrefixList("string")
.build())
.skip(false)
.build())
.name("string")
.tags(Map.of("string", "string"))
.build());
repository_resource = awsx.ecr.Repository("repositoryResource",
encryption_configurations=[{
"encryption_type": "string",
"kms_key": "string",
}],
force_delete=False,
image_scanning_configuration={
"scan_on_push": False,
},
image_tag_mutability="string",
lifecycle_policy={
"rules": [{
"tag_status": awsx.ecr.LifecycleTagStatus.ANY,
"description": "string",
"maximum_age_limit": 0,
"maximum_number_of_images": 0,
"tag_prefix_list": ["string"],
}],
"skip": False,
},
name="string",
tags={
"string": "string",
})
const repositoryResource = new awsx.ecr.Repository("repositoryResource", {
encryptionConfigurations: [{
encryptionType: "string",
kmsKey: "string",
}],
forceDelete: false,
imageScanningConfiguration: {
scanOnPush: false,
},
imageTagMutability: "string",
lifecyclePolicy: {
rules: [{
tagStatus: awsx.ecr.LifecycleTagStatus.Any,
description: "string",
maximumAgeLimit: 0,
maximumNumberOfImages: 0,
tagPrefixList: ["string"],
}],
skip: false,
},
name: "string",
tags: {
string: "string",
},
});
type: awsx:ecr:Repository
properties:
encryptionConfigurations:
- encryptionType: string
kmsKey: string
forceDelete: false
imageScanningConfiguration:
scanOnPush: false
imageTagMutability: string
lifecyclePolicy:
rules:
- description: string
maximumAgeLimit: 0
maximumNumberOfImages: 0
tagPrefixList:
- string
tagStatus: any
skip: false
name: string
tags:
string: string
Repository 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 Repository resource accepts the following input properties:
- Encryption
Configurations List<Pulumi.Aws. Ecr. Inputs. Repository Encryption Configuration> - Encryption configuration for the repository. See below for schema.
- Force
Delete bool - If
true
, will delete the repository even if it contains images. Defaults tofalse
. - Image
Scanning Pulumi.Configuration Aws. Ecr. Inputs. Repository Image Scanning Configuration Configuration block that defines image scanning configuration for the repository. By default, image scanning must be manually triggered. See the ECR User Guide for more information about image scanning.
This type is defined in the AWS Classic package.
- Image
Tag stringMutability - The tag mutability setting for the repository. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - Lifecycle
Policy LifecyclePolicy Args - A lifecycle policy consists of one or more rules that determine which images in a repository should be expired. If not provided, this will default to untagged images expiring after 1 day.
- Name string
- Name of the repository.
- Dictionary<string, string>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Encryption
Configurations RepositoryEncryption Configuration Args - Encryption configuration for the repository. See below for schema.
- Force
Delete bool - If
true
, will delete the repository even if it contains images. Defaults tofalse
. - Image
Scanning RepositoryConfiguration Image Scanning Configuration Args Configuration block that defines image scanning configuration for the repository. By default, image scanning must be manually triggered. See the ECR User Guide for more information about image scanning.
This type is defined in the AWS Classic package.
- Image
Tag stringMutability - The tag mutability setting for the repository. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - Lifecycle
Policy LifecyclePolicy Args - A lifecycle policy consists of one or more rules that determine which images in a repository should be expired. If not provided, this will default to untagged images expiring after 1 day.
- Name string
- Name of the repository.
- map[string]string
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- encryption
Configurations List<RepositoryEncryption Configuration> - Encryption configuration for the repository. See below for schema.
- force
Delete Boolean - If
true
, will delete the repository even if it contains images. Defaults tofalse
. - image
Scanning RepositoryConfiguration Image Scanning Configuration Configuration block that defines image scanning configuration for the repository. By default, image scanning must be manually triggered. See the ECR User Guide for more information about image scanning.
This type is defined in the AWS Classic package.
- image
Tag StringMutability - The tag mutability setting for the repository. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - lifecycle
Policy LifecyclePolicy Args - A lifecycle policy consists of one or more rules that determine which images in a repository should be expired. If not provided, this will default to untagged images expiring after 1 day.
- name String
- Name of the repository.
- Map<String,String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- encryption
Configurations pulumiAws.types.input. Repository Encryption Configuration[] - Encryption configuration for the repository. See below for schema.
- force
Delete boolean - If
true
, will delete the repository even if it contains images. Defaults tofalse
. - image
Scanning pulumiConfiguration Aws.types.input. Repository Image Scanning Configuration Configuration block that defines image scanning configuration for the repository. By default, image scanning must be manually triggered. See the ECR User Guide for more information about image scanning.
This type is defined in the AWS Classic package.
- image
Tag stringMutability - The tag mutability setting for the repository. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - lifecycle
Policy LifecyclePolicy Args - A lifecycle policy consists of one or more rules that determine which images in a repository should be expired. If not provided, this will default to untagged images expiring after 1 day.
- name string
- Name of the repository.
- {[key: string]: string}
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- encryption_
configurations Sequence[pulumi_aws.ecr. Repository Encryption Configuration Args] - Encryption configuration for the repository. See below for schema.
- force_
delete bool - If
true
, will delete the repository even if it contains images. Defaults tofalse
. - image_
scanning_ pulumi_configuration aws.ecr. Repository Image Scanning Configuration Args Configuration block that defines image scanning configuration for the repository. By default, image scanning must be manually triggered. See the ECR User Guide for more information about image scanning.
This type is defined in the AWS Classic package.
- image_
tag_ strmutability - The tag mutability setting for the repository. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - lifecycle_
policy LifecyclePolicy Args - A lifecycle policy consists of one or more rules that determine which images in a repository should be expired. If not provided, this will default to untagged images expiring after 1 day.
- name str
- Name of the repository.
- Mapping[str, str]
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- encryption
Configurations List<Property Map> - Encryption configuration for the repository. See below for schema.
- force
Delete Boolean - If
true
, will delete the repository even if it contains images. Defaults tofalse
. - image
Scanning Property MapConfiguration Configuration block that defines image scanning configuration for the repository. By default, image scanning must be manually triggered. See the ECR User Guide for more information about image scanning.
This type is defined in the AWS Classic package.
- image
Tag StringMutability - The tag mutability setting for the repository. Must be one of:
MUTABLE
orIMMUTABLE
. Defaults toMUTABLE
. - lifecycle
Policy Property Map - A lifecycle policy consists of one or more rules that determine which images in a repository should be expired. If not provided, this will default to untagged images expiring after 1 day.
- name String
- Name of the repository.
- Map<String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the Repository resource produces the following output properties:
- Aws
Repository Pulumi.Aws. Ecr. Repository - Underlying Repository resource This type is defined in the AWS Classic package.
- Url string
- The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).
- Repository Repository
- Underlying Repository resource This type is defined in the AWS Classic package.
- Url string
- The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).
- repository Repository
- Underlying Repository resource This type is defined in the AWS Classic package.
- url String
- The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).
- repository
pulumi
Aws. Repository - Underlying Repository resource This type is defined in the AWS Classic package.
- url string
- The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).
- repository
pulumi_
aws.ecr. Repository - Underlying Repository resource This type is defined in the AWS Classic package.
- url str
- The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).
- repository aws::Repository
- Underlying Repository resource This type is defined in the AWS Classic package.
- url String
- The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).
Supporting Types
LifecyclePolicy, LifecyclePolicyArgs
- Rules
List<Lifecycle
Policy Rule> - Specifies the rules to determine how images should be retired from this repository. Rules are ordered from lowest priority to highest. If there is a rule with a
selection
value ofany
, then it will have the highest priority. - Skip bool
- Skips creation of the policy if set to
true
.
- Rules
[]Lifecycle
Policy Rule - Specifies the rules to determine how images should be retired from this repository. Rules are ordered from lowest priority to highest. If there is a rule with a
selection
value ofany
, then it will have the highest priority. - Skip bool
- Skips creation of the policy if set to
true
.
- rules
List<Lifecycle
Policy Rule> - Specifies the rules to determine how images should be retired from this repository. Rules are ordered from lowest priority to highest. If there is a rule with a
selection
value ofany
, then it will have the highest priority. - skip Boolean
- Skips creation of the policy if set to
true
.
- rules
Lifecycle
Policy Rule[] - Specifies the rules to determine how images should be retired from this repository. Rules are ordered from lowest priority to highest. If there is a rule with a
selection
value ofany
, then it will have the highest priority. - skip boolean
- Skips creation of the policy if set to
true
.
- rules
Sequence[Lifecycle
Policy Rule] - Specifies the rules to determine how images should be retired from this repository. Rules are ordered from lowest priority to highest. If there is a rule with a
selection
value ofany
, then it will have the highest priority. - skip bool
- Skips creation of the policy if set to
true
.
- rules List<Property Map>
- Specifies the rules to determine how images should be retired from this repository. Rules are ordered from lowest priority to highest. If there is a rule with a
selection
value ofany
, then it will have the highest priority. - skip Boolean
- Skips creation of the policy if set to
true
.
LifecyclePolicyRule, LifecyclePolicyRuleArgs
- Pulumi.
Awsx. Ecr. Lifecycle Tag Status - Determines whether the lifecycle policy rule that you are adding specifies a tag for an image. Acceptable options are tagged, untagged, or any. If you specify any, then all images have the rule evaluated against them. If you specify tagged, then you must also specify a tagPrefixList value. If you specify untagged, then you must omit tagPrefixList.
- Description string
- Describes the purpose of a rule within a lifecycle policy.
- Maximum
Age doubleLimit - The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
- Maximum
Number doubleOf Images - The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
- Tag
Prefix List<string>List - A list of image tag prefixes on which to take action with your lifecycle policy. Only used if you specified "tagStatus": "tagged". For example, if your images are tagged as prod, prod1, prod2, and so on, you would use the tag prefix prod to specify all of them. If you specify multiple tags, only the images with all specified tags are selected.
- Lifecycle
Tag Status - Determines whether the lifecycle policy rule that you are adding specifies a tag for an image. Acceptable options are tagged, untagged, or any. If you specify any, then all images have the rule evaluated against them. If you specify tagged, then you must also specify a tagPrefixList value. If you specify untagged, then you must omit tagPrefixList.
- Description string
- Describes the purpose of a rule within a lifecycle policy.
- Maximum
Age float64Limit - The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
- Maximum
Number float64Of Images - The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
- Tag
Prefix []stringList - A list of image tag prefixes on which to take action with your lifecycle policy. Only used if you specified "tagStatus": "tagged". For example, if your images are tagged as prod, prod1, prod2, and so on, you would use the tag prefix prod to specify all of them. If you specify multiple tags, only the images with all specified tags are selected.
- Lifecycle
Tag Status - Determines whether the lifecycle policy rule that you are adding specifies a tag for an image. Acceptable options are tagged, untagged, or any. If you specify any, then all images have the rule evaluated against them. If you specify tagged, then you must also specify a tagPrefixList value. If you specify untagged, then you must omit tagPrefixList.
- description String
- Describes the purpose of a rule within a lifecycle policy.
- maximum
Age DoubleLimit - The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
- maximum
Number DoubleOf Images - The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
- tag
Prefix List<String>List - A list of image tag prefixes on which to take action with your lifecycle policy. Only used if you specified "tagStatus": "tagged". For example, if your images are tagged as prod, prod1, prod2, and so on, you would use the tag prefix prod to specify all of them. If you specify multiple tags, only the images with all specified tags are selected.
- Lifecycle
Tag Status - Determines whether the lifecycle policy rule that you are adding specifies a tag for an image. Acceptable options are tagged, untagged, or any. If you specify any, then all images have the rule evaluated against them. If you specify tagged, then you must also specify a tagPrefixList value. If you specify untagged, then you must omit tagPrefixList.
- description string
- Describes the purpose of a rule within a lifecycle policy.
- maximum
Age numberLimit - The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
- maximum
Number numberOf Images - The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
- tag
Prefix string[]List - A list of image tag prefixes on which to take action with your lifecycle policy. Only used if you specified "tagStatus": "tagged". For example, if your images are tagged as prod, prod1, prod2, and so on, you would use the tag prefix prod to specify all of them. If you specify multiple tags, only the images with all specified tags are selected.
- tag_
status LifecycleTag Status - Determines whether the lifecycle policy rule that you are adding specifies a tag for an image. Acceptable options are tagged, untagged, or any. If you specify any, then all images have the rule evaluated against them. If you specify tagged, then you must also specify a tagPrefixList value. If you specify untagged, then you must omit tagPrefixList.
- description str
- Describes the purpose of a rule within a lifecycle policy.
- maximum_
age_ floatlimit - The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
- maximum_
number_ floatof_ images - The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
- tag_
prefix_ Sequence[str]list - A list of image tag prefixes on which to take action with your lifecycle policy. Only used if you specified "tagStatus": "tagged". For example, if your images are tagged as prod, prod1, prod2, and so on, you would use the tag prefix prod to specify all of them. If you specify multiple tags, only the images with all specified tags are selected.
- "any" | "untagged" | "tagged"
- Determines whether the lifecycle policy rule that you are adding specifies a tag for an image. Acceptable options are tagged, untagged, or any. If you specify any, then all images have the rule evaluated against them. If you specify tagged, then you must also specify a tagPrefixList value. If you specify untagged, then you must omit tagPrefixList.
- description String
- Describes the purpose of a rule within a lifecycle policy.
- maximum
Age NumberLimit - The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
- maximum
Number NumberOf Images - The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
- tag
Prefix List<String>List - A list of image tag prefixes on which to take action with your lifecycle policy. Only used if you specified "tagStatus": "tagged". For example, if your images are tagged as prod, prod1, prod2, and so on, you would use the tag prefix prod to specify all of them. If you specify multiple tags, only the images with all specified tags are selected.
LifecycleTagStatus, LifecycleTagStatusArgs
- Any
- anyEvaluate rule against all images
- Untagged
- untaggedOnly evaluate rule against untagged images
- Tagged
- taggedOnly evaluated rule against images with specified prefixes
- Lifecycle
Tag Status Any - anyEvaluate rule against all images
- Lifecycle
Tag Status Untagged - untaggedOnly evaluate rule against untagged images
- Lifecycle
Tag Status Tagged - taggedOnly evaluated rule against images with specified prefixes
- Any
- anyEvaluate rule against all images
- Untagged
- untaggedOnly evaluate rule against untagged images
- Tagged
- taggedOnly evaluated rule against images with specified prefixes
- Any
- anyEvaluate rule against all images
- Untagged
- untaggedOnly evaluate rule against untagged images
- Tagged
- taggedOnly evaluated rule against images with specified prefixes
- ANY
- anyEvaluate rule against all images
- UNTAGGED
- untaggedOnly evaluate rule against untagged images
- TAGGED
- taggedOnly evaluated rule against images with specified prefixes
- "any"
- anyEvaluate rule against all images
- "untagged"
- untaggedOnly evaluate rule against untagged images
- "tagged"
- taggedOnly evaluated rule against images with specified prefixes
Package Details
- Repository
- AWSx (Pulumi Crosswalk for AWS) pulumi/pulumi-awsx
- License
- Apache-2.0