diff --git a/packages/@aws-cdk/aws-appconfig-alpha/README.md b/packages/@aws-cdk/aws-appconfig-alpha/README.md index b29fa5707a26d..f7a658fdc5ab8 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/README.md +++ b/packages/@aws-cdk/aws-appconfig-alpha/README.md @@ -39,7 +39,7 @@ Create an application with a name and description: ```ts new appconfig.Application(this, 'MyApplication', { - name: 'App1', + applicationName: 'App1', description: 'This is my application created through CDK.', }); ``` @@ -70,6 +70,22 @@ new appconfig.DeploymentStrategy(this, 'MyDeploymentStrategy', { }); ``` +Importing a deployment strategy by ID: + +```ts +appconfig.DeploymentStrategy.fromDeploymentStrategyId(this, 'MyImportedDeploymentStrategy', appconfig.DeploymentStrategyId.fromString('abc123')); +``` + +Importing an AWS AppConfig predefined deployment strategy by ID: + +```ts +appconfig.DeploymentStrategy.fromDeploymentStrategyId( + this, + 'MyImportedPredefinedDeploymentStrategy', + appconfig.DeploymentStrategyId.CANARY_10_PERCENT_20_MINUTES, +); +``` + ## Configuration A configuration is a higher-level construct that can either be a `HostedConfiguration` (stored internally through AWS diff --git a/packages/@aws-cdk/aws-appconfig-alpha/awslint.json b/packages/@aws-cdk/aws-appconfig-alpha/awslint.json index d5b37fa1cc5b6..74fa11fd7c925 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/awslint.json +++ b/packages/@aws-cdk/aws-appconfig-alpha/awslint.json @@ -25,14 +25,10 @@ "docs-public-apis:@aws-cdk/aws-appconfig-alpha.IConfiguration", "docs-public-apis:@aws-cdk/aws-appconfig-alpha.IApplication", - "no-unused-type:@aws-cdk/aws-appconfig-alpha.PredefinedDeploymentStrategyId", "ref-via-interface:@aws-cdk/aws-appconfig-alpha.Application.addAgentToEcs.taskDef", - "props-physical-name:@aws-cdk/aws-appconfig-alpha.ApplicationProps", - "props-physical-name:@aws-cdk/aws-appconfig-alpha.DeploymentStrategyProps", - "props-physical-name:@aws-cdk/aws-appconfig-alpha.EnvironmentProps", - "props-physical-name:@aws-cdk/aws-appconfig-alpha.ExtensionProps", "events-in-interface", "events-method-signature", - "events-generic" + "events-generic", + "from-signature:@aws-cdk/aws-appconfig-alpha.DeploymentStrategy.fromDeploymentStrategyId.params[2]" ] } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appconfig-alpha/lib/application.ts b/packages/@aws-cdk/aws-appconfig-alpha/lib/application.ts index 27b38f506b571..71197edca52b1 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/lib/application.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/lib/application.ts @@ -84,7 +84,7 @@ export interface ApplicationProps { * * @default - A name is generated. */ - readonly name?: string; + readonly applicationName?: string; /** * The description for the application. @@ -336,7 +336,7 @@ export class Application extends ApplicationBase { super(scope, id); this.description = props.description; - this.name = props.name || Names.uniqueResourceName(this, { + this.name = props.applicationName || Names.uniqueResourceName(this, { maxLength: 64, separator: '-', }); diff --git a/packages/@aws-cdk/aws-appconfig-alpha/lib/deployment-strategy.ts b/packages/@aws-cdk/aws-appconfig-alpha/lib/deployment-strategy.ts index a97c6ff02d038..83b3e9c2a88bd 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/lib/deployment-strategy.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/lib/deployment-strategy.ts @@ -18,7 +18,7 @@ export interface DeploymentStrategyProps { * * @default - A name is generated. */ - readonly name?: string; + readonly deploymentStrategyName?: string; /** * A description of the deployment strategy. @@ -66,16 +66,16 @@ export class DeploymentStrategy extends Resource implements IDeploymentStrategy * @param id The name of the deployment strategy construct * @param deploymentStrategyId The ID of the deployment strategy */ - public static fromDeploymentStrategyId(scope: Construct, id: string, deploymentStrategyId: string): IDeploymentStrategy { + public static fromDeploymentStrategyId(scope: Construct, id: string, deploymentStrategyId: DeploymentStrategyId): IDeploymentStrategy { const stack = Stack.of(scope); const deploymentStrategyArn = stack.formatArn({ service: 'appconfig', resource: 'deploymentstrategy', - resourceName: deploymentStrategyId, + resourceName: deploymentStrategyId.id, }); class Import extends Resource implements IDeploymentStrategy { - public readonly deploymentStrategyId = deploymentStrategyId; + public readonly deploymentStrategyId = deploymentStrategyId.id; public readonly deploymentStrategyArn = deploymentStrategyArn; } @@ -130,7 +130,7 @@ export class DeploymentStrategy extends Resource implements IDeploymentStrategy constructor(scope: Construct, id: string, props: DeploymentStrategyProps) { super(scope, id, { - physicalName: props.name, + physicalName: props.deploymentStrategyName, }); this.deploymentDurationInMinutes = props.rolloutStrategy.deploymentDuration.toMinutes(); @@ -138,7 +138,7 @@ export class DeploymentStrategy extends Resource implements IDeploymentStrategy this.description = props.description; this.finalBakeTimeInMinutes = props.rolloutStrategy.finalBakeTime?.toMinutes(); this.growthType = props.rolloutStrategy.growthType; - this.name = props.name || Names.uniqueResourceName(this, { + this.name = props.deploymentStrategyName || Names.uniqueResourceName(this, { maxLength: 64, separator: '-', }); @@ -182,36 +182,52 @@ export enum GrowthType { } /** - * Defines the deployment strategy ID's of AWS AppConfig predefined strategies. + * Defines the deployment strategy ID's of AWS AppConfig deployment strategies. * * @see https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-deployment-strategy.html */ -export enum PredefinedDeploymentStrategyId { +export abstract class DeploymentStrategyId { /** * **AWS Recommended**. This strategy processes the deployment exponentially using a 10% growth factor over 20 minutes. * AWS AppConfig recommends using this strategy for production deployments because it aligns with AWS best practices * for configuration deployments. */ - CANARY_10_PERCENT_20_MINUTES = 'AppConfig.Canary10Percent20Minutes', + public static readonly CANARY_10_PERCENT_20_MINUTES = DeploymentStrategyId.fromString('AppConfig.Canary10Percent20Minutes'); /** * **Testing/Demonstration**. This strategy deploys the configuration to half of all targets every 30 seconds for a * one-minute deployment. AWS AppConfig recommends using this strategy only for testing or demonstration purposes because * it has a short duration and bake time. */ - LINEAR_50_PERCENT_EVERY_30_SECONDS = 'AppConfig.Linear50PercentEvery30Seconds', + public static readonly LINEAR_50_PERCENT_EVERY_30_SECONDS = DeploymentStrategyId.fromString('AppConfig.Linear50PercentEvery30Seconds'); /** * **AWS Recommended**. This strategy deploys the configuration to 20% of all targets every six minutes for a 30 minute deployment. * AWS AppConfig recommends using this strategy for production deployments because it aligns with AWS best practices * for configuration deployments. */ - LINEAR_20_PERCENT_EVERY_6_MINUTES = 'AppConfig.Linear20PercentEvery6Minutes', + public static readonly LINEAR_20_PERCENT_EVERY_6_MINUTES = DeploymentStrategyId.fromString('AppConfig.Linear20PercentEvery6Minutes'); /** * **Quick**. This strategy deploys the configuration to all targets immediately. */ - ALL_AT_ONCE = 'AppConfig.AllAtOnce', + public static readonly ALL_AT_ONCE = DeploymentStrategyId.fromString('AppConfig.AllAtOnce'); + + /** + * Builds a deployment strategy ID from a string. + * + * @param deploymentStrategyId The deployment strategy ID. + */ + public static fromString(deploymentStrategyId: string): DeploymentStrategyId { + return { + id: deploymentStrategyId, + }; + } + + /** + * The deployment strategy ID. + */ + public abstract readonly id: string; } /** diff --git a/packages/@aws-cdk/aws-appconfig-alpha/lib/environment.ts b/packages/@aws-cdk/aws-appconfig-alpha/lib/environment.ts index e4216a569ab87..767373f92da81 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/lib/environment.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/lib/environment.ts @@ -94,7 +94,7 @@ export interface EnvironmentOptions { * * @default - A name is generated. */ - readonly name?: string; + readonly environmentName?: string; /** * The description of the environment. @@ -236,10 +236,10 @@ export class Environment extends EnvironmentBase { constructor(scope: Construct, id: string, props: EnvironmentProps) { super(scope, id, { - physicalName: props.name, + physicalName: props.environmentName, }); - this.name = props.name || Names.uniqueResourceName(this, { + this.name = props.environmentName || Names.uniqueResourceName(this, { maxLength: 64, separator: '-', }); diff --git a/packages/@aws-cdk/aws-appconfig-alpha/lib/extension.ts b/packages/@aws-cdk/aws-appconfig-alpha/lib/extension.ts index 72f6d1bc9c739..5d9f1164d3ac2 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/lib/extension.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/lib/extension.ts @@ -338,7 +338,7 @@ export interface ExtensionOptions { * * @default - A name is generated. */ - readonly name?: string; + readonly extensionName?: string; /** * A description of the extension @@ -493,11 +493,11 @@ export class Extension extends Resource implements IExtension { constructor(scope: Construct, id: string, props: ExtensionProps) { super(scope, id, { - physicalName: props.name, + physicalName: props.extensionName, }); this.actions = props.actions; - this.name = props.name || Names.uniqueResourceName(this, { + this.name = props.extensionName || Names.uniqueResourceName(this, { maxLength: 64, separator: '-', }); @@ -662,7 +662,7 @@ export class ExtensibleBase implements IExtensible { } private getExtensionForActionPoint(eventDestination: IEventDestination, actionPoint: ActionPoint, options?: ExtensionOptions) { - const name = options?.name || this.getExtensionDefaultName(); + const name = options?.extensionName || this.getExtensionDefaultName(); const versionNumber = options?.latestVersionNumber ? options?.latestVersionNumber + 1 : 1; const extension = new Extension(this.scope, `Extension${this.getExtensionHash(name, versionNumber)}`, { actions: [ @@ -673,7 +673,7 @@ export class ExtensibleBase implements IExtensible { ], }), ], - name, + extensionName: name, ...(options?.description ? { description: options.description } : {}), ...(options?.latestVersionNumber ? { latestVersionNumber: options.latestVersionNumber } : {}), ...(options?.parameters ? { parameters: options.parameters } : {}), diff --git a/packages/@aws-cdk/aws-appconfig-alpha/test/application.test.ts b/packages/@aws-cdk/aws-appconfig-alpha/test/application.test.ts index a5c85dad77d95..deda4253bcf4d 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/application.test.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/application.test.ts @@ -23,7 +23,7 @@ describe('appconfig', () => { test('appconfig with name', () => { const stack = new cdk.Stack(); new Application(stack, 'MyAppConfig', { - name: 'TestApp', + applicationName: 'TestApp', }); Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::Application', { @@ -121,7 +121,7 @@ describe('appconfig', () => { }); appconfig.preCreateHostedConfigurationVersion(new LambdaDestination(func), { description: 'This is my description', - name: 'MyExtension', + extensionName: 'MyExtension', latestVersionNumber: 1, parameters: [ Parameter.required('myparam', 'val'), diff --git a/packages/@aws-cdk/aws-appconfig-alpha/test/configuration.test.ts b/packages/@aws-cdk/aws-appconfig-alpha/test/configuration.test.ts index 489c95dfd818e..f6564708642f1 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/configuration.test.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/configuration.test.ts @@ -58,7 +58,7 @@ describe('configuration', () => { test('configuration with environments and no deployTo prop', () => { const stack = new cdk.Stack(); const app = new Application(stack, 'MyAppConfig', { - name: 'MyApplication', + applicationName: 'MyApplication', }); app.addEnvironment('MyEnv1'); app.addEnvironment('MyEnv2'); @@ -96,7 +96,7 @@ describe('configuration', () => { test('configuration with environments and deployTo prop', () => { const stack = new cdk.Stack(); const app = new Application(stack, 'MyAppConfig', { - name: 'MyApplication', + applicationName: 'MyApplication', }); app.addEnvironment('MyEnv1'); const env = app.addEnvironment('MyEnv2'); @@ -152,7 +152,7 @@ describe('configuration', () => { test('configuration using deploy method and no environment associated', () => { const stack = new cdk.Stack(); const app = new Application(stack, 'MyAppConfig', { - name: 'MyApplication', + applicationName: 'MyApplication', }); app.addEnvironment('MyEnv1'); const env = app.addEnvironment('MyEnv2'); @@ -191,7 +191,7 @@ describe('configuration', () => { test('configuration using deploy method with environment associated', () => { const stack = new cdk.Stack(); const app = new Application(stack, 'MyAppConfig', { - name: 'MyApplication', + applicationName: 'MyApplication', }); const env1 = app.addEnvironment('MyEnv1'); const env2 = app.addEnvironment('MyEnv2'); @@ -248,7 +248,7 @@ describe('configuration', () => { test('configuration with no environment associated and no deploy method used', () => { const stack = new cdk.Stack(); const app = new Application(stack, 'MyAppConfig', { - name: 'MyApplication', + applicationName: 'MyApplication', }); new HostedConfiguration(stack, 'MyHostedConfig', { content: ConfigurationContent.fromInlineText('This is my content'), @@ -267,7 +267,7 @@ describe('configuration', () => { test('configuration with two configurations specified', () => { const stack = new cdk.Stack(); const app = new Application(stack, 'MyAppConfig', { - name: 'MyApplication', + applicationName: 'MyApplication', }); const env1 = app.addEnvironment('MyEnv1'); const env2 = app.addEnvironment('MyEnv2'); @@ -382,7 +382,7 @@ describe('configuration', () => { test('configuration with two configurations and no deployment strategy specified', () => { const stack = new cdk.Stack(); const app = new Application(stack, 'MyAppConfig', { - name: 'MyApplication', + applicationName: 'MyApplication', }); const bucket = new Bucket(stack, 'MyBucket'); new HostedConfiguration(stack, 'MyHostedConfig', { diff --git a/packages/@aws-cdk/aws-appconfig-alpha/test/deployment-strategy.test.ts b/packages/@aws-cdk/aws-appconfig-alpha/test/deployment-strategy.test.ts index 14e4e1875af25..2e0d51e1d966f 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/deployment-strategy.test.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/deployment-strategy.test.ts @@ -1,7 +1,7 @@ import * as cdk from 'aws-cdk-lib'; import { App } from 'aws-cdk-lib'; import { Template } from 'aws-cdk-lib/assertions'; -import { DeploymentStrategy, PredefinedDeploymentStrategyId, RolloutStrategy } from '../lib'; +import { DeploymentStrategy, DeploymentStrategyId, RolloutStrategy } from '../lib'; describe('deployment strategy', () => { test('default deployment strategy', () => { @@ -25,7 +25,7 @@ describe('deployment strategy', () => { test('deployment strategy with name', () => { const stack = new cdk.Stack(); new DeploymentStrategy(stack, 'MyDeploymentStrategy', { - name: 'TestDeploymentStrategy', + deploymentStrategyName: 'TestDeploymentStrategy', rolloutStrategy: RolloutStrategy.linear({ growthFactor: 10, deploymentDuration: cdk.Duration.minutes(10), @@ -44,7 +44,7 @@ describe('deployment strategy', () => { test('deployment strategy duration in seconds', () => { const stack = new cdk.Stack(); new DeploymentStrategy(stack, 'MyDeploymentStrategy', { - name: 'TestDeploymentStrategy', + deploymentStrategyName: 'TestDeploymentStrategy', rolloutStrategy: RolloutStrategy.linear({ growthFactor: 10, deploymentDuration: cdk.Duration.seconds(120), @@ -63,7 +63,7 @@ describe('deployment strategy', () => { test('deployment strategy with description', () => { const stack = new cdk.Stack(); new DeploymentStrategy(stack, 'MyDeploymentStrategy', { - name: 'TestDeploymentStrategy', + deploymentStrategyName: 'TestDeploymentStrategy', rolloutStrategy: RolloutStrategy.linear({ growthFactor: 10, deploymentDuration: cdk.Duration.minutes(10), @@ -84,7 +84,7 @@ describe('deployment strategy', () => { test('deployment strategy with final bake time', () => { const stack = new cdk.Stack(); new DeploymentStrategy(stack, 'MyDeploymentStrategy', { - name: 'TestDeploymentStrategy', + deploymentStrategyName: 'TestDeploymentStrategy', rolloutStrategy: RolloutStrategy.linear({ growthFactor: 10, deploymentDuration: cdk.Duration.minutes(10), @@ -105,7 +105,7 @@ describe('deployment strategy', () => { test('deployment strategy with growth type', () => { const stack = new cdk.Stack(); new DeploymentStrategy(stack, 'MyDeploymentStrategy', { - name: 'TestDeploymentStrategy', + deploymentStrategyName: 'TestDeploymentStrategy', rolloutStrategy: RolloutStrategy.exponential({ growthFactor: 10, deploymentDuration: cdk.Duration.minutes(10), @@ -124,7 +124,7 @@ describe('deployment strategy', () => { test('deployment strategy with replicate to', () => { const stack = new cdk.Stack(); new DeploymentStrategy(stack, 'MyDeploymentStrategy', { - name: 'TestDeploymentStrategy', + deploymentStrategyName: 'TestDeploymentStrategy', rolloutStrategy: RolloutStrategy.linear({ growthFactor: 10, deploymentDuration: cdk.Duration.minutes(10), @@ -166,7 +166,7 @@ describe('deployment strategy', () => { account: '123456789012', }, }); - const deploymentStrategy = DeploymentStrategy.fromDeploymentStrategyId(stack, 'MyDeploymentStrategy', 'abc123'); + const deploymentStrategy = DeploymentStrategy.fromDeploymentStrategyId(stack, 'MyDeploymentStrategy', DeploymentStrategyId.fromString('abc123')); expect(deploymentStrategy.deploymentStrategyId).toEqual('abc123'); expect(deploymentStrategy.env.account).toEqual('123456789012'); @@ -181,7 +181,7 @@ describe('deployment strategy', () => { account: '123456789012', }, }); - const deploymentStrategy = DeploymentStrategy.fromDeploymentStrategyId(stack, 'MyDeploymentStrategy', PredefinedDeploymentStrategyId.ALL_AT_ONCE); + const deploymentStrategy = DeploymentStrategy.fromDeploymentStrategyId(stack, 'MyDeploymentStrategy', DeploymentStrategyId.ALL_AT_ONCE); expect(deploymentStrategy.deploymentStrategyId).toEqual('AppConfig.AllAtOnce'); expect(deploymentStrategy.env.account).toEqual('123456789012'); @@ -196,7 +196,7 @@ describe('deployment strategy', () => { account: '123456789012', }, }); - const deploymentStrategy = DeploymentStrategy.fromDeploymentStrategyId(stack, 'MyDeploymentStrategy', PredefinedDeploymentStrategyId.CANARY_10_PERCENT_20_MINUTES); + const deploymentStrategy = DeploymentStrategy.fromDeploymentStrategyId(stack, 'MyDeploymentStrategy', DeploymentStrategyId.CANARY_10_PERCENT_20_MINUTES); expect(deploymentStrategy.deploymentStrategyId).toEqual('AppConfig.Canary10Percent20Minutes'); expect(deploymentStrategy.env.account).toEqual('123456789012'); @@ -211,7 +211,7 @@ describe('deployment strategy', () => { account: '123456789012', }, }); - const deploymentStrategy = DeploymentStrategy.fromDeploymentStrategyId(stack, 'MyDeploymentStrategy', PredefinedDeploymentStrategyId.LINEAR_50_PERCENT_EVERY_30_SECONDS); + const deploymentStrategy = DeploymentStrategy.fromDeploymentStrategyId(stack, 'MyDeploymentStrategy', DeploymentStrategyId.LINEAR_50_PERCENT_EVERY_30_SECONDS); expect(deploymentStrategy.deploymentStrategyId).toEqual('AppConfig.Linear50PercentEvery30Seconds'); expect(deploymentStrategy.env.account).toEqual('123456789012'); diff --git a/packages/@aws-cdk/aws-appconfig-alpha/test/environment.test.ts b/packages/@aws-cdk/aws-appconfig-alpha/test/environment.test.ts index 9c6dd7c7f3e4b..261d113728dae 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/environment.test.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/environment.test.ts @@ -25,7 +25,7 @@ describe('environment', () => { const stack = new cdk.Stack(); const app = new Application(stack, 'MyAppConfig'); new Environment(stack, 'MyEnvironment', { - name: 'TestEnv', + environmentName: 'TestEnv', application: app, }); @@ -41,7 +41,7 @@ describe('environment', () => { const stack = new cdk.Stack(); const app = new Application(stack, 'MyAppConfig'); new Environment(stack, 'MyEnvironment', { - name: 'TestEnv', + environmentName: 'TestEnv', application: app, description: 'This is my description', }); @@ -72,7 +72,7 @@ describe('environment', () => { assumedBy: new iam.ServicePrincipal('appconfig.amazonaws.com'), }); const env = new Environment(stack, 'MyEnvironment', { - name: 'TestEnv', + environmentName: 'TestEnv', application: app, monitors: [Monitor.fromCloudWatchAlarm(alarm, alarmRole)], }); @@ -118,7 +118,7 @@ describe('environment', () => { }); const app = new Application(stack, 'MyAppConfig'); const env = new Environment(stack, 'MyEnvironment', { - name: 'TestEnv', + environmentName: 'TestEnv', application: app, monitors: [Monitor.fromCloudWatchAlarm(alarm)], }); @@ -174,7 +174,7 @@ describe('environment', () => { const stack = new cdk.Stack(); const app = new Application(stack, 'MyAppConfig'); const env = new Environment(stack, 'MyEnvironment', { - name: 'TestEnv', + environmentName: 'TestEnv', application: app, monitors: [ Monitor.fromCfnMonitorsProperty({ @@ -203,7 +203,7 @@ describe('environment', () => { const stack = new cdk.Stack(); const app = new Application(stack, 'MyAppConfig'); const env = new Environment(stack, 'MyEnvironment', { - name: 'TestEnv', + environmentName: 'TestEnv', application: app, monitors: [ Monitor.fromCfnMonitorsProperty({ @@ -247,7 +247,7 @@ describe('environment', () => { alarmRule: alarm, }); const env = new Environment(stack, 'MyEnvironment', { - name: 'TestEnv', + environmentName: 'TestEnv', application: app, monitors: [ Monitor.fromCloudWatchAlarm(compositeAlarm), @@ -330,7 +330,7 @@ describe('environment', () => { alarmRule: alarm, }); const env = new Environment(stack, 'MyEnvironment', { - name: 'TestEnv', + environmentName: 'TestEnv', application: app, monitors: [ Monitor.fromCloudWatchAlarm(compositeAlarm1), @@ -433,7 +433,7 @@ describe('environment', () => { ), }); new Environment(stack, 'MyEnvironment', { - name: 'TestEnv', + environmentName: 'TestEnv', application: app, monitors: [ Monitor.fromCloudWatchAlarm(alarm1), diff --git a/packages/@aws-cdk/aws-appconfig-alpha/test/extension.test.ts b/packages/@aws-cdk/aws-appconfig-alpha/test/extension.test.ts index 4bef613850bbf..9109975c31cad 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/extension.test.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/extension.test.ts @@ -185,7 +185,7 @@ describe('extension', () => { value: 'arn:lambda:us-east-1:123456789012:function:my-function', }); const appconfig = new Application(stack, 'MyApplication', { - name: 'MyApplication', + applicationName: 'MyApplication', }); const ext = new Extension(stack, 'MyExtension', { actions: [ @@ -196,7 +196,7 @@ describe('extension', () => { eventDestination: new LambdaDestination(func), }), ], - name: 'TestExtension', + extensionName: 'TestExtension', description: 'This is my extension', parameters: [ Parameter.required('testVariable', 'hello'), diff --git a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.ts b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.ts index bf6e396bc8f51..d893c415ec5b0 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.ts @@ -38,7 +38,7 @@ const stack = new Stack(app, 'aws-appconfig-configuration'); // create application for config profile const appConfigApp = new Application(stack, 'MyAppConfig', { - name: 'AppForConfigTest', + applicationName: 'AppForConfigTest', }); const deploymentStrategy = new DeploymentStrategy(stack, 'MyDeployStrategy', { diff --git a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.environment.ts b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.environment.ts index bce1591e70ba8..6681c66597bd4 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.environment.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.environment.ts @@ -10,7 +10,7 @@ const stack = new Stack(app, 'aws-appconfig-environment'); // create resources needed for environment const appForEnv = new Application(stack, 'MyApplicationForEnv', { - name: 'AppForEnvTest', + applicationName: 'AppForEnvTest', }); const alarm = new Alarm(stack, 'MyAlarm', { metric: new Metric({ diff --git a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.extension.ts b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.extension.ts index 94b3c38897037..0fdfd86d92e80 100755 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.extension.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.extension.ts @@ -31,7 +31,7 @@ const lambda = new Function(stack, 'MyFunction', { code: Code.fromInline('def handler(event, context):\n\tprint(\'The function has been invoked.\')'), }); const app = new Application(stack, 'MyApplication', { - name: 'AppForExtensionTest', + applicationName: 'AppForExtensionTest', }); const lambdaExtension = new Extension(stack, 'MyLambdaExtension', { actions: [ diff --git a/packages/aws-cdk-lib/aws-ec2/lib/volume.ts b/packages/aws-cdk-lib/aws-ec2/lib/volume.ts index 2c29b6e6dbbd9..5b349c2ecd02e 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/volume.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/volume.ts @@ -344,7 +344,7 @@ export interface VolumeProps { /** * The size of the volume, in GiBs. You must specify either a snapshot ID or a volume size. - * See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html + * See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-volume.html * for details on the allowable size for each type of volume. * * @default If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size. @@ -427,7 +427,7 @@ export interface VolumeProps { /** * The number of I/O operations per second (IOPS) to provision for the volume. The maximum ratio is 50 IOPS/GiB for PROVISIONED_IOPS_SSD, * and 500 IOPS/GiB for both PROVISIONED_IOPS_SSD_IO2 and GENERAL_PURPOSE_SSD_GP3. - * See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html + * See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-volume.html * for more information. * * This parameter is valid only for PROVISIONED_IOPS_SSD, PROVISIONED_IOPS_SSD_IO2 and GENERAL_PURPOSE_SSD_GP3 volumes. @@ -446,7 +446,7 @@ export interface VolumeProps { /** * The throughput that the volume supports, in MiB/s * Takes a minimum of 125 and maximum of 1000. - * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html#cfn-ec2-ebs-volume-throughput + * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-volume.html#cfn-ec2-volume-throughput * @default - 125 MiB/s. Only valid on gp3 volumes. */ readonly throughput?: number; @@ -691,11 +691,11 @@ export class Volume extends VolumeBase { ); } // Enforce minimum & maximum IOPS: - // https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html + // https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-volume.html const iopsRanges: { [key: string]: { Min: number, Max: number } } = {}; iopsRanges[EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3] = { Min: 3000, Max: 16000 }; iopsRanges[EbsDeviceVolumeType.PROVISIONED_IOPS_SSD] = { Min: 100, Max: 64000 }; - iopsRanges[EbsDeviceVolumeType.PROVISIONED_IOPS_SSD_IO2] = { Min: 100, Max: 64000 }; + iopsRanges[EbsDeviceVolumeType.PROVISIONED_IOPS_SSD_IO2] = { Min: 100, Max: 256000 }; const { Min, Max } = iopsRanges[volumeType]; if (props.iops < Min || props.iops > Max) { throw new Error(`\`${volumeType}\` volumes iops must be between ${Min} and ${Max}.`); @@ -739,7 +739,7 @@ export class Volume extends VolumeBase { if (props.size) { const size = props.size.toGibibytes({ rounding: SizeRoundingBehavior.FAIL }); // Enforce minimum & maximum volume size: - // https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html + // https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-volume.html const sizeRanges: { [key: string]: { Min: number, Max: number } } = {}; sizeRanges[EbsDeviceVolumeType.GENERAL_PURPOSE_SSD] = { Min: 1, Max: 16384 }; sizeRanges[EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3] = { Min: 1, Max: 16384 }; diff --git a/packages/aws-cdk-lib/aws-ec2/test/volume.test.ts b/packages/aws-cdk-lib/aws-ec2/test/volume.test.ts index ffe1ef38a9c17..cce55f2497bc8 100644 --- a/packages/aws-cdk-lib/aws-ec2/test/volume.test.ts +++ b/packages/aws-cdk-lib/aws-ec2/test/volume.test.ts @@ -1279,7 +1279,7 @@ describe('volume', () => { for (const testData of [ [EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3, 3000, 16000], [EbsDeviceVolumeType.PROVISIONED_IOPS_SSD, 100, 64000], - [EbsDeviceVolumeType.PROVISIONED_IOPS_SSD_IO2, 100, 64000], + [EbsDeviceVolumeType.PROVISIONED_IOPS_SSD_IO2, 100, 256000], ]) { const volumeType = testData[0] as EbsDeviceVolumeType; const min = testData[1] as number;