aws logo
AWS Classic v5.41.0, May 15 23

aws.ecr.Repository

Explore with Pulumi AI

Provides an Elastic Container Registry Repository.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var foo = new Aws.Ecr.Repository("foo", new()
    {
        ImageScanningConfiguration = new Aws.Ecr.Inputs.RepositoryImageScanningConfigurationArgs
        {
            ScanOnPush = true,
        },
        ImageTagMutability = "MUTABLE",
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecr.NewRepository(ctx, "foo", &ecr.RepositoryArgs{
			ImageScanningConfiguration: &ecr.RepositoryImageScanningConfigurationArgs{
				ScanOnPush: pulumi.Bool(true),
			},
			ImageTagMutability: pulumi.String("MUTABLE"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ecr.Repository;
import com.pulumi.aws.ecr.RepositoryArgs;
import com.pulumi.aws.ecr.inputs.RepositoryImageScanningConfigurationArgs;
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) {
        var foo = new Repository("foo", RepositoryArgs.builder()        
            .imageScanningConfiguration(RepositoryImageScanningConfigurationArgs.builder()
                .scanOnPush(true)
                .build())
            .imageTagMutability("MUTABLE")
            .build());

    }
}
import pulumi
import pulumi_aws as aws

foo = aws.ecr.Repository("foo",
    image_scanning_configuration=aws.ecr.RepositoryImageScanningConfigurationArgs(
        scan_on_push=True,
    ),
    image_tag_mutability="MUTABLE")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const foo = new aws.ecr.Repository("foo", {
    imageScanningConfiguration: {
        scanOnPush: true,
    },
    imageTagMutability: "MUTABLE",
});
resources:
  foo:
    type: aws:ecr:Repository
    properties:
      imageScanningConfiguration:
        scanOnPush: true
      imageTagMutability: MUTABLE

Create Repository Resource

new Repository(name: string, args?: RepositoryArgs, opts?: CustomResourceOptions);
@overload
def Repository(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               encryption_configurations: Optional[Sequence[RepositoryEncryptionConfigurationArgs]] = None,
               force_delete: Optional[bool] = None,
               image_scanning_configuration: Optional[RepositoryImageScanningConfigurationArgs] = None,
               image_tag_mutability: Optional[str] = None,
               name: Optional[str] = None,
               tags: Optional[Mapping[str, str]] = None)
@overload
def Repository(resource_name: str,
               args: Optional[RepositoryArgs] = None,
               opts: Optional[ResourceOptions] = 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: aws:ecr:Repository
properties: # The arguments to resource properties.
options: # 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.
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.

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.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 Pulumi.Aws.Ecr.Inputs.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.

ImageTagMutability string

The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.

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.

ImageTagMutability string

The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.

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<RepositoryEncryptionConfigurationArgs>

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 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.

imageTagMutability String

The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.

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 RepositoryEncryptionConfigurationArgs[]

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 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.

imageTagMutability string

The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.

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[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 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.

image_tag_mutability str

The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.

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.

imageTagMutability String

The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.

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:

Arn string

Full ARN of the repository.

Id string

The provider-assigned unique ID for this managed resource.

RegistryId string

The registry ID where the repository was created.

RepositoryUrl string

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

Full ARN of the repository.

Id string

The provider-assigned unique ID for this managed resource.

RegistryId string

The registry ID where the repository was created.

RepositoryUrl string

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

Full ARN of the repository.

id String

The provider-assigned unique ID for this managed resource.

registryId String

The registry ID where the repository was created.

repositoryUrl String

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

Full ARN of the repository.

id string

The provider-assigned unique ID for this managed resource.

registryId string

The registry ID where the repository was created.

repositoryUrl string

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

Full ARN of the repository.

id str

The provider-assigned unique ID for this managed resource.

registry_id str

The registry ID where the repository was created.

repository_url str

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

Full ARN of the repository.

id String

The provider-assigned unique ID for this managed resource.

registryId String

The registry ID where the repository was created.

repositoryUrl String

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Look up Existing Repository Resource

Get an existing Repository 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?: RepositoryState, opts?: CustomResourceOptions): Repository
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        encryption_configurations: Optional[Sequence[RepositoryEncryptionConfigurationArgs]] = None,
        force_delete: Optional[bool] = None,
        image_scanning_configuration: Optional[RepositoryImageScanningConfigurationArgs] = None,
        image_tag_mutability: Optional[str] = None,
        name: Optional[str] = None,
        registry_id: Optional[str] = None,
        repository_url: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> Repository
func GetRepository(ctx *Context, name string, id IDInput, state *RepositoryState, opts ...ResourceOption) (*Repository, error)
public static Repository Get(string name, Input<string> id, RepositoryState? state, CustomResourceOptions? opts = null)
public static Repository get(String name, Output<String> id, RepositoryState 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.
The following state arguments are supported:
Arn string

Full ARN of the repository.

EncryptionConfigurations List<Pulumi.Aws.Ecr.Inputs.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 Pulumi.Aws.Ecr.Inputs.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.

ImageTagMutability string

The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.

Name string

Name of the repository.

RegistryId string

The registry ID where the repository was created.

RepositoryUrl string

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

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.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

Full ARN of the repository.

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.

ImageTagMutability string

The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.

Name string

Name of the repository.

RegistryId string

The registry ID where the repository was created.

RepositoryUrl string

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

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.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

Full ARN of the repository.

encryptionConfigurations List<RepositoryEncryptionConfigurationArgs>

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 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.

imageTagMutability String

The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.

name String

Name of the repository.

registryId String

The registry ID where the repository was created.

repositoryUrl String

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

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.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

Full ARN of the repository.

encryptionConfigurations RepositoryEncryptionConfigurationArgs[]

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 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.

imageTagMutability string

The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.

name string

Name of the repository.

registryId string

The registry ID where the repository was created.

repositoryUrl string

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

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.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

Full ARN of the repository.

encryption_configurations Sequence[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 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.

image_tag_mutability str

The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.

name str

Name of the repository.

registry_id str

The registry ID where the repository was created.

repository_url str

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

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.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

Full ARN of the repository.

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.

imageTagMutability String

The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE.

name String

Name of the repository.

registryId String

The registry ID where the repository was created.

repositoryUrl String

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

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.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Supporting Types

RepositoryEncryptionConfiguration

EncryptionType string

The encryption type to use for the repository. 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 the repository. 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 the repository. 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 the repository. 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 the repository. 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 the repository. 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.

RepositoryImageScanningConfiguration

ScanOnPush bool

Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false).

ScanOnPush bool

Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false).

scanOnPush Boolean

Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false).

scanOnPush boolean

Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false).

scan_on_push bool

Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false).

scanOnPush Boolean

Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false).

Import

ECR Repositories can be imported using the name, e.g.,

 $ pulumi import aws:ecr/repository:Repository service test-service

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.