Skip to content

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

Merged
mergify[bot] merged 10 commits intoaws:mainfrom
mazyu36:apprunner-refactor-name-validation
Nov 19, 2024
Merged

refactor(apprunner): consolidate name validations for App Runner Resources and improve error messages#32062
mergify[bot] merged 10 commits intoaws:mainfrom
mazyu36:apprunner-refactor-name-validation

Conversation

@mazyu36
Copy link
Copy Markdown
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
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.18%. Comparing base (49b5afd) to head (68341e3).
Report is 1 commits behind head on main.

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           
Flag Coverage Δ
suite.unit 77.18% <ø> (ø)

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

Components Coverage Δ
packages/aws-cdk 77.18% <ø> (ø)
---- 🚨 Try these New Features:

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy link
Copy Markdown
Contributor

@gracelu0 gracelu0 left a comment

Choose a reason for hiding this comment

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

LGTM other than 2 typos, will approve once fixed :)

mazyu36 and others added 3 commits November 19, 2024 09:45
…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>
@mazyu36
Copy link
Copy Markdown
Contributor Author

mazyu36 commented Nov 19, 2024

@gracelu0
Thanks! I've updated.

Copy link
Copy Markdown
Contributor

@gracelu0 gracelu0 left a comment

Choose a reason for hiding this comment

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

just two more typos sorry I missed them earlier 😅

mazyu36 and others added 2 commits November 19, 2024 10:50
Co-authored-by: Grace Luo <54298030+gracelu0@users.noreply.github.com>
Co-authored-by: Grace Luo <54298030+gracelu0@users.noreply.github.com>
@mazyu36
Copy link
Copy Markdown
Contributor Author

mazyu36 commented Nov 19, 2024

@gracelu0
Oops...Sorry, I've fixed again.

@mazyu36 mazyu36 requested a review from gracelu0 November 19, 2024 03:02
Copy link
Copy Markdown
Contributor

@gracelu0 gracelu0 left a comment

Choose a reason for hiding this comment

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

Thank you!

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Nov 19, 2024

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-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Nov 19, 2024
@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

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

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

@mergify mergify bot merged commit 5e835f3 into aws:main Nov 19, 2024
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Nov 19, 2024

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).

@github-actions
Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 19, 2024
@mazyu36 mazyu36 deleted the apprunner-refactor-name-validation branch November 19, 2024 22:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants