chore(appconfig): refactor README and integ tests#29017
chore(appconfig): refactor README and integ tests#29017mergify[bot] merged 5 commits intoaws:mainfrom
Conversation
kaizencc
left a comment
There was a problem hiding this comment.
This is lovely! I like the new storyline. Just have a few things here and there
| Environment monitors also support L1 CfnEnvironment.MonitorsProperty constructs. However, this is not the recommended approach | ||
| for CloudWatch alarms because a role will not be auto-generated if not provided. |
There was a problem hiding this comment.
| Environment monitors also support L1 CfnEnvironment.MonitorsProperty constructs. However, this is not the recommended approach | |
| for CloudWatch alarms because a role will not be auto-generated if not provided. | |
| Environment monitors also support L1 `CfnEnvironment.MonitorsProperty` constructs. However, this is not the recommended approach | |
| for CloudWatch alarms because a role will not be auto-generated if not provided. |
I actually have a few issues with this section:
- the sentence should mention how, i.e. by using the
fromCfnMonitorsPropertymethod. - however, I am not a fan of this approach at all. am I missing some context about why this method was added in the first place? CDK doesn't typically encourage this type of L1 method on L2 so I want to dig a bit deeper on why its necessary at all
- finally, looking at the code, it seems like the issue with
fromCfnMonitorsPropertyis that it will fail entirely if a role is not provided, likely in a confusing manner (because errors due to!don't tend to be very descriptive). Looking at this code below:
public static fromCfnMonitorsProperty(monitorsProperty: CfnEnvironment.MonitorsProperty): Monitor {
return {
alarmArn: monitorsProperty.alarmArn!,
alarmRoleArn: monitorsProperty.alarmRoleArn,
monitorType: MonitorType.CFN_MONITORS_PROPERTY,
};
}I think, if we have a reason to keep this method, it should be updated to (to avoid ! entirely):
public static fromCfnMonitorsProperty(monitorsProperty: CfnEnvironment.MonitorsProperty): Monitor {
if (monitorsProperty.alarmArn === undefined) { throw new Error('need this prop'); }
return {
alarmArn: monitorsProperty.alarmArn,
alarmRoleArn: monitorsProperty.alarmRoleArn,
monitorType: MonitorType.CFN_MONITORS_PROPERTY,
};
}There was a problem hiding this comment.
updated with suggested changes
Pull request has been modified.
| * @param monitorsProperty The monitors property. | ||
| */ | ||
| public static fromCfnMonitorsProperty(monitorsProperty: CfnEnvironment.MonitorsProperty): Monitor { | ||
| if (monitorsProperty.alarmArn === undefined) { throw new Error('need this prop'); } |
There was a problem hiding this comment.
sorry! we need a better error message than this. This was a placeholder :)
|
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). |
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). |
### Reason for this change Making changes after API review. ### Description of changes Refactor README and integ tests. ### Description of how you validated changes ### Checklist - [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Reason for this change
Making changes after API review.
Description of changes
Refactor README and integ tests.
Description of how you validated changes
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license