forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aws-ecr): add onImageScanCompleted() support (aws#4819)
* feat(aws-ecr): add onImageScanCompleted() support(fix aws#4818) * fix detail validation in the eventPattern payload. * fix awslint errors * - minor update the repository.ts w/o touching the rule.ts
- Loading branch information
1 parent
6dba637
commit 5bdd9bb
Showing
4 changed files
with
344 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
packages/@aws-cdk/aws-ecr/test/integ.imagescan.expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"Resources": { | ||
"Repo02AC86CF": { | ||
"Type": "AWS::ECR::Repository", | ||
"UpdateReplacePolicy": "Retain", | ||
"DeletionPolicy": "Retain" | ||
}, | ||
"RepoImageScanComplete7BC71935": { | ||
"Type": "AWS::Events::Rule", | ||
"Properties": { | ||
"EventPattern": { | ||
"source": [ | ||
"aws.ecr" | ||
], | ||
"detail-type": [ | ||
"ECR Image Scan" | ||
], | ||
"detail": { | ||
"repository-name": [ | ||
{ | ||
"Ref": "Repo02AC86CF" | ||
} | ||
], | ||
"scan-status": [ | ||
"COMPLETE" | ||
] | ||
} | ||
}, | ||
"State": "ENABLED" | ||
} | ||
} | ||
}, | ||
"Outputs": { | ||
"RepositoryURI": { | ||
"Value": { | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
{ | ||
"Fn::Select": [ | ||
4, | ||
{ | ||
"Fn::Split": [ | ||
":", | ||
{ | ||
"Fn::GetAtt": [ | ||
"Repo02AC86CF", | ||
"Arn" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
".dkr.ecr.", | ||
{ | ||
"Fn::Select": [ | ||
3, | ||
{ | ||
"Fn::Split": [ | ||
":", | ||
{ | ||
"Fn::GetAtt": [ | ||
"Repo02AC86CF", | ||
"Arn" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
".", | ||
{ | ||
"Ref": "AWS::URLSuffix" | ||
}, | ||
"/", | ||
{ | ||
"Ref": "Repo02AC86CF" | ||
} | ||
] | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import cdk = require('@aws-cdk/core'); | ||
import ecr = require('../lib'); | ||
|
||
const app = new cdk.App(); | ||
const stack = new cdk.Stack(app, 'aws-ecr-integ-stack'); | ||
|
||
const repo = new ecr.Repository(stack, 'Repo'); | ||
repo.onImageScanCompleted('ImageScanComplete', { | ||
}); | ||
|
||
new cdk.CfnOutput(stack, 'RepositoryURI', { | ||
value: repo.repositoryUri | ||
}); | ||
|
||
app.synth(); |
Oops, something went wrong.