Registry for container images
TypeScript/JavaScript:
npm i @cloudcomponents/cdk-container-registry
Python:
pip install cloudcomponents.cdk-container-registry
import { Construct, Stack, StackProps } from '@aws-cdk/core';
import { Topic } from '@aws-cdk/aws-sns';
import { EmailSubscription } from '@aws-cdk/aws-sns-subscriptions';
import {
ImageRepository,
Severity,
} from '@cloudcomponents/cdk-container-registry';
export class ImageRepositoryStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
const alarmTopic = new Topic(this, 'Topic');
alarmTopic.addSubscription(
new EmailSubscription(process.env.DEVSECOPS_TEAM_EMAIL as string),
);
const imageRepository = new ImageRepository(this, 'ImageRepository', {
forceDelete: true, //Only for tests
imageScanOnPush: true,
});
imageRepository.onFinding('finding', {
severity: Severity.HIGH,
alarmTopic,
});
}
}
See API.md.
See more complete examples.