diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.ts index 6cadc5ec88304..9047c1ec945af 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.ts @@ -1,5 +1,4 @@ import { App, Stack } from 'aws-cdk-lib'; -// eslint-disable-next-line import/no-extraneous-dependencies import { IntegTest } from '@aws-cdk/integ-tests-alpha'; import * as ga from 'aws-cdk-lib/aws-globalaccelerator'; diff --git a/packages/aws-cdk-lib/aws-globalaccelerator/lib/accelerator.ts b/packages/aws-cdk-lib/aws-globalaccelerator/lib/accelerator.ts index 742224a6dfbe8..17a95fb584850 100644 --- a/packages/aws-cdk-lib/aws-globalaccelerator/lib/accelerator.ts +++ b/packages/aws-cdk-lib/aws-globalaccelerator/lib/accelerator.ts @@ -66,11 +66,16 @@ export interface AcceleratorProps { /** * IP addresses associated with the accelerator. * - * Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose IP addresses from your own pool to use for the accelerator's static IP addresses when you create an accelerator. You can specify one or two addresses, separated by a comma. Do not include the /32 suffix. + * Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose IP + * addresses from your own pool to use for the accelerator's static IP addresses when you create an accelerator. + * You can specify one or two addresses, separated by a comma. Do not include the /32 suffix. * - * Only one IP address from each of your IP address ranges can be used for each accelerator. If you specify only one IP address from your IP address range, Global Accelerator assigns a second static IP address for the accelerator from the AWS IP address pool. + * Only one IP address from each of your IP address ranges can be used for each accelerator. If you specify + * only one IP address from your IP address range, Global Accelerator assigns a second static IP address for + * the accelerator from the AWS IP address pool. * - * Note that you can't update IP addresses for an existing accelerator. To change them, you must create a new accelerator with the new addresses. + * Note that you can't update IP addresses for an existing accelerator. To change them, you must create a + * new accelerator with the new addresses. * * @default - undefined. IP addresses will be from Amazon's pool of IP addresses. */ @@ -216,7 +221,7 @@ export class Accelerator extends cdk.Resource implements IAccelerator { private validateIpAddresses(ipAddresses?: string[]) { if (ipAddresses !== undefined && (ipAddresses.length < 1 || ipAddresses.length > 2)) { - throw new Error(`Invalid ipAddresses value [${ipAddresses}], you can specify one or two addresses separated by a comma.`); + throw new Error(`Invalid ipAddresses value [${ipAddresses}], you can specify one or two addresses, got: ${ipAddresses.length}`); } } } diff --git a/packages/aws-cdk-lib/aws-globalaccelerator/test/globalaccelerator.test.ts b/packages/aws-cdk-lib/aws-globalaccelerator/test/globalaccelerator.test.ts index 22ce7b64e6cb3..b1ea83937a71c 100644 --- a/packages/aws-cdk-lib/aws-globalaccelerator/test/globalaccelerator.test.ts +++ b/packages/aws-cdk-lib/aws-globalaccelerator/test/globalaccelerator.test.ts @@ -301,10 +301,10 @@ test('should validate ipAddresses minimum and maximum length', () => { new ga.Accelerator(stack, 'Acc4', { ipAddresses: [], }); - }).toThrow('Invalid ipAddresses value [], you can specify one or two addresses separated by a comma.'); + }).toThrow('Invalid ipAddresses value [], you can specify one or two addresses, got: 0'); expect(() => { new ga.Accelerator(stack, 'Acc5', { ipAddresses: ['1.1.1.1', '2.2.2.2', '3.3.3.3'], }); - }).toThrow('Invalid ipAddresses value [1.1.1.1,2.2.2.2,3.3.3.3], you can specify one or two addresses separated by a comma.'); + }).toThrow('Invalid ipAddresses value [1.1.1.1,2.2.2.2,3.3.3.3], you can specify one or two addresses, got: 3'); });