Skip to content

Commit

Permalink
Update ecr readme with emptyOnDelete
Browse files Browse the repository at this point in the history
  • Loading branch information
markmansur committed Dec 2, 2023
1 parent dc5ac6d commit 5c3ee91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export class DefaultStagingStack extends Stack implements IStagingResources {
}],
...(this.autoDeleteStagingAssets ? {
removalPolicy: RemovalPolicy.DESTROY,
autoDeleteImages: true,
emptyOnDelete: true,
} : {
removalPolicy: RemovalPolicy.RETAIN,
}),
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-ecr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ policy is set to `RemovalPolicy.DESTROY`, the repository will be deleted as long
as it does not contain any images.

To override this and force all images to get deleted during repository deletion,
enable the`autoDeleteImages` option.
enable the`emptyOnDelete` option.

```ts
const repository = new ecr.Repository(this, 'MyTempRepo', {
removalPolicy: RemovalPolicy.DESTROY,
autoDeleteImages: true,
emptyOnDelete: true,
});
```

Expand Down

0 comments on commit 5c3ee91

Please sign in to comment.