RepositoryAutoDeleteImages Mixin
ECR-specific Mixin to force-delete all images from a repository when the repository is removed from the stack or when the stack is deleted.
Sets the emptyOnDelete property on the repository.
| Source | aws-ecr/lib/mixins/repository.ts |
|---|---|
| Type last changed |
Example
ts
new ecr.CfnRepository(this, 'Repo')
.with(new ecr.mixins.RepositoryAutoDeleteImages());
python
ecr.CfnRepository(self, "Repo").with(ecr.mixins.RepositoryAutoDeleteImages())
java
new CfnRepository(this, "Repo").with(new RepositoryAutoDeleteImages());
csharp
// Install: dotnet add package Amazon.CDK.Lib
new CfnRepository(this, "Repo").With(new Mixins.RepositoryAutoDeleteImages());
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
ecr.NewCfnRepository(this, jsii.String("Repo")).With(mixins.NewRepositoryAutoDeleteImages())
Initializer
ts
new RepositoryAutoDeleteImages()
python
RepositoryAutoDeleteImages()
java
new RepositoryAutoDeleteImages()
csharp
new RepositoryAutoDeleteImages()
go
NewRepositoryAutoDeleteImages()
Methods
applyTo(construct: IConstruct): voiddef apply_to(self, construct: IConstruct) -> Nonepublic void applyTo(IConstruct construct)public void ApplyTo(IConstruct construct)func ApplyTo(Construct IConstruct) #Applies the mixin functionality to the target construct.
isMixin(x: any): boolean@staticmethod def is_mixin(x: Any) -> boolpublic static Boolean isMixin(Object x)public static bool IsMixin(object x)func IsMixin(X interface{}) *bool static #Checks if `x` is a Mixin.
1 parameter · returns
Parameters
xxxxX— Any object.
Returns: true if x is an object created from a class which extends Mixin.
supports(construct: IConstruct): booleandef supports(self, construct: IConstruct) -> boolpublic Boolean supports(IConstruct construct)public bool Supports(IConstruct construct)func Supports(Construct IConstruct) *bool #Determines whether this mixin can be applied to the given construct.