Skip to content
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

refactor(apprunner): consolidate name validations for App Runner Resources and improve error messages #32062

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mazyu36
Copy link
Contributor

@mazyu36 mazyu36 commented Nov 8, 2024

Issue # (if applicable)

N/A

Reason for this change

Consolidate name validations for App Runner Resources and improve error messages.

Description of changes

  • Split regex-pattern check and length check to be more user-friendly.
    • autoScalingConfigurationName in AutoScalingConfiguration
    • observabilityConfigurationName in ObservabilityConfigurationName
    • vpcIngressConnectionName in VpcIngressConnectionName
  • Add name validations.

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

@github-actions github-actions bot added the p2 label Nov 8, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team November 8, 2024 07:39
@github-actions github-actions bot added the distinguished-contributor [Pilot] contributed 50+ PRs to the CDK label Nov 8, 2024
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Nov 8, 2024
Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.19%. Comparing base (6bb142e) to head (bd7a3c9).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #32062   +/-   ##
=======================================
  Coverage   77.19%   77.19%           
=======================================
  Files         105      105           
  Lines        7164     7164           
  Branches     1311     1311           
=======================================
  Hits         5530     5530           
  Misses       1454     1454           
  Partials      180      180           
Flag Coverage Δ
suite.unit 77.19% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk 77.19% <ø> (ø)

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: bd7a3c9
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@badmintoncryer badmintoncryer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made just one comment! Please check it!

);
}

if (!/^[A-Za-z0-9][A-Za-z0-9\-_]*$/.test(props.vpcConnectorName)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}$

Copy link
Contributor Author

@mazyu36 mazyu36 Nov 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@badmintoncryer
Thanks.

I think regex pattern in Cfn document is wrong.
I successfully created a VPC Connector with a name containing hyphens.

スクリーンショット 2024-11-16 18 13 54

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.

image

I would like to provide feedback regarding this documentation to AWS team.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your information! I understand.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Nov 15, 2024
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2 pr/needs-maintainer-review This PR needs a review from a Core Team Member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants