1. Packages
  2. AWSx (Pulumi Crosswalk for AWS)
  3. API Docs
  4. ecr
  5. Repository
AWSx (Pulumi Crosswalk for AWS) v2.8.0 published on Friday, Apr 19, 2024 by Pulumi

awsx.ecr.Repository

Explore with Pulumi AI

awsx logo
AWSx (Pulumi Crosswalk for AWS) v2.8.0 published on Friday, Apr 19, 2024 by Pulumi

    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?: CustomResourceOptions);
    @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, CustomResourceOptions? opts = null)
    public Repository(String name, RepositoryArgs args)
    public Repository(String name, RepositoryArgs args, CustomResourceOptions 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 CustomResourceOptions
    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 CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RepositoryArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    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" },
        },
    });
    
    Coming soon!
    
    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=[aws.ecr.RepositoryEncryptionConfigurationArgs(
            encryption_type="string",
            kms_key="string",
        )],
        force_delete=False,
        image_scanning_configuration=aws.ecr.RepositoryImageScanningConfigurationArgs(
            scan_on_push=False,
        ),
        image_tag_mutability="string",
        lifecycle_policy=awsx.ecr.LifecyclePolicyArgs(
            rules=[awsx.ecr.LifecyclePolicyRuleArgs(
                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

    The Repository resource accepts the following input properties:

    EncryptionConfigurations List<Pulumi.Aws.Ecr.Inputs.RepositoryEncryptionConfiguration>
    Encryption configuration for the repository. See below for schema.
    ForceDelete bool
    If true, will delete the repository even if it contains images. Defaults to false.
    ImageScanningConfiguration Pulumi.Aws.Ecr.Inputs.RepositoryImageScanningConfiguration

    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.

    ImageTagMutability string
    The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
    LifecyclePolicy LifecyclePolicyArgs
    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.
    Tags 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.
    EncryptionConfigurations RepositoryEncryptionConfigurationArgs
    Encryption configuration for the repository. See below for schema.
    ForceDelete bool
    If true, will delete the repository even if it contains images. Defaults to false.
    ImageScanningConfiguration RepositoryImageScanningConfigurationArgs

    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.

    ImageTagMutability string
    The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
    LifecyclePolicy LifecyclePolicyArgs
    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.
    Tags 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.
    encryptionConfigurations List<RepositoryEncryptionConfiguration>
    Encryption configuration for the repository. See below for schema.
    forceDelete Boolean
    If true, will delete the repository even if it contains images. Defaults to false.
    imageScanningConfiguration RepositoryImageScanningConfiguration

    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.

    imageTagMutability String
    The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
    lifecyclePolicy LifecyclePolicyArgs
    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.
    tags 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.
    encryptionConfigurations pulumiAws.types.input.RepositoryEncryptionConfiguration[]
    Encryption configuration for the repository. See below for schema.
    forceDelete boolean
    If true, will delete the repository even if it contains images. Defaults to false.
    imageScanningConfiguration pulumiAws.types.input.RepositoryImageScanningConfiguration

    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.

    imageTagMutability string
    The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
    lifecyclePolicy LifecyclePolicyArgs
    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.
    tags {[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.RepositoryEncryptionConfigurationArgs]
    Encryption configuration for the repository. See below for schema.
    force_delete bool
    If true, will delete the repository even if it contains images. Defaults to false.
    image_scanning_configuration pulumi_aws.ecr.RepositoryImageScanningConfigurationArgs

    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_mutability str
    The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
    lifecycle_policy LifecyclePolicyArgs
    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.
    tags 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.
    encryptionConfigurations List<Property Map>
    Encryption configuration for the repository. See below for schema.
    forceDelete Boolean
    If true, will delete the repository even if it contains images. Defaults to false.
    imageScanningConfiguration Property Map

    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.

    imageTagMutability String
    The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.
    lifecyclePolicy 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.
    tags 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:

    AwsRepository 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 pulumiAws.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<LifecyclePolicyRule>
    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 of any, then it will have the highest priority.
    Skip bool
    Skips creation of the policy if set to true.
    Rules []LifecyclePolicyRule
    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 of any, then it will have the highest priority.
    Skip bool
    Skips creation of the policy if set to true.
    rules List<LifecyclePolicyRule>
    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 of any, then it will have the highest priority.
    skip Boolean
    Skips creation of the policy if set to true.
    rules LifecyclePolicyRule[]
    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 of any, then it will have the highest priority.
    skip boolean
    Skips creation of the policy if set to true.
    rules Sequence[LifecyclePolicyRule]
    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 of any, 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 of any, then it will have the highest priority.
    skip Boolean
    Skips creation of the policy if set to true.

    LifecyclePolicyRule, LifecyclePolicyRuleArgs

    TagStatus Pulumi.Awsx.Ecr.LifecycleTagStatus
    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.
    MaximumAgeLimit double
    The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
    MaximumNumberOfImages double
    The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
    TagPrefixList List<string>
    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.
    TagStatus LifecycleTagStatus
    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.
    MaximumAgeLimit float64
    The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
    MaximumNumberOfImages float64
    The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
    TagPrefixList []string
    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.
    tagStatus LifecycleTagStatus
    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.
    maximumAgeLimit Double
    The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
    maximumNumberOfImages Double
    The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
    tagPrefixList List<String>
    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.
    tagStatus LifecycleTagStatus
    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.
    maximumAgeLimit number
    The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
    maximumNumberOfImages number
    The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
    tagPrefixList string[]
    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 LifecycleTagStatus
    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_limit float
    The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
    maximum_number_of_images float
    The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
    tag_prefix_list Sequence[str]
    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.
    tagStatus "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.
    maximumAgeLimit Number
    The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
    maximumNumberOfImages Number
    The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
    tagPrefixList List<String>
    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
    LifecycleTagStatusAny
    anyEvaluate rule against all images
    LifecycleTagStatusUntagged
    untaggedOnly evaluate rule against untagged images
    LifecycleTagStatusTagged
    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
    awsx logo
    AWSx (Pulumi Crosswalk for AWS) v2.8.0 published on Friday, Apr 19, 2024 by Pulumi