-
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
chore(apprunner): add validation cpu and memory for app runner #25877
chore(apprunner): add validation cpu and memory for app runner #25877
Conversation
I reverted this commit for the following reasons.
|
The AWS CodeBuild CI Report failed with internal health check errors...
|
I would try to make it more type safe, but guess what? It is a union type of input-able values, and since it is string-compatible, it does not affect existing implementations and is not a destructive change. If not, I will revert to the previous commit. Considering languages other than TypeScript (e.g. Python), maybe the previous one is better? |
/** | ||
* CPU input patterns for App Runner service | ||
*/ | ||
export type CpuPatternType = '256' | '512' | '1024' | '2048' | '4096' | '0.25 vCPU' | '0.5 vCPU' | '1 vCPU' | '2 vCPU' | '4 vCPU' |
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.
As you have guessed, this doesn't work for languages other than TypeScript. Take a look at:
aws-cdk/packages/@aws-cdk/aws-apprunner-alpha/lib/service.ts
Lines 31 to 55 in 75d1853
export class Cpu { | |
/** | |
* 0.25 vCPU | |
*/ | |
public static readonly QUARTER_VCPU = Cpu.of('0.25 vCPU'); | |
/** | |
* 0.5 vCPU | |
*/ | |
public static readonly HALF_VCPU = Cpu.of('0.5 vCPU'); | |
/** | |
* 1 vCPU | |
*/ | |
public static readonly ONE_VCPU = Cpu.of('1 vCPU') | |
/** | |
* 2 vCPU | |
*/ | |
public static readonly TWO_VCPU = Cpu.of('2 vCPU') | |
/** | |
* 4 vCPU | |
*/ | |
public static readonly FOUR_VCPU = Cpu.of('4 vCPU') |
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.
/** | ||
* Memory input patterns for App Runner service | ||
*/ | ||
export type MemoryPatternType = '512' | '1024' | '2048' | '3072' | '4096' | '6144' | '8192' | '10240' | '12288' | '0.5 GB' | '1 GB' | '2 GB' | '3 GB' | '4 GB' | '6 GB' | '8 GB' | '10 GB' | '12 GB'; |
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.
Same kind of solution could be used here.
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.
I reverted same as above comments.
Pull request has been modified.
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). |
This PR adds the same validation for the App Runner's CPU and Memory values as CloudFormation's input patterns.
Closes #25872
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license