-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(scheduler-targets-alpha): InspectorStartAssessmentRun
Target
#27850
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Just some minor adjustments in my opinion.
export class InspectorStartAssessmentRun extends ScheduleTargetBase implements IScheduleTarget { | ||
constructor( | ||
private readonly template: CfnAssessmentTemplate, | ||
private readonly props: ScheduleTargetBaseProps, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private readonly props: ScheduleTargetBaseProps, | |
private readonly props: ScheduleTargetBaseProps = {}, |
Let's provide a default object to simplify constructor initialization.
@@ -27,6 +27,7 @@ The following targets are supported: | |||
1. `targets.LambdaInvoke`: [Invoke an AWS Lambda function](#invoke-a-lambda-function)) | |||
2. `targets.StepFunctionsStartExecution`: [Start an AWS Step Function](#start-an-aws-step-function) | |||
3. `targets.CodeBuildStartBuild`: [Start a CodeBuild job](#start-a-codebuild-job) | |||
4. `targets.InspectorStartAssessmentRun`: [Start an Amazon Inspector assessment run](#start-an-aws-inspector-assessment-run) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4. `targets.InspectorStartAssessmentRun`: [Start an Amazon Inspector assessment run](#start-an-aws-inspector-assessment-run) | |
4. `targets.InspectorStartAssessmentRun`: [Start an Amazon Inspector assessment run](#start-an-amazon-inspector-assessment-run) |
@@ -2,3 +2,4 @@ export * from './target'; | |||
export * from './lambda-invoke'; | |||
export * from './stepfunctions-start-execution'; | |||
export * from './codebuild-start-build'; | |||
export * from './inspector-start-assessment-run'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please order these alphabetically?
Thanks! I changed them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Just some minor adjustment after setting a default value for the props
parameter and it will be good to go for me.
|
||
new Schedule(this, 'Schedule', { | ||
schedule: ScheduleExpression.rate(Duration.minutes(60)), | ||
target: new targets.InspectorStartAssessmentRun(assessmentTemplate, {}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target: new targets.InspectorStartAssessmentRun(assessmentTemplate, {}), | |
target: new targets.InspectorStartAssessmentRun(assessmentTemplate), |
Properties are now optional, let's keep the documentation more concise.
|
||
new scheduler.Schedule(stack, 'Schedule', { | ||
schedule: scheduler.ScheduleExpression.rate(cdk.Duration.minutes(10)), | ||
target: new InspectorStartAssessmentRun(assessmentTemplate, {}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target: new InspectorStartAssessmentRun(assessmentTemplate, {}), | |
target: new InspectorStartAssessmentRun(assessmentTemplate), |
}); | ||
|
||
test('creates IAM role and IAM policy for inspector assessment template in the same account', () => { | ||
const inspectorTarget = new InspectorStartAssessmentRun(template, {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const inspectorTarget = new InspectorStartAssessmentRun(template, {}); | |
const inspectorTarget = new InspectorStartAssessmentRun(template); |
Can you please remove the optional parameters here as well? where possible.
Thanks! I missed the modification. I changed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
…cheduler-targets-inspector
Signed-off-by: Vinayak Kukreja <vinakuk@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @go-to-k , thank you for this contribution.
I have just updated the ReadMe. I ran the integ test and added the information that helped me running these.
InspectorStartAssessmentRun
Target
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…ws#27850) This PR adds InspectorStartAssessmentRun Target for EventBridge Scheduler. In [the issue](aws#27453), the `inspector.CfnAssessmentTarget` is used in the `InspectorStartAssessmentRun`. But it should be a `CfnAssessmentTemplate` so I fixed. ```ts export class InspectorStartAssessmentRun extends ScheduleTargetBase implements IScheduleTarget { constructor( private readonly target: inspector.CfnAssessmentTarget, // <- here private readonly props: ScheduleTargetBaseProps, ) { ``` Closes aws#27453. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This PR adds InspectorStartAssessmentRun Target for EventBridge Scheduler.
In the issue, the
inspector.CfnAssessmentTarget
is used in theInspectorStartAssessmentRun
. But it should be aCfnAssessmentTemplate
so I fixed.Closes #27453.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license