refactor(apprunner): consolidate name validations for App Runner Resources and improve error messages#32062
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32062 +/- ##
=======================================
Coverage 77.18% 77.18%
=======================================
Files 105 105
Lines 7161 7161
Branches 1312 1312
=======================================
Hits 5527 5527
Misses 1454 1454
Partials 180 180
Flags with carried forward coverage won't be shown. Click here to find out more.
|
badmintoncryer
left a comment
There was a problem hiding this comment.
I have made just one comment! Please check it!
| ); | ||
| } | ||
|
|
||
| if (!/^[A-Za-z0-9][A-Za-z0-9\-_]*$/.test(props.vpcConnectorName)) { |
There was a problem hiding this comment.
From Cfn document, it seems that hyphen is not allowed for the VPC Connector name.
^[A-Za-z0-9][A-Za-z0-9-\\_]{3,39}$
There was a problem hiding this comment.
@badmintoncryer
Thanks.
I think regex pattern in Cfn document is wrong.
I successfully created a VPC Connector with a name containing hyphens.
According to the management console, VPC connector names can only contain alphanumeric characters, hyphens, and underscores.
While the regex pattern in the CFn documentation indicates that backslashes are allowed, in practice they are not permitted.
I would like to provide feedback regarding this documentation to AWS team.
There was a problem hiding this comment.
Thank you for your information! I understand.
gracelu0
left a comment
There was a problem hiding this comment.
LGTM other than 2 typos, will approve once fixed :)
packages/@aws-cdk/aws-apprunner-alpha/test/obserbability-configuration.test.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-apprunner-alpha/test/vpc-ingress-connection.test.ts
Outdated
Show resolved
Hide resolved
…guration.test.ts Co-authored-by: Grace Luo <54298030+gracelu0@users.noreply.github.com>
…ion.test.ts Co-authored-by: Grace Luo <54298030+gracelu0@users.noreply.github.com>
|
@gracelu0 |
gracelu0
left a comment
There was a problem hiding this comment.
just two more typos sorry I missed them earlier 😅
packages/@aws-cdk/aws-apprunner-alpha/test/vpc-connector.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Grace Luo <54298030+gracelu0@users.noreply.github.com>
Co-authored-by: Grace Luo <54298030+gracelu0@users.noreply.github.com>
|
@gracelu0 |
|
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). |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
N/A
Reason for this change
Consolidate name validations for App Runner Resources and improve error messages.
Description of changes
autoScalingConfigurationNameinAutoScalingConfigurationobservabilityConfigurationNameinObservabilityConfigurationNamevpcIngressConnectionNameinVpcIngressConnectionNameserviceNameinServiceName. (Ref: CFn document)vpcConnectorNameinVpcConnectorName. (Ref: CFn document)Description of how you validated changes
Modify and add unit tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license