Describe the feature
App Runner's CPU and Memory have a fixed input patterns in CloudFormation.
However, in CDK's L2 Construct (alpha), the input format is free (like Some vCPU). Tests are as follows (packages/@aws-cdk/aws-apprunner-alpha/test/service.test.ts).
test('custom cpu and memory units are allowed', () => {
// GIVEN
const app = new cdk.App();
const stack = new cdk.Stack(app, 'demo-stack');
// WHEN
new apprunner.Service(stack, 'DemoService', {
source: apprunner.Source.fromEcrPublic({
imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
}),
cpu: apprunner.Cpu.of('Some vCPU'),
memory: apprunner.Memory.of('Some GB'),
});
// THEN
Template.fromStack(stack).hasResourceProperties('AWS::AppRunner::Service', {
InstanceConfiguration: {
Cpu: 'Some vCPU',
Memory: 'Some GB',
},
NetworkConfiguration: {
EgressConfiguration: {
EgressType: 'DEFAULT',
},
},
});
});
I would like to validate an invalid format before deploy.
Use Case
Incorrect values can be detected at the synth stage before deployment.
Proposed Solution
Create a private method for validation and call it at the constructor in the Service class.
Other Information
CFn output is the following message when deploy errors.
Properties validation failed for resource AppRunnerConstructAppRunnerService123456789 with message: #/InstanceConfiguration/Cpu: failed validation constraint for keyword [pattern]
Acknowledgements
CDK version used
v2.82.0
Environment details (OS name and version, etc.)
MacOS Ventura 13.2
Describe the feature
App Runner's CPU and Memory have a fixed input patterns in CloudFormation.
However, in CDK's L2 Construct (alpha), the input format is free (like
Some vCPU). Tests are as follows (packages/@aws-cdk/aws-apprunner-alpha/test/service.test.ts).I would like to validate an invalid format before deploy.
Use Case
Incorrect values can be detected at the synth stage before deployment.
Proposed Solution
Create a private method for validation and call it at the constructor in the
Serviceclass.Other Information
CFn output is the following message when deploy errors.
Properties validation failed for resource AppRunnerConstructAppRunnerService123456789 with message: #/InstanceConfiguration/Cpu: failed validation constraint for keyword [pattern]Acknowledgements
CDK version used
v2.82.0
Environment details (OS name and version, etc.)
MacOS Ventura 13.2