Skip to content

Commit

Permalink
Adds ECR repository creation and tests. Closes #1, #2
Browse files Browse the repository at this point in the history
  • Loading branch information
ariel17 committed May 9, 2023
1 parent c4061fd commit d51863b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
3 changes: 2 additions & 1 deletion efimeral/lib/efimeral-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ export class EfimeralStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);

const cfnPublicRepository = new ecr.CfnPublicRepository(this, 'public-efimeral-boxes', {
const repository = new ecr.Repository(this, 'efimeral-repository', {
repositoryName: 'efimeral-boxes',
imageScanOnPush: true,
});
}
}
29 changes: 15 additions & 14 deletions efimeral/test/efimeral.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
// import * as cdk from 'aws-cdk-lib';
// import { Template } from 'aws-cdk-lib/assertions';
// import * as Efimeral from '../lib/efimeral-stack';
import * as cdk from 'aws-cdk-lib';
import { Template } from 'aws-cdk-lib/assertions';
import * as Efimeral from '../lib/efimeral-stack';

// example test. To run these tests, uncomment this file along with the
// example resource in lib/efimeral-stack.ts
test('SQS Queue Created', () => {
// const app = new cdk.App();
// // WHEN
// const stack = new Efimeral.EfimeralStack(app, 'MyTestStack');
// // THEN
// const template = Template.fromStack(stack);
test('ECR repository created', () => {
const app = new cdk.App();
// WHEN
const stack = new Efimeral.EfimeralStack(app, 'MyTestStack');
// THEN
const template = Template.fromStack(stack);

// template.hasResourceProperties('AWS::SQS::Queue', {
// VisibilityTimeout: 300
// });
template.hasResourceProperties('AWS::ECR::Repository', {
RepositoryName: "efimeral-boxes",
ImageScanningConfiguration: {
ScanOnPush: true,
}
});
});

0 comments on commit d51863b

Please sign in to comment.