TagMutability Enum
The tag mutability setting for your repository.
| Source | aws-ecr/lib/repository.ts |
|---|---|
| Type last changed |
Example
ts
// Make all tags immutable except for those starting with 'dev-' or 'test-'
new ecr.Repository(this, 'Repo', {
imageTagMutability: ecr.TagMutability.IMMUTABLE_WITH_EXCLUSION,
imageTagMutabilityExclusionFilters: [
ecr.ImageTagMutabilityExclusionFilter.wildcard('dev-*'),
ecr.ImageTagMutabilityExclusionFilter.wildcard('test-*'),
],
});
python
# Make all tags immutable except for those starting with 'dev-' or 'test-'
ecr.Repository(self, "Repo",
image_tag_mutability=ecr.TagMutability.IMMUTABLE_WITH_EXCLUSION,
image_tag_mutability_exclusion_filters=[
ecr.ImageTagMutabilityExclusionFilter.wildcard("dev-*"),
ecr.ImageTagMutabilityExclusionFilter.wildcard("test-*")
]
)
java
// Make all tags immutable except for those starting with 'dev-' or 'test-'
// Make all tags immutable except for those starting with 'dev-' or 'test-'
Repository.Builder.create(this, "Repo")
.imageTagMutability(TagMutability.IMMUTABLE_WITH_EXCLUSION)
.imageTagMutabilityExclusionFilters(List.of(ImageTagMutabilityExclusionFilter.wildcard("dev-*"), ImageTagMutabilityExclusionFilter.wildcard("test-*")))
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// Make all tags immutable except for those starting with 'dev-' or 'test-'
// Make all tags immutable except for those starting with 'dev-' or 'test-'
new Repository(this, "Repo", new RepositoryProps {
ImageTagMutability = TagMutability.IMMUTABLE_WITH_EXCLUSION,
ImageTagMutabilityExclusionFilters = new [] { ImageTagMutabilityExclusionFilter.Wildcard("dev-*"), ImageTagMutabilityExclusionFilter.Wildcard("test-*") }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// Make all tags immutable except for those starting with 'dev-' or 'test-'
// Make all tags immutable except for those starting with 'dev-' or 'test-'
ecr.NewRepository(this, jsii.String("Repo"), &RepositoryProps{
ImageTagMutability: ecr.TagMutability_IMMUTABLE_WITH_EXCLUSION,
ImageTagMutabilityExclusionFilters: []ImageTagMutabilityExclusionFilter{
ecr.ImageTagMutabilityExclusionFilter_Wildcard(jsii.String("dev-*")),
ecr.ImageTagMutabilityExclusionFilter_*Wildcard(jsii.String("test-*")),
},
})
Members
| Member | Description |
|---|---|
MUTABLE | allow image tags to be overwritten. |
IMMUTABLE | all image tags within the repository will be immutable which will prevent them from being overwritten. |
IMMUTABLE_WITH_EXCLUSION | all image tags within the repository will be immutable, while allowing you to define some filters for tags that can be changed. |
MUTABLE_WITH_EXCLUSION | allow image tags to be overwritten while allowing you to define some filters for tags that should remain unchanged. |
Referenced by
RepositoryProps.imageTagMutabilityimage_tag_mutabilityimageTagMutabilityImageTagMutabilityImageTagMutability