From 58e87fb6b96a50016d01d9859fdbd939eac62c2d Mon Sep 17 00:00:00 2001 From: Jane Chen <125300057+chenjane-dev@users.noreply.github.com> Date: Fri, 18 Aug 2023 04:30:18 -0400 Subject: [PATCH 01/19] refactor(appconfig): refactoring deployTo and contentType properties (#26768) Refactoring deployTo property to only create a deployment if specified. Refactoring contentType to be passed in by ConfigurationContent. **Includes breaking change. Deployments will not be created anymore if deployTo is not specified and contentType cannot be passed in as a HostedConfiguration prop, only can be passed directly to ConfigurationContent ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- package.json | 2 + packages/@aws-cdk/aws-appconfig-alpha/NOTICE | 32 ++++ .../@aws-cdk/aws-appconfig-alpha/README.md | 14 +- .../aws-appconfig-alpha/lib/configuration.ts | 67 ++++--- .../@aws-cdk/aws-appconfig-alpha/package.json | 15 +- .../test/configuration.test.ts | 178 ++++++++++-------- .../test/extension.test.ts | 2 +- .../aws-appconfig-configuration.assets.json | 4 +- .../aws-appconfig-configuration.template.json | 4 +- .../manifest.json | 2 +- .../integ.configuration.js.snapshot/tree.json | 62 +++--- .../test/integ.configuration.ts | 4 +- .../test/integ.extension.ts | 2 +- yarn.lock | 9 +- 14 files changed, 239 insertions(+), 158 deletions(-) diff --git a/package.json b/package.json index 4756155a19828..ca669ebbb6326 100644 --- a/package.json +++ b/package.json @@ -96,6 +96,8 @@ "@aws-cdk/assertions-alpha/fs-extra/**", "@aws-cdk/assertions/fs-extra", "@aws-cdk/assertions/fs-extra/**", + "@aws-cdk/aws-appconfig-alpha/mime-types", + "@aws-cdk/aws-appconfig-alpha/mime-types/**", "@aws-cdk/aws-codebuild/yaml", "@aws-cdk/aws-codebuild/yaml/**", "@aws-cdk/aws-codepipeline-actions/case", diff --git a/packages/@aws-cdk/aws-appconfig-alpha/NOTICE b/packages/@aws-cdk/aws-appconfig-alpha/NOTICE index a27b7dd317649..b1adfdf58a098 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/NOTICE +++ b/packages/@aws-cdk/aws-appconfig-alpha/NOTICE @@ -1,2 +1,34 @@ AWS Cloud Development Kit (AWS CDK) Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +------------------------------------------------------------------------------- + +The AWS CDK includes the following third-party software/licensing: + +** mime-db - https://www.npmjs.com/package/mime-db +** mime-types - https://www.npmjs.com/package/mime-types +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---------------- diff --git a/packages/@aws-cdk/aws-appconfig-alpha/README.md b/packages/@aws-cdk/aws-appconfig-alpha/README.md index c20878cbbad24..2f29be7bba89e 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/README.md +++ b/packages/@aws-cdk/aws-appconfig-alpha/README.md @@ -79,7 +79,7 @@ declare const application: appconfig.Application; new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', { application, - content: appconfig.ConfigurationContent.fromInline('This is my configuration content.'), + content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'), }); ``` @@ -95,7 +95,7 @@ declare const application: appconfig.Application; new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', { application, - content: appconfig.ConfigurationContent.fromInline('This is my configuration content.'), + content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'), type: appconfig.ConfigurationType.FEATURE_FLAGS, }); ``` @@ -111,7 +111,7 @@ declare const fn: lambda.Function; new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', { application, - content: appconfig.ConfigurationContent.fromInline('This is my configuration content.'), + content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'), validators: [ appconfig.JsonSchemaValidator.fromFile('schema.json'), appconfig.LambdaValidator.fromFunction(fn), @@ -128,7 +128,7 @@ declare const application: appconfig.Application; new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', { application, - content: appconfig.ConfigurationContent.fromInline('This is my configuration content.'), + content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'), deploymentStrategy: new appconfig.DeploymentStrategy(this, 'MyDeploymentStrategy', { rolloutStrategy: appconfig.RolloutStrategy.linear({ growthFactor: 15, @@ -139,7 +139,7 @@ new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', { }); ``` -The `deployTo` parameter is used to specify which environments to deploy the configuration to. If this parameter is not specified, there will only be a deployment if there is one environment associated to the AWS AppConfig application. +The `deployTo` parameter is used to specify which environments to deploy the configuration to. If this parameter is not specified, there will not be a deployment. A hosted configuration with `deployTo`: @@ -149,7 +149,7 @@ declare const env: appconfig.Environment; new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', { application, - content: appconfig.ConfigurationContent.fromInline('This is my configuration content.'), + content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'), deployTo: [env], }); ``` @@ -301,7 +301,7 @@ new appconfig.SourcedConfiguration(this, 'MySourcedConfiguration', { }); ``` -The `deployTo` parameter is used to specify which environments to deploy the configuration to. If this parameter is not specified, there will only be a deployment if there is one environment associated to the AWS AppConfig application. +The `deployTo` parameter is used to specify which environments to deploy the configuration to. If this parameter is not specified, there will not be a deployment. A sourced configuration with `deployTo`: diff --git a/packages/@aws-cdk/aws-appconfig-alpha/lib/configuration.ts b/packages/@aws-cdk/aws-appconfig-alpha/lib/configuration.ts index 0681f73487e08..51f36b406dd9c 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/lib/configuration.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/lib/configuration.ts @@ -1,4 +1,5 @@ import * as fs from 'fs'; +import * as mimeTypes from 'mime-types'; import { PhysicalName, Stack, ArnFormat, Names, RemovalPolicy } from 'aws-cdk-lib'; import { CfnConfigurationProfile, CfnDeployment, CfnHostedConfigurationVersion } from 'aws-cdk-lib/aws-appconfig'; import * as cp from 'aws-cdk-lib/aws-codepipeline'; @@ -55,9 +56,8 @@ export interface ConfigurationOptions { /** * The list of environments to deploy the configuration to. * - * If this parameter is not specified and there is only one environment - * associated to the application, then we will deploy to that one. Otherwise, - * there will be no deployment. + * If this parameter is not specified, then there will be no + * deployment. * * @default - None. */ @@ -305,13 +305,7 @@ abstract class ConfigurationBase extends Construct implements IConfiguration, IE } protected deployConfigToEnvironments() { - if (this.application.environments.length == 0) { - this.application.addEnvironment('Environment', { - description: this.description, - }); - } - - if ((!this.deployTo && this.application.environments.length > 1) || !this.versionNumber) { + if (!this.deployTo || !this.versionNumber) { return; } @@ -320,9 +314,6 @@ abstract class ConfigurationBase extends Construct implements IConfiguration, IE return; } const logicalId = `Deployment${this.getDeploymentHash(environment)}`; - if (this.node.tryFindChild(logicalId)) { - return; - } new CfnDeployment(this, logicalId, { applicationId: this.application.applicationId, configurationProfileId: this.configurationProfileId, @@ -342,11 +333,6 @@ export interface HostedConfigurationOptions extends ConfigurationOptions { */ readonly content: ConfigurationContent; - /** - * The content type of the hosted configuration. - */ - readonly contentType?: string; - /** * The latest version number of the hosted configuration. */ @@ -364,11 +350,6 @@ export interface HostedConfigurationProps extends ConfigurationProps { */ readonly content: ConfigurationContent; - /** - * The content type of the hosted configuration. - */ - readonly contentType?: string; - /** * The latest version number of the hosted configuration. */ @@ -444,7 +425,7 @@ export class HostedConfiguration extends ConfigurationBase { this.extensible = new ExtensibleBase(scope, this.configurationProfileArn, this.name); this.content = props.content.content; - this.contentType = props.contentType || 'application/json'; + this.contentType = props.content.contentType; this.latestVersionNumber = props.latestVersionNumber; this.versionLabel = props.versionLabel; this._cfnHostedConfigurationVersion = new CfnHostedConfigurationVersion(this, 'Resource', { @@ -792,10 +773,12 @@ export abstract class ConfigurationContent { * Defines the hosted configuration content from a file. * * @param path The path to the file that defines configuration content + * @param contentType The content type of the configuration */ - public static fromFile(path: string): ConfigurationContent { + public static fromFile(path: string, contentType?: string): ConfigurationContent { return { content: fs.readFileSync(path).toString(), + contentType: contentType || mimeTypes.lookup(path) || 'application/json', }; } @@ -803,10 +786,37 @@ export abstract class ConfigurationContent { * Defines the hosted configuration content from inline code. * * @param content The inline code that defines the configuration content + * @param contentType The content type of the configuration */ - public static fromInline(content: string): ConfigurationContent { + public static fromInline(content: string, contentType?: string): ConfigurationContent { return { content, + contentType: contentType || 'application/octet-stream', + }; + } + + /** + * Defines the hosted configuration content as JSON from inline code. + * + * @param content The inline code that defines the configuration content + * @param contentType The content type of the configuration + */ + public static fromInlineJson(content: string, contentType?: string): ConfigurationContent { + return { + content, + contentType: contentType || 'application/json', + }; + } + + /** + * Defines the hosted configuration content as text from inline code. + * + * @param content The inline code that defines the configuration content + */ + public static fromInlineText(content: string): ConfigurationContent { + return { + content, + contentType: 'text/plain', }; } @@ -814,6 +824,11 @@ export abstract class ConfigurationContent { * The configuration content. */ public abstract readonly content: string; + + /** + * The configuration content type. + */ + public abstract readonly contentType: string; } /** diff --git a/packages/@aws-cdk/aws-appconfig-alpha/package.json b/packages/@aws-cdk/aws-appconfig-alpha/package.json index 0c6b1342a7064..1b3a2512a7897 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/package.json +++ b/packages/@aws-cdk/aws-appconfig-alpha/package.json @@ -76,18 +76,20 @@ }, "license": "Apache-2.0", "devDependencies": { - "aws-cdk-lib": "0.0.0", "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", - "@aws-cdk/pkglint": "0.0.0", "@aws-cdk/integ-tests-alpha": "0.0.0", + "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^29.5.3", + "@types/mime-types": "^2.1.1", + "aws-cdk-lib": "0.0.0", "constructs": "^10.0.0", - "jest": "^29.6.2" + "jest": "^29.6.1" }, "dependencies": { "aws-cdk-lib": "0.0.0", - "constructs": "^10.0.0" + "constructs": "^10.0.0", + "mime-types": "^2.1.35" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -115,5 +117,8 @@ "env": { "AWSLINT_BASE_CONSTRUCT": true } - } + }, + "bundleDependencies": [ + "mime-types" + ] } 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 6022720431473..5e4479b61979b 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/configuration.test.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/configuration.test.ts @@ -25,7 +25,7 @@ describe('configuration', () => { const stack = new cdk.Stack(); const app = new Application(stack, 'MyAppConfig'); new HostedConfiguration(stack, 'MyHostedConfig', { - content: ConfigurationContent.fromInline('This is my content'), + content: ConfigurationContent.fromInlineText('This is my content'), application: app, deploymentStrategy: new DeploymentStrategy(stack, 'MyDeploymentStrategy', { rolloutStrategy: RolloutStrategy.linear({ @@ -35,12 +35,7 @@ describe('configuration', () => { }), }); - Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::Environment', { - Name: 'MyAppConfig-Environment-CF46384A', - ApplicationId: { - Ref: 'MyAppConfigB4B63E75', - }, - }); + Template.fromStack(stack).resourceCountIs('AWS::AppConfig::Environment', 0); Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::ConfigurationProfile', { Name: 'MyHostedConfig', ApplicationId: { @@ -55,25 +50,9 @@ describe('configuration', () => { Ref: 'MyHostedConfigConfigurationProfile2E1A2BBC', }, Content: 'This is my content', - ContentType: 'application/json', - }); - Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::Deployment', { - ApplicationId: { - Ref: 'MyAppConfigB4B63E75', - }, - EnvironmentId: { - Ref: 'MyAppConfigEnvironment833A9182', - }, - ConfigurationVersion: { - Ref: 'MyHostedConfig51D3877D', - }, - ConfigurationProfileId: { - Ref: 'MyHostedConfigConfigurationProfile2E1A2BBC', - }, - DeploymentStrategyId: { - Ref: 'MyDeploymentStrategy60D31FB0', - }, + ContentType: 'text/plain', }); + Template.fromStack(stack).resourceCountIs('AWS::AppConfig::Deployment', 0); }); test('configuration with environments and no deployTo prop', () => { @@ -84,7 +63,7 @@ describe('configuration', () => { app.addEnvironment('MyEnv1'); app.addEnvironment('MyEnv2'); new HostedConfiguration(stack, 'MyHostedConfig', { - content: ConfigurationContent.fromInline('This is my content'), + content: ConfigurationContent.fromInlineText('This is my content'), application: app, deploymentStrategy: new DeploymentStrategy(stack, 'MyDeploymentStrategy', { rolloutStrategy: RolloutStrategy.linear({ @@ -108,7 +87,7 @@ describe('configuration', () => { Ref: 'MyHostedConfigConfigurationProfile2E1A2BBC', }, Content: 'This is my content', - ContentType: 'application/json', + ContentType: 'text/plain', }); Template.fromStack(stack).resourceCountIs('AWS::AppConfig::Environment', 2); Template.fromStack(stack).resourceCountIs('AWS::AppConfig::Deployment', 0); @@ -122,7 +101,7 @@ describe('configuration', () => { app.addEnvironment('MyEnv1'); const env = app.addEnvironment('MyEnv2'); new HostedConfiguration(stack, 'MyHostedConfig', { - content: ConfigurationContent.fromInline('This is my content'), + content: ConfigurationContent.fromInlineText('This is my content'), application: app, deployTo: [env], deploymentStrategy: new DeploymentStrategy(stack, 'MyDeploymentStrategy', { @@ -147,7 +126,7 @@ describe('configuration', () => { Ref: 'MyHostedConfigConfigurationProfile2E1A2BBC', }, Content: 'This is my content', - ContentType: 'application/json', + ContentType: 'text/plain', }); Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::Deployment', { ApplicationId: { @@ -179,7 +158,7 @@ describe('configuration', () => { const env2 = app.addEnvironment('MyEnv2'); const bucket = new Bucket(stack, 'MyBucket'); new HostedConfiguration(stack, 'MyHostedConfig', { - content: ConfigurationContent.fromInline('This is my content'), + content: ConfigurationContent.fromInlineText('This is my content'), application: app, deployTo: [env1], deploymentStrategy: new DeploymentStrategy(stack, 'MyDeploymentStrategy1', { @@ -217,7 +196,7 @@ describe('configuration', () => { Ref: 'MyHostedConfigConfigurationProfile2E1A2BBC', }, Content: 'This is my content', - ContentType: 'application/json', + ContentType: 'text/plain', }); Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::ConfigurationProfile', { Name: 'MySourcedConfig', @@ -292,7 +271,7 @@ describe('configuration', () => { }); const bucket = new Bucket(stack, 'MyBucket'); new HostedConfiguration(stack, 'MyHostedConfig', { - content: ConfigurationContent.fromInline('This is my content'), + content: ConfigurationContent.fromInlineText('This is my content'), application: app, }); new SourcedConfiguration(stack, 'MySourcedConfig', { @@ -333,6 +312,7 @@ describe('configuration', () => { deploymentDuration: cdk.Duration.minutes(30), }), }), + deployTo: [app.addEnvironment('Environment')], }); Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::Deployment', { @@ -358,13 +338,14 @@ describe('configuration', () => { const app = new Application(stack, 'MyAppConfig'); new HostedConfiguration(stack, 'MyConfiguration', { application: app, - content: ConfigurationContent.fromInline('This is my content'), + content: ConfigurationContent.fromInlineText('This is my content'), deploymentStrategy: new DeploymentStrategy(stack, 'MyDeploymentStrategy', { rolloutStrategy: RolloutStrategy.linear({ growthFactor: 15, deploymentDuration: cdk.Duration.minutes(30), }), }), + deployTo: [app.addEnvironment('Environment')], }); Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::ConfigurationProfile', { @@ -382,41 +363,76 @@ describe('configuration', () => { Ref: 'MyConfigurationConfigurationProfileEE0ECA85', }, Content: 'This is my content', - ContentType: 'application/json', + ContentType: 'text/plain', }); Template.fromStack(stack).resourceCountIs('AWS::AppConfig::Deployment', 1); }); - // test('default configuration from asset', () => { - // const stack = new cdk.Stack(); - // const app = new AppConfig(stack, 'MyAppConfig', { - // deploymentStrategy: new DeploymentStrategy(stack, 'MyDeploymentStrategy', { - // rolloutStrategy: RolloutStrategy.linear(15, cdk.Duration.minutes(30)), - // }), - // }); - // new HostedConfiguration(stack, 'MyConfiguration', { - // appConfig: app, - // content: ConfigurationContent.fromAsset('/Users/chenjane/Documents/appconfig-l2-constructs/test/config.json'), - // }); + test('default configuration from file', () => { + const stack = new cdk.Stack(); + const app = new Application(stack, 'MyAppConfig'); + new HostedConfiguration(stack, 'MyConfiguration', { + deploymentStrategy: new DeploymentStrategy(stack, 'MyDeploymentStrategy', { + rolloutStrategy: RolloutStrategy.linear({ + growthFactor: 15, + deploymentDuration: cdk.Duration.minutes(30), + }), + }), + application: app, + content: ConfigurationContent.fromFile('./test/config.json'), + }); - // Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::ConfigurationProfile', { - // Name: 'MyConfiguration', - // ApplicationId: { - // Ref: 'MyAppConfigB4B63E75', - // }, - // LocationUri: 'hosted', - // }); - // Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::HostedConfigurationVersion', { - // ApplicationId: { - // Ref: 'MyAppConfigB4B63E75', - // }, - // ConfigurationProfileId: { - // Ref: 'MyConfigurationConfigurationProfileEE0ECA85', - // }, - // Content: '{\n "content": "This is the configuration content"\n}', - // ContentType: 'application/json', - // }); - // }); + Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::ConfigurationProfile', { + Name: 'MyConfiguration', + ApplicationId: { + Ref: 'MyAppConfigB4B63E75', + }, + LocationUri: 'hosted', + }); + Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::HostedConfigurationVersion', { + ApplicationId: { + Ref: 'MyAppConfigB4B63E75', + }, + ConfigurationProfileId: { + Ref: 'MyConfigurationConfigurationProfileEE0ECA85', + }, + Content: '{\n "content": "This is the configuration content"\n}', + ContentType: 'application/json', + }); + }); + + test('default configuration from inline octet', () => { + const stack = new cdk.Stack(); + const app = new Application(stack, 'MyAppConfig'); + new HostedConfiguration(stack, 'MyConfiguration', { + deploymentStrategy: new DeploymentStrategy(stack, 'MyDeploymentStrategy', { + rolloutStrategy: RolloutStrategy.linear({ + growthFactor: 15, + deploymentDuration: cdk.Duration.minutes(30), + }), + }), + application: app, + content: ConfigurationContent.fromInline('This should be of content type application/octet'), + }); + + Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::ConfigurationProfile', { + Name: 'MyConfiguration', + ApplicationId: { + Ref: 'MyAppConfigB4B63E75', + }, + LocationUri: 'hosted', + }); + Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::HostedConfigurationVersion', { + ApplicationId: { + Ref: 'MyAppConfigB4B63E75', + }, + ConfigurationProfileId: { + Ref: 'MyConfigurationConfigurationProfileEE0ECA85', + }, + Content: 'This should be of content type application/octet', + ContentType: 'application/octet-stream', + }); + }); test('configuration profile with name', () => { const stack = new cdk.Stack(); @@ -424,7 +440,7 @@ describe('configuration', () => { new HostedConfiguration(stack, 'MyConfigurationProfile', { name: 'TestConfigProfile', application: app, - content: ConfigurationContent.fromInline('This is my content'), + content: ConfigurationContent.fromInlineText('This is my content'), deploymentStrategy: new DeploymentStrategy(stack, 'MyDeploymentStrategy', { rolloutStrategy: RolloutStrategy.linear({ growthFactor: 15, @@ -448,9 +464,9 @@ describe('configuration', () => { Ref: 'MyConfigurationProfile33A97163', }, Content: 'This is my content', - ContentType: 'application/json', + ContentType: 'text/plain', }); - Template.fromStack(stack).resourceCountIs('AWS::AppConfig::Deployment', 1); + Template.fromStack(stack).resourceCountIs('AWS::AppConfig::Deployment', 0); }); test('configuration profile with type', () => { @@ -460,7 +476,7 @@ describe('configuration', () => { name: 'TestConfigProfile', application: app, type: ConfigurationType.FEATURE_FLAGS, - content: ConfigurationContent.fromInline('This is my content'), + content: ConfigurationContent.fromInlineText('This is my content'), deploymentStrategy: new DeploymentStrategy(stack, 'MyDeploymentStrategy', { rolloutStrategy: RolloutStrategy.linear({ growthFactor: 15, @@ -485,9 +501,9 @@ describe('configuration', () => { Ref: 'MyConfigurationProfile33A97163', }, Content: 'This is my content', - ContentType: 'application/json', + ContentType: 'text/plain', }); - Template.fromStack(stack).resourceCountIs('AWS::AppConfig::Deployment', 1); + Template.fromStack(stack).resourceCountIs('AWS::AppConfig::Deployment', 0); }); test('configuration profile with description', () => { @@ -496,7 +512,7 @@ describe('configuration', () => { new HostedConfiguration(stack, 'MyConfigurationProfile', { name: 'TestConfigProfile', application: app, - content: ConfigurationContent.fromInline('This is my content'), + content: ConfigurationContent.fromInlineText('This is my content'), description: 'This is my description', deploymentStrategy: new DeploymentStrategy(stack, 'MyDeploymentStrategy', { rolloutStrategy: RolloutStrategy.linear({ @@ -522,10 +538,10 @@ describe('configuration', () => { Ref: 'MyConfigurationProfile33A97163', }, Content: 'This is my content', - ContentType: 'application/json', + ContentType: 'text/plain', Description: 'This is my description', }); - Template.fromStack(stack).resourceCountIs('AWS::AppConfig::Deployment', 1); + Template.fromStack(stack).resourceCountIs('AWS::AppConfig::Deployment', 0); }); test('configuration profile with validator', () => { @@ -534,7 +550,7 @@ describe('configuration', () => { new HostedConfiguration(stack, 'MyConfigurationProfile', { name: 'TestConfigProfile', application: app, - content: ConfigurationContent.fromInline('This is my content'), + content: ConfigurationContent.fromInlineText('This is my content'), validators: [ { content: 'dummy validator', @@ -570,9 +586,9 @@ describe('configuration', () => { Ref: 'MyConfigurationProfile33A97163', }, Content: 'This is my content', - ContentType: 'application/json', + ContentType: 'text/plain', }); - Template.fromStack(stack).resourceCountIs('AWS::AppConfig::Deployment', 1); + Template.fromStack(stack).resourceCountIs('AWS::AppConfig::Deployment', 0); }); test('configuration profile with inline json schema validator', () => { @@ -715,7 +731,7 @@ describe('configuration', () => { validators: [ JsonSchemaValidator.fromInline(validatorContent), ], - content: ConfigurationContent.fromInline('This is my content'), + content: ConfigurationContent.fromInlineText('This is my content'), deploymentStrategy: new DeploymentStrategy(stack, 'MyDeploymentStrategy', { rolloutStrategy: RolloutStrategy.linear({ growthFactor: 15, @@ -745,9 +761,9 @@ describe('configuration', () => { Ref: 'MyConfigurationConfigurationProfileEE0ECA85', }, Content: 'This is my content', - ContentType: 'application/json', + ContentType: 'text/plain', }); - Template.fromStack(stack).resourceCountIs('AWS::AppConfig::Deployment', 1); + Template.fromStack(stack).resourceCountIs('AWS::AppConfig::Deployment', 0); }); test('configuration profile with ssm parameter', () => { @@ -768,6 +784,7 @@ describe('configuration', () => { deploymentDuration: cdk.Duration.minutes(30), }), }), + deployTo: [app.addEnvironment('Environment')], }); Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::ConfigurationProfile', { @@ -848,6 +865,7 @@ describe('configuration', () => { deploymentDuration: cdk.Duration.minutes(30), }), }), + deployTo: [app.addEnvironment('Environment')], }); Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::ConfigurationProfile', { @@ -915,6 +933,7 @@ describe('configuration', () => { deploymentDuration: cdk.Duration.minutes(30), }), }), + deployTo: [app.addEnvironment('Environment')], }); Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::ConfigurationProfile', { @@ -1030,6 +1049,7 @@ describe('configuration', () => { deploymentDuration: cdk.Duration.minutes(30), }), }), + deployTo: [app.addEnvironment('Environment')], }); Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::ConfigurationProfile', { @@ -1074,6 +1094,7 @@ describe('configuration', () => { deploymentDuration: cdk.Duration.minutes(30), }), }), + deployTo: [app.addEnvironment('Environment')], }); Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::ConfigurationProfile', { @@ -1125,6 +1146,7 @@ describe('configuration', () => { deploymentDuration: cdk.Duration.minutes(30), }), }), + deployTo: [app.addEnvironment('Environment')], }); Template.fromStack(stack).hasResourceProperties('AWS::AppConfig::ConfigurationProfile', { 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 c4faed3acb4c3..7be5ace16bc12 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/extension.test.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/extension.test.ts @@ -497,7 +497,7 @@ describe('extension', () => { const app = new Application(stack, 'MyApplication'); const configProfile = new HostedConfiguration(stack, 'MyConfiguration', { application: app, - content: ConfigurationContent.fromInline('This is my content.'), + content: ConfigurationContent.fromInlineJson('This is my content.'), }); const ext = new Extension(stack, 'MyExtension', { actions: [ diff --git a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/aws-appconfig-configuration.assets.json b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/aws-appconfig-configuration.assets.json index e245698a2ce83..3f2c4e58bfe66 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/aws-appconfig-configuration.assets.json +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/aws-appconfig-configuration.assets.json @@ -53,7 +53,7 @@ } } }, - "62a9b3aeb4a84560d1814dd4ac31c12a8f5047e3cde5873f6f4c351d7668af04": { + "76b9cabe996a7bad89a83038f1c4375968b6a16e8f5f1e2ce353b667d8576cbe": { "source": { "path": "aws-appconfig-configuration.template.json", "packaging": "file" @@ -61,7 +61,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "62a9b3aeb4a84560d1814dd4ac31c12a8f5047e3cde5873f6f4c351d7668af04.json", + "objectKey": "76b9cabe996a7bad89a83038f1c4375968b6a16e8f5f1e2ce353b667d8576cbe.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/aws-appconfig-configuration.template.json b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/aws-appconfig-configuration.template.json index b1eda3c6e7502..6dbdcb9b930ac 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/aws-appconfig-configuration.template.json +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/aws-appconfig-configuration.template.json @@ -105,7 +105,7 @@ "Ref": "MyHostedConfigConfigurationProfile2E1A2BBC" }, "Content": "This is my configuration content.", - "ContentType": "application/json" + "ContentType": "text/plain" }, "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain" @@ -150,7 +150,7 @@ "Ref": "MyHostedConfigFromJsonConfigurationProfile863E1E42" }, "Content": "This is the configuration content", - "ContentType": "application/json" + "ContentType": "text/plain" }, "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain" diff --git a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/manifest.json b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/manifest.json index 745926ca84296..803f0bed5f4f7 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/62a9b3aeb4a84560d1814dd4ac31c12a8f5047e3cde5873f6f4c351d7668af04.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/76b9cabe996a7bad89a83038f1c4375968b6a16e8f5f1e2ce353b667d8576cbe.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/tree.json b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/tree.json index 0f0a957f37369..df892fd33b39c 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.js.snapshot/tree.json @@ -49,7 +49,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-appconfig-alpha.Environment", "version": "0.0.0" } }, @@ -76,7 +76,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-appconfig-alpha.Environment", "version": "0.0.0" } }, @@ -103,7 +103,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-appconfig-alpha.Environment", "version": "0.0.0" } }, @@ -130,7 +130,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-appconfig-alpha.Environment", "version": "0.0.0" } }, @@ -157,7 +157,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-appconfig-alpha.Environment", "version": "0.0.0" } }, @@ -184,7 +184,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-appconfig-alpha.Environment", "version": "0.0.0" } }, @@ -211,13 +211,13 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-appconfig-alpha.Environment", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-appconfig-alpha.Application", "version": "0.0.0" } }, @@ -245,7 +245,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-appconfig-alpha.DeploymentStrategy", "version": "0.0.0" } }, @@ -290,7 +290,7 @@ "Ref": "MyHostedConfigConfigurationProfile2E1A2BBC" }, "content": "This is my configuration content.", - "contentType": "application/json" + "contentType": "text/plain" } }, "constructInfo": { @@ -328,8 +328,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.69" + "fqn": "@aws-cdk/aws-appconfig-alpha.HostedConfiguration", + "version": "0.0.0" } }, "MyHostedConfigFromJson": { @@ -367,7 +367,7 @@ "Ref": "MyHostedConfigFromJsonConfigurationProfile863E1E42" }, "content": "This is the configuration content", - "contentType": "application/json" + "contentType": "text/plain" } }, "constructInfo": { @@ -405,8 +405,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.69" + "fqn": "@aws-cdk/aws-appconfig-alpha.HostedConfiguration", + "version": "0.0.0" } }, "MyValidatorFunction": { @@ -717,8 +717,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.69" + "fqn": "@aws-cdk/aws-appconfig-alpha.SourcedConfiguration", + "version": "0.0.0" } }, "MyDocument": { @@ -897,8 +897,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.69" + "fqn": "@aws-cdk/aws-appconfig-alpha.SourcedConfiguration", + "version": "0.0.0" } }, "MyBucket": { @@ -1349,7 +1349,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-appconfig-alpha.DeploymentStrategy", "version": "0.0.0" } }, @@ -1515,8 +1515,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.69" + "fqn": "@aws-cdk/aws-appconfig-alpha.SourcedConfiguration", + "version": "0.0.0" } }, "MySecret": { @@ -1572,7 +1572,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-appconfig-alpha.DeploymentStrategy", "version": "0.0.0" } }, @@ -1664,8 +1664,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.69" + "fqn": "@aws-cdk/aws-appconfig-alpha.SourcedConfiguration", + "version": "0.0.0" } }, "MyKey": { @@ -1824,7 +1824,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-appconfig-alpha.DeploymentStrategy", "version": "0.0.0" } }, @@ -1926,8 +1926,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.69" + "fqn": "@aws-cdk/aws-appconfig-alpha.SourcedConfiguration", + "version": "0.0.0" } }, "MyPipeline": { @@ -2787,7 +2787,7 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.Resource", + "fqn": "@aws-cdk/aws-appconfig-alpha.DeploymentStrategy", "version": "0.0.0" } }, @@ -2821,8 +2821,8 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.69" + "fqn": "@aws-cdk/aws-appconfig-alpha.SourcedConfiguration", + "version": "0.0.0" } }, "BootstrapVersion": { 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 5722d6ae23a7f..ff28df311f576 100644 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.configuration.ts @@ -52,7 +52,7 @@ const deploymentStrategy = new DeploymentStrategy(stack, 'MyDeployStrategy', { const hostedEnv = appConfigApp.addEnvironment('HostedEnv'); new HostedConfiguration(stack, 'MyHostedConfig', { application: appConfigApp, - content: ConfigurationContent.fromInline('This is my configuration content.'), + content: ConfigurationContent.fromInlineText('This is my configuration content.'), deployTo: [hostedEnv], validators: [ JsonSchemaValidator.fromInline(SCHEMA_STR), @@ -65,7 +65,7 @@ new HostedConfiguration(stack, 'MyHostedConfig', { const hostedEnvFromJson = appConfigApp.addEnvironment('HostedEnvFromJson'); new HostedConfiguration(stack, 'MyHostedConfigFromJson', { application: appConfigApp, - content: ConfigurationContent.fromInline('This is the configuration content'), + content: ConfigurationContent.fromInlineText('This is the configuration content'), deployTo: [hostedEnvFromJson], deploymentStrategy, }); 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 65ff5986da603..7e6becd0d0e90 100755 --- a/packages/@aws-cdk/aws-appconfig-alpha/test/integ.extension.ts +++ b/packages/@aws-cdk/aws-appconfig-alpha/test/integ.extension.ts @@ -102,7 +102,7 @@ app.addExtension(busExtension); const env = app.addEnvironment('MyEnv'); const hostedConfig = new HostedConfiguration(stack, 'HostedConfiguration', { application: app, - content: ConfigurationContent.fromInline('This is my configuration content'), + content: ConfigurationContent.fromInlineJson('This is my configuration content'), deployTo: [env], deploymentStrategy: new DeploymentStrategy(stack, 'MyDeployStrategy', { rolloutStrategy: RolloutStrategy.linear({ diff --git a/yarn.lock b/yarn.lock index 75711b6c0dccf..c7ef459617048 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3874,6 +3874,11 @@ resolved "https://registry.npmjs.org/@types/md5/-/md5-2.3.2.tgz#529bb3f8a7e9e9f621094eb76a443f585d882528" integrity sha512-v+JFDu96+UYJ3/UWzB0mEglIS//MZXgRaJ4ubUPwOM0gvLc/kcQ3TWNYwENEK7/EcXGQVrW8h/XqednSjBd/Og== +"@types/mime-types@^2.1.1": + version "2.1.1" + resolved "https://registry.npmjs.org/@types/mime-types/-/mime-types-2.1.1.tgz#d9ba43490fa3a3df958759adf69396c3532cf2c1" + integrity sha512-vXOTGVSLR2jMw440moWTC7H19iUyLtP3Z1YTj7cSsubOICinjMxFeb/V57v9QdyyPGbbWolUFSSmSiRSn94tFw== + "@types/mime@^2.0.3": version "2.0.3" resolved "https://registry.npmjs.org/@types/mime/-/mime-2.0.3.tgz#c893b73721db73699943bfc3653b1deb7faa4a3a" @@ -8851,7 +8856,7 @@ jest-worker@^29.6.2: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^29, jest@^29.6.2: +jest@^29, jest@^29.6.1, jest@^29.6.2: version "29.6.2" resolved "https://registry.npmjs.org/jest/-/jest-29.6.2.tgz#3bd55b9fd46a161b2edbdf5f1d1bd0d1eab76c42" integrity sha512-8eQg2mqFbaP7CwfsTpCxQ+sHzw1WuNWL5UUvjnWP4hx2riGz9fPSzYOaU5q8/GqWn1TfgZIVTqYJygbGbWAANg== @@ -9906,7 +9911,7 @@ mime-db@1.52.0: resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12: +mime-types@^2.1.12, mime-types@^2.1.35: version "2.1.35" resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== From 52b43fc39964ab1791da0ae3d1344e68012bfd33 Mon Sep 17 00:00:00 2001 From: Luca Pizzini Date: Fri, 18 Aug 2023 13:15:36 +0200 Subject: [PATCH 02/19] chore(ecs-patterns): ScheduledFargateTaskProps is exposing unused props from FargateServiceBaseProps (#26737) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `ScheduledFargateTaskProps` was extending the `FargateServiceBaseProps` interface. The only property used from that interface is [`platformVersion`](https://github.com/aws/aws-cdk/blob/694b4067023d7422927dfde51cf9621395ca753b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts#L97). This change adds warning messages if the unused properties are specified: - `taskDefinition` - `cpu` - `memoryLimitMiB` - `runtimePlatform` Closes #26702. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/fargate/scheduled-fargate-task.ts | 15 ++++++++- .../fargate/scheduled-fargate-task.test.ts | 32 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts index 46b96a7bb1d4e..ec6d1dd1ebd2b 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts @@ -1,6 +1,7 @@ import { Construct } from 'constructs'; import { FargateTaskDefinition } from '../../../aws-ecs'; import { EcsTask } from '../../../aws-events-targets'; +import { Annotations } from '../../../core'; import { FargateServiceBaseProps } from '../base/fargate-service-base'; import { ScheduledTaskBase, ScheduledTaskBaseProps, ScheduledTaskImageProps } from '../base/scheduled-task-base'; @@ -23,7 +24,6 @@ export interface ScheduledFargateTaskProps extends ScheduledTaskBaseProps, Farga * @default none */ readonly scheduledFargateTaskImageOptions?: ScheduledFargateTaskImageOptions; - } /** @@ -88,6 +88,19 @@ export class ScheduledFargateTask extends ScheduledTaskBase { throw new Error('You must specify one of: taskDefinition or image'); } + if (props.taskDefinition) { + Annotations.of(this).addWarning('Property \'taskDefinition\' is ignored, use \'scheduledFargateTaskDefinitionOptions\' or \'scheduledFargateTaskImageOptions\' instead.'); + } + if (props.cpu) { + Annotations.of(this).addWarning('Property \'cpu\' is ignored, use \'scheduledFargateTaskImageOptions.cpu\' instead.'); + } + if (props.memoryLimitMiB) { + Annotations.of(this).addWarning('Property \'memoryLimitMiB\' is ignored, use \'scheduledFargateTaskImageOptions.memoryLimitMiB\' instead.'); + } + if (props.runtimePlatform) { + Annotations.of(this).addWarning('Property \'runtimePlatform\' is ignored.'); + } + // Use the EcsTask as the target of the EventRule this.task = new EcsTask( { cluster: this.cluster, diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/scheduled-fargate-task.test.ts b/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/scheduled-fargate-task.test.ts index caca8ef0d32b5..e18588fc10932 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/scheduled-fargate-task.test.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/scheduled-fargate-task.test.ts @@ -548,3 +548,35 @@ test('Scheduled Fargate Task - with list of tags', () => { ], }); }); + +test('Scheduled Fargate Task - with unused properties', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 1 }); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + + new ScheduledFargateTask(stack, 'ScheduledFargateTask', { + cluster, + scheduledFargateTaskImageOptions: { + image: ecs.ContainerImage.fromRegistry('henk'), + memoryLimitMiB: 512, + }, + schedule: events.Schedule.expression('rate(1 minute)'), + taskDefinition: new ecs.FargateTaskDefinition(stack, 'ScheduledFargateTaskDefinition'), + cpu: 256, + memoryLimitMiB: 512, + runtimePlatform: { + cpuArchitecture: ecs.CpuArchitecture.X86_64, + }, + }); + + // THEN + Annotations.fromStack(stack).hasWarning( + '/Default/ScheduledFargateTask', + Match.stringLikeRegexp('Property \'taskDefinition\' is ignored, use \'scheduledFargateTaskDefinitionOptions\' or \'scheduledFargateTaskImageOptions\' instead.'), + ); + Annotations.fromStack(stack).hasWarning('/Default/ScheduledFargateTask', Match.stringLikeRegexp('Property \'cpu\' is ignored, use \'scheduledFargateTaskImageOptions.cpu\' instead.')); + Annotations.fromStack(stack).hasWarning('/Default/ScheduledFargateTask', Match.stringLikeRegexp('Property \'memoryLimitMiB\' is ignored, use \'scheduledFargateTaskImageOptions.memoryLimitMiB\' instead.')); + Annotations.fromStack(stack).hasWarning('/Default/ScheduledFargateTask', Match.stringLikeRegexp('Property \'runtimePlatform\' is ignored.')); +}); + From e78e355729b01bfd7a6ba31256b8d3b85f6d04f4 Mon Sep 17 00:00:00 2001 From: Mitchell Valine Date: Fri, 18 Aug 2023 04:53:23 -0700 Subject: [PATCH 03/19] fix: aws-sdk still used in EKS custom resources (#26756) Removes usage of aws-sdk in eks custom resources. The remaining usage was only type references that appear to be forward compatible but this cleans up the code and makes it possible to remove aws-sdk as a dev dependency to aws-cdk-lib once the rout53 cross account zone delegation handler is updated. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/cluster-resource-handler/cluster.ts | 28 +++++++------- .../lib/cluster-resource-handler/common.ts | 18 ++++----- .../compareLogging.ts | 12 +++--- .../lib/cluster-resource-handler/fargate.ts | 13 +++---- .../test/cluster-resource-handler-mocks.ts | 37 +++++++++++-------- 5 files changed, 56 insertions(+), 52 deletions(-) diff --git a/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/cluster.ts b/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/cluster.ts index 3a0a7294db31d..433de220b6c83 100644 --- a/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/cluster.ts +++ b/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/cluster.ts @@ -1,9 +1,7 @@ /* eslint-disable no-console */ // eslint-disable-next-line import/no-extraneous-dependencies -import { ResourceNotFoundException } from '@aws-sdk/client-eks'; -// eslint-disable-next-line import/no-extraneous-dependencies -import * as aws from 'aws-sdk'; +import * as EKS from '@aws-sdk/client-eks'; import { EksClient, ResourceEvent, ResourceHandler } from './common'; import { compareLoggingProps } from './compareLogging'; import { IsCompleteResponse, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; @@ -19,8 +17,8 @@ export class ClusterResourceHandler extends ResourceHandler { return this.physicalResourceId; } - private readonly newProps: aws.EKS.CreateClusterRequest; - private readonly oldProps: Partial; + private readonly newProps: EKS.CreateClusterCommandInput; + private readonly oldProps: Partial; constructor(eks: EksClient, event: ResourceEvent) { super(eks, event); @@ -28,7 +26,7 @@ export class ClusterResourceHandler extends ResourceHandler { this.newProps = parseProps(this.event.ResourceProperties); this.oldProps = event.RequestType === 'Update' ? parseProps(event.OldResourceProperties) : {}; // compare newProps and oldProps and update the newProps by appending disabled LogSetup if any - const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); + const compared: Partial = compareLoggingProps(this.oldProps, this.newProps); this.newProps.logging = compared.logging; } @@ -71,7 +69,7 @@ export class ClusterResourceHandler extends ResourceHandler { try { await this.eks.deleteCluster({ name: this.clusterName }); } catch (e: any) { - if (!(e instanceof ResourceNotFoundException)) { + if (!(e instanceof EKS.ResourceNotFoundException)) { throw e; } else { console.log(`cluster ${this.clusterName} not found, idempotently succeeded`); @@ -90,7 +88,7 @@ export class ClusterResourceHandler extends ResourceHandler { console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2)); } catch (e: any) { // see https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/ - if (e instanceof ResourceNotFoundException) { + if (e instanceof EKS.ResourceNotFoundException) { console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)'); return { IsComplete: true }; } @@ -147,7 +145,7 @@ export class ClusterResourceHandler extends ResourceHandler { } if (updates.updateLogging || updates.updateAccess) { - const config: aws.EKS.UpdateClusterConfigRequest = { + const config: EKS.UpdateClusterConfigCommandInput = { name: this.clusterName, }; if (updates.updateLogging) { @@ -158,9 +156,9 @@ export class ClusterResourceHandler extends ResourceHandler { // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html) // will fail, therefore we take only the access fields explicitly config.resourcesVpcConfig = { - endpointPrivateAccess: this.newProps.resourcesVpcConfig.endpointPrivateAccess, - endpointPublicAccess: this.newProps.resourcesVpcConfig.endpointPublicAccess, - publicAccessCidrs: this.newProps.resourcesVpcConfig.publicAccessCidrs, + endpointPrivateAccess: this.newProps.resourcesVpcConfig?.endpointPrivateAccess, + endpointPublicAccess: this.newProps.resourcesVpcConfig?.endpointPublicAccess, + publicAccessCidrs: this.newProps.resourcesVpcConfig?.publicAccessCidrs, }; } const updateResponse = await this.eks.updateClusterConfig(config); @@ -241,7 +239,7 @@ export class ClusterResourceHandler extends ResourceHandler { OpenIdConnectIssuer: cluster.identity?.oidc?.issuer?.substring(8) ?? '', // Strips off https:// from the issuer url // We can safely return the first item from encryption configuration array, because it has a limit of 1 item - // https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig + // https://docs.amazon.com/eks/latest/APIReference/API_CreateCluster.html#AmazonEKS-CreateCluster-request-encryptionConfig EncryptionConfigKeyArn: cluster.encryptionConfig?.shift()?.provider?.keyArn ?? '', }, }; @@ -283,7 +281,7 @@ export class ClusterResourceHandler extends ResourceHandler { } } -function parseProps(props: any): aws.EKS.CreateClusterRequest { +function parseProps(props: any): EKS.CreateClusterCommandInput { const parsed = props?.Config ?? {}; @@ -317,7 +315,7 @@ interface UpdateMap { updateAccess: boolean; // resourcesVpcConfig.endpointPrivateAccess and endpointPublicAccess } -function analyzeUpdate(oldProps: Partial, newProps: aws.EKS.CreateClusterRequest): UpdateMap { +function analyzeUpdate(oldProps: Partial, newProps: EKS.CreateClusterCommandInput): UpdateMap { console.log('old props: ', JSON.stringify(oldProps)); console.log('new props: ', JSON.stringify(newProps)); diff --git a/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/common.ts b/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/common.ts index 368da91e414df..3e7eec86ef067 100644 --- a/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/common.ts +++ b/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/common.ts @@ -77,13 +77,13 @@ export abstract class ResourceHandler { export interface EksClient { configureAssumeRole(request: sts.AssumeRoleCommandInput): void; - createCluster(request: _eks.CreateClusterCommandInput): Promise<_eks.CreateClusterResponse>; - deleteCluster(request: _eks.DeleteClusterCommandInput): Promise<_eks.DeleteClusterResponse>; - describeCluster(request: _eks.DescribeClusterCommandInput): Promise<_eks.DescribeClusterResponse>; - updateClusterConfig(request: _eks.UpdateClusterConfigCommandInput): Promise<_eks.UpdateClusterConfigResponse>; - updateClusterVersion(request: _eks.UpdateClusterVersionCommandInput): Promise<_eks.UpdateClusterVersionResponse>; - describeUpdate(req: _eks.DescribeUpdateCommandInput): Promise<_eks.DescribeUpdateResponse>; - createFargateProfile(request: _eks.CreateFargateProfileCommandInput): Promise<_eks.CreateFargateProfileResponse>; - describeFargateProfile(request: _eks.DescribeFargateProfileCommandInput): Promise<_eks.DescribeFargateProfileResponse>; - deleteFargateProfile(request: _eks.DeleteFargateProfileCommandInput): Promise<_eks.DeleteFargateProfileResponse>; + createCluster(request: _eks.CreateClusterCommandInput): Promise<_eks.CreateClusterCommandOutput>; + deleteCluster(request: _eks.DeleteClusterCommandInput): Promise<_eks.DeleteClusterCommandOutput>; + describeCluster(request: _eks.DescribeClusterCommandInput): Promise<_eks.DescribeClusterCommandOutput>; + updateClusterConfig(request: _eks.UpdateClusterConfigCommandInput): Promise<_eks.UpdateClusterConfigCommandOutput>; + updateClusterVersion(request: _eks.UpdateClusterVersionCommandInput): Promise<_eks.UpdateClusterVersionCommandOutput>; + describeUpdate(req: _eks.DescribeUpdateCommandInput): Promise<_eks.DescribeUpdateCommandOutput>; + createFargateProfile(request: _eks.CreateFargateProfileCommandInput): Promise<_eks.CreateFargateProfileCommandOutput>; + describeFargateProfile(request: _eks.DescribeFargateProfileCommandInput): Promise<_eks.DescribeFargateProfileCommandOutput>; + deleteFargateProfile(request: _eks.DeleteFargateProfileCommandInput): Promise<_eks.DeleteFargateProfileCommandOutput>; } diff --git a/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/compareLogging.ts b/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/compareLogging.ts index 0eb9a9b6d253f..0a43d6c26365f 100644 --- a/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/compareLogging.ts +++ b/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/compareLogging.ts @@ -6,12 +6,14 @@ * @param newProps new properties * @returns result with LogSet with enabled:false if any */ +// eslint-disable-next-line import/no-extraneous-dependencies +import * as EKS from '@aws-sdk/client-eks'; -export function compareLoggingProps(oldProps: Partial, - newProps: Partial): Partial { - const result: Partial = { logging: {} }; - let enabledTypes: AWS.EKS.LogType[] = []; - let disabledTypes: AWS.EKS.LogType[] = []; +export function compareLoggingProps(oldProps: Partial, + newProps: Partial): Partial { + const result: Partial = { logging: {} }; + let enabledTypes: (EKS.LogType | string)[] = []; + let disabledTypes: (EKS.LogType | string)[] = []; if (newProps.logging?.clusterLogging === undefined && oldProps.logging?.clusterLogging === undefined) { return newProps; diff --git a/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/fargate.ts b/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/fargate.ts index 16b9f9abfeb49..a47a17cbec0a7 100644 --- a/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/fargate.ts +++ b/packages/aws-cdk-lib/aws-eks/lib/cluster-resource-handler/fargate.ts @@ -1,6 +1,5 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { ResourceNotFoundException } from '@aws-sdk/client-eks'; -import * as aws from 'aws-sdk'; // eslint-disable-line import/no-extraneous-dependencies +import * as EKS from '@aws-sdk/client-eks'; import { ResourceHandler } from './common'; const MAX_NAME_LEN = 63; @@ -9,7 +8,7 @@ export class FargateProfileResourceHandler extends ResourceHandler { protected async onCreate() { const fargateProfileName = this.event.ResourceProperties.Config.fargateProfileName ?? this.generateProfileName(); - const createFargateProfile: aws.EKS.CreateFargateProfileRequest = { + const createFargateProfile: EKS.CreateFargateProfileCommandInput = { fargateProfileName, ...this.event.ResourceProperties.Config, }; @@ -35,7 +34,7 @@ export class FargateProfileResourceHandler extends ResourceHandler { throw new Error('Cannot delete a profile without a physical id'); } - const deleteFargateProfile: aws.EKS.DeleteFargateProfileRequest = { + const deleteFargateProfile: EKS.DeleteFargateProfileCommandInput = { clusterName: this.event.ResourceProperties.Config.clusterName, fargateProfileName: this.physicalResourceId, }; @@ -86,12 +85,12 @@ export class FargateProfileResourceHandler extends ResourceHandler { * Queries the Fargate profile's current status and returns the status or * NOT_FOUND if the profile doesn't exist (i.e. it has been deleted). */ - private async queryStatus(): Promise { + private async queryStatus(): Promise { if (!this.physicalResourceId) { throw new Error('Unable to determine status for fargate profile without a resource name'); } - const describeFargateProfile: aws.EKS.DescribeFargateProfileRequest = { + const describeFargateProfile: EKS.DescribeFargateProfileCommandInput = { clusterName: this.event.ResourceProperties.Config.clusterName, fargateProfileName: this.physicalResourceId, }; @@ -109,7 +108,7 @@ export class FargateProfileResourceHandler extends ResourceHandler { return status; } catch (describeFargateProfileError: any) { - if (describeFargateProfileError instanceof ResourceNotFoundException) { + if (describeFargateProfileError instanceof EKS.ResourceNotFoundException) { this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)'); return 'NOT_FOUND'; } diff --git a/packages/aws-cdk-lib/aws-eks/test/cluster-resource-handler-mocks.ts b/packages/aws-cdk-lib/aws-eks/test/cluster-resource-handler-mocks.ts index 8cd2f45acf69e..bb1c49b5789df 100644 --- a/packages/aws-cdk-lib/aws-eks/test/cluster-resource-handler-mocks.ts +++ b/packages/aws-cdk-lib/aws-eks/test/cluster-resource-handler-mocks.ts @@ -1,6 +1,5 @@ import * as eks from '@aws-sdk/client-eks'; import * as sts from '@aws-sdk/client-sts'; -import * as sdk from 'aws-sdk'; import { EksClient } from '../lib/cluster-resource-handler/common'; /** @@ -9,15 +8,15 @@ import { EksClient } from '../lib/cluster-resource-handler/common'; */ export let actualRequest: { configureAssumeRoleRequest?: sts.AssumeRoleRequest; - createClusterRequest?: eks.CreateClusterRequest; - describeClusterRequest?: eks.DescribeClusterRequest; - describeUpdateRequest?: eks.DescribeUpdateRequest; - deleteClusterRequest?: eks.DeleteClusterRequest; - updateClusterConfigRequest?: eks.UpdateClusterConfigRequest; - updateClusterVersionRequest?: eks.UpdateClusterVersionRequest; - createFargateProfile?: eks.CreateFargateProfileRequest; - describeFargateProfile?: eks.DescribeFargateProfileRequest; - deleteFargateProfile?: eks.DeleteFargateProfileRequest; + createClusterRequest?: eks.CreateClusterCommandInput; + describeClusterRequest?: eks.DescribeClusterCommandInput; + describeUpdateRequest?: eks.DescribeUpdateCommandInput; + deleteClusterRequest?: eks.DeleteClusterCommandInput; + updateClusterConfigRequest?: eks.UpdateClusterConfigCommandInput; + updateClusterVersionRequest?: eks.UpdateClusterVersionCommandInput; + createFargateProfile?: eks.CreateFargateProfileCommandInput; + describeFargateProfile?: eks.DescribeFargateProfileCommandInput; + deleteFargateProfile?: eks.DeleteFargateProfileCommandInput; } = { }; /** @@ -26,7 +25,7 @@ export let actualRequest: { export let simulateResponse: { describeClusterResponseMockStatus?: string; describeUpdateResponseMockStatus?: string; - describeUpdateResponseMockErrors?: sdk.EKS.ErrorDetails; + describeUpdateResponseMockErrors?: eks.ErrorDetail[]; deleteClusterError?: Error; describeClusterException?: Error; } = { }; @@ -47,6 +46,7 @@ export const client: EksClient = { createCluster: async req => { actualRequest.createClusterRequest = req; return { + $metadata: {}, cluster: { name: req.name, roleArn: req.roleArn, @@ -64,6 +64,7 @@ export const client: EksClient = { throw simulateResponse.deleteClusterError; } return { + $metadata: {}, cluster: { name: req.name, }, @@ -78,6 +79,7 @@ export const client: EksClient = { } return { + $metadata: {}, cluster: { name: req.name, version: '1.0', @@ -94,6 +96,7 @@ export const client: EksClient = { actualRequest.describeUpdateRequest = req; return { + $metadata: {}, update: { id: req.updateId, errors: simulateResponse.describeUpdateResponseMockErrors, @@ -105,6 +108,7 @@ export const client: EksClient = { updateClusterConfig: async req => { actualRequest.updateClusterConfigRequest = req; return { + $metadata: {}, update: { id: MOCK_UPDATE_STATUS_ID, }, @@ -114,6 +118,7 @@ export const client: EksClient = { updateClusterVersion: async req => { actualRequest.updateClusterVersionRequest = req; return { + $metadata: {}, update: { id: MOCK_UPDATE_STATUS_ID, }, @@ -122,17 +127,17 @@ export const client: EksClient = { createFargateProfile: async req => { actualRequest.createFargateProfile = req; - return { }; + return { $metadata: {} }; }, describeFargateProfile: async req => { actualRequest.describeFargateProfile = req; - return { }; + return { $metadata: {} }; }, deleteFargateProfile: async req => { actualRequest.deleteFargateProfile = req; - return { }; + return { $metadata: {} }; }, }; @@ -148,8 +153,8 @@ export const MOCK_ASSUME_ROLE_ARN = 'assume:role:arn'; export function newRequest( requestType: T, - props?: Partial, - oldProps?: Partial) { + props?: Partial, + oldProps?: Partial) { return { StackId: 'fake-stack-id', RequestId: 'fake-request-id', From dbe5615b8e80c3bae67e3dd05674e340cac43931 Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Fri, 18 Aug 2023 08:20:31 -0400 Subject: [PATCH 04/19] chore(codebuild): improve the doc for subnetSelection (#26592) If `vpc` is specified with `subnetSelection` undefined, according to this: https://github.com/aws/aws-cdk/blob/d5c64cba9aa8af8e92af4893657d144ef8e4f873/packages/aws-cdk-lib/aws-ec2/lib/vpc.ts#L655-L660 CDK will look for `PRIVATE_WITH_EGRESS`, `PRIVATE_ISOLATED`, and `PUBLIC` in order. If customer does not have `PRIVATE_WITH_EGRESS` subnets, they will need to have vpc endpoints if they need to access AWS services such as AWS Secrets Manager or Amazon ECR. This PR improves the doc to clarify. Closes #. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk-lib/aws-codebuild/lib/project.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-codebuild/lib/project.ts b/packages/aws-cdk-lib/aws-codebuild/lib/project.ts index 245b36ab1c99c..403fdbe7e157b 100644 --- a/packages/aws-cdk-lib/aws-codebuild/lib/project.ts +++ b/packages/aws-cdk-lib/aws-codebuild/lib/project.ts @@ -616,9 +616,18 @@ export interface CommonProjectProps { /** * Where to place the network interfaces within the VPC. * - * Only used if 'vpc' is supplied. + * To access AWS services, your CodeBuild project needs to be in one of the following types of subnets: + * + * 1. Subnets with access to the internet (of type PRIVATE_WITH_EGRESS). + * 2. Private subnets unconnected to the internet, but with [VPC endpoints](https://docs.aws.amazon.com/codebuild/latest/userguide/use-vpc-endpoints-with-codebuild.html) for the necessary services. + * + * If you don't specify a subnet selection, the default behavior is to use PRIVATE_WITH_EGRESS subnets first if they exist, + * then PRIVATE_WITHOUT_EGRESS, and finally PUBLIC subnets. If your VPC doesn't have PRIVATE_WITH_EGRESS subnets but you need + * AWS service access, add VPC Endpoints to your private subnets. + * + * @see https://docs.aws.amazon.com/codebuild/latest/userguide/vpc-support.html for more details. * - * @default - All private subnets. + * @default - private subnets if available else public subnets */ readonly subnetSelection?: ec2.SubnetSelection; From 01a7b5b72a163c2bc2c69db6843567f6a81a4a36 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Fri, 18 Aug 2023 10:28:06 -0400 Subject: [PATCH 05/19] fix(assertions): stack overflow while parsing template (#26767) Closes #26766 The function `findCycle` tries to find a cycle by using a depth-first search (DFS). The DFS is implemented recursively in the recurse function. For each node, it tries to find a path that eventually leads back to the start of the path. If such a path is found, a cycle exists, and the nodes forming this cycle are returned. One of the bugs in the current implementation is that it only checks whether the current dependency `dep` is equal to the first node of the current path `path[0]`. This means it will only detect a cycle if the cycle includes the first node of the search, which might not always be the case. To fix this, the function should check whether the current dependency `dep` is already somewhere in the current path `path`. If it is, then a cycle has been found. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../assertions/lib/private/cyclic.ts | 4 ++-- .../assertions/test/template.test.ts | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/assertions/lib/private/cyclic.ts b/packages/aws-cdk-lib/assertions/lib/private/cyclic.ts index 109434cc14a8e..b7154c15e6fc8 100644 --- a/packages/aws-cdk-lib/assertions/lib/private/cyclic.ts +++ b/packages/aws-cdk-lib/assertions/lib/private/cyclic.ts @@ -167,7 +167,7 @@ function findCycle(deps: ReadonlyMap>): string[] { function recurse(node: string, path: string[]): string[] | undefined { for (const dep of deps.get(node) ?? []) { - if (dep === path[0]) { return [...path, dep]; } + if (path.includes(dep)) { return [...path, dep]; } const cycle = recurse(dep, [...path, dep]); if (cycle) { return cycle; } @@ -175,4 +175,4 @@ function findCycle(deps: ReadonlyMap>): string[] { return undefined; } -} \ No newline at end of file +} diff --git a/packages/aws-cdk-lib/assertions/test/template.test.ts b/packages/aws-cdk-lib/assertions/test/template.test.ts index 5ad22f6cb9164..46f4df1b4356e 100644 --- a/packages/aws-cdk-lib/assertions/test/template.test.ts +++ b/packages/aws-cdk-lib/assertions/test/template.test.ts @@ -1345,6 +1345,29 @@ describe('Template', () => { }).toThrow(/dependency cycle/); }); + test('throws when given a more complex template with cyclic dependencies', () => { + expect(() => { + Template.fromJSON({ + Resources: { + Res1: { + Type: 'Foo', + Properties: { + Thing: { Ref: 'Res2' }, + }, + }, + Res2: { + Type: 'Foo', + DependsOn: ['Res3'], + }, + Res3: { + Type: 'Foo', + DependsOn: ['Res2'], + }, + }, + }); + }).toThrow(/dependency cycle/); + }); + test('does not throw when given a template with cyclic dependencies if check is skipped', () => { expect(() => { Template.fromJSON({ From 70c374f75a1e3c4bedaab00067468e7a114f6aac Mon Sep 17 00:00:00 2001 From: Rico Hermans Date: Fri, 18 Aug 2023 16:54:13 +0200 Subject: [PATCH 06/19] fix(cloudformation-diff): fails on CloudFormation intrinsics in unexpected places (#26791) The `cloudformation-diff` module was written to parse templates that CDK itself would produce, mostly consisting of concrete values and barely any CloudFormation intrinsics. It would crash when encountering CloudFormation intrinsics in unexpected places (for example, an intrinsic where it expected an array). Make the parsing more robust, checking the types of various values before we try and access it. Property-based tests generate random templates to make sure we didn't forget any edge cases. Upgrade `fast-check` to the latest version while we're at it. Fixes #7413. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/diff/maybe-parsed.ts | 25 ++ .../cloudformation-diff/lib/diff/util.ts | 6 + .../lib/iam/iam-changes.ts | 11 +- .../lib/iam/managed-policy.ts | 9 +- .../cloudformation-diff/lib/iam/statement.ts | 9 +- .../lib/network/security-group-changes.ts | 8 +- .../lib/network/security-group-rule.ts | 8 +- .../@aws-cdk/cloudformation-diff/package.json | 2 +- .../test/diff-template.test.ts | 12 + .../test/iam/detect-changes.test.ts | 79 +++++- .../test/iam/statement.test.ts | 75 +----- .../test/network/rule.test.ts | 33 +-- .../test/test-arbitraries.ts | 253 ++++++++++++++++++ .../aws-applicationautoscaling/test/util.ts | 12 +- .../aws-autoscaling-common/test/util.ts | 12 +- packages/aws-cdk-lib/core/test/fn.test.ts | 16 +- packages/aws-cdk-lib/package.json | 2 +- packages/aws-cdk/package.json | 2 +- yarn.lock | 15 +- 19 files changed, 431 insertions(+), 158 deletions(-) create mode 100644 packages/@aws-cdk/cloudformation-diff/lib/diff/maybe-parsed.ts create mode 100644 packages/@aws-cdk/cloudformation-diff/test/test-arbitraries.ts diff --git a/packages/@aws-cdk/cloudformation-diff/lib/diff/maybe-parsed.ts b/packages/@aws-cdk/cloudformation-diff/lib/diff/maybe-parsed.ts new file mode 100644 index 0000000000000..4ae35a26caf80 --- /dev/null +++ b/packages/@aws-cdk/cloudformation-diff/lib/diff/maybe-parsed.ts @@ -0,0 +1,25 @@ +/** + * A value that may or may not be parseable + */ +export type MaybeParsed = Parsed | UnparseableCfn; + +export interface Parsed { + readonly type: 'parsed'; + readonly value: A; +} + +export interface UnparseableCfn { + readonly type: 'unparseable'; + readonly repr: string; +} + +export function mkParsed(value: A): Parsed { + return { type: 'parsed', value }; +} + +export function mkUnparseable(value: any): UnparseableCfn { + return { + type: 'unparseable', + repr: typeof value === 'string' ? value : JSON.stringify(value), + }; +} diff --git a/packages/@aws-cdk/cloudformation-diff/lib/diff/util.ts b/packages/@aws-cdk/cloudformation-diff/lib/diff/util.ts index 8b076dd36221e..53c816778b2e4 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/diff/util.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/diff/util.ts @@ -113,6 +113,12 @@ export function diffKeyedEntities( for (const logicalId of unionOf(Object.keys(oldValue || {}), Object.keys(newValue || {}))) { const oldElement = oldValue && oldValue[logicalId]; const newElement = newValue && newValue[logicalId]; + + if (oldElement === undefined && newElement === undefined) { + // Shouldn't happen in reality, but may happen in tests. Skip. + continue; + } + result[logicalId] = elementDiff(oldElement, newElement, logicalId); } return result; diff --git a/packages/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.ts b/packages/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.ts index 2eabea69e6638..f18ac6dfcab52 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.ts @@ -2,6 +2,7 @@ import * as cfnspec from '@aws-cdk/cfnspec'; import * as chalk from 'chalk'; import { ManagedPolicyAttachment, ManagedPolicyJson } from './managed-policy'; import { parseLambdaPermission, parseStatements, Statement, StatementJson } from './statement'; +import { MaybeParsed } from '../diff/maybe-parsed'; import { PropertyChange, PropertyMap, ResourceChange } from '../diff/types'; import { DiffableCollection } from '../diffable'; import { renderIntrinsics } from '../render-intrinsics'; @@ -184,7 +185,7 @@ export class IamChanges { * Parse a list of policies on an identity */ private readIdentityPolicies(policies: any, logicalId: string): Statement[] { - if (policies === undefined) { return []; } + if (policies === undefined || !Array.isArray(policies)) { return []; } const appliesToPrincipal = 'AWS:${' + logicalId + '}'; @@ -276,8 +277,8 @@ function defaultResource(resource: string, statements: Statement[]) { } export interface IamChangesJson { - statementAdditions?: StatementJson[]; - statementRemovals?: StatementJson[]; - managedPolicyAdditions?: ManagedPolicyJson[]; - managedPolicyRemovals?: ManagedPolicyJson[]; + statementAdditions?: Array>; + statementRemovals?: Array>; + managedPolicyAdditions?: Array>; + managedPolicyRemovals?: Array>; } diff --git a/packages/@aws-cdk/cloudformation-diff/lib/iam/managed-policy.ts b/packages/@aws-cdk/cloudformation-diff/lib/iam/managed-policy.ts index f0d54140398bc..57f6fe76a6877 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/iam/managed-policy.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/iam/managed-policy.ts @@ -1,3 +1,5 @@ +import { MaybeParsed, mkParsed } from '../diff/maybe-parsed'; + export class ManagedPolicyAttachment { public static parseManagedPolicies(identityArn: string, arns: string | string[]): ManagedPolicyAttachment[] { return typeof arns === 'string' @@ -19,8 +21,11 @@ export class ManagedPolicyAttachment { * * @internal */ - public _toJson(): ManagedPolicyJson { - return { identityArn: this.identityArn, managedPolicyArn: this.managedPolicyArn }; + public _toJson(): MaybeParsed { + return mkParsed({ + identityArn: this.identityArn, + managedPolicyArn: this.managedPolicyArn, + }); } } diff --git a/packages/@aws-cdk/cloudformation-diff/lib/iam/statement.ts b/packages/@aws-cdk/cloudformation-diff/lib/iam/statement.ts index c0bedec4292de..a2eacf037959d 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/iam/statement.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/iam/statement.ts @@ -1,3 +1,4 @@ +import { MaybeParsed, mkParsed, mkUnparseable } from '../diff/maybe-parsed'; import { deepRemoveUndefined } from '../util'; // namespace object imports won't work in the bundle for function exports @@ -94,17 +95,17 @@ export class Statement { * * @internal */ - public _toJson(): StatementJson { + public _toJson(): MaybeParsed { return this.serializedIntrinsic - ? this.serializedIntrinsic - : deepRemoveUndefined({ + ? mkUnparseable(this.serializedIntrinsic) + : mkParsed(deepRemoveUndefined({ sid: this.sid, effect: this.effect, resources: this.resources._toJson(), principals: this.principals._toJson(), actions: this.actions._toJson(), condition: this.condition, - }); + })); } /** diff --git a/packages/@aws-cdk/cloudformation-diff/lib/network/security-group-changes.ts b/packages/@aws-cdk/cloudformation-diff/lib/network/security-group-changes.ts index f03e29efe9927..3d6092067388f 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/network/security-group-changes.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/network/security-group-changes.ts @@ -97,12 +97,16 @@ export class SecurityGroupChanges { } private readInlineRules(rules: any, logicalId: string): SecurityGroupRule[] { - if (!rules) { return []; } + if (!rules || !Array.isArray(rules)) { return []; } // UnCloudFormation so the parser works in an easier domain const ref = '${' + logicalId + '.GroupId}'; - return rules.map((r: any) => new SecurityGroupRule(renderIntrinsics(r), ref)); + return rules.flatMap((r: any) => { + const rendered = renderIntrinsics(r); + // SecurityGroupRule is not robust against unparsed objects + return typeof rendered === 'object' ? [new SecurityGroupRule(rendered, ref)] : []; + }); } private readRuleResource(resource: any): SecurityGroupRule[] { diff --git a/packages/@aws-cdk/cloudformation-diff/lib/network/security-group-rule.ts b/packages/@aws-cdk/cloudformation-diff/lib/network/security-group-rule.ts index f382918afa98b..fda8cb0404d25 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/network/security-group-rule.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/network/security-group-rule.ts @@ -121,8 +121,12 @@ function peerEqual(a?: RulePeer, b?: RulePeer) { function findFirst(obj: any, keys: string[], fn: (x: string) => T): T | undefined { for (const key of keys) { - if (key in obj) { - return fn(obj[key]); + try { + if (key in obj) { + return fn(obj[key]); + } + } catch (e) { + debugger; } } return undefined; diff --git a/packages/@aws-cdk/cloudformation-diff/package.json b/packages/@aws-cdk/cloudformation-diff/package.json index 92eea6c2988a8..229a1efa6c8ca 100644 --- a/packages/@aws-cdk/cloudformation-diff/package.json +++ b/packages/@aws-cdk/cloudformation-diff/package.json @@ -35,7 +35,7 @@ "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^29.5.3", "@types/string-width": "^4.0.1", - "fast-check": "^2.25.0", + "fast-check": "^3.12.0", "jest": "^29.6.2", "ts-jest": "^29.1.1" }, diff --git a/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts b/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts index 642f5cc8b86a2..5c755339fd737 100644 --- a/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts +++ b/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts @@ -1,3 +1,5 @@ +import * as fc from 'fast-check'; +import { arbitraryTemplate } from './test-arbitraries'; import { diffTemplate, ResourceImpact } from '../lib/diff-template'; const POLICY_DOCUMENT = { foo: 'Bar' }; // Obviously a fake one! @@ -689,3 +691,13 @@ test('handles a resource changing its Type', () => { resourceTypes: { newType: 'AWS::ApiGateway::RestApi', oldType: 'AWS::Serverless::Api' }, }); }); + +test('diffing any two arbitrary templates should not crash', () => { + // We're not interested in making sure we find the right differences here -- just + // that we're not crashing. + fc.assert(fc.property(arbitraryTemplate, arbitraryTemplate, (t1, t2) => { + diffTemplate(t1, t2); + }), { + // path: '1:0:0:0:3:0:1:1:1:1:1:1:1:1:1:1:1:1:1:2:1:1:1', + }); +}); diff --git a/packages/@aws-cdk/cloudformation-diff/test/iam/detect-changes.test.ts b/packages/@aws-cdk/cloudformation-diff/test/iam/detect-changes.test.ts index fd457cd701b66..c9e70ec456c4e 100644 --- a/packages/@aws-cdk/cloudformation-diff/test/iam/detect-changes.test.ts +++ b/packages/@aws-cdk/cloudformation-diff/test/iam/detect-changes.test.ts @@ -1,4 +1,7 @@ import { diffTemplate } from '../../lib'; +import { MaybeParsed } from '../../lib/diff/maybe-parsed'; +import { IamChangesJson } from '../../lib/iam/iam-changes'; +import { deepRemoveUndefined } from '../../lib/util'; import { poldoc, policy, resource, role, template } from '../util'; test('shows new AssumeRolePolicyDocument', () => { @@ -14,7 +17,7 @@ test('shows new AssumeRolePolicyDocument', () => { })); // THEN - expect(diff.iamChanges._toJson()).toEqual({ + expect(unwrapParsed(diff.iamChanges._toJson())).toEqual({ statementAdditions: [ { effect: 'Allow', @@ -41,7 +44,7 @@ test('implicitly knows principal of identity policy for all resource types', () })); // THEN - expect(diff.iamChanges._toJson()).toEqual({ + expect(unwrapParsed(diff.iamChanges._toJson())).toEqual({ statementAdditions: [ { effect: 'Allow', @@ -73,7 +76,7 @@ test('policies on an identity object', () => { })); // THEN - expect(diff.iamChanges._toJson()).toEqual({ + expect(unwrapParsed(diff.iamChanges._toJson())).toEqual({ statementAdditions: [ { effect: 'Allow', @@ -86,6 +89,39 @@ test('policies on an identity object', () => { } }); +test('statement is an intrinsic', () => { + const diff = diffTemplate({}, template({ + MyIdentity: resource('AWS::IAM::User', { + Policies: [ + { + PolicyName: 'Polly', + PolicyDocument: poldoc({ + 'Fn::If': [ + 'SomeCondition', + { + Effect: 'Allow', + Action: 's3:DoThatThing', + Resource: '*', + }, + { Ref: 'AWS::NoValue' }, + ], + }), + }, + ], + }), + })); + + // THEN + expect(diff.iamChanges._toJson()).toEqual({ + statementAdditions: [ + { + type: 'unparseable', + repr: '{"Fn::If":["SomeCondition",{"Effect":"Allow","Action":"s3:DoThatThing","Resource":"*"}]}', + }, + ], + }); +}); + test('if policy is attached to multiple roles all are shown', () => { // WHEN const diff = diffTemplate({}, template({ @@ -100,7 +136,7 @@ test('if policy is attached to multiple roles all are shown', () => { })); // THEN - expect(diff.iamChanges._toJson()).toEqual({ + expect(unwrapParsed(diff.iamChanges._toJson())).toEqual({ statementAdditions: [ { effect: 'Allow', @@ -131,7 +167,7 @@ test('correctly parses Lambda permissions', () => { })); // THEN - expect(diff.iamChanges._toJson()).toEqual({ + expect(unwrapParsed(diff.iamChanges._toJson())).toEqual({ statementAdditions: [ { effect: 'Allow', @@ -162,7 +198,7 @@ test('implicitly knows resource of (queue) resource policy even if * given', () })); // THEN - expect(diff.iamChanges._toJson()).toEqual({ + expect(unwrapParsed(diff.iamChanges._toJson())).toEqual({ statementAdditions: [ { effect: 'Allow', @@ -189,7 +225,7 @@ test('finds sole statement removals', () => { }), {}); // THEN - expect(diff.iamChanges._toJson()).toEqual({ + expect(unwrapParsed(diff.iamChanges._toJson())).toEqual({ statementRemovals: [ { effect: 'Allow', @@ -233,7 +269,7 @@ test('finds one of many statement removals', () => { })); // THEN - expect(diff.iamChanges._toJson()).toEqual({ + expect(unwrapParsed(diff.iamChanges._toJson())).toEqual({ statementRemovals: [ { effect: 'Allow', @@ -254,7 +290,7 @@ test('finds policy attachments', () => { })); // THEN - expect(diff.iamChanges._toJson()).toEqual({ + expect(unwrapParsed(diff.iamChanges._toJson())).toEqual({ managedPolicyAdditions: [ { identityArn: '${SomeRole}', @@ -279,7 +315,7 @@ test('finds policy removals', () => { })); // THEN - expect(diff.iamChanges._toJson()).toEqual({ + expect(unwrapParsed(diff.iamChanges._toJson())).toEqual({ managedPolicyRemovals: [ { identityArn: '${SomeRole}', @@ -314,7 +350,7 @@ test('queuepolicy queue change counts as removal+addition', () => { })); // THEN - expect(diff.iamChanges._toJson()).toEqual({ + expect(unwrapParsed(diff.iamChanges._toJson())).toEqual({ statementAdditions: [ { effect: 'Allow', @@ -354,7 +390,7 @@ test('supports Fn::If in the top-level property value of Role', () => { })); // THEN - expect(diff.iamChanges._toJson()).toEqual({ + expect(unwrapParsed(diff.iamChanges._toJson())).toEqual({ managedPolicyAdditions: [ { identityArn: '${MyRole}', @@ -420,3 +456,22 @@ test('supports Fn::If in the elements of an array-typed property of Role', () => expect(changedPolicies[resourceColumn]).toContain('{"Fn::If":["SomeCondition",{"PolicyName":"S3","PolicyDocument":{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"s3:GetObject","Resource":"*"}]}}]}'); expect(changedPolicies[principalColumn]).toContain('AWS:${MyRole}'); }); + +/** + * Assume that all types are parsed, and unwrap them + */ +function unwrapParsed(chg: IamChangesJson) { + return deepRemoveUndefined({ + managedPolicyAdditions: chg.managedPolicyAdditions?.map(unwrap1), + managedPolicyRemovals: chg.managedPolicyRemovals?.map(unwrap1), + statementAdditions: chg.statementAdditions?.map(unwrap1), + statementRemovals: chg.statementRemovals?.map(unwrap1), + }); + + function unwrap1(x: MaybeParsed): A { + if (x.type !== 'parsed') { + throw new Error(`Expected parsed expression, found: "${x.repr}"`); + } + return x.value; + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/cloudformation-diff/test/iam/statement.test.ts b/packages/@aws-cdk/cloudformation-diff/test/iam/statement.test.ts index b0037d7d15b5c..9e65daa5bc987 100644 --- a/packages/@aws-cdk/cloudformation-diff/test/iam/statement.test.ts +++ b/packages/@aws-cdk/cloudformation-diff/test/iam/statement.test.ts @@ -1,5 +1,6 @@ import * as fc from 'fast-check'; import { parseLambdaPermission, renderCondition, Statement } from '../../lib/iam/statement'; +import { arbitraryStatement, twoArbitraryStatements } from '../test-arbitraries'; test('can parse all positive fields', () => { const statement = new Statement({ @@ -138,77 +139,3 @@ test('equality is symmetric', () => { }, )); }); - -// We should be testing transitivity as well but it's too much code to generate -// arbitraries that satisfy the precondition enough times to be useful. - -const arbitraryResource = fc.oneof(fc.constantFrom('*', 'arn:resource')); -const arbitraryAction = fc.constantFrom('*', 's3:*', 's3:GetObject', 's3:PutObject'); -const arbitraryPrincipal = fc.oneof( - fc.constant(undefined), - fc.constant('*'), - fc.record({ AWS: fc.oneof(fc.string(), fc.constant('*')) }), - fc.record({ Service: fc.string() }), - fc.record({ Federated: fc.string() }), -); -const arbitraryCondition = fc.oneof( - fc.constant(undefined), - fc.constant({ StringEquals: { Key: 'Value' } }), - fc.constant({ StringEquals: { Key: 'Value' }, NumberEquals: { Key: 5 } }), -); - -const arbitraryStatement = fc.record({ - Sid: fc.oneof(fc.string(), fc.constant(undefined)), - Effect: fc.constantFrom('Allow', 'Deny'), - Resource: fc.array(arbitraryResource, 0, 2), - NotResource: fc.boolean(), - Action: fc.array(arbitraryAction, 1, 2), - NotAction: fc.boolean(), - Principal: fc.array(arbitraryPrincipal, 0, 2), - NotPrincipal: fc.boolean(), - Condition: arbitraryCondition, -}).map(record => { - // This map() that shuffles keys is the easiest way to create variation between Action/NotAction etc. - makeNot(record, 'Resource', 'NotResource'); - makeNot(record, 'Action', 'NotAction'); - makeNot(record, 'Principal', 'NotPrincipal'); - return record; -}); - -function makeNot(obj: any, key: string, notKey: string) { - if (obj[notKey]) { - obj[notKey] = obj[key]; - delete obj[key]; - } else { - delete obj[notKey]; - } -} - -/** - * Two statements where one is a modification of the other - * - * This is to generate two statements that have a higher chance of being similar - * than generating two arbitrary statements independently. - */ -const twoArbitraryStatements = fc.record({ - statement1: arbitraryStatement, - statement2: arbitraryStatement, - copySid: fc.boolean(), - copyEffect: fc.boolean(), - copyResource: fc.boolean(), - copyAction: fc.boolean(), - copyPrincipal: fc.boolean(), - copyCondition: fc.boolean(), -}).map(op => { - const original = op.statement1; - const modified = Object.create(original, {}); - - if (op.copySid) { modified.Sid = op.statement2.Sid; } - if (op.copyEffect) { modified.Effect = op.statement2.Effect; } - if (op.copyResource) { modified.Resource = op.statement2.Resource; modified.NotResource = op.statement2.NotResource; } - if (op.copyAction) { modified.Action = op.statement2.Action; modified.NotAction = op.statement2.NotAction; } - if (op.copyPrincipal) { modified.Principal = op.statement2.Principal; modified.NotPrincipal = op.statement2.NotPrincipal; } - if (op.copyCondition) { modified.Condition = op.statement2.Condition; } - - return { statement1: original, statement2: modified }; -}); diff --git a/packages/@aws-cdk/cloudformation-diff/test/network/rule.test.ts b/packages/@aws-cdk/cloudformation-diff/test/network/rule.test.ts index e790deb4ed7ad..234eb3ebd7c99 100644 --- a/packages/@aws-cdk/cloudformation-diff/test/network/rule.test.ts +++ b/packages/@aws-cdk/cloudformation-diff/test/network/rule.test.ts @@ -1,5 +1,6 @@ import * as fc from 'fast-check'; import { SecurityGroupRule } from '../../lib/network/security-group-rule'; +import { arbitraryRule, twoArbitraryRules } from '../test-arbitraries'; test('can parse cidr-ip', () => { const rule = new SecurityGroupRule({ @@ -73,35 +74,3 @@ test('equality is symmetric', () => { }, )); }); - -const arbitraryRule = fc.record({ - IpProtocol: fc.constantFrom('tcp', 'udp', 'icmp'), - FromPort: fc.integer(80, 81), - ToPort: fc.integer(81, 82), - CidrIp: fc.constantFrom('0.0.0.0/0', '1.2.3.4/8', undefined, undefined), - DestinationSecurityGroupId: fc.constantFrom('sg-1234', undefined), - DestinationPrefixListId: fc.constantFrom('pl-1', undefined), -}); - -const twoArbitraryRules = fc.record({ - rule1: arbitraryRule, - rule2: arbitraryRule, - copyIp: fc.boolean(), - copyFromPort: fc.boolean(), - copyToPort: fc.boolean(), - copyCidrIp: fc.boolean(), - copySecurityGroupId: fc.boolean(), - copyPrefixListId: fc.boolean(), -}).map(op => { - const original = op.rule1; - const modified = Object.create(original, {}); - - if (op.copyIp) { modified.IpProtocol = op.rule2.IpProtocol; } - if (op.copyFromPort) { modified.FromPort = op.rule2.FromPort; } - if (op.copyToPort) { modified.ToPort = op.rule2.ToPort; } - if (op.copyCidrIp) { modified.CidrIp = op.rule2.CidrIp; } - if (op.copySecurityGroupId) { modified.DestinationSecurityGroupId = op.rule2.DestinationSecurityGroupId; } - if (op.copyPrefixListId) { modified.DestinationPrefixListId = op.rule2.DestinationPrefixListId; } - - return { rule1: original, rule2: modified }; -}); diff --git a/packages/@aws-cdk/cloudformation-diff/test/test-arbitraries.ts b/packages/@aws-cdk/cloudformation-diff/test/test-arbitraries.ts new file mode 100644 index 0000000000000..b1fbb12596715 --- /dev/null +++ b/packages/@aws-cdk/cloudformation-diff/test/test-arbitraries.ts @@ -0,0 +1,253 @@ +import * as fc from 'fast-check'; + +// We should be testing transitivity as well but it's too much code to generate +// arbitraries that satisfy the precondition enough times to be useful. + +function makeNot(obj: any, key: string, notKey: string) { + if (obj[notKey]) { + obj[notKey] = obj[key]; + delete obj[key]; + } else { + delete obj[notKey]; + } +} + +/** + * fc.option generates 'null' by default which our code is not robust against + * + * Use a variant that always produces 'undefined'. + */ +function maybe(x: fc.Arbitrary) { + return fc.option(x, { nil: undefined }); +} + +////////////////////////////////////////////////////////////////////// +// IAM + +const arbitraryArn = fc.oneof(fc.constantFrom('*', 'arn:resource', { Ref: 'SomeResource' })); +const arbitraryAction = fc.constantFrom('*', 's3:*', 's3:GetObject', 's3:PutObject', { Ref: 'SomeAction' }); +const arbitraryPrincipal = fc.oneof( + fc.constant(undefined), + fc.constant('*'), + fc.record({ AWS: fc.oneof(fc.string(), fc.constant('*')) }), + fc.record({ Service: fc.string() }), + fc.string({ minLength: 1 }).map((svcName) => ({ Service: { 'Fn::Join': ['', [svcName, '.amazonaws.com']] } })), + fc.record({ Federated: fc.string() }), +); +const arbitraryCondition = fc.oneof( + fc.constant(undefined), + fc.constant({ StringEquals: { Key: 'Value' } }), + fc.constant({ StringEquals: { Key: 'Value' }, NumberEquals: { Key: 5 } }), +); + +export const arbitraryStatement = fc.record({ + Sid: fc.oneof(fc.string(), fc.constant(undefined)), + Effect: fc.constantFrom('Allow', 'Deny'), + Resource: fc.array(arbitraryArn, { minLength: 0, maxLength: 2 }), + NotResource: fc.boolean(), + Action: fc.array(arbitraryAction, { minLength: 1, maxLength: 2 }), + NotAction: fc.boolean(), + Principal: fc.array(arbitraryPrincipal, { minLength: 0, maxLength: 2 }), + NotPrincipal: fc.boolean(), + Condition: arbitraryCondition, +}).map(record => { + // This map() that shuffles keys is the easiest way to create variation between Action/NotAction etc. + makeNot(record, 'Resource', 'NotResource'); + makeNot(record, 'Action', 'NotAction'); + makeNot(record, 'Principal', 'NotPrincipal'); + return record; +}); + +/** + * Two statements where one is a modification of the other + * + * This is to generate two statements that have a higher chance of being similar + * than generating two arbitrary statements independently. + */ +export const twoArbitraryStatements = fc.record({ + statement1: arbitraryStatement, + statement2: arbitraryStatement, + copySid: fc.boolean(), + copyEffect: fc.boolean(), + copyResource: fc.boolean(), + copyAction: fc.boolean(), + copyPrincipal: fc.boolean(), + copyCondition: fc.boolean(), +}).map(op => { + const original = op.statement1; + const modified = Object.create(original, {}); + + if (op.copySid) { modified.Sid = op.statement2.Sid; } + if (op.copyEffect) { modified.Effect = op.statement2.Effect; } + if (op.copyResource) { modified.Resource = op.statement2.Resource; modified.NotResource = op.statement2.NotResource; } + if (op.copyAction) { modified.Action = op.statement2.Action; modified.NotAction = op.statement2.NotAction; } + if (op.copyPrincipal) { modified.Principal = op.statement2.Principal; modified.NotPrincipal = op.statement2.NotPrincipal; } + if (op.copyCondition) { modified.Condition = op.statement2.Condition; } + + return { statement1: original, statement2: modified }; +}); + +////////////////////////////////////////////////////////////////////// +// SECURITY GROUPS + +export const arbitraryRule = fc.record({ + IpProtocol: fc.constantFrom('tcp', 'udp', 'icmp'), + FromPort: fc.integer({ min: 80, max: 81 }), + ToPort: fc.integer({ min: 81, max: 82 }), + CidrIp: fc.constantFrom('0.0.0.0/0', '1.2.3.4/8', undefined, undefined), + DestinationSecurityGroupId: fc.constantFrom('sg-1234', undefined), + DestinationPrefixListId: fc.constantFrom('pl-1', undefined), +}); + +export const twoArbitraryRules = fc.record({ + rule1: arbitraryRule, + rule2: arbitraryRule, + copyIp: fc.boolean(), + copyFromPort: fc.boolean(), + copyToPort: fc.boolean(), + copyCidrIp: fc.boolean(), + copySecurityGroupId: fc.boolean(), + copyPrefixListId: fc.boolean(), +}).map(op => { + const original = op.rule1; + const modified = Object.create(original, {}); + + if (op.copyIp) { modified.IpProtocol = op.rule2.IpProtocol; } + if (op.copyFromPort) { modified.FromPort = op.rule2.FromPort; } + if (op.copyToPort) { modified.ToPort = op.rule2.ToPort; } + if (op.copyCidrIp) { modified.CidrIp = op.rule2.CidrIp; } + if (op.copySecurityGroupId) { modified.DestinationSecurityGroupId = op.rule2.DestinationSecurityGroupId; } + if (op.copyPrefixListId) { modified.DestinationPrefixListId = op.rule2.DestinationPrefixListId; } + + return { rule1: original, rule2: modified }; +}); + +function maybeIntrinsic(x: fc.Arbitrary) { + return fc.oneof( + x, + x.map((value) => ({ 'Fn::If': ['Condition', value, { Ref: 'AWS::NoValue' }] })), + ); +} + +const arbitraryPolicyDocument = fc.record({ + Version: fc.constant('2012-10-17'), + Statement: maybeIntrinsic(fc.array(maybeIntrinsic(arbitraryStatement), { maxLength: 5 })), +}); + +////////////////////////////////////////////////////////////////////// +// Generate a template with a subset of a predefined number of resources in it + +const arbitraryRole = fc.record({ + AssumeRolePolicyDocument: arbitraryPolicyDocument, + ManagedPolicyArns: maybe(maybeIntrinsic(fc.array(arbitraryArn, { maxLength: 2 }))), + Policies: maybe(maybeIntrinsic(fc.array(maybeIntrinsic(fc.record({ + PolicyName: fc.hexaString(), + PolicyDocument: maybeIntrinsic(arbitraryPolicyDocument), + })), { maxLength: 3 }))), +}); + +const arbitraryPolicy = fc.record({ + PolicyName: fc.hexaString(), + PolicyDocument: maybeIntrinsic(arbitraryPolicyDocument), +}); + +const arbitraryBucketPolicy = fc.record({ + PolicyDocument: maybeIntrinsic(arbitraryPolicyDocument), +}); + +const arbitraryIngress = fc.record({ + CidrIp: maybe(fc.hexaString()), + CidrIpv6: maybe(fc.hexaString()), + Description: maybe(fc.hexaString()), + FromPort: maybe(fc.integer()), + IpProtocol: fc.hexaString(), + SourcePrefixListId: maybe(fc.hexaString()), + SourceSecurityGroupId: maybe(fc.hexaString()), + ToPort: maybe(fc.integer()), +}); + +const arbitraryEgress = fc.record({ + CidrIp: maybe(fc.hexaString()), + CidrIpv6: maybe(fc.hexaString()), + Description: maybe(fc.hexaString()), + DestinationPrefixListId: maybe(fc.hexaString()), + DestinationSecurityGroupId: maybe(fc.hexaString()), + IpProtocol: fc.hexaString(), + FromPort: maybe(fc.integer()), + ToPort: maybe(fc.integer()), +}); + +const arbitrarySecurityGroup = fc.record({ + SecurityGroupIngress: maybe(maybeIntrinsic(fc.array(maybeIntrinsic(arbitraryIngress), { maxLength: 5 }))), + SecurityGroupEgress: maybe(maybeIntrinsic(fc.array(maybeIntrinsic(arbitraryEgress), { maxLength: 5 }))), +}); + +export const arbitraryTemplate = fc.record({ + role: maybe(arbitraryRole), + policy: maybe(arbitraryPolicy), + bucketWithPolicy: maybe(arbitraryBucketPolicy), + securityGroup: maybe(arbitrarySecurityGroup), + ingressRule: maybe(arbitraryIngress), + egressRule: maybe(arbitraryEgress), +}).map((generate) => { + return { + Resources: Object.assign( + {}, + mapVal(generate.role, (roleProps) => ({ + MyRole: { + Type: 'AWS::IAM::Role', + Properties: roleProps, + }, + })), + mapVal(generate.role && generate.policy, (policyProps) => ({ + MyPolicy: { + Type: 'AWS::IAM::Policy', + Properties: { + Roles: [{ Ref: 'MyRole' }], + ...policyProps, + }, + }, + })), + mapVal(generate.bucketWithPolicy, (bucketPol) => ({ + MyBucket: { + Type: 'AWS::S3::Bucket', + }, + MyBucketPolicy: { + Type: 'AWS::S3::BucketPolicy', + Properties: { + Bucket: { Ref: 'MyBucket' }, + ...bucketPol, + }, + }, + })), + mapVal(generate.securityGroup, (sgProps) => ({ + MySecurityGroup: { + Type: 'AWS::EC2::SecurityGroup', + Properties: sgProps, + }, + })), + mapVal(generate.securityGroup && generate.ingressRule, (ingressProps) => ({ + MyIngress: { + Type: 'AWS::EC2::SecurityGroupIngress', + Properties: { + GroupId: { Ref: 'MySecurityGroup' }, + ...ingressProps, + }, + }, + })), + mapVal(generate.securityGroup && generate.egressRule, (egressProps) => ({ + MyEgress: { + Type: 'AWS::EC2::SecurityGroupEgress', + Properties: { + GroupId: { Ref: 'MySecurityGroup' }, + ...egressProps, + }, + }, + })), + ), + }; + + function mapVal(cond: A, cb: (x: NonNullable) => B): B | {} { + return cond ? cb(cond) : {}; + } +}); \ No newline at end of file diff --git a/packages/aws-cdk-lib/aws-applicationautoscaling/test/util.ts b/packages/aws-cdk-lib/aws-applicationautoscaling/test/util.ts index 11e67ac50fd57..28716be20a254 100644 --- a/packages/aws-cdk-lib/aws-applicationautoscaling/test/util.ts +++ b/packages/aws-cdk-lib/aws-applicationautoscaling/test/util.ts @@ -14,9 +14,17 @@ export function createScalableTarget(scope: constructs.Construct) { } export class ArbitraryInputIntervals extends fc.Arbitrary { - public generate(mrng: fc.Random): fc.Shrinkable { + public generate(mrng: fc.Random): fc.Value { const ret = scalingcommon.generateArbitraryIntervals(mrng); - return new fc.Shrinkable(ret.intervals); + return new fc.Value(ret.intervals, {}); + } + + public canShrinkWithoutContext(_value: unknown): _value is appscaling.ScalingInterval[] { + return false; + } + + public shrink(_value: appscaling.ScalingInterval[], _context: unknown): fc.Stream> { + return fc.Stream.nil(); } } diff --git a/packages/aws-cdk-lib/aws-autoscaling-common/test/util.ts b/packages/aws-cdk-lib/aws-autoscaling-common/test/util.ts index 8b744072554cb..819d267d4f579 100644 --- a/packages/aws-cdk-lib/aws-autoscaling-common/test/util.ts +++ b/packages/aws-cdk-lib/aws-autoscaling-common/test/util.ts @@ -2,9 +2,17 @@ import * as fc from 'fast-check'; import * as scalingcommon from '../lib'; export class ArbitraryCompleteIntervals extends fc.Arbitrary { - public generate(mrng: fc.Random): fc.Shrinkable { + public generate(mrng: fc.Random): fc.Value { const ret = scalingcommon.generateArbitraryIntervals(mrng); - return new fc.Shrinkable(scalingcommon.normalizeIntervals(ret.intervals, ret.absolute)); + return new fc.Value(scalingcommon.normalizeIntervals(ret.intervals, ret.absolute), {}); + } + + public canShrinkWithoutContext(_value: unknown): _value is scalingcommon.CompleteScalingInterval[] { + return false; + } + + public shrink(_value: scalingcommon.CompleteScalingInterval[], _context: unknown): fc.Stream> { + return fc.Stream.nil(); } } diff --git a/packages/aws-cdk-lib/core/test/fn.test.ts b/packages/aws-cdk-lib/core/test/fn.test.ts index cd29f060b8b30..8356e14cfcd0a 100644 --- a/packages/aws-cdk-lib/core/test/fn.test.ts +++ b/packages/aws-cdk-lib/core/test/fn.test.ts @@ -18,8 +18,8 @@ function asyncTest(cb: () => Promise): () => void { }; } -const nonEmptyString = fc.string(1, 16); -const tokenish = fc.array(nonEmptyString, 2, 2).map(arr => ({ [arr[0]]: arr[1] })); +const nonEmptyString = fc.string({ minLength: 1, maxLength: 16 }); +const tokenish = fc.array(nonEmptyString, { minLength: 2, maxLength: 2 }).map(arr => ({ [arr[0]]: arr[1] })); const anyValue = fc.oneof(nonEmptyString, tokenish); describe('fn', () => { @@ -106,7 +106,7 @@ describe('fn', () => { const stack = new Stack(); fc.assert( fc.property( - fc.string(), fc.array(nonEmptyString, 1, 15), + fc.string(), fc.array(nonEmptyString, { minLength: 1, maxLength: 15 }), (delimiter, values) => stack.resolve(Fn.join(delimiter, values)) === values.join(delimiter), ), { verbose: true }, @@ -117,7 +117,7 @@ describe('fn', () => { const stack = new Stack(); fc.assert( fc.property( - fc.string(), fc.array(nonEmptyString, 1, 3), tokenish, fc.array(nonEmptyString, 1, 3), + fc.string(), fc.array(nonEmptyString, { minLength: 1, maxLength: 3 }), tokenish, fc.array(nonEmptyString, { minLength: 1, maxLength: 3 }), (delimiter, prefix, obj, suffix) => _.isEqual(stack.resolve(Fn.join(delimiter, [...prefix, stringToken(obj), ...suffix])), { 'Fn::Join': [delimiter, [prefix.join(delimiter), obj, suffix.join(delimiter)]] }), @@ -131,7 +131,7 @@ describe('fn', () => { fc.assert( fc.property( fc.string(), fc.array(anyValue), - fc.array(anyValue, 1, 3), + fc.array(anyValue, { minLength: 1, maxLength: 3 }), fc.array(anyValue), (delimiter, prefix, nested, suffix) => // Gonna test @@ -147,9 +147,9 @@ describe('fn', () => { fc.assert( fc.property( fc.string(), fc.string(), - fc.array(anyValue, 1, 3), - fc.array(tokenish, 2, 3), - fc.array(anyValue, 3), + fc.array(anyValue, { minLength: 1, maxLength: 3 }), + fc.array(tokenish, { minLength: 2, maxLength: 3 }), + fc.array(anyValue, { minLength: 3 }), (delimiter1, delimiter2, prefix, nested, suffix) => { fc.pre(delimiter1 !== delimiter2); const join = Fn.join(delimiter1, [...prefix as string[], Fn.join(delimiter2, stringListToken(nested)), ...suffix as string[]]); diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index dbbac2914c953..ab84f81ed660d 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -176,7 +176,7 @@ "constructs": "^10.0.0", "delay": "5.0.0", "esbuild": "^0.19.2", - "fast-check": "^2.25.0", + "fast-check": "^3.12.0", "fs-extra": "^11.1.1", "jest": "^29.6.2", "jest-each": "^29.6.2", diff --git a/packages/aws-cdk/package.json b/packages/aws-cdk/package.json index 3796392a98e2f..fa792237a83b5 100644 --- a/packages/aws-cdk/package.json +++ b/packages/aws-cdk/package.json @@ -80,7 +80,7 @@ "aws-sdk-mock": "5.6.0", "axios": "^0.27.2", "constructs": "^10.0.0", - "fast-check": "^2.25.0", + "fast-check": "^3.12.0", "jest": "^29.6.2", "madge": "^5.0.2", "make-runnable": "^1.4.1", diff --git a/yarn.lock b/yarn.lock index c7ef459617048..5967fe5e306f5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6870,12 +6870,12 @@ external-editor@^3.0.3: iconv-lite "^0.4.24" tmp "^0.0.33" -fast-check@^2.25.0: - version "2.25.0" - resolved "https://registry.npmjs.org/fast-check/-/fast-check-2.25.0.tgz#5146601851bf3be0953bd17eb2b7d547936c6561" - integrity sha512-wRUT2KD2lAmT75WNIJIHECawoUUMHM0I5jrlLXGtGeqmPL8jl/EldUDjY1VCp6fDY8yflyfUeIOsOBrIbIiArg== +fast-check@^3.12.0: + version "3.12.0" + resolved "https://registry.npmjs.org/fast-check/-/fast-check-3.12.0.tgz#440949277387a053f7f82cd532fa3fcf67346ba1" + integrity sha512-SqahE9mlL3+lhjJ39joMLwcj6F+24hfZdf/tchlNO8sHcTdrUUdA5P/ZbSFZM9Xpzs36XaneGwE0FWepm/zyOA== dependencies: - pure-rand "^5.0.1" + pure-rand "^6.0.0" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -11573,11 +11573,6 @@ pupa@^3.1.0: dependencies: escape-goat "^4.0.0" -pure-rand@^5.0.1: - version "5.0.5" - resolved "https://registry.npmjs.org/pure-rand/-/pure-rand-5.0.5.tgz#bda2a7f6a1fc0f284d78d78ca5902f26f2ad35cf" - integrity sha512-BwQpbqxSCBJVpamI6ydzcKqyFmnd5msMWUGvzXLm1aXvusbbgkbOto/EUPM00hjveJEaJtdbhUjKSzWRhQVkaw== - pure-rand@^6.0.0: version "6.0.2" resolved "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.2.tgz#a9c2ddcae9b68d736a8163036f088a2781c8b306" From 728af19ba04d212ef65c8d2b360d6fceae391cae Mon Sep 17 00:00:00 2001 From: David Adams <56132666+funguy-tech@users.noreply.github.com> Date: Fri, 18 Aug 2023 12:17:06 -0400 Subject: [PATCH 07/19] chore(ec2): add M7gd, R7gd, C7gd instance types (#26776) As of v2.92.0, we don't yet have C7gd, M7gd, and R7gd instance types available via instance type selection. Closes #26774 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-cdk-lib/aws-ec2/lib/instance-types.ts | 48 +++++++++++++++++++ .../aws-cdk-lib/aws-ec2/test/instance.test.ts | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts b/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts index e8e18c608dd0d..be0e852a9b223 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts @@ -312,6 +312,20 @@ export enum InstanceClass { */ R7G = 'r7g', + /** + * Memory optimized instances, 7th generation with Graviton3 processors and local NVME drive + * + * This instance class is currently only available in US East (Ohio), US East (N. Virginia), US West (Oregon), and Europe (Ireland). + */ + MEMORY7_GRAVITON3_NVME_DRIVE = 'memory7-graviton3-nvme-drive', + + /** + * Memory optimized instances, 7th generation with Graviton3 processors and local NVME drive + * + * This instance class is currently only available in US East (Ohio), US East (N. Virginia), US West (Oregon), and Europe (Ireland). + */ + R7GD = 'r7gd', + /** * Compute optimized instances, 3rd generation */ @@ -454,6 +468,20 @@ export enum InstanceClass { */ C6GD = 'c6gd', + /** + * Compute optimized instances for high performance computing, 7th generation with Graviton3 processors and local NVME drive + * + * This instance class is currently only available in US East (Ohio), US East (N. Virginia), US West (Oregon), and Europe (Ireland). + */ + COMPUTE7_GRAVITON3_NVME_DRIVE = 'compute7-graviton3-nvme-drive', + + /** + * Compute optimized instances for high performance computing, 7th generation with Graviton3 processors and local NVME drive + * + * This instance class is currently only available in US East (Ohio), US East (N. Virginia), US West (Oregon), and Europe (Ireland). + */ + C7GD = 'c7gd', + /** * Compute optimized instances for high performance computing, 6th generation with Graviton2 processors * and high network bandwidth capabilities @@ -864,6 +892,20 @@ export enum InstanceClass { */ M7G = 'm7g', + /** + * Standard instances, 7th generation with Graviton3 processors and local NVME drive + * + * This instance class is currently only available in US East (Ohio), US East (N. Virginia), US West (Oregon), and Europe (Ireland). + */ + STANDARD7_GRAVITON3_NVME_DRIVE = 'standard7-graviton3-nvme-drive', + + /** + * Standard instances, 7th generation with Graviton3 processors and local NVME drive + * + * This instance class is currently only available in US East (Ohio), US East (N. Virginia), US West (Oregon), and Europe (Ireland). + */ + M7GD = 'm7gd', + /** * High memory and compute capacity instances, 1st generation */ @@ -1143,6 +1185,8 @@ export class InstanceType { [InstanceClass.R6GD]: 'r6gd', [InstanceClass.MEMORY7_GRAVITON]: 'r7g', [InstanceClass.R7G]: 'r7g', + [InstanceClass.MEMORY7_GRAVITON3_NVME_DRIVE]: 'r7gd', + [InstanceClass.R7GD]: 'r7gd', [InstanceClass.COMPUTE3]: 'c3', [InstanceClass.C3]: 'c3', [InstanceClass.COMPUTE4]: 'c4', @@ -1173,6 +1217,8 @@ export class InstanceType { [InstanceClass.C6GN]: 'c6gn', [InstanceClass.COMPUTE7_GRAVITON3]: 'c7g', [InstanceClass.C7G]: 'c7g', + [InstanceClass.COMPUTE7_GRAVITON3_NVME_DRIVE]: 'c7gd', + [InstanceClass.C7GD]: 'c7gd', [InstanceClass.STORAGE2]: 'd2', [InstanceClass.D2]: 'd2', [InstanceClass.STORAGE3]: 'd3', @@ -1243,6 +1289,8 @@ export class InstanceType { [InstanceClass.M6GD]: 'm6gd', [InstanceClass.STANDARD7_GRAVITON]: 'm7g', [InstanceClass.M7G]: 'm7g', + [InstanceClass.STANDARD7_GRAVITON3_NVME_DRIVE]: 'm7gd', + [InstanceClass.M7GD]: 'm7gd', [InstanceClass.HIGH_COMPUTE_MEMORY1]: 'z1d', [InstanceClass.Z1D]: 'z1d', [InstanceClass.INFERENCE1]: 'inf1', diff --git a/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts b/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts index 4a70080b265de..82cf2031a9bd5 100644 --- a/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts +++ b/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts @@ -104,7 +104,7 @@ describe('instance', () => { test('instance architecture is correctly discerned for arm instances', () => { // GIVEN const sampleInstanceClasses = [ - 'a1', 't4g', 'c6g', 'c7g', 'c6gd', 'c6gn', 'm6g', 'm6gd', 'm7g', 'r6g', 'r6gd', 'r7g', 'g5g', 'im4gn', 'is4gen', // current Graviton-based instance classes + 'a1', 't4g', 'c6g', 'c7g', 'c6gd', 'c6gn', 'c7g', 'c7gd', 'm6g', 'm6gd', 'm7g', 'm7gd', 'r6g', 'r6gd', 'r7g', 'r7gd', 'g5g', 'im4gn', 'is4gen', // current Graviton-based instance classes 'a13', 't11g', 'y10ng', 'z11ngd', // theoretical future Graviton-based instance classes ]; From 4d3ec71e33847e80fe99da073ca0ece472e71111 Mon Sep 17 00:00:00 2001 From: Mitchell Valine Date: Fri, 18 Aug 2023 09:43:10 -0700 Subject: [PATCH 08/19] fix(custom-resources): bad payload deserialization (#26797) When `AwsCustomResource` was updated to use sdkv3, it wasn't updated to correctly handle the change in returned value when calling `lambda.invokeFunction`. The payload property was changed from type `Buffer` to `Uint8Array` to increase compatibility in browsers. Added a check in the `flatten` function used to format payloads in `AwsCustomResource`'s runtime to correctly decode values if they are a typed array or a buffer. Created a new integ test which fails to deploy if the payload property is not serialized correctly and able to be made a Cfn output. Fixes: #26730 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../index.js | 249 ++++-- .../aws-sdk-v2-handler.js | 0 .../aws-sdk-v3-handler.bundled.js | 22 +- .../index.js | 0 .../shared.js | 123 +++ .../shared.js | 106 --- .../integ-cognito.assets.json | 10 +- .../integ-cognito.template.json | 2 +- ...efaultTestDeployAssert6F2623C9.assets.json | 10 +- ...aultTestDeployAssert6F2623C9.template.json | 4 +- .../integ.cognito.js.snapshot/manifest.json | 4 +- .../test/integ.cognito.js.snapshot/tree.json | 2 +- .../IntegAlbOidc.assets.json | 10 +- .../IntegAlbOidc.template.json | 2 +- ...efaultTestDeployAssert2476ECB6.assets.json | 10 +- ...aultTestDeployAssert2476ECB6.template.json | 4 +- .../index.js | 249 ++++-- .../aws-sdk-v2-handler.js | 0 .../aws-sdk-v3-handler.bundled.js | 22 +- .../index.js | 0 .../shared.js | 123 +++ .../shared.js | 106 --- .../integ.alb.oidc.js.snapshot/manifest.json | 4 +- .../test/integ.alb.oidc.js.snapshot/tree.json | 2 +- .../aws-sdk-v2-handler.js | 0 .../aws-sdk-v3-handler.bundled.js | 22 +- .../index.js | 0 .../shared.js | 123 +++ .../shared.js | 106 --- ...g-elasticsearch-custom-kms-key.assets.json | 10 +- ...elasticsearch-custom-kms-key.template.json | 2 +- .../manifest.json | 2 +- .../tree.json | 2 +- .../aws-sdk-v2-handler.js | 0 .../aws-sdk-v3-handler.bundled.js | 22 +- .../index.js | 0 .../shared.js | 123 +++ .../shared.js | 106 --- ...lasticsearch-unsignedbasicauth.assets.json | 10 +- ...sticsearch-unsignedbasicauth.template.json | 2 +- .../manifest.json | 2 +- .../tree.json | 2 +- ...efaultTestDeployAssert353EE07A.assets.json | 10 +- ...aultTestDeployAssert353EE07A.template.json | 22 +- .../index.js | 249 ++++-- .../aws-sdk-v2-handler.js | 0 .../aws-sdk-v3-handler.bundled.js | 779 ++++++++++++++++++ .../index.js | 0 .../shared.js | 123 +++ .../aws-sdk-v3-handler.bundled.js | 769 ----------------- .../shared.js | 106 --- .../log-group-events.assets.json | 10 +- .../log-group-events.template.json | 8 +- .../integ.log-group.js.snapshot/manifest.json | 34 +- .../integ.log-group.js.snapshot/tree.json | 32 +- .../aws-sdk-v2-handler.js | 0 .../aws-sdk-v3-handler.bundled.js | 779 ++++++++++++++++++ .../index.js | 0 .../shared.js | 123 +++ .../aws-sdk-v3-handler.bundled.js | 769 ----------------- .../shared.js | 106 --- .../integ-globalaccelerator.assets.json | 10 +- .../integ-globalaccelerator.template.json | 2 +- .../manifest.json | 2 +- .../tree.json | 2 +- ...efaultTestDeployAssert03DFA015.assets.json | 19 + ...aultTestDeployAssert03DFA015.template.json | 36 + .../cdk-integ-lambda-nodejs-esm.assets.json | 6 +- .../cdk-integ-lambda-nodejs-esm.template.json | 12 +- .../test/integ.esm.js.snapshot/cdk.out | 2 +- .../test/integ.esm.js.snapshot/integ.json | 13 +- .../test/integ.esm.js.snapshot/manifest.json | 51 +- .../test/integ.esm.js.snapshot/tree.json | 68 +- ...861cefeee8f1fe360b256c7f66b9bc521c11e3.zip | Bin 0 -> 1002 bytes ...c84320861bfe911d58e603bee8767c2d6e9e8a.zip | Bin 0 -> 332 bytes ...dc13c1c6935e59b0490249af5b05a1becfb7ab.zip | Bin 0 -> 331 bytes .../aws-lambda-nodejs/test/integ.modules.ts | 7 +- ...efaultTestDeployAssert7BC530B7.assets.json | 10 +- ...aultTestDeployAssert7BC530B7.template.json | 6 +- .../index.js | 249 ++++-- .../aws-sdk-v2-handler.js | 0 .../aws-sdk-v3-handler.bundled.js | 779 ++++++++++++++++++ .../index.js | 0 .../shared.js | 123 +++ .../aws-sdk-v3-handler.bundled.js | 769 ----------------- .../shared.js | 106 --- .../lambda-logssubscription-integ.assets.json | 10 +- ...ambda-logssubscription-integ.template.json | 4 +- .../integ.lambda.js.snapshot/manifest.json | 10 +- .../test/integ.lambda.js.snapshot/tree.json | 2 +- .../aws-sdk-v2-handler.js | 0 .../aws-sdk-v3-handler.bundled.js | 779 ++++++++++++++++++ .../index.js | 0 .../shared.js | 123 +++ .../aws-sdk-v3-handler.bundled.js | 769 ----------------- .../shared.js | 106 --- ...nteg-opensearch-custom-kms-key.assets.json | 10 +- ...eg-opensearch-custom-kms-key.template.json | 4 +- .../manifest.json | 8 +- .../tree.json | 2 +- .../aws-sdk-v2-handler.js | 0 .../aws-sdk-v3-handler.bundled.js | 779 ++++++++++++++++++ .../index.js | 0 .../shared.js | 123 +++ .../aws-sdk-v3-handler.bundled.js | 769 ----------------- .../shared.js | 106 --- .../cdk-integ-opensearch.assets.json | 10 +- .../cdk-integ-opensearch.template.json | 10 +- .../manifest.json | 26 +- .../integ.opensearch.js.snapshot/tree.json | 2 +- .../aws-sdk-v2-handler.js | 0 .../aws-sdk-v3-handler.bundled.js | 779 ++++++++++++++++++ .../index.js | 0 .../shared.js | 123 +++ .../aws-sdk-v3-handler.bundled.js | 769 ----------------- .../shared.js | 106 --- ...g-opensearch-unsignedbasicauth.assets.json | 10 +- ...opensearch-unsignedbasicauth.template.json | 4 +- .../manifest.json | 8 +- .../tree.json | 2 +- .../aws-sdk-v2-handler.js | 0 .../aws-sdk-v3-handler.bundled.js | 779 ++++++++++++++++++ .../index.js | 0 .../shared.js | 123 +++ .../aws-sdk-v3-handler.bundled.js | 769 ----------------- .../shared.js | 106 --- ...aws-cdk-vpc-endpoint-dns-integ.assets.json | 10 +- ...s-cdk-vpc-endpoint-dns-integ.template.json | 2 +- .../manifest.json | 2 +- .../tree.json | 2 +- .../aws-sdk-v2-handler.js | 0 .../aws-sdk-v3-handler.bundled.js | 779 ++++++++++++++++++ .../index.js | 0 .../shared.js | 123 +++ .../aws-sdk-v3-handler.bundled.js | 769 ----------------- .../shared.js | 106 --- ...-s3-bucket-auto-delete-objects.assets.json | 10 +- ...3-bucket-auto-delete-objects.template.json | 4 +- .../manifest.json | 8 +- .../tree.json | 2 +- .../aws-sdk-v2-handler.js | 0 .../aws-sdk-v3-handler.bundled.js | 779 ++++++++++++++++++ .../index.js | 0 .../shared.js | 123 +++ .../aws-sdk-v3-handler.bundled.js | 769 ----------------- .../shared.js | 106 --- ...aws-cdk-customresources-athena.assets.json | 10 +- ...s-cdk-customresources-athena.template.json | 2 +- .../manifest.json | 2 +- .../tree.json | 2 +- .../aws-sdk-v2-handler.js | 0 .../aws-sdk-v3-handler.bundled.js | 779 ++++++++++++++++++ .../index.js | 0 .../shared.js | 123 +++ .../aws-sdk-v3-handler.bundled.js | 769 ----------------- .../shared.js | 106 --- .../aws-cdk-customresources-vpc.assets.json | 10 +- .../aws-cdk-customresources-vpc.template.json | 4 +- .../manifest.json | 8 +- .../tree.json | 2 +- .../aws-sdk-v2-handler.js | 0 .../aws-sdk-v3-handler.bundled.js | 779 ++++++++++++++++++ .../index.js | 0 .../shared.js | 123 +++ .../aws-sdk-v3-handler.bundled.js | 769 ----------------- .../shared.js | 106 --- .../aws-cdk-sdk-js-v3.assets.json | 10 +- .../aws-cdk-sdk-js-v3.template.json | 12 +- .../aws-cdk-sdk-js.assets.json | 10 +- .../aws-cdk-sdk-js.template.json | 12 +- .../manifest.json | 64 +- .../tree.json | 4 +- ...efaultTestDeployAssertB4B64337.assets.json | 19 + ...aultTestDeployAssertB4B64337.template.json | 36 + ...stomResourceInvokePayloadStack.assets.json | 32 + ...omResourceInvokePayloadStack.template.json | 271 ++++++ .../aws-sdk-v2-handler.js | 161 ++++ .../aws-sdk-v3-handler.bundled.js | 779 ++++++++++++++++++ .../index.js | 10 + .../shared.js | 123 +++ .../cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 159 ++++ .../tree.json | 456 ++++++++++ .../integ.invoke-function-payload.ts | 44 + .../lib/aws-custom-resource/runtime/shared.ts | 38 +- .../runtime/shared.test.ts | 21 +- 187 files changed, 13825 insertions(+), 10656 deletions(-) rename packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/{asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle => asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle}/index.js (99%) rename packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v2-handler.js (100%) rename packages/@aws-cdk-testing/framework-integ/test/{aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v3-handler.bundled.js (97%) rename packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/index.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js rename packages/@aws-cdk-testing/framework-integ/test/{aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle => aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle}/index.js (99%) rename packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v2-handler.js (100%) rename packages/@aws-cdk-testing/framework-integ/test/{aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v3-handler.bundled.js (97%) rename packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/index.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js rename packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v2-handler.js (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v3-handler.bundled.js (97%) rename packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/index.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js rename packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v2-handler.js (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v3-handler.bundled.js (97%) rename packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/index.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js rename packages/@aws-cdk-testing/framework-integ/test/{aws-logs-destinations/test/integ.lambda.js.snapshot/asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle => aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle}/index.js (99%) rename packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v2-handler.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js rename packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/index.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js rename packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v2-handler.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js rename packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/index.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.modules.js.snapshot/.cache/2149a129ab87c93e19bbdbfc0f861cefeee8f1fe360b256c7f66b9bc521c11e3.zip create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.modules.js.snapshot/.cache/28de77e42ea798836445f0dd73c84320861bfe911d58e603bee8767c2d6e9e8a.zip create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.modules.js.snapshot/.cache/3df927e5941c39836eafe07496dc13c1c6935e59b0490249af5b05a1becfb7ab.zip rename packages/@aws-cdk-testing/framework-integ/test/{aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle => aws-logs-destinations/test/integ.lambda.js.snapshot/asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle}/index.js (99%) rename packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v2-handler.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js rename packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/index.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js rename packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v2-handler.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js rename packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/index.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js rename packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v2-handler.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js rename packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/index.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js rename packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v2-handler.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js rename packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/index.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js rename packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v2-handler.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js rename packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/index.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js rename packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v2-handler.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js rename packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/index.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js rename packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v2-handler.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js rename packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/index.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js rename packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v2-handler.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js rename packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/index.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js rename packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/aws-sdk-v2-handler.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js rename packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/{asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83 => asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6}/index.js (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadStack.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadStack.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/integ.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/tree.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle/index.js similarity index 99% rename from packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle/index.js index f995c420af68c..88c13ce7441ab 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle/index.js +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle/index.js @@ -1538,6 +1538,88 @@ var require_eventStream = __commonJS({ } }); +// ../../../node_modules/@smithy/types/dist-cjs/extensions/checksum.js +var require_checksum2 = __commonJS({ + "../../../node_modules/@smithy/types/dist-cjs/extensions/checksum.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; + var AlgorithmId; + (function(AlgorithmId2) { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + })(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); + var getChecksumConfiguration = (runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => AlgorithmId.SHA256, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => AlgorithmId.MD5, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; + }; + exports.getChecksumConfiguration = getChecksumConfiguration; + var resolveChecksumRuntimeConfig = (clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; + }; + exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; + } +}); + +// ../../../node_modules/@smithy/types/dist-cjs/extensions/defaultClientConfiguration.js +var require_defaultClientConfiguration = __commonJS({ + "../../../node_modules/@smithy/types/dist-cjs/extensions/defaultClientConfiguration.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; + var checksum_1 = require_checksum2(); + var getDefaultClientConfiguration = (runtimeConfig) => { + return { + ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig) + }; + }; + exports.getDefaultClientConfiguration = getDefaultClientConfiguration; + var resolveDefaultRuntimeConfig = (config) => { + return { + ...(0, checksum_1.resolveChecksumRuntimeConfig)(config) + }; + }; + exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; + } +}); + +// ../../../node_modules/@smithy/types/dist-cjs/extensions/index.js +var require_extensions = __commonJS({ + "../../../node_modules/@smithy/types/dist-cjs/extensions/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_defaultClientConfiguration(), exports); + } +}); + // ../../../node_modules/@smithy/types/dist-cjs/http.js var require_http = __commonJS({ "../../../node_modules/@smithy/types/dist-cjs/http.js"(exports) { @@ -1756,6 +1838,7 @@ var require_dist_cjs = __commonJS({ tslib_1.__exportStar(require_endpoint(), exports); tslib_1.__exportStar(require_endpoints(), exports); tslib_1.__exportStar(require_eventStream(), exports); + tslib_1.__exportStar(require_extensions(), exports); tslib_1.__exportStar(require_http(), exports); tslib_1.__exportStar(require_identity2(), exports); tslib_1.__exportStar(require_logger(), exports); @@ -5224,7 +5307,7 @@ var require_blob_types = __commonJS({ }); // ../../../node_modules/@aws-sdk/types/dist-cjs/checksum.js -var require_checksum2 = __commonJS({ +var require_checksum3 = __commonJS({ "../../../node_modules/@aws-sdk/types/dist-cjs/checksum.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -5518,7 +5601,7 @@ var require_dist_cjs17 = __commonJS({ tslib_1.__exportStar(require_abort2(), exports); tslib_1.__exportStar(require_auth2(), exports); tslib_1.__exportStar(require_blob_types(), exports); - tslib_1.__exportStar(require_checksum2(), exports); + tslib_1.__exportStar(require_checksum3(), exports); tslib_1.__exportStar(require_client2(), exports); tslib_1.__exportStar(require_command2(), exports); tslib_1.__exportStar(require_connection2(), exports); @@ -10396,7 +10479,7 @@ var require_package = __commonJS({ module2.exports = { name: "@aws-sdk/client-sfn", description: "AWS SDK for JavaScript Sfn Client for Node.js, Browser and React Native", - version: "3.388.0", + version: "3.391.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -10416,37 +10499,37 @@ var require_package = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/client-sts": "3.388.0", - "@aws-sdk/credential-provider-node": "3.388.0", - "@aws-sdk/middleware-host-header": "3.387.0", - "@aws-sdk/middleware-logger": "3.387.0", - "@aws-sdk/middleware-recursion-detection": "3.387.0", - "@aws-sdk/middleware-signing": "3.387.0", - "@aws-sdk/middleware-user-agent": "3.387.0", - "@aws-sdk/types": "3.387.0", - "@aws-sdk/util-endpoints": "3.387.0", - "@aws-sdk/util-user-agent-browser": "3.387.0", - "@aws-sdk/util-user-agent-node": "3.387.0", - "@smithy/config-resolver": "^2.0.2", - "@smithy/fetch-http-handler": "^2.0.2", - "@smithy/hash-node": "^2.0.2", - "@smithy/invalid-dependency": "^2.0.2", - "@smithy/middleware-content-length": "^2.0.2", - "@smithy/middleware-endpoint": "^2.0.2", - "@smithy/middleware-retry": "^2.0.2", - "@smithy/middleware-serde": "^2.0.2", + "@aws-sdk/client-sts": "3.391.0", + "@aws-sdk/credential-provider-node": "3.391.0", + "@aws-sdk/middleware-host-header": "3.391.0", + "@aws-sdk/middleware-logger": "3.391.0", + "@aws-sdk/middleware-recursion-detection": "3.391.0", + "@aws-sdk/middleware-signing": "3.391.0", + "@aws-sdk/middleware-user-agent": "3.391.0", + "@aws-sdk/types": "3.391.0", + "@aws-sdk/util-endpoints": "3.391.0", + "@aws-sdk/util-user-agent-browser": "3.391.0", + "@aws-sdk/util-user-agent-node": "3.391.0", + "@smithy/config-resolver": "^2.0.3", + "@smithy/fetch-http-handler": "^2.0.3", + "@smithy/hash-node": "^2.0.3", + "@smithy/invalid-dependency": "^2.0.3", + "@smithy/middleware-content-length": "^2.0.3", + "@smithy/middleware-endpoint": "^2.0.3", + "@smithy/middleware-retry": "^2.0.3", + "@smithy/middleware-serde": "^2.0.3", "@smithy/middleware-stack": "^2.0.0", - "@smithy/node-config-provider": "^2.0.2", - "@smithy/node-http-handler": "^2.0.2", - "@smithy/protocol-http": "^2.0.2", - "@smithy/smithy-client": "^2.0.2", - "@smithy/types": "^2.1.0", - "@smithy/url-parser": "^2.0.2", + "@smithy/node-config-provider": "^2.0.3", + "@smithy/node-http-handler": "^2.0.3", + "@smithy/protocol-http": "^2.0.3", + "@smithy/smithy-client": "^2.0.3", + "@smithy/types": "^2.2.0", + "@smithy/url-parser": "^2.0.3", "@smithy/util-base64": "^2.0.0", "@smithy/util-body-length-browser": "^2.0.0", "@smithy/util-body-length-node": "^2.0.0", - "@smithy/util-defaults-mode-browser": "^2.0.2", - "@smithy/util-defaults-mode-node": "^2.0.2", + "@smithy/util-defaults-mode-browser": "^2.0.3", + "@smithy/util-defaults-mode-node": "^2.0.3", "@smithy/util-retry": "^2.0.0", "@smithy/util-utf8": "^2.0.0", tslib: "^2.5.0" @@ -10535,7 +10618,7 @@ var require_package2 = __commonJS({ module2.exports = { name: "@aws-sdk/client-sts", description: "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native", - version: "3.388.0", + version: "3.391.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -10557,37 +10640,37 @@ var require_package2 = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/credential-provider-node": "3.388.0", - "@aws-sdk/middleware-host-header": "3.387.0", - "@aws-sdk/middleware-logger": "3.387.0", - "@aws-sdk/middleware-recursion-detection": "3.387.0", - "@aws-sdk/middleware-sdk-sts": "3.387.0", - "@aws-sdk/middleware-signing": "3.387.0", - "@aws-sdk/middleware-user-agent": "3.387.0", - "@aws-sdk/types": "3.387.0", - "@aws-sdk/util-endpoints": "3.387.0", - "@aws-sdk/util-user-agent-browser": "3.387.0", - "@aws-sdk/util-user-agent-node": "3.387.0", - "@smithy/config-resolver": "^2.0.2", - "@smithy/fetch-http-handler": "^2.0.2", - "@smithy/hash-node": "^2.0.2", - "@smithy/invalid-dependency": "^2.0.2", - "@smithy/middleware-content-length": "^2.0.2", - "@smithy/middleware-endpoint": "^2.0.2", - "@smithy/middleware-retry": "^2.0.2", - "@smithy/middleware-serde": "^2.0.2", + "@aws-sdk/credential-provider-node": "3.391.0", + "@aws-sdk/middleware-host-header": "3.391.0", + "@aws-sdk/middleware-logger": "3.391.0", + "@aws-sdk/middleware-recursion-detection": "3.391.0", + "@aws-sdk/middleware-sdk-sts": "3.391.0", + "@aws-sdk/middleware-signing": "3.391.0", + "@aws-sdk/middleware-user-agent": "3.391.0", + "@aws-sdk/types": "3.391.0", + "@aws-sdk/util-endpoints": "3.391.0", + "@aws-sdk/util-user-agent-browser": "3.391.0", + "@aws-sdk/util-user-agent-node": "3.391.0", + "@smithy/config-resolver": "^2.0.3", + "@smithy/fetch-http-handler": "^2.0.3", + "@smithy/hash-node": "^2.0.3", + "@smithy/invalid-dependency": "^2.0.3", + "@smithy/middleware-content-length": "^2.0.3", + "@smithy/middleware-endpoint": "^2.0.3", + "@smithy/middleware-retry": "^2.0.3", + "@smithy/middleware-serde": "^2.0.3", "@smithy/middleware-stack": "^2.0.0", - "@smithy/node-config-provider": "^2.0.2", - "@smithy/node-http-handler": "^2.0.2", - "@smithy/protocol-http": "^2.0.2", - "@smithy/smithy-client": "^2.0.2", - "@smithy/types": "^2.1.0", - "@smithy/url-parser": "^2.0.2", + "@smithy/node-config-provider": "^2.0.3", + "@smithy/node-http-handler": "^2.0.3", + "@smithy/protocol-http": "^2.0.3", + "@smithy/smithy-client": "^2.0.3", + "@smithy/types": "^2.2.0", + "@smithy/url-parser": "^2.0.3", "@smithy/util-base64": "^2.0.0", "@smithy/util-body-length-browser": "^2.0.0", "@smithy/util-body-length-node": "^2.0.0", - "@smithy/util-defaults-mode-browser": "^2.0.2", - "@smithy/util-defaults-mode-node": "^2.0.2", + "@smithy/util-defaults-mode-browser": "^2.0.3", + "@smithy/util-defaults-mode-node": "^2.0.3", "@smithy/util-retry": "^2.0.0", "@smithy/util-utf8": "^2.0.0", "fast-xml-parser": "4.2.5", @@ -14806,7 +14889,7 @@ var require_package3 = __commonJS({ module2.exports = { name: "@aws-sdk/client-sso", description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native", - version: "3.387.0", + version: "3.391.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -14826,34 +14909,34 @@ var require_package3 = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/middleware-host-header": "3.387.0", - "@aws-sdk/middleware-logger": "3.387.0", - "@aws-sdk/middleware-recursion-detection": "3.387.0", - "@aws-sdk/middleware-user-agent": "3.387.0", - "@aws-sdk/types": "3.387.0", - "@aws-sdk/util-endpoints": "3.387.0", - "@aws-sdk/util-user-agent-browser": "3.387.0", - "@aws-sdk/util-user-agent-node": "3.387.0", - "@smithy/config-resolver": "^2.0.2", - "@smithy/fetch-http-handler": "^2.0.2", - "@smithy/hash-node": "^2.0.2", - "@smithy/invalid-dependency": "^2.0.2", - "@smithy/middleware-content-length": "^2.0.2", - "@smithy/middleware-endpoint": "^2.0.2", - "@smithy/middleware-retry": "^2.0.2", - "@smithy/middleware-serde": "^2.0.2", + "@aws-sdk/middleware-host-header": "3.391.0", + "@aws-sdk/middleware-logger": "3.391.0", + "@aws-sdk/middleware-recursion-detection": "3.391.0", + "@aws-sdk/middleware-user-agent": "3.391.0", + "@aws-sdk/types": "3.391.0", + "@aws-sdk/util-endpoints": "3.391.0", + "@aws-sdk/util-user-agent-browser": "3.391.0", + "@aws-sdk/util-user-agent-node": "3.391.0", + "@smithy/config-resolver": "^2.0.3", + "@smithy/fetch-http-handler": "^2.0.3", + "@smithy/hash-node": "^2.0.3", + "@smithy/invalid-dependency": "^2.0.3", + "@smithy/middleware-content-length": "^2.0.3", + "@smithy/middleware-endpoint": "^2.0.3", + "@smithy/middleware-retry": "^2.0.3", + "@smithy/middleware-serde": "^2.0.3", "@smithy/middleware-stack": "^2.0.0", - "@smithy/node-config-provider": "^2.0.2", - "@smithy/node-http-handler": "^2.0.2", - "@smithy/protocol-http": "^2.0.2", - "@smithy/smithy-client": "^2.0.2", - "@smithy/types": "^2.1.0", - "@smithy/url-parser": "^2.0.2", + "@smithy/node-config-provider": "^2.0.3", + "@smithy/node-http-handler": "^2.0.3", + "@smithy/protocol-http": "^2.0.3", + "@smithy/smithy-client": "^2.0.3", + "@smithy/types": "^2.2.0", + "@smithy/url-parser": "^2.0.3", "@smithy/util-base64": "^2.0.0", "@smithy/util-body-length-browser": "^2.0.0", "@smithy/util-body-length-node": "^2.0.0", - "@smithy/util-defaults-mode-browser": "^2.0.2", - "@smithy/util-defaults-mode-node": "^2.0.2", + "@smithy/util-defaults-mode-browser": "^2.0.3", + "@smithy/util-defaults-mode-node": "^2.0.3", "@smithy/util-retry": "^2.0.0", "@smithy/util-utf8": "^2.0.0", tslib: "^2.5.0" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js similarity index 97% rename from packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js index 1b662725f1b0b..9f6e97928f257 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -561,15 +561,25 @@ var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); // custom-resources/lib/aws-custom-resource/runtime/shared.ts var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } return Object.assign( {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) + ..._flatten(object) ); } function decodeSpecialValues(object, physicalResourceId) { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +exports.startsWithOneOf = startsWithOneOf; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7R0FFRztBQUNILE1BQU0sT0FBTyxHQUFHLElBQUksV0FBVyxFQUFFLENBQUM7QUFFbEM7O0dBRUc7QUFDSCxTQUFTLFVBQVUsQ0FBQyxLQUFVO0lBQzVCLElBQUksTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsRUFBRTtRQUMxQixPQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDL0I7U0FBTSxJQUFJLFdBQVcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLEVBQUU7UUFDcEMsT0FBTyxPQUFPLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQztLQUNyQztJQUVELE9BQU8sS0FBSyxDQUFDO0FBQ2YsQ0FBQztBQUNEOzs7OztHQU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/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js deleted file mode 100644 index 6c53eaeef8cd1..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -exports.decodeSpecialValues = decodeSpecialValues; -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -exports.filterKeys = filterKeys; -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - // eslint-disable-next-line no-console - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': Buffer.byteLength(responseBody, 'utf8'), - }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -exports.respond = respond; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -exports.decodeCall = decodeCall; -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} -exports.startsWithOneOf = startsWithOneOf; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7Ozs7R0FLRztBQUNILFNBQWdCLE9BQU8sQ0FBQyxNQUFjO0lBQ3BDLE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FDbEIsRUFBRSxFQUNGLEdBQUcsU0FBUyxRQUFRLENBQUMsS0FBVSxFQUFFLE9BQWlCLEVBQUU7UUFDbEQsT0F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tcbiAgaWYgKCFjYWxsKSB7IHJldHVybiB1bmRlZmluZWQ7IH1cbiAgcmV0dXJuIEpTT04ucGFyc2UoY2FsbCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzdGFydHNXaXRoT25lT2Yoc2VhcmNoU3RyaW5nczogc3RyaW5nW10pOiAoc3RyaW5nOiBzdHJpbmcpID0+IGJvb2xlYW4ge1xuICByZXR1cm4gZnVuY3Rpb24oc3RyaW5nOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgICBmb3IgKGNvbnN0IHNlYXJjaFN0cmluZyBvZiBzZWFyY2hTdHJpbmdzKSB7XG4gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integ-cognito.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integ-cognito.assets.json index 109fc49055762..8655c485c5dfd 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integ-cognito.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integ-cognito.assets.json @@ -1,15 +1,15 @@ { "version": "33.0.0", "files": { - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -27,7 +27,7 @@ } } }, - "a4abeaa129dc6ad5ea942859fb3378b4ca6fac422104feb34fd11fb90a19c39c": { + "666e94920b35d1e6c48738aafa11d6724921169527f2d6d136c0eb8d350ed5cb": { "source": { "path": "integ-cognito.template.json", "packaging": "file" @@ -35,7 +35,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a4abeaa129dc6ad5ea942859fb3378b4ca6fac422104feb34fd11fb90a19c39c.json", + "objectKey": "666e94920b35d1e6c48738aafa11d6724921169527f2d6d136c0eb8d350ed5cb.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integ-cognito.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integ-cognito.template.json index 56ea2c7cf2ed9..6f7685479f509 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integ-cognito.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integ-cognito.template.json @@ -827,7 +827,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integtestcognitoDefaultTestDeployAssert6F2623C9.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integtestcognitoDefaultTestDeployAssert6F2623C9.assets.json index 88f76a975a0f5..e0a74f633e070 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integtestcognitoDefaultTestDeployAssert6F2623C9.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integtestcognitoDefaultTestDeployAssert6F2623C9.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907": { + "54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5": { "source": { - "path": "asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle", + "path": "asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.zip", + "objectKey": "54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "3134b7cc7efa6bcf89ff590b3730d4c7664b45d5057f072ee873fa976a3e18a7": { + "e614ea6f3d7b8b9e1f0857e2135e052b62b5a2d12e4af0c00269a9ee43a6d683": { "source": { "path": "integtestcognitoDefaultTestDeployAssert6F2623C9.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "3134b7cc7efa6bcf89ff590b3730d4c7664b45d5057f072ee873fa976a3e18a7.json", + "objectKey": "e614ea6f3d7b8b9e1f0857e2135e052b62b5a2d12e4af0c00269a9ee43a6d683.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integtestcognitoDefaultTestDeployAssert6F2623C9.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integtestcognitoDefaultTestDeployAssert6F2623C9.template.json index 0d364b7ceab46..0043fa803333c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integtestcognitoDefaultTestDeployAssert6F2623C9.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integtestcognitoDefaultTestDeployAssert6F2623C9.template.json @@ -27,7 +27,7 @@ } }, "flattenResponse": "false", - "salt": "1691773610689" + "salt": "1692315261454" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -127,7 +127,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.zip" + "S3Key": "54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.zip" }, "Timeout": 120, "Handler": "index.handler", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/manifest.json index 491cf0fd6b8e8..bf4ab45c9c57a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a4abeaa129dc6ad5ea942859fb3378b4ca6fac422104feb34fd11fb90a19c39c.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/666e94920b35d1e6c48738aafa11d6724921169527f2d6d136c0eb8d350ed5cb.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -316,7 +316,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3134b7cc7efa6bcf89ff590b3730d4c7664b45d5057f072ee873fa976a3e18a7.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e614ea6f3d7b8b9e1f0857e2135e052b62b5a2d12e4af0c00269a9ee43a6d683.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/tree.json index 846fa02dbe5d7..991d7b31698bf 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/tree.json @@ -1362,7 +1362,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegAlbOidc.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegAlbOidc.assets.json index e2fae9c6d4330..f162dd394fceb 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegAlbOidc.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegAlbOidc.assets.json @@ -14,15 +14,15 @@ } } }, - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -40,7 +40,7 @@ } } }, - "9b0301b4bf2179ca19a22b4c4906f23b2b6af34d2c5961ccfbfb4cdfc56b9105": { + "3de5385d7ffdd5f8db4cb2984e3f080e567de6adbfab08ba87aa0fd81dc0a5cc": { "source": { "path": "IntegAlbOidc.template.json", "packaging": "file" @@ -48,7 +48,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "9b0301b4bf2179ca19a22b4c4906f23b2b6af34d2c5961ccfbfb4cdfc56b9105.json", + "objectKey": "3de5385d7ffdd5f8db4cb2984e3f080e567de6adbfab08ba87aa0fd81dc0a5cc.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegAlbOidc.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegAlbOidc.template.json index 5c1d8e93a2a6e..8fdfb30ee2067 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegAlbOidc.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegAlbOidc.template.json @@ -895,7 +895,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegTestAlbOidcDefaultTestDeployAssert2476ECB6.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegTestAlbOidcDefaultTestDeployAssert2476ECB6.assets.json index d323ca7f1e8fe..89c892d73e56e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegTestAlbOidcDefaultTestDeployAssert2476ECB6.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegTestAlbOidcDefaultTestDeployAssert2476ECB6.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907": { + "54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5": { "source": { - "path": "asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle", + "path": "asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.zip", + "objectKey": "54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "e54ace7f676f0ee0c00fbb0f491d9c2e7317dce04bcaca7717fb9e983caf6e1d": { + "d94e1d1d13f55070b80f7cadc4a2635a88d90d3e3a9c893e85e33dff0a53aa43": { "source": { "path": "IntegTestAlbOidcDefaultTestDeployAssert2476ECB6.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "e54ace7f676f0ee0c00fbb0f491d9c2e7317dce04bcaca7717fb9e983caf6e1d.json", + "objectKey": "d94e1d1d13f55070b80f7cadc4a2635a88d90d3e3a9c893e85e33dff0a53aa43.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegTestAlbOidcDefaultTestDeployAssert2476ECB6.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegTestAlbOidcDefaultTestDeployAssert2476ECB6.template.json index 137906401097d..9b40d527056fb 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegTestAlbOidcDefaultTestDeployAssert2476ECB6.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/IntegTestAlbOidcDefaultTestDeployAssert2476ECB6.template.json @@ -27,7 +27,7 @@ } }, "flattenResponse": "false", - "salt": "1691773610714" + "salt": "1692315262180" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -127,7 +127,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.zip" + "S3Key": "54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.zip" }, "Timeout": 120, "Handler": "index.handler", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle/index.js similarity index 99% rename from packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle/index.js index f995c420af68c..88c13ce7441ab 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle/index.js +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle/index.js @@ -1538,6 +1538,88 @@ var require_eventStream = __commonJS({ } }); +// ../../../node_modules/@smithy/types/dist-cjs/extensions/checksum.js +var require_checksum2 = __commonJS({ + "../../../node_modules/@smithy/types/dist-cjs/extensions/checksum.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; + var AlgorithmId; + (function(AlgorithmId2) { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + })(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); + var getChecksumConfiguration = (runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => AlgorithmId.SHA256, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => AlgorithmId.MD5, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; + }; + exports.getChecksumConfiguration = getChecksumConfiguration; + var resolveChecksumRuntimeConfig = (clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; + }; + exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; + } +}); + +// ../../../node_modules/@smithy/types/dist-cjs/extensions/defaultClientConfiguration.js +var require_defaultClientConfiguration = __commonJS({ + "../../../node_modules/@smithy/types/dist-cjs/extensions/defaultClientConfiguration.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; + var checksum_1 = require_checksum2(); + var getDefaultClientConfiguration = (runtimeConfig) => { + return { + ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig) + }; + }; + exports.getDefaultClientConfiguration = getDefaultClientConfiguration; + var resolveDefaultRuntimeConfig = (config) => { + return { + ...(0, checksum_1.resolveChecksumRuntimeConfig)(config) + }; + }; + exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; + } +}); + +// ../../../node_modules/@smithy/types/dist-cjs/extensions/index.js +var require_extensions = __commonJS({ + "../../../node_modules/@smithy/types/dist-cjs/extensions/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_defaultClientConfiguration(), exports); + } +}); + // ../../../node_modules/@smithy/types/dist-cjs/http.js var require_http = __commonJS({ "../../../node_modules/@smithy/types/dist-cjs/http.js"(exports) { @@ -1756,6 +1838,7 @@ var require_dist_cjs = __commonJS({ tslib_1.__exportStar(require_endpoint(), exports); tslib_1.__exportStar(require_endpoints(), exports); tslib_1.__exportStar(require_eventStream(), exports); + tslib_1.__exportStar(require_extensions(), exports); tslib_1.__exportStar(require_http(), exports); tslib_1.__exportStar(require_identity2(), exports); tslib_1.__exportStar(require_logger(), exports); @@ -5224,7 +5307,7 @@ var require_blob_types = __commonJS({ }); // ../../../node_modules/@aws-sdk/types/dist-cjs/checksum.js -var require_checksum2 = __commonJS({ +var require_checksum3 = __commonJS({ "../../../node_modules/@aws-sdk/types/dist-cjs/checksum.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -5518,7 +5601,7 @@ var require_dist_cjs17 = __commonJS({ tslib_1.__exportStar(require_abort2(), exports); tslib_1.__exportStar(require_auth2(), exports); tslib_1.__exportStar(require_blob_types(), exports); - tslib_1.__exportStar(require_checksum2(), exports); + tslib_1.__exportStar(require_checksum3(), exports); tslib_1.__exportStar(require_client2(), exports); tslib_1.__exportStar(require_command2(), exports); tslib_1.__exportStar(require_connection2(), exports); @@ -10396,7 +10479,7 @@ var require_package = __commonJS({ module2.exports = { name: "@aws-sdk/client-sfn", description: "AWS SDK for JavaScript Sfn Client for Node.js, Browser and React Native", - version: "3.388.0", + version: "3.391.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -10416,37 +10499,37 @@ var require_package = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/client-sts": "3.388.0", - "@aws-sdk/credential-provider-node": "3.388.0", - "@aws-sdk/middleware-host-header": "3.387.0", - "@aws-sdk/middleware-logger": "3.387.0", - "@aws-sdk/middleware-recursion-detection": "3.387.0", - "@aws-sdk/middleware-signing": "3.387.0", - "@aws-sdk/middleware-user-agent": "3.387.0", - "@aws-sdk/types": "3.387.0", - "@aws-sdk/util-endpoints": "3.387.0", - "@aws-sdk/util-user-agent-browser": "3.387.0", - "@aws-sdk/util-user-agent-node": "3.387.0", - "@smithy/config-resolver": "^2.0.2", - "@smithy/fetch-http-handler": "^2.0.2", - "@smithy/hash-node": "^2.0.2", - "@smithy/invalid-dependency": "^2.0.2", - "@smithy/middleware-content-length": "^2.0.2", - "@smithy/middleware-endpoint": "^2.0.2", - "@smithy/middleware-retry": "^2.0.2", - "@smithy/middleware-serde": "^2.0.2", + "@aws-sdk/client-sts": "3.391.0", + "@aws-sdk/credential-provider-node": "3.391.0", + "@aws-sdk/middleware-host-header": "3.391.0", + "@aws-sdk/middleware-logger": "3.391.0", + "@aws-sdk/middleware-recursion-detection": "3.391.0", + "@aws-sdk/middleware-signing": "3.391.0", + "@aws-sdk/middleware-user-agent": "3.391.0", + "@aws-sdk/types": "3.391.0", + "@aws-sdk/util-endpoints": "3.391.0", + "@aws-sdk/util-user-agent-browser": "3.391.0", + "@aws-sdk/util-user-agent-node": "3.391.0", + "@smithy/config-resolver": "^2.0.3", + "@smithy/fetch-http-handler": "^2.0.3", + "@smithy/hash-node": "^2.0.3", + "@smithy/invalid-dependency": "^2.0.3", + "@smithy/middleware-content-length": "^2.0.3", + "@smithy/middleware-endpoint": "^2.0.3", + "@smithy/middleware-retry": "^2.0.3", + "@smithy/middleware-serde": "^2.0.3", "@smithy/middleware-stack": "^2.0.0", - "@smithy/node-config-provider": "^2.0.2", - "@smithy/node-http-handler": "^2.0.2", - "@smithy/protocol-http": "^2.0.2", - "@smithy/smithy-client": "^2.0.2", - "@smithy/types": "^2.1.0", - "@smithy/url-parser": "^2.0.2", + "@smithy/node-config-provider": "^2.0.3", + "@smithy/node-http-handler": "^2.0.3", + "@smithy/protocol-http": "^2.0.3", + "@smithy/smithy-client": "^2.0.3", + "@smithy/types": "^2.2.0", + "@smithy/url-parser": "^2.0.3", "@smithy/util-base64": "^2.0.0", "@smithy/util-body-length-browser": "^2.0.0", "@smithy/util-body-length-node": "^2.0.0", - "@smithy/util-defaults-mode-browser": "^2.0.2", - "@smithy/util-defaults-mode-node": "^2.0.2", + "@smithy/util-defaults-mode-browser": "^2.0.3", + "@smithy/util-defaults-mode-node": "^2.0.3", "@smithy/util-retry": "^2.0.0", "@smithy/util-utf8": "^2.0.0", tslib: "^2.5.0" @@ -10535,7 +10618,7 @@ var require_package2 = __commonJS({ module2.exports = { name: "@aws-sdk/client-sts", description: "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native", - version: "3.388.0", + version: "3.391.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -10557,37 +10640,37 @@ var require_package2 = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/credential-provider-node": "3.388.0", - "@aws-sdk/middleware-host-header": "3.387.0", - "@aws-sdk/middleware-logger": "3.387.0", - "@aws-sdk/middleware-recursion-detection": "3.387.0", - "@aws-sdk/middleware-sdk-sts": "3.387.0", - "@aws-sdk/middleware-signing": "3.387.0", - "@aws-sdk/middleware-user-agent": "3.387.0", - "@aws-sdk/types": "3.387.0", - "@aws-sdk/util-endpoints": "3.387.0", - "@aws-sdk/util-user-agent-browser": "3.387.0", - "@aws-sdk/util-user-agent-node": "3.387.0", - "@smithy/config-resolver": "^2.0.2", - "@smithy/fetch-http-handler": "^2.0.2", - "@smithy/hash-node": "^2.0.2", - "@smithy/invalid-dependency": "^2.0.2", - "@smithy/middleware-content-length": "^2.0.2", - "@smithy/middleware-endpoint": "^2.0.2", - "@smithy/middleware-retry": "^2.0.2", - "@smithy/middleware-serde": "^2.0.2", + "@aws-sdk/credential-provider-node": "3.391.0", + "@aws-sdk/middleware-host-header": "3.391.0", + "@aws-sdk/middleware-logger": "3.391.0", + "@aws-sdk/middleware-recursion-detection": "3.391.0", + "@aws-sdk/middleware-sdk-sts": "3.391.0", + "@aws-sdk/middleware-signing": "3.391.0", + "@aws-sdk/middleware-user-agent": "3.391.0", + "@aws-sdk/types": "3.391.0", + "@aws-sdk/util-endpoints": "3.391.0", + "@aws-sdk/util-user-agent-browser": "3.391.0", + "@aws-sdk/util-user-agent-node": "3.391.0", + "@smithy/config-resolver": "^2.0.3", + "@smithy/fetch-http-handler": "^2.0.3", + "@smithy/hash-node": "^2.0.3", + "@smithy/invalid-dependency": "^2.0.3", + "@smithy/middleware-content-length": "^2.0.3", + "@smithy/middleware-endpoint": "^2.0.3", + "@smithy/middleware-retry": "^2.0.3", + "@smithy/middleware-serde": "^2.0.3", "@smithy/middleware-stack": "^2.0.0", - "@smithy/node-config-provider": "^2.0.2", - "@smithy/node-http-handler": "^2.0.2", - "@smithy/protocol-http": "^2.0.2", - "@smithy/smithy-client": "^2.0.2", - "@smithy/types": "^2.1.0", - "@smithy/url-parser": "^2.0.2", + "@smithy/node-config-provider": "^2.0.3", + "@smithy/node-http-handler": "^2.0.3", + "@smithy/protocol-http": "^2.0.3", + "@smithy/smithy-client": "^2.0.3", + "@smithy/types": "^2.2.0", + "@smithy/url-parser": "^2.0.3", "@smithy/util-base64": "^2.0.0", "@smithy/util-body-length-browser": "^2.0.0", "@smithy/util-body-length-node": "^2.0.0", - "@smithy/util-defaults-mode-browser": "^2.0.2", - "@smithy/util-defaults-mode-node": "^2.0.2", + "@smithy/util-defaults-mode-browser": "^2.0.3", + "@smithy/util-defaults-mode-node": "^2.0.3", "@smithy/util-retry": "^2.0.0", "@smithy/util-utf8": "^2.0.0", "fast-xml-parser": "4.2.5", @@ -14806,7 +14889,7 @@ var require_package3 = __commonJS({ module2.exports = { name: "@aws-sdk/client-sso", description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native", - version: "3.387.0", + version: "3.391.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -14826,34 +14909,34 @@ var require_package3 = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/middleware-host-header": "3.387.0", - "@aws-sdk/middleware-logger": "3.387.0", - "@aws-sdk/middleware-recursion-detection": "3.387.0", - "@aws-sdk/middleware-user-agent": "3.387.0", - "@aws-sdk/types": "3.387.0", - "@aws-sdk/util-endpoints": "3.387.0", - "@aws-sdk/util-user-agent-browser": "3.387.0", - "@aws-sdk/util-user-agent-node": "3.387.0", - "@smithy/config-resolver": "^2.0.2", - "@smithy/fetch-http-handler": "^2.0.2", - "@smithy/hash-node": "^2.0.2", - "@smithy/invalid-dependency": "^2.0.2", - "@smithy/middleware-content-length": "^2.0.2", - "@smithy/middleware-endpoint": "^2.0.2", - "@smithy/middleware-retry": "^2.0.2", - "@smithy/middleware-serde": "^2.0.2", + "@aws-sdk/middleware-host-header": "3.391.0", + "@aws-sdk/middleware-logger": "3.391.0", + "@aws-sdk/middleware-recursion-detection": "3.391.0", + "@aws-sdk/middleware-user-agent": "3.391.0", + "@aws-sdk/types": "3.391.0", + "@aws-sdk/util-endpoints": "3.391.0", + "@aws-sdk/util-user-agent-browser": "3.391.0", + "@aws-sdk/util-user-agent-node": "3.391.0", + "@smithy/config-resolver": "^2.0.3", + "@smithy/fetch-http-handler": "^2.0.3", + "@smithy/hash-node": "^2.0.3", + "@smithy/invalid-dependency": "^2.0.3", + "@smithy/middleware-content-length": "^2.0.3", + "@smithy/middleware-endpoint": "^2.0.3", + "@smithy/middleware-retry": "^2.0.3", + "@smithy/middleware-serde": "^2.0.3", "@smithy/middleware-stack": "^2.0.0", - "@smithy/node-config-provider": "^2.0.2", - "@smithy/node-http-handler": "^2.0.2", - "@smithy/protocol-http": "^2.0.2", - "@smithy/smithy-client": "^2.0.2", - "@smithy/types": "^2.1.0", - "@smithy/url-parser": "^2.0.2", + "@smithy/node-config-provider": "^2.0.3", + "@smithy/node-http-handler": "^2.0.3", + "@smithy/protocol-http": "^2.0.3", + "@smithy/smithy-client": "^2.0.3", + "@smithy/types": "^2.2.0", + "@smithy/url-parser": "^2.0.3", "@smithy/util-base64": "^2.0.0", "@smithy/util-body-length-browser": "^2.0.0", "@smithy/util-body-length-node": "^2.0.0", - "@smithy/util-defaults-mode-browser": "^2.0.2", - "@smithy/util-defaults-mode-node": "^2.0.2", + "@smithy/util-defaults-mode-browser": "^2.0.3", + "@smithy/util-defaults-mode-node": "^2.0.3", "@smithy/util-retry": "^2.0.0", "@smithy/util-utf8": "^2.0.0", tslib: "^2.5.0" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js similarity index 97% rename from packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js index 1b662725f1b0b..9f6e97928f257 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -561,15 +561,25 @@ var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); // custom-resources/lib/aws-custom-resource/runtime/shared.ts var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } return Object.assign( {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) + ..._flatten(object) ); } function decodeSpecialValues(object, physicalResourceId) { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +exports.startsWithOneOf = startsWithOneOf; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7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SlNPTi5wYXJzZShjYWxsKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHN0YXJ0c1dpdGhPbmVPZihzZWFyY2hTdHJpbmdzOiBzdHJpbmdbXSk6IChzdHJpbmc6IHN0cmluZykgPT4gYm9vbGVhbiB7XG4gIHJldHVybiBmdW5jdGlvbihzdHJpbmc6IHN0cmluZyk6IGJvb2xlYW4ge1xuICAgIGZvciAoY29uc3Qgc2VhcmNoU3RyaW5nIG9mIHNlYXJjaFN0cmluZ3MpIHtcbiAgICAgIGlmIChzdHJpbmcuc3RhcnRzV2l0aChzZWFyY2hTdHJpbmcpKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js deleted file mode 100644 index 6c53eaeef8cd1..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -exports.decodeSpecialValues = decodeSpecialValues; -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -exports.filterKeys = filterKeys; -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - // eslint-disable-next-line no-console - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': Buffer.byteLength(responseBody, 'utf8'), - }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -exports.respond = respond; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -exports.decodeCall = decodeCall; -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(search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tZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXJlcXVpcmUtaW1wb3J0c1xuICAgICAgY29uc3QgcmVxdWVzdCA9IHJlcXVpcmUoJ2h0dHBzJykucmVxdWVzdChyZXF1ZXN0T3B0aW9ucywgcmVzb2x2ZSk7XG4gICAgICByZXF1ZXN0Lm9uKCdlcnJvcicsIHJlamVjdCk7XG4gICAgICByZXF1ZXN0LndyaXRlKHJlc3BvbnNlQm9keSk7XG4gICAgICByZXF1ZXN0LmVuZCgpO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIHJlamVjdChlKTtcbiAgICB9XG4gIH0pO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZGVjb2RlQ2FsbChjYWxsOiBzdHJpbmcgfCB1bmRlZmluZWQpIHtcbiAgaWYgKCFjYWxsKSB7IHJldHVybiB1bmRlZmluZWQ7IH1cbiAgcmV0dXJuIEpTT04ucGFyc2UoY2FsbCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzdGFydHNXaXRoT25lT2Yoc2VhcmNoU3RyaW5nczogc3RyaW5nW10pOiAoc3RyaW5nOiBzdHJpbmcpID0+IGJvb2xlYW4ge1xuICByZXR1cm4gZnVuY3Rpb24oc3RyaW5nOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgICBmb3IgKGNvbnN0IHNlYXJjaFN0cmluZyBvZiBzZWFyY2hTdHJpbmdzKSB7XG4gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/manifest.json index 4c670cd8ac6c4..d8e5db02cbaa2 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/9b0301b4bf2179ca19a22b4c4906f23b2b6af34d2c5961ccfbfb4cdfc56b9105.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3de5385d7ffdd5f8db4cb2984e3f080e567de6adbfab08ba87aa0fd81dc0a5cc.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -334,7 +334,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e54ace7f676f0ee0c00fbb0f491d9c2e7317dce04bcaca7717fb9e983caf6e1d.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d94e1d1d13f55070b80f7cadc4a2635a88d90d3e3a9c893e85e33dff0a53aa43.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/tree.json index 66bf4f686424d..1d1e877a1d47f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.oidc.js.snapshot/tree.json @@ -1265,7 +1265,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js similarity index 97% rename from packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js index 1b662725f1b0b..9f6e97928f257 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -561,15 +561,25 @@ var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); // custom-resources/lib/aws-custom-resource/runtime/shared.ts var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } return Object.assign( {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) + ..._flatten(object) ); } function decodeSpecialValues(object, physicalResourceId) { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +exports.startsWithOneOf = startsWithOneOf; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7R0FFRztBQUNILE1BQU0sT0FBTyxHQUFHLElBQUksV0FBVyxFQUFFLENBQUM7QUFFbEM7O0dBRUc7QUFDSCxTQUFTLFVBQVUsQ0FBQyxLQUFVO0lBQzVCLElBQUksTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsRUFBRTtRQUMxQixPQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLEN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3Qgc2VhcmNoU3RyaW5nIG9mIHNlYXJjaFN0cmluZ3MpIHtcbiAgICAgIGlmIChzdHJpbmcuc3RhcnRzV2l0aChzZWFyY2hTdHJpbmcpKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js deleted file mode 100644 index 6c53eaeef8cd1..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -exports.decodeSpecialValues = decodeSpecialValues; -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -exports.filterKeys = filterKeys; -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - // eslint-disable-next-line no-console - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': Buffer.byteLength(responseBody, 'utf8'), - }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -exports.respond = respond; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -exports.decodeCall = decodeCall; -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} -exports.startsWithOneOf = startsWithOneOf; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1Us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Ck7XG4gICAgICByZXF1ZXN0LndyaXRlKHJlc3BvbnNlQm9keSk7XG4gICAgICByZXF1ZXN0LmVuZCgpO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIHJlamVjdChlKTtcbiAgICB9XG4gIH0pO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZGVjb2RlQ2FsbChjYWxsOiBzdHJpbmcgfCB1bmRlZmluZWQpIHtcbiAgaWYgKCFjYWxsKSB7IHJldHVybiB1bmRlZmluZWQ7IH1cbiAgcmV0dXJuIEpTT04ucGFyc2UoY2FsbCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzdGFydHNXaXRoT25lT2Yoc2VhcmNoU3RyaW5nczogc3RyaW5nW10pOiAoc3RyaW5nOiBzdHJpbmcpID0+IGJvb2xlYW4ge1xuICByZXR1cm4gZnVuY3Rpb24oc3RyaW5nOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgICBmb3IgKGNvbnN0IHNlYXJjaFN0cmluZyBvZiBzZWFyY2hTdHJpbmdzKSB7XG4gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/cdk-integ-elasticsearch-custom-kms-key.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/cdk-integ-elasticsearch-custom-kms-key.assets.json index 3f4c95a3b8c8f..961a8f7aeb487 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/cdk-integ-elasticsearch-custom-kms-key.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/cdk-integ-elasticsearch-custom-kms-key.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "970be226058fcc5e3ea0e33edf03d33a5acaa0555046c88841788a8a2d6d070a": { + "12d2b19cc48d75e824a29142e5f0ede5f48c6c31e25d00884a290cf7269b1de0": { "source": { "path": "cdk-integ-elasticsearch-custom-kms-key.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "970be226058fcc5e3ea0e33edf03d33a5acaa0555046c88841788a8a2d6d070a.json", + "objectKey": "12d2b19cc48d75e824a29142e5f0ede5f48c6c31e25d00884a290cf7269b1de0.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/cdk-integ-elasticsearch-custom-kms-key.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/cdk-integ-elasticsearch-custom-kms-key.template.json index 49fcc02c368a6..7f6851eaad064 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/cdk-integ-elasticsearch-custom-kms-key.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/cdk-integ-elasticsearch-custom-kms-key.template.json @@ -355,7 +355,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/manifest.json index fe7ff8b362fd1..eeb5bcdd3790a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/970be226058fcc5e3ea0e33edf03d33a5acaa0555046c88841788a8a2d6d070a.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/12d2b19cc48d75e824a29142e5f0ede5f48c6c31e25d00884a290cf7269b1de0.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/tree.json index 47d8e46e930ae..7839cb3a94a74 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.custom-kms-key.js.snapshot/tree.json @@ -481,7 +481,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js similarity index 97% rename from packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js index 1b662725f1b0b..9f6e97928f257 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -561,15 +561,25 @@ var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); // custom-resources/lib/aws-custom-resource/runtime/shared.ts var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } return Object.assign( {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) + ..._flatten(object) ); } function decodeSpecialValues(object, physicalResourceId) { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +exports.startsWithOneOf = startsWithOneOf; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7R0FFRztBQUNILE1BQU0sT0FBTyx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1cblxuZXhwb3J0IGZ1bmN0aW9uIHN0YXJ0c1dpdGhPbmVPZihzZWFyY2hTdHJpbmdzOiBzdHJpbmdbXSk6IChzdHJpbmc6IHN0cmluZykgPT4gYm9vbGVhbiB7XG4gIHJldHVybiBmdW5jdGlvbihzdHJpbmc6IHN0cmluZyk6IGJvb2xlYW4ge1xuICAgIGZvciAoY29uc3Qgc2VhcmNoU3RyaW5nIG9mIHNlYXJjaFN0cmluZ3MpIHtcbiAgICAgIGlmIChzdHJpbmcuc3RhcnRzV2l0aChzZWFyY2hTdHJpbmcpKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js deleted file mode 100644 index 6c53eaeef8cd1..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -exports.decodeSpecialValues = decodeSpecialValues; -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -exports.filterKeys = filterKeys; -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - // eslint-disable-next-line no-console - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': Buffer.byteLength(responseBody, 'utf8'), - }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -exports.respond = respond; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -exports.decodeCall = decodeCall; -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - }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S1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXJlcXVpcmUtaW1wb3J0c1xuICAgICAgY29uc3QgcmVxdWVzdCA9IHJlcXVpcmUoJ2h0dHBzJykucmVxdWVzdChyZXF1ZXN0T3B0aW9ucywgcmVzb2x2ZSk7XG4gICAgICByZXF1ZXN0Lm9uKCdlcnJvcicsIHJlamVjdCk7XG4gICAgICByZXF1ZXN0LndyaXRlKHJlc3BvbnNlQm9keSk7XG4gICAgICByZXF1ZXN0LmVuZCgpO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIHJlamVjdChlKTtcbiAgICB9XG4gIH0pO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZGVjb2RlQ2FsbChjYWxsOiBzdHJpbmcgfCB1bmRlZmluZWQpIHtcbiAgaWYgKCFjYWxsKSB7IHJldHVybiB1bmRlZmluZWQ7IH1cbiAgcmV0dXJuIEpTT04ucGFyc2UoY2FsbCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzdGFydHNXaXRoT25lT2Yoc2VhcmNoU3RyaW5nczogc3RyaW5nW10pOiAoc3RyaW5nOiBzdHJpbmcpID0+IGJvb2xlYW4ge1xuICByZXR1cm4gZnVuY3Rpb24oc3RyaW5nOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgICBmb3IgKGNvbnN0IHNlYXJjaFN0cmluZyBvZiBzZWFyY2hTdHJpbmdzKSB7XG4gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/cdk-integ-elasticsearch-unsignedbasicauth.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/cdk-integ-elasticsearch-unsignedbasicauth.assets.json index 393af1005234e..aabd0154c0137 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/cdk-integ-elasticsearch-unsignedbasicauth.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/cdk-integ-elasticsearch-unsignedbasicauth.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "71c5510ca40271f6d68ae02b24bd509584eb7ac75a5ec1f0aea86ec19c34496a": { + "c3c8eabf3887499e2d06973603ec7b606debb96913c5f1ea575e2e972f2c0efa": { "source": { "path": "cdk-integ-elasticsearch-unsignedbasicauth.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "71c5510ca40271f6d68ae02b24bd509584eb7ac75a5ec1f0aea86ec19c34496a.json", + "objectKey": "c3c8eabf3887499e2d06973603ec7b606debb96913c5f1ea575e2e972f2c0efa.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/cdk-integ-elasticsearch-unsignedbasicauth.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/cdk-integ-elasticsearch-unsignedbasicauth.template.json index d374d5d606b6b..2b7a14452f2fc 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/cdk-integ-elasticsearch-unsignedbasicauth.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/cdk-integ-elasticsearch-unsignedbasicauth.template.json @@ -191,7 +191,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/manifest.json index 71913886117ce..7956c8e88ce38 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/71c5510ca40271f6d68ae02b24bd509584eb7ac75a5ec1f0aea86ec19c34496a.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c3c8eabf3887499e2d06973603ec7b606debb96913c5f1ea575e2e972f2c0efa.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/tree.json index f5e5ed2d46c11..6ed6fac693149 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticsearch/test/integ.elasticsearch.unsignedbasicauth.js.snapshot/tree.json @@ -281,7 +281,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/LogGroupDefaultTestDeployAssert353EE07A.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/LogGroupDefaultTestDeployAssert353EE07A.assets.json index 2b1d8fc4fda6c..643f1adf6d700 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/LogGroupDefaultTestDeployAssert353EE07A.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/LogGroupDefaultTestDeployAssert353EE07A.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907": { + "54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5": { "source": { - "path": "asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle", + "path": "asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.zip", + "objectKey": "54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "52d728c85f35a58bbfdfd2b6dbdad511312ae00ed2707bd69ad2bf8dfc772400": { + "69fcede415ffed48915f848f7515603039a2ec603b4ebf6fb36a165f18bdc98d": { "source": { "path": "LogGroupDefaultTestDeployAssert353EE07A.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "52d728c85f35a58bbfdfd2b6dbdad511312ae00ed2707bd69ad2bf8dfc772400.json", + "objectKey": "69fcede415ffed48915f848f7515603039a2ec603b4ebf6fb36a165f18bdc98d.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/LogGroupDefaultTestDeployAssert353EE07A.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/LogGroupDefaultTestDeployAssert353EE07A.template.json index 87a6e46bcd2e2..3ab41b7b9db11 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/LogGroupDefaultTestDeployAssert353EE07A.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/LogGroupDefaultTestDeployAssert353EE07A.template.json @@ -1,6 +1,6 @@ { "Resources": { - "AwsApiCallEventBridgeputEvents86d1feecd8251713d5bdf1c558f2aa31": { + "AwsApiCallEventBridgeputEvents4923866d22d2c71d8b1a85360b620e5f": { "Type": "Custom::DeployAssert@SdkCallEventBridgeputEvents", "Properties": { "ServiceToken": { @@ -12,10 +12,10 @@ "service": "EventBridge", "api": "putEvents", "parameters": { - "Entries": "[{\"Detail\":\"{\\\"date\\\":\\\"abc1691773608972\\\"}\",\"DetailType\":\"cdk-integ-custom-rule\",\"Source\":\"cdk-integ\"}]" + "Entries": "[{\"Detail\":\"{\\\"date\\\":\\\"abc1692313412724\\\"}\",\"DetailType\":\"cdk-integ-custom-rule\",\"Source\":\"cdk-integ\"}]" }, "flattenResponse": "false", - "salt": "1691773608988" + "salt": "1692313412731" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -87,7 +87,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.zip" + "S3Key": "54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.zip" }, "Timeout": 120, "Handler": "index.handler", @@ -99,7 +99,7 @@ } } }, - "AwsApiCallCloudWatchLogsfilterLogEvents5769f20437ecc1683899ac2c8e798593": { + "AwsApiCallCloudWatchLogsfilterLogEvents9ba36aa083750b6bbe1071e7a7e08267": { "Type": "Custom::DeployAssert@SdkCallCloudWatchLogsfilterLogEvents", "Properties": { "ServiceToken": { @@ -110,7 +110,7 @@ }, "service": "CloudWatchLogs", "api": "filterLogEvents", - "expected": "{\"$StringLike\":\"abc1691773608972\"}", + "expected": "{\"$StringLike\":\"abc1692313412724\"}", "actualPath": "events.0.message", "parameters": { "logGroupName": { @@ -125,27 +125,27 @@ ] ] }, - "startTime": "1691773608972", + "startTime": "1692313412724", "limit": "1" }, "flattenResponse": "true", "outputPaths": [ "events.0.message" ], - "salt": "1691773608989" + "salt": "1692313412731" }, "DependsOn": [ - "AwsApiCallEventBridgeputEvents86d1feecd8251713d5bdf1c558f2aa31" + "AwsApiCallEventBridgeputEvents4923866d22d2c71d8b1a85360b620e5f" ], "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" } }, "Outputs": { - "AssertionResultsAwsApiCallCloudWatchLogsfilterLogEvents5769f20437ecc1683899ac2c8e798593": { + "AssertionResultsAwsApiCallCloudWatchLogsfilterLogEvents9ba36aa083750b6bbe1071e7a7e08267": { "Value": { "Fn::GetAtt": [ - "AwsApiCallCloudWatchLogsfilterLogEvents5769f20437ecc1683899ac2c8e798593", + "AwsApiCallCloudWatchLogsfilterLogEvents9ba36aa083750b6bbe1071e7a7e08267", "assertion" ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle/index.js similarity index 99% rename from packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle/index.js index f995c420af68c..88c13ce7441ab 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.53f3cc9aed6e22e9f14f47dee475ebce282c77825ed736209307c57d588df907.bundle/index.js +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.54ed1902ad5ad220444041937ce65cb63c7fbccd0c11fdfd9ecbec43770cdaa5.bundle/index.js @@ -1538,6 +1538,88 @@ var require_eventStream = __commonJS({ } }); +// ../../../node_modules/@smithy/types/dist-cjs/extensions/checksum.js +var require_checksum2 = __commonJS({ + "../../../node_modules/@smithy/types/dist-cjs/extensions/checksum.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; + var AlgorithmId; + (function(AlgorithmId2) { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + })(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); + var getChecksumConfiguration = (runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => AlgorithmId.SHA256, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => AlgorithmId.MD5, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; + }; + exports.getChecksumConfiguration = getChecksumConfiguration; + var resolveChecksumRuntimeConfig = (clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; + }; + exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; + } +}); + +// ../../../node_modules/@smithy/types/dist-cjs/extensions/defaultClientConfiguration.js +var require_defaultClientConfiguration = __commonJS({ + "../../../node_modules/@smithy/types/dist-cjs/extensions/defaultClientConfiguration.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; + var checksum_1 = require_checksum2(); + var getDefaultClientConfiguration = (runtimeConfig) => { + return { + ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig) + }; + }; + exports.getDefaultClientConfiguration = getDefaultClientConfiguration; + var resolveDefaultRuntimeConfig = (config) => { + return { + ...(0, checksum_1.resolveChecksumRuntimeConfig)(config) + }; + }; + exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; + } +}); + +// ../../../node_modules/@smithy/types/dist-cjs/extensions/index.js +var require_extensions = __commonJS({ + "../../../node_modules/@smithy/types/dist-cjs/extensions/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_defaultClientConfiguration(), exports); + } +}); + // ../../../node_modules/@smithy/types/dist-cjs/http.js var require_http = __commonJS({ "../../../node_modules/@smithy/types/dist-cjs/http.js"(exports) { @@ -1756,6 +1838,7 @@ var require_dist_cjs = __commonJS({ tslib_1.__exportStar(require_endpoint(), exports); tslib_1.__exportStar(require_endpoints(), exports); tslib_1.__exportStar(require_eventStream(), exports); + tslib_1.__exportStar(require_extensions(), exports); tslib_1.__exportStar(require_http(), exports); tslib_1.__exportStar(require_identity2(), exports); tslib_1.__exportStar(require_logger(), exports); @@ -5224,7 +5307,7 @@ var require_blob_types = __commonJS({ }); // ../../../node_modules/@aws-sdk/types/dist-cjs/checksum.js -var require_checksum2 = __commonJS({ +var require_checksum3 = __commonJS({ "../../../node_modules/@aws-sdk/types/dist-cjs/checksum.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -5518,7 +5601,7 @@ var require_dist_cjs17 = __commonJS({ tslib_1.__exportStar(require_abort2(), exports); tslib_1.__exportStar(require_auth2(), exports); tslib_1.__exportStar(require_blob_types(), exports); - tslib_1.__exportStar(require_checksum2(), exports); + tslib_1.__exportStar(require_checksum3(), exports); tslib_1.__exportStar(require_client2(), exports); tslib_1.__exportStar(require_command2(), exports); tslib_1.__exportStar(require_connection2(), exports); @@ -10396,7 +10479,7 @@ var require_package = __commonJS({ module2.exports = { name: "@aws-sdk/client-sfn", description: "AWS SDK for JavaScript Sfn Client for Node.js, Browser and React Native", - version: "3.388.0", + version: "3.391.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -10416,37 +10499,37 @@ var require_package = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/client-sts": "3.388.0", - "@aws-sdk/credential-provider-node": "3.388.0", - "@aws-sdk/middleware-host-header": "3.387.0", - "@aws-sdk/middleware-logger": "3.387.0", - "@aws-sdk/middleware-recursion-detection": "3.387.0", - "@aws-sdk/middleware-signing": "3.387.0", - "@aws-sdk/middleware-user-agent": "3.387.0", - "@aws-sdk/types": "3.387.0", - "@aws-sdk/util-endpoints": "3.387.0", - "@aws-sdk/util-user-agent-browser": "3.387.0", - "@aws-sdk/util-user-agent-node": "3.387.0", - "@smithy/config-resolver": "^2.0.2", - "@smithy/fetch-http-handler": "^2.0.2", - "@smithy/hash-node": "^2.0.2", - "@smithy/invalid-dependency": "^2.0.2", - "@smithy/middleware-content-length": "^2.0.2", - "@smithy/middleware-endpoint": "^2.0.2", - "@smithy/middleware-retry": "^2.0.2", - "@smithy/middleware-serde": "^2.0.2", + "@aws-sdk/client-sts": "3.391.0", + "@aws-sdk/credential-provider-node": "3.391.0", + "@aws-sdk/middleware-host-header": "3.391.0", + "@aws-sdk/middleware-logger": "3.391.0", + "@aws-sdk/middleware-recursion-detection": "3.391.0", + "@aws-sdk/middleware-signing": "3.391.0", + "@aws-sdk/middleware-user-agent": "3.391.0", + "@aws-sdk/types": "3.391.0", + "@aws-sdk/util-endpoints": "3.391.0", + "@aws-sdk/util-user-agent-browser": "3.391.0", + "@aws-sdk/util-user-agent-node": "3.391.0", + "@smithy/config-resolver": "^2.0.3", + "@smithy/fetch-http-handler": "^2.0.3", + "@smithy/hash-node": "^2.0.3", + "@smithy/invalid-dependency": "^2.0.3", + "@smithy/middleware-content-length": "^2.0.3", + "@smithy/middleware-endpoint": "^2.0.3", + "@smithy/middleware-retry": "^2.0.3", + "@smithy/middleware-serde": "^2.0.3", "@smithy/middleware-stack": "^2.0.0", - "@smithy/node-config-provider": "^2.0.2", - "@smithy/node-http-handler": "^2.0.2", - "@smithy/protocol-http": "^2.0.2", - "@smithy/smithy-client": "^2.0.2", - "@smithy/types": "^2.1.0", - "@smithy/url-parser": "^2.0.2", + "@smithy/node-config-provider": "^2.0.3", + "@smithy/node-http-handler": "^2.0.3", + "@smithy/protocol-http": "^2.0.3", + "@smithy/smithy-client": "^2.0.3", + "@smithy/types": "^2.2.0", + "@smithy/url-parser": "^2.0.3", "@smithy/util-base64": "^2.0.0", "@smithy/util-body-length-browser": "^2.0.0", "@smithy/util-body-length-node": "^2.0.0", - "@smithy/util-defaults-mode-browser": "^2.0.2", - "@smithy/util-defaults-mode-node": "^2.0.2", + "@smithy/util-defaults-mode-browser": "^2.0.3", + "@smithy/util-defaults-mode-node": "^2.0.3", "@smithy/util-retry": "^2.0.0", "@smithy/util-utf8": "^2.0.0", tslib: "^2.5.0" @@ -10535,7 +10618,7 @@ var require_package2 = __commonJS({ module2.exports = { name: "@aws-sdk/client-sts", description: "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native", - version: "3.388.0", + version: "3.391.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -10557,37 +10640,37 @@ var require_package2 = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/credential-provider-node": "3.388.0", - "@aws-sdk/middleware-host-header": "3.387.0", - "@aws-sdk/middleware-logger": "3.387.0", - "@aws-sdk/middleware-recursion-detection": "3.387.0", - "@aws-sdk/middleware-sdk-sts": "3.387.0", - "@aws-sdk/middleware-signing": "3.387.0", - "@aws-sdk/middleware-user-agent": "3.387.0", - "@aws-sdk/types": "3.387.0", - "@aws-sdk/util-endpoints": "3.387.0", - "@aws-sdk/util-user-agent-browser": "3.387.0", - "@aws-sdk/util-user-agent-node": "3.387.0", - "@smithy/config-resolver": "^2.0.2", - "@smithy/fetch-http-handler": "^2.0.2", - "@smithy/hash-node": "^2.0.2", - "@smithy/invalid-dependency": "^2.0.2", - "@smithy/middleware-content-length": "^2.0.2", - "@smithy/middleware-endpoint": "^2.0.2", - "@smithy/middleware-retry": "^2.0.2", - "@smithy/middleware-serde": "^2.0.2", + "@aws-sdk/credential-provider-node": "3.391.0", + "@aws-sdk/middleware-host-header": "3.391.0", + "@aws-sdk/middleware-logger": "3.391.0", + "@aws-sdk/middleware-recursion-detection": "3.391.0", + "@aws-sdk/middleware-sdk-sts": "3.391.0", + "@aws-sdk/middleware-signing": "3.391.0", + "@aws-sdk/middleware-user-agent": "3.391.0", + "@aws-sdk/types": "3.391.0", + "@aws-sdk/util-endpoints": "3.391.0", + "@aws-sdk/util-user-agent-browser": "3.391.0", + "@aws-sdk/util-user-agent-node": "3.391.0", + "@smithy/config-resolver": "^2.0.3", + "@smithy/fetch-http-handler": "^2.0.3", + "@smithy/hash-node": "^2.0.3", + "@smithy/invalid-dependency": "^2.0.3", + "@smithy/middleware-content-length": "^2.0.3", + "@smithy/middleware-endpoint": "^2.0.3", + "@smithy/middleware-retry": "^2.0.3", + "@smithy/middleware-serde": "^2.0.3", "@smithy/middleware-stack": "^2.0.0", - "@smithy/node-config-provider": "^2.0.2", - "@smithy/node-http-handler": "^2.0.2", - "@smithy/protocol-http": "^2.0.2", - "@smithy/smithy-client": "^2.0.2", - "@smithy/types": "^2.1.0", - "@smithy/url-parser": "^2.0.2", + "@smithy/node-config-provider": "^2.0.3", + "@smithy/node-http-handler": "^2.0.3", + "@smithy/protocol-http": "^2.0.3", + "@smithy/smithy-client": "^2.0.3", + "@smithy/types": "^2.2.0", + "@smithy/url-parser": "^2.0.3", "@smithy/util-base64": "^2.0.0", "@smithy/util-body-length-browser": "^2.0.0", "@smithy/util-body-length-node": "^2.0.0", - "@smithy/util-defaults-mode-browser": "^2.0.2", - "@smithy/util-defaults-mode-node": "^2.0.2", + "@smithy/util-defaults-mode-browser": "^2.0.3", + "@smithy/util-defaults-mode-node": "^2.0.3", "@smithy/util-retry": "^2.0.0", "@smithy/util-utf8": "^2.0.0", "fast-xml-parser": "4.2.5", @@ -14806,7 +14889,7 @@ var require_package3 = __commonJS({ module2.exports = { name: "@aws-sdk/client-sso", description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native", - version: "3.387.0", + version: "3.391.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -14826,34 +14909,34 @@ var require_package3 = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/middleware-host-header": "3.387.0", - "@aws-sdk/middleware-logger": "3.387.0", - "@aws-sdk/middleware-recursion-detection": "3.387.0", - "@aws-sdk/middleware-user-agent": "3.387.0", - "@aws-sdk/types": "3.387.0", - "@aws-sdk/util-endpoints": "3.387.0", - "@aws-sdk/util-user-agent-browser": "3.387.0", - "@aws-sdk/util-user-agent-node": "3.387.0", - "@smithy/config-resolver": "^2.0.2", - "@smithy/fetch-http-handler": "^2.0.2", - "@smithy/hash-node": "^2.0.2", - "@smithy/invalid-dependency": "^2.0.2", - "@smithy/middleware-content-length": "^2.0.2", - "@smithy/middleware-endpoint": "^2.0.2", - "@smithy/middleware-retry": "^2.0.2", - "@smithy/middleware-serde": "^2.0.2", + "@aws-sdk/middleware-host-header": "3.391.0", + "@aws-sdk/middleware-logger": "3.391.0", + "@aws-sdk/middleware-recursion-detection": "3.391.0", + "@aws-sdk/middleware-user-agent": "3.391.0", + "@aws-sdk/types": "3.391.0", + "@aws-sdk/util-endpoints": "3.391.0", + "@aws-sdk/util-user-agent-browser": "3.391.0", + "@aws-sdk/util-user-agent-node": "3.391.0", + "@smithy/config-resolver": "^2.0.3", + "@smithy/fetch-http-handler": "^2.0.3", + "@smithy/hash-node": "^2.0.3", + "@smithy/invalid-dependency": "^2.0.3", + "@smithy/middleware-content-length": "^2.0.3", + "@smithy/middleware-endpoint": "^2.0.3", + "@smithy/middleware-retry": "^2.0.3", + "@smithy/middleware-serde": "^2.0.3", "@smithy/middleware-stack": "^2.0.0", - "@smithy/node-config-provider": "^2.0.2", - "@smithy/node-http-handler": "^2.0.2", - "@smithy/protocol-http": "^2.0.2", - "@smithy/smithy-client": "^2.0.2", - "@smithy/types": "^2.1.0", - "@smithy/url-parser": "^2.0.2", + "@smithy/node-config-provider": "^2.0.3", + "@smithy/node-http-handler": "^2.0.3", + "@smithy/protocol-http": "^2.0.3", + "@smithy/smithy-client": "^2.0.3", + "@smithy/types": "^2.2.0", + "@smithy/url-parser": "^2.0.3", "@smithy/util-base64": "^2.0.0", "@smithy/util-body-length-browser": "^2.0.0", "@smithy/util-body-length-node": "^2.0.0", - "@smithy/util-defaults-mode-browser": "^2.0.2", - "@smithy/util-defaults-mode-node": "^2.0.2", + "@smithy/util-defaults-mode-browser": "^2.0.3", + "@smithy/util-defaults-mode-node": "^2.0.3", "@smithy/util-retry": "^2.0.0", "@smithy/util-utf8": "^2.0.0", tslib: "^2.5.0" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js new file mode 100644 index 0000000000000..9f6e97928f257 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -0,0 +1,779 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts +var CLIENT_NAMES; +var init_client_names = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { + "use strict"; + CLIENT_NAMES = [ + "ACM", + "ACMPCA", + "APIGateway", + "ARCZonalShift", + "AccessAnalyzer", + "Account", + "AlexaForBusiness", + "Amp", + "Amplify", + "AmplifyBackend", + "AmplifyUIBuilder", + "ApiGatewayManagementApi", + "ApiGatewayV2", + "AppConfig", + "AppConfigData", + "AppIntegrations", + "AppMesh", + "AppRunner", + "AppStream", + "AppSync", + "Appflow", + "ApplicationAutoScaling", + "ApplicationCostProfiler", + "ApplicationInsights", + "Athena", + "AuditManager", + "AugmentedAIRuntime", + "AutoScaling", + "AutoScalingPlans", + "Backup", + "BackupGateway", + "BackupStorage", + "Batch", + "Billingconductor", + "Braket", + "Budgets", + "CUR", + "Chime", + "ChimeSDKIdentity", + "ChimeSDKMediaPipelines", + "ChimeSDKMeetings", + "ChimeSDKMessaging", + "ChimeSDKVoice", + "Cloud9", + "CloudControl", + "CloudDirectory", + "CloudFormation", + "CloudFront", + "CloudHSM", + "CloudHSMV2", + "CloudSearch", + "CloudSearchDomain", + "CloudTrail", + "CloudWatch", + "CloudWatchEvents", + "CloudWatchLogs", + "CodeArtifact", + "CodeBuild", + "CodeCatalyst", + "CodeCommit", + "CodeDeploy", + "CodeGuruProfiler", + "CodeGuruReviewer", + "CodePipeline", + "CodeStar", + "CodeStarNotifications", + "CodeStarconnections", + "CognitoIdentity", + "CognitoIdentityServiceProvider", + "CognitoSync", + "Comprehend", + "ComprehendMedical", + "ComputeOptimizer", + "ConfigService", + "Connect", + "ConnectCampaigns", + "ConnectCases", + "ConnectContactLens", + "ConnectParticipant", + "ControlTower", + "CostExplorer", + "CustomerProfiles", + "DAX", + "DLM", + "DMS", + "DataBrew", + "DataExchange", + "DataPipeline", + "DataSync", + "Detective", + "DevOpsGuru", + "DeviceFarm", + "DirectConnect", + "DirectoryService", + "Discovery", + "DocDB", + "DocDBElastic", + "Drs", + "DynamoDB", + "DynamoDBStreams", + "EBS", + "EC2", + "EC2InstanceConnect", + "ECR", + "ECRPUBLIC", + "ECS", + "EFS", + "EKS", + "ELB", + "ELBv2", + "EMR", + "EMRServerless", + "EMRcontainers", + "ES", + "ElastiCache", + "ElasticBeanstalk", + "ElasticInference", + "ElasticTranscoder", + "EventBridge", + "Evidently", + "FMS", + "FSx", + "Finspace", + "Finspacedata", + "Firehose", + "Fis", + "ForecastQueryService", + "ForecastService", + "FraudDetector", + "GameLift", + "GameSparks", + "Glacier", + "GlobalAccelerator", + "Glue", + "Grafana", + "Greengrass", + "GreengrassV2", + "GroundStation", + "GuardDuty", + "Health", + "HealthLake", + "Honeycode", + "IAM", + "IVS", + "IdentityStore", + "Imagebuilder", + "Inspector", + "Inspector2", + "IoT1ClickDevicesService", + "IoT1ClickProjects", + "IoTAnalytics", + "IoTEvents", + "IoTEventsData", + "IoTFleetHub", + "IoTFleetWise", + "IoTJobsDataPlane", + "IoTRoboRunner", + "IoTSecureTunneling", + "IoTSiteWise", + "IoTThingsGraph", + "IoTTwinMaker", + "IoTWireless", + "Iot", + "IotData", + "IotDeviceAdvisor", + "Ivschat", + "KMS", + "Kafka", + "KafkaConnect", + "Kendra", + "Keyspaces", + "Kinesis", + "KinesisAnalytics", + "KinesisAnalyticsV2", + "KinesisVideo", + "KinesisVideoArchivedMedia", + "KinesisVideoMedia", + "KinesisVideoSignalingChannels", + "KinesisVideoWebRTCStorage", + "LakeFormation", + "Lambda", + "LexModelBuildingService", + "LexModelsV2", + "LexRuntime", + "LexRuntimeV2", + "LicenseManager", + "LicenseManagerLinuxSubscriptions", + "LicenseManagerUserSubscriptions", + "Lightsail", + "Location", + "LookoutEquipment", + "LookoutMetrics", + "LookoutVision", + "M2", + "MQ", + "MTurk", + "MWAA", + "MachineLearning", + "Macie", + "Macie2", + "ManagedBlockchain", + "MarketplaceCatalog", + "MarketplaceCommerceAnalytics", + "MarketplaceEntitlementService", + "MarketplaceMetering", + "MediaConnect", + "MediaConvert", + "MediaLive", + "MediaPackage", + "MediaPackageVod", + "MediaStore", + "MediaStoreData", + "MediaTailor", + "MemoryDB", + "Mgn", + "MigrationHub", + "MigrationHubConfig", + "MigrationHubOrchestrator", + "MigrationHubRefactorSpaces", + "MigrationHubStrategy", + "Mobile", + "Neptune", + "NetworkFirewall", + "NetworkManager", + "Nimble", + "OAM", + "Omics", + "OpenSearch", + "OpenSearchServerless", + "OpsWorks", + "OpsWorksCM", + "Organizations", + "Outposts", + "PI", + "Panorama", + "Personalize", + "PersonalizeEvents", + "PersonalizeRuntime", + "Pinpoint", + "PinpointEmail", + "PinpointSMSVoice", + "PinpointSMSVoiceV2", + "Pipes", + "Polly", + "Pricing", + "PrivateNetworks", + "Proton", + "QLDB", + "QLDBSession", + "QuickSight", + "RAM", + "RDS", + "RDSDataService", + "RUM", + "Rbin", + "Redshift", + "RedshiftData", + "RedshiftServerless", + "Rekognition", + "Resiliencehub", + "ResourceExplorer2", + "ResourceGroups", + "ResourceGroupsTaggingAPI", + "RoboMaker", + "RolesAnywhere", + "Route53", + "Route53Domains", + "Route53RecoveryCluster", + "Route53RecoveryControlConfig", + "Route53RecoveryReadiness", + "Route53Resolver", + "S3", + "S3Control", + "S3Outposts", + "SES", + "SESV2", + "SMS", + "SNS", + "SQS", + "SSM", + "SSMContacts", + "SSMIncidents", + "SSO", + "SSOAdmin", + "SSOOIDC", + "STS", + "SWF", + "SageMaker", + "SageMakerFeatureStoreRuntime", + "SageMakerGeospatial", + "SageMakerMetrics", + "SageMakerRuntime", + "SagemakerEdge", + "SavingsPlans", + "Scheduler", + "Schemas", + "SecretsManager", + "SecurityHub", + "SecurityLake", + "ServerlessApplicationRepository", + "ServiceCatalog", + "ServiceCatalogAppRegistry", + "ServiceDiscovery", + "ServiceQuotas", + "Shield", + "Signer", + "SimSpaceWeaver", + "SnowDeviceManagement", + "Snowball", + "SsmSap", + "StepFunctions", + "StorageGateway", + "Support", + "SupportApp", + "Synthetics", + "Textract", + "TimestreamQuery", + "TimestreamWrite", + "TranscribeService", + "Transfer", + "Translate", + "VoiceID", + "WAF", + "WAFRegional", + "WAFV2", + "WellArchitected", + "Wisdom", + "WorkDocs", + "WorkLink", + "WorkMail", + "WorkMailMessageFlow", + "WorkSpaces", + "WorkSpacesWeb", + "XRay" + ]; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts +var CLIENT_PACKAGE_NAMES_MAP; +var init_client_package_names_map = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { + "use strict"; + init_client_names(); + CLIENT_PACKAGE_NAMES_MAP = { + ...CLIENT_NAMES.reduce( + (acc, name) => ({ + ...acc, + [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") + }), + {} + ), + AccessAnalyzer: "client-accessanalyzer", + ACMPCA: "client-acm-pca", + APIGateway: "client-api-gateway", + ApiGatewayManagementApi: "client-apigatewaymanagementapi", + ApiGatewayV2: "client-apigatewayv2", + AppConfig: "client-appconfig", + AppConfigData: "client-appconfigdata", + AppIntegrations: "client-appintegrations", + AppRunner: "client-apprunner", + AppStream: "client-appstream", + AppSync: "client-appsync", + ApplicationCostProfiler: "client-applicationcostprofiler", + ARCZonalShift: "client-arc-zonal-shift", + AugmentedAIRuntime: "client-sage-maker-a2iruntime", + AuditManager: "client-auditmanager", + BackupStorage: "client-backupstorage", + CUR: "client-cost-and-usage-report-service", + CloudHSMV2: "client-cloudhsm-v2", + CodeGuruProfiler: "client-codeguruprofiler", + CodeStarconnections: "client-codestar-connections", + CognitoIdentityServiceProvider: "client-cognito-identity-provider", + ComprehendMedical: "client-comprehendmedical", + ConnectContactLens: "client-connect-contact-lens", + ControlTower: "client-controltower", + DMS: "client-database-migration-service", + DataPipeline: "client-data-pipeline", + Discovery: "client-application-discovery-service", + DevOpsGuru: "client-devops-guru", + DynamoDB: "client-dynamodb", + DynamoDBStreams: "client-dynamodb-streams", + DocDB: "client-docdb", + DocDBElastic: "client-docdb-elastic", + EC2InstanceConnect: "client-ec2-instance-connect", + ECRPUBLIC: "client-ecr-public", + ELB: "client-elastic-load-balancing", + ELBv2: "client-elastic-load-balancing-v2", + ElastiCache: "client-elasticache", + EMRcontainers: "client-emr-containers", + EMRServerless: "client-emr-serverless", + ES: "client-elasticsearch-service", + EventBridge: "client-eventbridge", + Finspacedata: "client-finspace-data", + ForecastQueryService: "client-forecastquery", + ForecastService: "client-forecast", + FraudDetector: "client-frauddetector", + GameLift: "client-gamelift", + GameSparks: "client-gamesparks", + GreengrassV2: "client-greengrassv2", + GroundStation: "client-groundstation", + GuardDuty: "client-guardduty", + HealthLake: "client-healthlake", + IdentityStore: "client-identitystore", + IoTAnalytics: "client-iotanalytics", + IotData: "client-iot-data-plane", + IotDeviceAdvisor: "client-iotdeviceadvisor", + IoTSecureTunneling: "client-iotsecuretunneling", + IoTSiteWise: "client-iotsitewise", + IoTThingsGraph: "client-iotthingsgraph", + IoTTwinMaker: "client-iottwinmaker", + IoTRoboRunner: "client-iot-roborunner", + KafkaConnect: "client-kafkaconnect", + KinesisVideoSignalingChannels: "client-kinesis-video-signaling", + KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", + LakeFormation: "client-lakeformation", + LexRuntime: "client-lex-runtime-service", + ManagedBlockchain: "client-managedblockchain", + MigrationHubConfig: "client-migrationhub-config", + MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", + NetworkManager: "client-networkmanager", + OpenSearch: "client-opensearch", + OpenSearchServerless: "client-opensearchserverless", + OpsWorks: "client-opsworks", + OpsWorksCM: "client-opsworkscm", + PrivateNetworks: "client-privatenetworks", + QLDBSession: "client-qldb-session", + QuickSight: "client-quicksight", + ResourceExplorer2: "client-resource-explorer-2", + RDSDataService: "client-rds-data", + RoboMaker: "client-robomaker", + RolesAnywhere: "client-rolesanywhere", + Route53: "client-route-53", + Route53Domains: "client-route-53-domains", + Route53Resolver: "client-route53resolver", + S3Control: "client-s3-control", + SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", + SavingsPlans: "client-savingsplans", + SecurityHub: "client-securityhub", + ServerlessApplicationRepository: "client-serverlessapplicationrepository", + ServiceCatalogAppRegistry: "client-service-catalog-appregistry", + ServiceDiscovery: "client-servicediscovery", + SimSpaceWeaver: "client-simspaceweaver", + SSMContacts: "client-ssm-contacts", + SSMIncidents: "client-ssm-incidents", + SSOAdmin: "client-sso-admin", + SSOOIDC: "client-sso-oidc", + StepFunctions: "client-sfn", + TranscribeService: "client-transcribe", + WAFRegional: "client-waf-regional", + WellArchitected: "client-wellarchitected", + WorkMailMessageFlow: "client-workmailmessageflow" + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts +var get_v3_client_package_name_exports = {}; +__export(get_v3_client_package_name_exports, { + getV3ClientPackageName: () => getV3ClientPackageName +}); +var getV3ClientPackageName; +var init_get_v3_client_package_name = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { + "use strict"; + init_client_package_names_map(); + getV3ClientPackageName = (clientName) => { + if (clientName in CLIENT_PACKAGE_NAMES_MAP) { + return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; + } + throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts +var find_client_constructor_exports = {}; +__export(find_client_constructor_exports, { + findV3ClientConstructor: () => findV3ClientConstructor +}); +function findV3ClientConstructor(pkg) { + const [_clientName, ServiceClient] = Object.entries(pkg).find( + ([name]) => { + return name.endsWith("Client") && name !== "__Client"; + } + ); + return ServiceClient; +} +var init_find_client_constructor = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { + "use strict"; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js +var require_lib = __commonJS({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; + var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); + Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { + return get_v3_client_package_name_1.getV3ClientPackageName; + } }); + var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); + Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { + return find_client_constructor_1.findV3ClientConstructor; + } }); + } +}); + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var aws_sdk_v3_handler_exports = {}; +__export(aws_sdk_v3_handler_exports, { + forceSdkInstallation: () => forceSdkInstallation, + handler: () => handler +}); +module.exports = __toCommonJS(aws_sdk_v3_handler_exports); +var import_child_process = require("child_process"); +var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); + +// custom-resources/lib/aws-custom-resource/runtime/shared.ts +var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } + return Object.assign( + {}, + ..._flatten(object) + ); +} +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +function filterKeys(object, pred) { + return Object.entries(object).reduce( + (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, + {} + ); +} +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data + }); + console.log("Responding", responseBody); + const parsedUrl = require("url").parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { + "content-type": "", + "content-length": Buffer.byteLength(responseBody, "utf8") + } + }; + return new Promise((resolve, reject) => { + try { + const request = require("https").request(requestOptions, resolve); + request.on("error", reject); + request.write(responseBody); + request.end(); + } catch (e) { + reject(e); + } + }); +} +function decodeCall(call) { + if (!call) { + return void 0; + } + return JSON.parse(call); +} +function startsWithOneOf(searchStrings) { + return function(string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var installedSdk = {}; +function forceSdkInstallation() { + installedSdk = {}; +} +function installLatestSdk(packageName) { + console.log(`Installing latest AWS SDK v3: ${packageName}`); + (0, import_child_process.execSync)( + `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` + ); + installedSdk = { + ...installedSdk, + [packageName]: true + }; +} +async function loadAwsSdk(packageName, installLatestAwsSdk) { + let awsSdk; + try { + if (!installedSdk[packageName] && installLatestAwsSdk === "true") { + try { + installLatestSdk(packageName); + awsSdk = require(`/tmp/node_modules/${packageName}`); + } catch (e) { + console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); + return require(packageName); + } + } else if (installedSdk[packageName]) { + awsSdk = require(`/tmp/node_modules/${packageName}`); + } else { + awsSdk = require(packageName); + } + } catch (error) { + throw Error(`Package ${packageName} does not exist.`); + } + return awsSdk; +} +async function handler(event, context) { + try { + event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); + event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); + event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); + let data = {}; + let physicalResourceId; + switch (event.RequestType) { + case "Create": + physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; + break; + case "Update": + case "Delete": + physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; + break; + } + const call = event.ResourceProperties[event.RequestType]; + if (call) { + const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); + let awsSdk = loadAwsSdk( + packageName, + event.ResourceProperties.InstallLatestAwsSdk + ); + console.log(JSON.stringify({ ...event, ResponseURL: "..." })); + let credentials; + if (call.assumedRoleArn) { + const timestamp = (/* @__PURE__ */ new Date()).getTime(); + const params = { + RoleArn: call.assumedRoleArn, + RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) + }; + const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); + credentials = fromTemporaryCredentials({ + params + }); + } + awsSdk = await awsSdk; + const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); + const client = new ServiceClient({ + apiVersion: call.apiVersion, + credentials, + region: call.region + }); + const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; + const Command = Object.entries(awsSdk).find( + ([name]) => name.toLowerCase() === commandName.toLowerCase() + )?.[1]; + let flatData = {}; + try { + const response = await client.send( + new Command( + (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} + ) + ); + flatData = { + apiVersion: client.config.apiVersion, + // For test purposes: check if apiVersion was correctly passed. + region: await client.config.region().catch(() => void 0), + // For test purposes: check if region was correctly passed. + ...flatten(response) + }; + let outputPaths; + if (call.outputPath) { + outputPaths = [call.outputPath]; + } else if (call.outputPaths) { + outputPaths = call.outputPaths; + } + if (outputPaths) { + data = filterKeys(flatData, startsWithOneOf(outputPaths)); + } else { + data = flatData; + } + } catch (e) { + const exceptionName = e.name ?? e.constructor.name; + if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { + throw e; + } + } + if (call.physicalResourceId?.responsePath) { + physicalResourceId = flatData[call.physicalResourceId.responsePath]; + } + } + await respond(event, "SUCCESS", "OK", physicalResourceId, data); + } catch (e) { + console.log(e); + await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + forceSdkInstallation, + handler +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +exports.startsWithOneOf = startsWithOneOf; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7R0FFRztBQUNILE1BQU0sT0FBTyxHQUFHLElBQUksV0FBVyxFQUFFLENBQUM7QUFFbEM7O0dBRUc7QUFDSCxTQUFTLFVBQVUsQ0FBQyxLQUFVO0lBQzVC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Jpbmc6IHN0cmluZykgPT4gYm9vbGVhbiB7XG4gIHJldHVybiBmdW5jdGlvbihzdHJpbmc6IHN0cmluZyk6IGJvb2xlYW4ge1xuICAgIGZvciAoY29uc3Qgc2VhcmNoU3RyaW5nIG9mIHNlYXJjaFN0cmluZ3MpIHtcbiAgICAgIGlmIChzdHJpbmcuc3RhcnRzV2l0aChzZWFyY2hTdHJpbmcpKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js deleted file mode 100644 index 1b662725f1b0b..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js +++ /dev/null @@ -1,769 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts -var CLIENT_NAMES; -var init_client_names = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { - "use strict"; - CLIENT_NAMES = [ - "ACM", - "ACMPCA", - "APIGateway", - "ARCZonalShift", - "AccessAnalyzer", - "Account", - "AlexaForBusiness", - "Amp", - "Amplify", - "AmplifyBackend", - "AmplifyUIBuilder", - "ApiGatewayManagementApi", - "ApiGatewayV2", - "AppConfig", - "AppConfigData", - "AppIntegrations", - "AppMesh", - "AppRunner", - "AppStream", - "AppSync", - "Appflow", - "ApplicationAutoScaling", - "ApplicationCostProfiler", - "ApplicationInsights", - "Athena", - "AuditManager", - "AugmentedAIRuntime", - "AutoScaling", - "AutoScalingPlans", - "Backup", - "BackupGateway", - "BackupStorage", - "Batch", - "Billingconductor", - "Braket", - "Budgets", - "CUR", - "Chime", - "ChimeSDKIdentity", - "ChimeSDKMediaPipelines", - "ChimeSDKMeetings", - "ChimeSDKMessaging", - "ChimeSDKVoice", - "Cloud9", - "CloudControl", - "CloudDirectory", - "CloudFormation", - "CloudFront", - "CloudHSM", - "CloudHSMV2", - "CloudSearch", - "CloudSearchDomain", - "CloudTrail", - "CloudWatch", - "CloudWatchEvents", - "CloudWatchLogs", - "CodeArtifact", - "CodeBuild", - "CodeCatalyst", - "CodeCommit", - "CodeDeploy", - "CodeGuruProfiler", - "CodeGuruReviewer", - "CodePipeline", - "CodeStar", - "CodeStarNotifications", - "CodeStarconnections", - "CognitoIdentity", - "CognitoIdentityServiceProvider", - "CognitoSync", - "Comprehend", - "ComprehendMedical", - "ComputeOptimizer", - "ConfigService", - "Connect", - "ConnectCampaigns", - "ConnectCases", - "ConnectContactLens", - "ConnectParticipant", - "ControlTower", - "CostExplorer", - "CustomerProfiles", - "DAX", - "DLM", - "DMS", - "DataBrew", - "DataExchange", - "DataPipeline", - "DataSync", - "Detective", - "DevOpsGuru", - "DeviceFarm", - "DirectConnect", - "DirectoryService", - "Discovery", - "DocDB", - "DocDBElastic", - "Drs", - "DynamoDB", - "DynamoDBStreams", - "EBS", - "EC2", - "EC2InstanceConnect", - "ECR", - "ECRPUBLIC", - "ECS", - "EFS", - "EKS", - "ELB", - "ELBv2", - "EMR", - "EMRServerless", - "EMRcontainers", - "ES", - "ElastiCache", - "ElasticBeanstalk", - "ElasticInference", - "ElasticTranscoder", - "EventBridge", - "Evidently", - "FMS", - "FSx", - "Finspace", - "Finspacedata", - "Firehose", - "Fis", - "ForecastQueryService", - "ForecastService", - "FraudDetector", - "GameLift", - "GameSparks", - "Glacier", - "GlobalAccelerator", - "Glue", - "Grafana", - "Greengrass", - "GreengrassV2", - "GroundStation", - "GuardDuty", - "Health", - "HealthLake", - "Honeycode", - "IAM", - "IVS", - "IdentityStore", - "Imagebuilder", - "Inspector", - "Inspector2", - "IoT1ClickDevicesService", - "IoT1ClickProjects", - "IoTAnalytics", - "IoTEvents", - "IoTEventsData", - "IoTFleetHub", - "IoTFleetWise", - "IoTJobsDataPlane", - "IoTRoboRunner", - "IoTSecureTunneling", - "IoTSiteWise", - "IoTThingsGraph", - "IoTTwinMaker", - "IoTWireless", - "Iot", - "IotData", - "IotDeviceAdvisor", - "Ivschat", - "KMS", - "Kafka", - "KafkaConnect", - "Kendra", - "Keyspaces", - "Kinesis", - "KinesisAnalytics", - "KinesisAnalyticsV2", - "KinesisVideo", - "KinesisVideoArchivedMedia", - "KinesisVideoMedia", - "KinesisVideoSignalingChannels", - "KinesisVideoWebRTCStorage", - "LakeFormation", - "Lambda", - "LexModelBuildingService", - "LexModelsV2", - "LexRuntime", - "LexRuntimeV2", - "LicenseManager", - "LicenseManagerLinuxSubscriptions", - "LicenseManagerUserSubscriptions", - "Lightsail", - "Location", - "LookoutEquipment", - "LookoutMetrics", - "LookoutVision", - "M2", - "MQ", - "MTurk", - "MWAA", - "MachineLearning", - "Macie", - "Macie2", - "ManagedBlockchain", - "MarketplaceCatalog", - "MarketplaceCommerceAnalytics", - "MarketplaceEntitlementService", - "MarketplaceMetering", - "MediaConnect", - "MediaConvert", - "MediaLive", - "MediaPackage", - "MediaPackageVod", - "MediaStore", - "MediaStoreData", - "MediaTailor", - "MemoryDB", - "Mgn", - "MigrationHub", - "MigrationHubConfig", - "MigrationHubOrchestrator", - "MigrationHubRefactorSpaces", - "MigrationHubStrategy", - "Mobile", - "Neptune", - "NetworkFirewall", - "NetworkManager", - "Nimble", - "OAM", - "Omics", - "OpenSearch", - "OpenSearchServerless", - "OpsWorks", - "OpsWorksCM", - "Organizations", - "Outposts", - "PI", - "Panorama", - "Personalize", - "PersonalizeEvents", - "PersonalizeRuntime", - "Pinpoint", - "PinpointEmail", - "PinpointSMSVoice", - "PinpointSMSVoiceV2", - "Pipes", - "Polly", - "Pricing", - "PrivateNetworks", - "Proton", - "QLDB", - "QLDBSession", - "QuickSight", - "RAM", - "RDS", - "RDSDataService", - "RUM", - "Rbin", - "Redshift", - "RedshiftData", - "RedshiftServerless", - "Rekognition", - "Resiliencehub", - "ResourceExplorer2", - "ResourceGroups", - "ResourceGroupsTaggingAPI", - "RoboMaker", - "RolesAnywhere", - "Route53", - "Route53Domains", - "Route53RecoveryCluster", - "Route53RecoveryControlConfig", - "Route53RecoveryReadiness", - "Route53Resolver", - "S3", - "S3Control", - "S3Outposts", - "SES", - "SESV2", - "SMS", - "SNS", - "SQS", - "SSM", - "SSMContacts", - "SSMIncidents", - "SSO", - "SSOAdmin", - "SSOOIDC", - "STS", - "SWF", - "SageMaker", - "SageMakerFeatureStoreRuntime", - "SageMakerGeospatial", - "SageMakerMetrics", - "SageMakerRuntime", - "SagemakerEdge", - "SavingsPlans", - "Scheduler", - "Schemas", - "SecretsManager", - "SecurityHub", - "SecurityLake", - "ServerlessApplicationRepository", - "ServiceCatalog", - "ServiceCatalogAppRegistry", - "ServiceDiscovery", - "ServiceQuotas", - "Shield", - "Signer", - "SimSpaceWeaver", - "SnowDeviceManagement", - "Snowball", - "SsmSap", - "StepFunctions", - "StorageGateway", - "Support", - "SupportApp", - "Synthetics", - "Textract", - "TimestreamQuery", - "TimestreamWrite", - "TranscribeService", - "Transfer", - "Translate", - "VoiceID", - "WAF", - "WAFRegional", - "WAFV2", - "WellArchitected", - "Wisdom", - "WorkDocs", - "WorkLink", - "WorkMail", - "WorkMailMessageFlow", - "WorkSpaces", - "WorkSpacesWeb", - "XRay" - ]; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts -var CLIENT_PACKAGE_NAMES_MAP; -var init_client_package_names_map = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { - "use strict"; - init_client_names(); - CLIENT_PACKAGE_NAMES_MAP = { - ...CLIENT_NAMES.reduce( - (acc, name) => ({ - ...acc, - [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") - }), - {} - ), - AccessAnalyzer: "client-accessanalyzer", - ACMPCA: "client-acm-pca", - APIGateway: "client-api-gateway", - ApiGatewayManagementApi: "client-apigatewaymanagementapi", - ApiGatewayV2: "client-apigatewayv2", - AppConfig: "client-appconfig", - AppConfigData: "client-appconfigdata", - AppIntegrations: "client-appintegrations", - AppRunner: "client-apprunner", - AppStream: "client-appstream", - AppSync: "client-appsync", - ApplicationCostProfiler: "client-applicationcostprofiler", - ARCZonalShift: "client-arc-zonal-shift", - AugmentedAIRuntime: "client-sage-maker-a2iruntime", - AuditManager: "client-auditmanager", - BackupStorage: "client-backupstorage", - CUR: "client-cost-and-usage-report-service", - CloudHSMV2: "client-cloudhsm-v2", - CodeGuruProfiler: "client-codeguruprofiler", - CodeStarconnections: "client-codestar-connections", - CognitoIdentityServiceProvider: "client-cognito-identity-provider", - ComprehendMedical: "client-comprehendmedical", - ConnectContactLens: "client-connect-contact-lens", - ControlTower: "client-controltower", - DMS: "client-database-migration-service", - DataPipeline: "client-data-pipeline", - Discovery: "client-application-discovery-service", - DevOpsGuru: "client-devops-guru", - DynamoDB: "client-dynamodb", - DynamoDBStreams: "client-dynamodb-streams", - DocDB: "client-docdb", - DocDBElastic: "client-docdb-elastic", - EC2InstanceConnect: "client-ec2-instance-connect", - ECRPUBLIC: "client-ecr-public", - ELB: "client-elastic-load-balancing", - ELBv2: "client-elastic-load-balancing-v2", - ElastiCache: "client-elasticache", - EMRcontainers: "client-emr-containers", - EMRServerless: "client-emr-serverless", - ES: "client-elasticsearch-service", - EventBridge: "client-eventbridge", - Finspacedata: "client-finspace-data", - ForecastQueryService: "client-forecastquery", - ForecastService: "client-forecast", - FraudDetector: "client-frauddetector", - GameLift: "client-gamelift", - GameSparks: "client-gamesparks", - GreengrassV2: "client-greengrassv2", - GroundStation: "client-groundstation", - GuardDuty: "client-guardduty", - HealthLake: "client-healthlake", - IdentityStore: "client-identitystore", - IoTAnalytics: "client-iotanalytics", - IotData: "client-iot-data-plane", - IotDeviceAdvisor: "client-iotdeviceadvisor", - IoTSecureTunneling: "client-iotsecuretunneling", - IoTSiteWise: "client-iotsitewise", - IoTThingsGraph: "client-iotthingsgraph", - IoTTwinMaker: "client-iottwinmaker", - IoTRoboRunner: "client-iot-roborunner", - KafkaConnect: "client-kafkaconnect", - KinesisVideoSignalingChannels: "client-kinesis-video-signaling", - KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", - LakeFormation: "client-lakeformation", - LexRuntime: "client-lex-runtime-service", - ManagedBlockchain: "client-managedblockchain", - MigrationHubConfig: "client-migrationhub-config", - MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", - NetworkManager: "client-networkmanager", - OpenSearch: "client-opensearch", - OpenSearchServerless: "client-opensearchserverless", - OpsWorks: "client-opsworks", - OpsWorksCM: "client-opsworkscm", - PrivateNetworks: "client-privatenetworks", - QLDBSession: "client-qldb-session", - QuickSight: "client-quicksight", - ResourceExplorer2: "client-resource-explorer-2", - RDSDataService: "client-rds-data", - RoboMaker: "client-robomaker", - RolesAnywhere: "client-rolesanywhere", - Route53: "client-route-53", - Route53Domains: "client-route-53-domains", - Route53Resolver: "client-route53resolver", - S3Control: "client-s3-control", - SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", - SavingsPlans: "client-savingsplans", - SecurityHub: "client-securityhub", - ServerlessApplicationRepository: "client-serverlessapplicationrepository", - ServiceCatalogAppRegistry: "client-service-catalog-appregistry", - ServiceDiscovery: "client-servicediscovery", - SimSpaceWeaver: "client-simspaceweaver", - SSMContacts: "client-ssm-contacts", - SSMIncidents: "client-ssm-incidents", - SSOAdmin: "client-sso-admin", - SSOOIDC: "client-sso-oidc", - StepFunctions: "client-sfn", - TranscribeService: "client-transcribe", - WAFRegional: "client-waf-regional", - WellArchitected: "client-wellarchitected", - WorkMailMessageFlow: "client-workmailmessageflow" - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts -var get_v3_client_package_name_exports = {}; -__export(get_v3_client_package_name_exports, { - getV3ClientPackageName: () => getV3ClientPackageName -}); -var getV3ClientPackageName; -var init_get_v3_client_package_name = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { - "use strict"; - init_client_package_names_map(); - getV3ClientPackageName = (clientName) => { - if (clientName in CLIENT_PACKAGE_NAMES_MAP) { - return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; - } - throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts -var find_client_constructor_exports = {}; -__export(find_client_constructor_exports, { - findV3ClientConstructor: () => findV3ClientConstructor -}); -function findV3ClientConstructor(pkg) { - const [_clientName, ServiceClient] = Object.entries(pkg).find( - ([name]) => { - return name.endsWith("Client") && name !== "__Client"; - } - ); - return ServiceClient; -} -var init_find_client_constructor = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { - "use strict"; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js -var require_lib = __commonJS({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; - var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); - Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { - return get_v3_client_package_name_1.getV3ClientPackageName; - } }); - var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); - Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { - return find_client_constructor_1.findV3ClientConstructor; - } }); - } -}); - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var aws_sdk_v3_handler_exports = {}; -__export(aws_sdk_v3_handler_exports, { - forceSdkInstallation: () => forceSdkInstallation, - handler: () => handler -}); -module.exports = __toCommonJS(aws_sdk_v3_handler_exports); -var import_child_process = require("child_process"); -var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); - -// custom-resources/lib/aws-custom-resource/runtime/shared.ts -var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; -function flatten(object) { - return Object.assign( - {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) - ); -} -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -function filterKeys(object, pred) { - return Object.entries(object).reduce( - (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, - {} - ); -} -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data - }); - console.log("Responding", responseBody); - const parsedUrl = require("url").parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { - "content-type": "", - "content-length": Buffer.byteLength(responseBody, "utf8") - } - }; - return new Promise((resolve, reject) => { - try { - const request = require("https").request(requestOptions, resolve); - request.on("error", reject); - request.write(responseBody); - request.end(); - } catch (e) { - reject(e); - } - }); -} -function decodeCall(call) { - if (!call) { - return void 0; - } - return JSON.parse(call); -} -function startsWithOneOf(searchStrings) { - return function(string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var installedSdk = {}; -function forceSdkInstallation() { - installedSdk = {}; -} -function installLatestSdk(packageName) { - console.log(`Installing latest AWS SDK v3: ${packageName}`); - (0, import_child_process.execSync)( - `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` - ); - installedSdk = { - ...installedSdk, - [packageName]: true - }; -} -async function loadAwsSdk(packageName, installLatestAwsSdk) { - let awsSdk; - try { - if (!installedSdk[packageName] && installLatestAwsSdk === "true") { - try { - installLatestSdk(packageName); - awsSdk = require(`/tmp/node_modules/${packageName}`); - } catch (e) { - console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); - return require(packageName); - } - } else if (installedSdk[packageName]) { - awsSdk = require(`/tmp/node_modules/${packageName}`); - } else { - awsSdk = require(packageName); - } - } catch (error) { - throw Error(`Package ${packageName} does not exist.`); - } - return awsSdk; -} -async function handler(event, context) { - try { - event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); - event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); - event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); - let data = {}; - let physicalResourceId; - switch (event.RequestType) { - case "Create": - physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; - break; - case "Update": - case "Delete": - physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; - break; - } - const call = event.ResourceProperties[event.RequestType]; - if (call) { - const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); - let awsSdk = loadAwsSdk( - packageName, - event.ResourceProperties.InstallLatestAwsSdk - ); - console.log(JSON.stringify({ ...event, ResponseURL: "..." })); - let credentials; - if (call.assumedRoleArn) { - const timestamp = (/* @__PURE__ */ new Date()).getTime(); - const params = { - RoleArn: call.assumedRoleArn, - RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) - }; - const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); - credentials = fromTemporaryCredentials({ - params - }); - } - awsSdk = await awsSdk; - const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); - const client = new ServiceClient({ - apiVersion: call.apiVersion, - credentials, - region: call.region - }); - const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; - const Command = Object.entries(awsSdk).find( - ([name]) => name.toLowerCase() === commandName.toLowerCase() - )?.[1]; - let flatData = {}; - try { - const response = await client.send( - new Command( - (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} - ) - ); - flatData = { - apiVersion: client.config.apiVersion, - // For test purposes: check if apiVersion was correctly passed. - region: await client.config.region().catch(() => void 0), - // For test purposes: check if region was correctly passed. - ...flatten(response) - }; - let outputPaths; - if (call.outputPath) { - outputPaths = [call.outputPath]; - } else if (call.outputPaths) { - outputPaths = call.outputPaths; - } - if (outputPaths) { - data = filterKeys(flatData, startsWithOneOf(outputPaths)); - } else { - data = flatData; - } - } catch (e) { - const exceptionName = e.name ?? e.constructor.name; - if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { - throw e; - } - } - if (call.physicalResourceId?.responsePath) { - physicalResourceId = flatData[call.physicalResourceId.responsePath]; - } - } - await respond(event, "SUCCESS", "OK", physicalResourceId, data); - } catch (e) { - console.log(e); - await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - forceSdkInstallation, - handler -}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js deleted file mode 100644 index 6c53eaeef8cd1..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -exports.decodeSpecialValues = decodeSpecialValues; -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -exports.filterKeys = filterKeys; -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - // eslint-disable-next-line no-console - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': Buffer.byteLength(responseBody, 'utf8'), - }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -exports.respond = respond; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -exports.decodeCall = decodeCall; -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} -exports.startsWithOneOf = startsWithOneOf; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7Ozs7R0FLRztBQUNILFNBQWdCLE9BQU8sQ0FBQyxNQUFjO0lBQ3BDLE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FDbEIsRUFBRSxFQUNGLEdBQUcsU0FBUyxRQUFRLENBQUMsS0FBVSxFQUFFLE9BQWlCLEVBQUU7UUFDbEQsT0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDLEd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1bmRlZmluZWQ7IH1cbiAgcmV0dXJuIEpTT04ucGFyc2UoY2FsbCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzdGFydHNXaXRoT25lT2Yoc2VhcmNoU3RyaW5nczogc3RyaW5nW10pOiAoc3RyaW5nOiBzdHJpbmcpID0+IGJvb2xlYW4ge1xuICByZXR1cm4gZnVuY3Rpb24oc3RyaW5nOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgICBmb3IgKGNvbnN0IHNlYXJjaFN0cmluZyBvZiBzZWFyY2hTdHJpbmdzKSB7XG4gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/log-group-events.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/log-group-events.assets.json index 4a1a59325210d..3a4040ef3605a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/log-group-events.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/log-group-events.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "6feea734979602727e48e034646a8a447ddc1aa154848f139a3291416ef27212": { + "c7d0acde3d0eb5ed37c977f9c75f871f44eb1767d1e831ab9e6c96f97d438cb0": { "source": { "path": "log-group-events.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "6feea734979602727e48e034646a8a447ddc1aa154848f139a3291416ef27212.json", + "objectKey": "c7d0acde3d0eb5ed37c977f9c75f871f44eb1767d1e831ab9e6c96f97d438cb0.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/log-group-events.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/log-group-events.template.json index e20945f5c3f8e..6c2d264035f40 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/log-group-events.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/log-group-events.template.json @@ -100,7 +100,7 @@ ] }, "Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"loggroupeventsEventsLogGroupPolicyloggroupeventsTimerC63340B025F606BE\"},\"ignoreErrorCodesMatching\":\"ResourceNotFoundException\"}", - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "EventsLogGroupPolicyloggroupeventsTimerC63340B0CustomResourcePolicy67B796AA" @@ -170,7 +170,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { @@ -275,7 +275,7 @@ ] }, "Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"loggroupeventsEventsLogGroupPolicyloggroupeventsCustomRule99E1EEF62FFABD78\"},\"ignoreErrorCodesMatching\":\"ResourceNotFoundException\"}", - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6CustomResourcePolicy361E9A96" @@ -406,7 +406,7 @@ ] }, "Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"loggroupeventsEventsLogGroupPolicyloggroupeventsTimer37DF74C17EF314A8E\"},\"ignoreErrorCodesMatching\":\"ResourceNotFoundException\"}", - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "EventsLogGroupPolicyloggroupeventsTimer37DF74C17CustomResourcePolicyAE930E1E" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/manifest.json index efc5a9707e128..5f9d9daecd194 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/6feea734979602727e48e034646a8a447ddc1aa154848f139a3291416ef27212.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c7d0acde3d0eb5ed37c977f9c75f871f44eb1767d1e831ab9e6c96f97d438cb0.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -57,6 +57,12 @@ "data": "TimerBF6F831F" } ], + "/log-group-events/EventsLogGroupPolicyloggroupeventsTimerC63340B0": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/log-group-events/EventsLogGroupPolicyloggroupeventsTimerC63340B0/Resource/Default": [ { "type": "aws:cdk:logicalId", @@ -87,6 +93,12 @@ "data": "CustomRuleB1CBBADE" } ], + "/log-group-events/EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/log-group-events/EventsLogGroupPolicyloggroupeventsCustomRule99E1EEF6/Resource/Default": [ { "type": "aws:cdk:logicalId", @@ -111,6 +123,12 @@ "data": "Timer30894E3BB" } ], + "/log-group-events/EventsLogGroupPolicyloggroupeventsTimer37DF74C17": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/log-group-events/EventsLogGroupPolicyloggroupeventsTimer37DF74C17/Resource/Default": [ { "type": "aws:cdk:logicalId", @@ -160,7 +178,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/52d728c85f35a58bbfdfd2b6dbdad511312ae00ed2707bd69ad2bf8dfc772400.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/69fcede415ffed48915f848f7515603039a2ec603b4ebf6fb36a165f18bdc98d.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -177,10 +195,10 @@ "LogGroupDefaultTestDeployAssert353EE07A.assets" ], "metadata": { - "/LogGroup/DefaultTest/DeployAssert/AwsApiCallEventBridgeputEvents86d1feecd8251713d5bdf1c558f2aa31/Default/Default": [ + "/LogGroup/DefaultTest/DeployAssert/AwsApiCallEventBridgeputEvents4923866d22d2c71d8b1a85360b620e5f/Default/Default": [ { "type": "aws:cdk:logicalId", - "data": "AwsApiCallEventBridgeputEvents86d1feecd8251713d5bdf1c558f2aa31" + "data": "AwsApiCallEventBridgeputEvents4923866d22d2c71d8b1a85360b620e5f" } ], "/LogGroup/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ @@ -195,16 +213,16 @@ "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" } ], - "/LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents5769f20437ecc1683899ac2c8e798593/Default/Default": [ + "/LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents9ba36aa083750b6bbe1071e7a7e08267/Default/Default": [ { "type": "aws:cdk:logicalId", - "data": "AwsApiCallCloudWatchLogsfilterLogEvents5769f20437ecc1683899ac2c8e798593" + "data": "AwsApiCallCloudWatchLogsfilterLogEvents9ba36aa083750b6bbe1071e7a7e08267" } ], - "/LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents5769f20437ecc1683899ac2c8e798593/AssertionResults": [ + "/LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents9ba36aa083750b6bbe1071e7a7e08267/AssertionResults": [ { "type": "aws:cdk:logicalId", - "data": "AssertionResultsAwsApiCallCloudWatchLogsfilterLogEvents5769f20437ecc1683899ac2c8e798593" + "data": "AssertionResultsAwsApiCallCloudWatchLogsfilterLogEvents9ba36aa083750b6bbe1071e7a7e08267" } ], "/LogGroup/DefaultTest/DeployAssert/BootstrapVersion": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/tree.json index 67949aa42f57c..906d67fdf2ae6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/logs/integ.log-group.js.snapshot/tree.json @@ -317,7 +317,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { @@ -708,17 +708,17 @@ "id": "DeployAssert", "path": "LogGroup/DefaultTest/DeployAssert", "children": { - "AwsApiCallEventBridgeputEvents86d1feecd8251713d5bdf1c558f2aa31": { - "id": "AwsApiCallEventBridgeputEvents86d1feecd8251713d5bdf1c558f2aa31", - "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallEventBridgeputEvents86d1feecd8251713d5bdf1c558f2aa31", + "AwsApiCallEventBridgeputEvents4923866d22d2c71d8b1a85360b620e5f": { + "id": "AwsApiCallEventBridgeputEvents4923866d22d2c71d8b1a85360b620e5f", + "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallEventBridgeputEvents4923866d22d2c71d8b1a85360b620e5f", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallEventBridgeputEvents86d1feecd8251713d5bdf1c558f2aa31/SdkProvider", + "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallEventBridgeputEvents4923866d22d2c71d8b1a85360b620e5f/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallEventBridgeputEvents86d1feecd8251713d5bdf1c558f2aa31/SdkProvider/AssertionsProvider", + "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallEventBridgeputEvents4923866d22d2c71d8b1a85360b620e5f/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", "version": "10.2.69" @@ -732,11 +732,11 @@ }, "Default": { "id": "Default", - "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallEventBridgeputEvents86d1feecd8251713d5bdf1c558f2aa31/Default", + "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallEventBridgeputEvents4923866d22d2c71d8b1a85360b620e5f/Default", "children": { "Default": { "id": "Default", - "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallEventBridgeputEvents86d1feecd8251713d5bdf1c558f2aa31/Default/Default", + "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallEventBridgeputEvents4923866d22d2c71d8b1a85360b620e5f/Default/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -788,17 +788,17 @@ "version": "10.2.69" } }, - "AwsApiCallCloudWatchLogsfilterLogEvents5769f20437ecc1683899ac2c8e798593": { - "id": "AwsApiCallCloudWatchLogsfilterLogEvents5769f20437ecc1683899ac2c8e798593", - "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents5769f20437ecc1683899ac2c8e798593", + "AwsApiCallCloudWatchLogsfilterLogEvents9ba36aa083750b6bbe1071e7a7e08267": { + "id": "AwsApiCallCloudWatchLogsfilterLogEvents9ba36aa083750b6bbe1071e7a7e08267", + "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents9ba36aa083750b6bbe1071e7a7e08267", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents5769f20437ecc1683899ac2c8e798593/SdkProvider", + "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents9ba36aa083750b6bbe1071e7a7e08267/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents5769f20437ecc1683899ac2c8e798593/SdkProvider/AssertionsProvider", + "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents9ba36aa083750b6bbe1071e7a7e08267/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", "version": "10.2.69" @@ -812,11 +812,11 @@ }, "Default": { "id": "Default", - "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents5769f20437ecc1683899ac2c8e798593/Default", + "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents9ba36aa083750b6bbe1071e7a7e08267/Default", "children": { "Default": { "id": "Default", - "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents5769f20437ecc1683899ac2c8e798593/Default/Default", + "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents9ba36aa083750b6bbe1071e7a7e08267/Default/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -830,7 +830,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents5769f20437ecc1683899ac2c8e798593/AssertionResults", + "path": "LogGroup/DefaultTest/DeployAssert/AwsApiCallCloudWatchLogsfilterLogEvents9ba36aa083750b6bbe1071e7a7e08267/AssertionResults", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js new file mode 100644 index 0000000000000..9f6e97928f257 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -0,0 +1,779 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts +var CLIENT_NAMES; +var init_client_names = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { + "use strict"; + CLIENT_NAMES = [ + "ACM", + "ACMPCA", + "APIGateway", + "ARCZonalShift", + "AccessAnalyzer", + "Account", + "AlexaForBusiness", + "Amp", + "Amplify", + "AmplifyBackend", + "AmplifyUIBuilder", + "ApiGatewayManagementApi", + "ApiGatewayV2", + "AppConfig", + "AppConfigData", + "AppIntegrations", + "AppMesh", + "AppRunner", + "AppStream", + "AppSync", + "Appflow", + "ApplicationAutoScaling", + "ApplicationCostProfiler", + "ApplicationInsights", + "Athena", + "AuditManager", + "AugmentedAIRuntime", + "AutoScaling", + "AutoScalingPlans", + "Backup", + "BackupGateway", + "BackupStorage", + "Batch", + "Billingconductor", + "Braket", + "Budgets", + "CUR", + "Chime", + "ChimeSDKIdentity", + "ChimeSDKMediaPipelines", + "ChimeSDKMeetings", + "ChimeSDKMessaging", + "ChimeSDKVoice", + "Cloud9", + "CloudControl", + "CloudDirectory", + "CloudFormation", + "CloudFront", + "CloudHSM", + "CloudHSMV2", + "CloudSearch", + "CloudSearchDomain", + "CloudTrail", + "CloudWatch", + "CloudWatchEvents", + "CloudWatchLogs", + "CodeArtifact", + "CodeBuild", + "CodeCatalyst", + "CodeCommit", + "CodeDeploy", + "CodeGuruProfiler", + "CodeGuruReviewer", + "CodePipeline", + "CodeStar", + "CodeStarNotifications", + "CodeStarconnections", + "CognitoIdentity", + "CognitoIdentityServiceProvider", + "CognitoSync", + "Comprehend", + "ComprehendMedical", + "ComputeOptimizer", + "ConfigService", + "Connect", + "ConnectCampaigns", + "ConnectCases", + "ConnectContactLens", + "ConnectParticipant", + "ControlTower", + "CostExplorer", + "CustomerProfiles", + "DAX", + "DLM", + "DMS", + "DataBrew", + "DataExchange", + "DataPipeline", + "DataSync", + "Detective", + "DevOpsGuru", + "DeviceFarm", + "DirectConnect", + "DirectoryService", + "Discovery", + "DocDB", + "DocDBElastic", + "Drs", + "DynamoDB", + "DynamoDBStreams", + "EBS", + "EC2", + "EC2InstanceConnect", + "ECR", + "ECRPUBLIC", + "ECS", + "EFS", + "EKS", + "ELB", + "ELBv2", + "EMR", + "EMRServerless", + "EMRcontainers", + "ES", + "ElastiCache", + "ElasticBeanstalk", + "ElasticInference", + "ElasticTranscoder", + "EventBridge", + "Evidently", + "FMS", + "FSx", + "Finspace", + "Finspacedata", + "Firehose", + "Fis", + "ForecastQueryService", + "ForecastService", + "FraudDetector", + "GameLift", + "GameSparks", + "Glacier", + "GlobalAccelerator", + "Glue", + "Grafana", + "Greengrass", + "GreengrassV2", + "GroundStation", + "GuardDuty", + "Health", + "HealthLake", + "Honeycode", + "IAM", + "IVS", + "IdentityStore", + "Imagebuilder", + "Inspector", + "Inspector2", + "IoT1ClickDevicesService", + "IoT1ClickProjects", + "IoTAnalytics", + "IoTEvents", + "IoTEventsData", + "IoTFleetHub", + "IoTFleetWise", + "IoTJobsDataPlane", + "IoTRoboRunner", + "IoTSecureTunneling", + "IoTSiteWise", + "IoTThingsGraph", + "IoTTwinMaker", + "IoTWireless", + "Iot", + "IotData", + "IotDeviceAdvisor", + "Ivschat", + "KMS", + "Kafka", + "KafkaConnect", + "Kendra", + "Keyspaces", + "Kinesis", + "KinesisAnalytics", + "KinesisAnalyticsV2", + "KinesisVideo", + "KinesisVideoArchivedMedia", + "KinesisVideoMedia", + "KinesisVideoSignalingChannels", + "KinesisVideoWebRTCStorage", + "LakeFormation", + "Lambda", + "LexModelBuildingService", + "LexModelsV2", + "LexRuntime", + "LexRuntimeV2", + "LicenseManager", + "LicenseManagerLinuxSubscriptions", + "LicenseManagerUserSubscriptions", + "Lightsail", + "Location", + "LookoutEquipment", + "LookoutMetrics", + "LookoutVision", + "M2", + "MQ", + "MTurk", + "MWAA", + "MachineLearning", + "Macie", + "Macie2", + "ManagedBlockchain", + "MarketplaceCatalog", + "MarketplaceCommerceAnalytics", + "MarketplaceEntitlementService", + "MarketplaceMetering", + "MediaConnect", + "MediaConvert", + "MediaLive", + "MediaPackage", + "MediaPackageVod", + "MediaStore", + "MediaStoreData", + "MediaTailor", + "MemoryDB", + "Mgn", + "MigrationHub", + "MigrationHubConfig", + "MigrationHubOrchestrator", + "MigrationHubRefactorSpaces", + "MigrationHubStrategy", + "Mobile", + "Neptune", + "NetworkFirewall", + "NetworkManager", + "Nimble", + "OAM", + "Omics", + "OpenSearch", + "OpenSearchServerless", + "OpsWorks", + "OpsWorksCM", + "Organizations", + "Outposts", + "PI", + "Panorama", + "Personalize", + "PersonalizeEvents", + "PersonalizeRuntime", + "Pinpoint", + "PinpointEmail", + "PinpointSMSVoice", + "PinpointSMSVoiceV2", + "Pipes", + "Polly", + "Pricing", + "PrivateNetworks", + "Proton", + "QLDB", + "QLDBSession", + "QuickSight", + "RAM", + "RDS", + "RDSDataService", + "RUM", + "Rbin", + "Redshift", + "RedshiftData", + "RedshiftServerless", + "Rekognition", + "Resiliencehub", + "ResourceExplorer2", + "ResourceGroups", + "ResourceGroupsTaggingAPI", + "RoboMaker", + "RolesAnywhere", + "Route53", + "Route53Domains", + "Route53RecoveryCluster", + "Route53RecoveryControlConfig", + "Route53RecoveryReadiness", + "Route53Resolver", + "S3", + "S3Control", + "S3Outposts", + "SES", + "SESV2", + "SMS", + "SNS", + "SQS", + "SSM", + "SSMContacts", + "SSMIncidents", + "SSO", + "SSOAdmin", + "SSOOIDC", + "STS", + "SWF", + "SageMaker", + "SageMakerFeatureStoreRuntime", + "SageMakerGeospatial", + "SageMakerMetrics", + "SageMakerRuntime", + "SagemakerEdge", + "SavingsPlans", + "Scheduler", + "Schemas", + "SecretsManager", + "SecurityHub", + "SecurityLake", + "ServerlessApplicationRepository", + "ServiceCatalog", + "ServiceCatalogAppRegistry", + "ServiceDiscovery", + "ServiceQuotas", + "Shield", + "Signer", + "SimSpaceWeaver", + "SnowDeviceManagement", + "Snowball", + "SsmSap", + "StepFunctions", + "StorageGateway", + "Support", + "SupportApp", + "Synthetics", + "Textract", + "TimestreamQuery", + "TimestreamWrite", + "TranscribeService", + "Transfer", + "Translate", + "VoiceID", + "WAF", + "WAFRegional", + "WAFV2", + "WellArchitected", + "Wisdom", + "WorkDocs", + "WorkLink", + "WorkMail", + "WorkMailMessageFlow", + "WorkSpaces", + "WorkSpacesWeb", + "XRay" + ]; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts +var CLIENT_PACKAGE_NAMES_MAP; +var init_client_package_names_map = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { + "use strict"; + init_client_names(); + CLIENT_PACKAGE_NAMES_MAP = { + ...CLIENT_NAMES.reduce( + (acc, name) => ({ + ...acc, + [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") + }), + {} + ), + AccessAnalyzer: "client-accessanalyzer", + ACMPCA: "client-acm-pca", + APIGateway: "client-api-gateway", + ApiGatewayManagementApi: "client-apigatewaymanagementapi", + ApiGatewayV2: "client-apigatewayv2", + AppConfig: "client-appconfig", + AppConfigData: "client-appconfigdata", + AppIntegrations: "client-appintegrations", + AppRunner: "client-apprunner", + AppStream: "client-appstream", + AppSync: "client-appsync", + ApplicationCostProfiler: "client-applicationcostprofiler", + ARCZonalShift: "client-arc-zonal-shift", + AugmentedAIRuntime: "client-sage-maker-a2iruntime", + AuditManager: "client-auditmanager", + BackupStorage: "client-backupstorage", + CUR: "client-cost-and-usage-report-service", + CloudHSMV2: "client-cloudhsm-v2", + CodeGuruProfiler: "client-codeguruprofiler", + CodeStarconnections: "client-codestar-connections", + CognitoIdentityServiceProvider: "client-cognito-identity-provider", + ComprehendMedical: "client-comprehendmedical", + ConnectContactLens: "client-connect-contact-lens", + ControlTower: "client-controltower", + DMS: "client-database-migration-service", + DataPipeline: "client-data-pipeline", + Discovery: "client-application-discovery-service", + DevOpsGuru: "client-devops-guru", + DynamoDB: "client-dynamodb", + DynamoDBStreams: "client-dynamodb-streams", + DocDB: "client-docdb", + DocDBElastic: "client-docdb-elastic", + EC2InstanceConnect: "client-ec2-instance-connect", + ECRPUBLIC: "client-ecr-public", + ELB: "client-elastic-load-balancing", + ELBv2: "client-elastic-load-balancing-v2", + ElastiCache: "client-elasticache", + EMRcontainers: "client-emr-containers", + EMRServerless: "client-emr-serverless", + ES: "client-elasticsearch-service", + EventBridge: "client-eventbridge", + Finspacedata: "client-finspace-data", + ForecastQueryService: "client-forecastquery", + ForecastService: "client-forecast", + FraudDetector: "client-frauddetector", + GameLift: "client-gamelift", + GameSparks: "client-gamesparks", + GreengrassV2: "client-greengrassv2", + GroundStation: "client-groundstation", + GuardDuty: "client-guardduty", + HealthLake: "client-healthlake", + IdentityStore: "client-identitystore", + IoTAnalytics: "client-iotanalytics", + IotData: "client-iot-data-plane", + IotDeviceAdvisor: "client-iotdeviceadvisor", + IoTSecureTunneling: "client-iotsecuretunneling", + IoTSiteWise: "client-iotsitewise", + IoTThingsGraph: "client-iotthingsgraph", + IoTTwinMaker: "client-iottwinmaker", + IoTRoboRunner: "client-iot-roborunner", + KafkaConnect: "client-kafkaconnect", + KinesisVideoSignalingChannels: "client-kinesis-video-signaling", + KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", + LakeFormation: "client-lakeformation", + LexRuntime: "client-lex-runtime-service", + ManagedBlockchain: "client-managedblockchain", + MigrationHubConfig: "client-migrationhub-config", + MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", + NetworkManager: "client-networkmanager", + OpenSearch: "client-opensearch", + OpenSearchServerless: "client-opensearchserverless", + OpsWorks: "client-opsworks", + OpsWorksCM: "client-opsworkscm", + PrivateNetworks: "client-privatenetworks", + QLDBSession: "client-qldb-session", + QuickSight: "client-quicksight", + ResourceExplorer2: "client-resource-explorer-2", + RDSDataService: "client-rds-data", + RoboMaker: "client-robomaker", + RolesAnywhere: "client-rolesanywhere", + Route53: "client-route-53", + Route53Domains: "client-route-53-domains", + Route53Resolver: "client-route53resolver", + S3Control: "client-s3-control", + SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", + SavingsPlans: "client-savingsplans", + SecurityHub: "client-securityhub", + ServerlessApplicationRepository: "client-serverlessapplicationrepository", + ServiceCatalogAppRegistry: "client-service-catalog-appregistry", + ServiceDiscovery: "client-servicediscovery", + SimSpaceWeaver: "client-simspaceweaver", + SSMContacts: "client-ssm-contacts", + SSMIncidents: "client-ssm-incidents", + SSOAdmin: "client-sso-admin", + SSOOIDC: "client-sso-oidc", + StepFunctions: "client-sfn", + TranscribeService: "client-transcribe", + WAFRegional: "client-waf-regional", + WellArchitected: "client-wellarchitected", + WorkMailMessageFlow: "client-workmailmessageflow" + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts +var get_v3_client_package_name_exports = {}; +__export(get_v3_client_package_name_exports, { + getV3ClientPackageName: () => getV3ClientPackageName +}); +var getV3ClientPackageName; +var init_get_v3_client_package_name = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { + "use strict"; + init_client_package_names_map(); + getV3ClientPackageName = (clientName) => { + if (clientName in CLIENT_PACKAGE_NAMES_MAP) { + return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; + } + throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts +var find_client_constructor_exports = {}; +__export(find_client_constructor_exports, { + findV3ClientConstructor: () => findV3ClientConstructor +}); +function findV3ClientConstructor(pkg) { + const [_clientName, ServiceClient] = Object.entries(pkg).find( + ([name]) => { + return name.endsWith("Client") && name !== "__Client"; + } + ); + return ServiceClient; +} +var init_find_client_constructor = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { + "use strict"; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js +var require_lib = __commonJS({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; + var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); + Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { + return get_v3_client_package_name_1.getV3ClientPackageName; + } }); + var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); + Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { + return find_client_constructor_1.findV3ClientConstructor; + } }); + } +}); + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var aws_sdk_v3_handler_exports = {}; +__export(aws_sdk_v3_handler_exports, { + forceSdkInstallation: () => forceSdkInstallation, + handler: () => handler +}); +module.exports = __toCommonJS(aws_sdk_v3_handler_exports); +var import_child_process = require("child_process"); +var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); + +// custom-resources/lib/aws-custom-resource/runtime/shared.ts +var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } + return Object.assign( + {}, + ..._flatten(object) + ); +} +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +function filterKeys(object, pred) { + return Object.entries(object).reduce( + (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, + {} + ); +} +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data + }); + console.log("Responding", responseBody); + const parsedUrl = require("url").parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { + "content-type": "", + "content-length": Buffer.byteLength(responseBody, "utf8") + } + }; + return new Promise((resolve, reject) => { + try { + const request = require("https").request(requestOptions, resolve); + request.on("error", reject); + request.write(responseBody); + request.end(); + } catch (e) { + reject(e); + } + }); +} +function decodeCall(call) { + if (!call) { + return void 0; + } + return JSON.parse(call); +} +function startsWithOneOf(searchStrings) { + return function(string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var installedSdk = {}; +function forceSdkInstallation() { + installedSdk = {}; +} +function installLatestSdk(packageName) { + console.log(`Installing latest AWS SDK v3: ${packageName}`); + (0, import_child_process.execSync)( + `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` + ); + installedSdk = { + ...installedSdk, + [packageName]: true + }; +} +async function loadAwsSdk(packageName, installLatestAwsSdk) { + let awsSdk; + try { + if (!installedSdk[packageName] && installLatestAwsSdk === "true") { + try { + installLatestSdk(packageName); + awsSdk = require(`/tmp/node_modules/${packageName}`); + } catch (e) { + console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); + return require(packageName); + } + } else if (installedSdk[packageName]) { + awsSdk = require(`/tmp/node_modules/${packageName}`); + } else { + awsSdk = require(packageName); + } + } catch (error) { + throw Error(`Package ${packageName} does not exist.`); + } + return awsSdk; +} +async function handler(event, context) { + try { + event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); + event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); + event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); + let data = {}; + let physicalResourceId; + switch (event.RequestType) { + case "Create": + physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; + break; + case "Update": + case "Delete": + physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; + break; + } + const call = event.ResourceProperties[event.RequestType]; + if (call) { + const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); + let awsSdk = loadAwsSdk( + packageName, + event.ResourceProperties.InstallLatestAwsSdk + ); + console.log(JSON.stringify({ ...event, ResponseURL: "..." })); + let credentials; + if (call.assumedRoleArn) { + const timestamp = (/* @__PURE__ */ new Date()).getTime(); + const params = { + RoleArn: call.assumedRoleArn, + RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) + }; + const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); + credentials = fromTemporaryCredentials({ + params + }); + } + awsSdk = await awsSdk; + const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); + const client = new ServiceClient({ + apiVersion: call.apiVersion, + credentials, + region: call.region + }); + const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; + const Command = Object.entries(awsSdk).find( + ([name]) => name.toLowerCase() === commandName.toLowerCase() + )?.[1]; + let flatData = {}; + try { + const response = await client.send( + new Command( + (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} + ) + ); + flatData = { + apiVersion: client.config.apiVersion, + // For test purposes: check if apiVersion was correctly passed. + region: await client.config.region().catch(() => void 0), + // For test purposes: check if region was correctly passed. + ...flatten(response) + }; + let outputPaths; + if (call.outputPath) { + outputPaths = [call.outputPath]; + } else if (call.outputPaths) { + outputPaths = call.outputPaths; + } + if (outputPaths) { + data = filterKeys(flatData, startsWithOneOf(outputPaths)); + } else { + data = flatData; + } + } catch (e) { + const exceptionName = e.name ?? e.constructor.name; + if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { + throw e; + } + } + if (call.physicalResourceId?.responsePath) { + physicalResourceId = flatData[call.physicalResourceId.responsePath]; + } + } + await respond(event, "SUCCESS", "OK", physicalResourceId, data); + } catch (e) { + console.log(e); + await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + forceSdkInstallation, + handler +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +exports.startsWithOneOf = startsWithOneOf; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7R0FFRztBQUNILE1BQU0sT0FBTyxHQUFHLElBQUksV0FBVyxFQUFFLENBQUM7QUFFbEM7O0dBRUc7QUFDSCxTQUFTLFVBQVUsQ0FBQyxLQUFVO0lBQzVCLElBQUksTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsRUFBRTtRQUMxQixPQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDL0I7U0FBTSxJQUFJLFdBQVcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLEVBQUU7UUFDcEMsT0FBTyxPQUFPLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQztLQUNyQztJQUVELE9BQU8sS0FBSyxDQUFDO0FBQ2YsQ0FBQztBQUNEOzs7OztHQUtHO0FBQ0gsU0FBZ0IsT0FBTyxDQUFDLE1BQWM7SUFDcEMsU0FBUyxRQUFRLENBQUMsS0FBVSxFQUFFLE9BQWlCLEVBQUU7UUFDL0MsT0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUM7YUFDbkMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxFQUFFO1lBQ1QsTUFBTSxRQUFRLEdBQUcsVUFBVSxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0F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lc3Qub24oJ2Vycm9yJywgcmVqZWN0KTtcbiAgICAgIHJlcXVlc3Qud3JpdGUocmVzcG9uc2VCb2R5KTtcbiAgICAgIHJlcXVlc3QuZW5kKCk7XG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgcmVqZWN0KGUpO1xuICAgIH1cbiAgfSk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBkZWNvZGVDYWxsKGNhbGw6IHN0cmluZyB8IHVuZGVmaW5lZCkge1xuICBpZiAoIWNhbGwpIHsgcmV0dXJuIHVuZGVmaW5lZDsgfVxuICByZXR1cm4gSlNPTi5wYXJzZShjYWxsKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHN0YXJ0c1dpdGhPbmVPZihzZWFyY2hTdHJpbmdzOiBzdHJpbmdbXSk6IChzdHJpbmc6IHN0cmluZykgPT4gYm9vbGVhbiB7XG4gIHJldHVybiBmdW5jdGlvbihzdHJpbmc6IHN0cmluZyk6IGJvb2xlYW4ge1xuICAgIGZvciAoY29uc3Qgc2VhcmNoU3RyaW5nIG9mIHNlYXJjaFN0cmluZ3MpIHtcbiAgICAgIGlmIChzdHJpbmcuc3RhcnRzV2l0aChzZWFyY2hTdHJpbmcpKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js deleted file mode 100644 index 1b662725f1b0b..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js +++ /dev/null @@ -1,769 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts -var CLIENT_NAMES; -var init_client_names = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { - "use strict"; - CLIENT_NAMES = [ - "ACM", - "ACMPCA", - "APIGateway", - "ARCZonalShift", - "AccessAnalyzer", - "Account", - "AlexaForBusiness", - "Amp", - "Amplify", - "AmplifyBackend", - "AmplifyUIBuilder", - "ApiGatewayManagementApi", - "ApiGatewayV2", - "AppConfig", - "AppConfigData", - "AppIntegrations", - "AppMesh", - "AppRunner", - "AppStream", - "AppSync", - "Appflow", - "ApplicationAutoScaling", - "ApplicationCostProfiler", - "ApplicationInsights", - "Athena", - "AuditManager", - "AugmentedAIRuntime", - "AutoScaling", - "AutoScalingPlans", - "Backup", - "BackupGateway", - "BackupStorage", - "Batch", - "Billingconductor", - "Braket", - "Budgets", - "CUR", - "Chime", - "ChimeSDKIdentity", - "ChimeSDKMediaPipelines", - "ChimeSDKMeetings", - "ChimeSDKMessaging", - "ChimeSDKVoice", - "Cloud9", - "CloudControl", - "CloudDirectory", - "CloudFormation", - "CloudFront", - "CloudHSM", - "CloudHSMV2", - "CloudSearch", - "CloudSearchDomain", - "CloudTrail", - "CloudWatch", - "CloudWatchEvents", - "CloudWatchLogs", - "CodeArtifact", - "CodeBuild", - "CodeCatalyst", - "CodeCommit", - "CodeDeploy", - "CodeGuruProfiler", - "CodeGuruReviewer", - "CodePipeline", - "CodeStar", - "CodeStarNotifications", - "CodeStarconnections", - "CognitoIdentity", - "CognitoIdentityServiceProvider", - "CognitoSync", - "Comprehend", - "ComprehendMedical", - "ComputeOptimizer", - "ConfigService", - "Connect", - "ConnectCampaigns", - "ConnectCases", - "ConnectContactLens", - "ConnectParticipant", - "ControlTower", - "CostExplorer", - "CustomerProfiles", - "DAX", - "DLM", - "DMS", - "DataBrew", - "DataExchange", - "DataPipeline", - "DataSync", - "Detective", - "DevOpsGuru", - "DeviceFarm", - "DirectConnect", - "DirectoryService", - "Discovery", - "DocDB", - "DocDBElastic", - "Drs", - "DynamoDB", - "DynamoDBStreams", - "EBS", - "EC2", - "EC2InstanceConnect", - "ECR", - "ECRPUBLIC", - "ECS", - "EFS", - "EKS", - "ELB", - "ELBv2", - "EMR", - "EMRServerless", - "EMRcontainers", - "ES", - "ElastiCache", - "ElasticBeanstalk", - "ElasticInference", - "ElasticTranscoder", - "EventBridge", - "Evidently", - "FMS", - "FSx", - "Finspace", - "Finspacedata", - "Firehose", - "Fis", - "ForecastQueryService", - "ForecastService", - "FraudDetector", - "GameLift", - "GameSparks", - "Glacier", - "GlobalAccelerator", - "Glue", - "Grafana", - "Greengrass", - "GreengrassV2", - "GroundStation", - "GuardDuty", - "Health", - "HealthLake", - "Honeycode", - "IAM", - "IVS", - "IdentityStore", - "Imagebuilder", - "Inspector", - "Inspector2", - "IoT1ClickDevicesService", - "IoT1ClickProjects", - "IoTAnalytics", - "IoTEvents", - "IoTEventsData", - "IoTFleetHub", - "IoTFleetWise", - "IoTJobsDataPlane", - "IoTRoboRunner", - "IoTSecureTunneling", - "IoTSiteWise", - "IoTThingsGraph", - "IoTTwinMaker", - "IoTWireless", - "Iot", - "IotData", - "IotDeviceAdvisor", - "Ivschat", - "KMS", - "Kafka", - "KafkaConnect", - "Kendra", - "Keyspaces", - "Kinesis", - "KinesisAnalytics", - "KinesisAnalyticsV2", - "KinesisVideo", - "KinesisVideoArchivedMedia", - "KinesisVideoMedia", - "KinesisVideoSignalingChannels", - "KinesisVideoWebRTCStorage", - "LakeFormation", - "Lambda", - "LexModelBuildingService", - "LexModelsV2", - "LexRuntime", - "LexRuntimeV2", - "LicenseManager", - "LicenseManagerLinuxSubscriptions", - "LicenseManagerUserSubscriptions", - "Lightsail", - "Location", - "LookoutEquipment", - "LookoutMetrics", - "LookoutVision", - "M2", - "MQ", - "MTurk", - "MWAA", - "MachineLearning", - "Macie", - "Macie2", - "ManagedBlockchain", - "MarketplaceCatalog", - "MarketplaceCommerceAnalytics", - "MarketplaceEntitlementService", - "MarketplaceMetering", - "MediaConnect", - "MediaConvert", - "MediaLive", - "MediaPackage", - "MediaPackageVod", - "MediaStore", - "MediaStoreData", - "MediaTailor", - "MemoryDB", - "Mgn", - "MigrationHub", - "MigrationHubConfig", - "MigrationHubOrchestrator", - "MigrationHubRefactorSpaces", - "MigrationHubStrategy", - "Mobile", - "Neptune", - "NetworkFirewall", - "NetworkManager", - "Nimble", - "OAM", - "Omics", - "OpenSearch", - "OpenSearchServerless", - "OpsWorks", - "OpsWorksCM", - "Organizations", - "Outposts", - "PI", - "Panorama", - "Personalize", - "PersonalizeEvents", - "PersonalizeRuntime", - "Pinpoint", - "PinpointEmail", - "PinpointSMSVoice", - "PinpointSMSVoiceV2", - "Pipes", - "Polly", - "Pricing", - "PrivateNetworks", - "Proton", - "QLDB", - "QLDBSession", - "QuickSight", - "RAM", - "RDS", - "RDSDataService", - "RUM", - "Rbin", - "Redshift", - "RedshiftData", - "RedshiftServerless", - "Rekognition", - "Resiliencehub", - "ResourceExplorer2", - "ResourceGroups", - "ResourceGroupsTaggingAPI", - "RoboMaker", - "RolesAnywhere", - "Route53", - "Route53Domains", - "Route53RecoveryCluster", - "Route53RecoveryControlConfig", - "Route53RecoveryReadiness", - "Route53Resolver", - "S3", - "S3Control", - "S3Outposts", - "SES", - "SESV2", - "SMS", - "SNS", - "SQS", - "SSM", - "SSMContacts", - "SSMIncidents", - "SSO", - "SSOAdmin", - "SSOOIDC", - "STS", - "SWF", - "SageMaker", - "SageMakerFeatureStoreRuntime", - "SageMakerGeospatial", - "SageMakerMetrics", - "SageMakerRuntime", - "SagemakerEdge", - "SavingsPlans", - "Scheduler", - "Schemas", - "SecretsManager", - "SecurityHub", - "SecurityLake", - "ServerlessApplicationRepository", - "ServiceCatalog", - "ServiceCatalogAppRegistry", - "ServiceDiscovery", - "ServiceQuotas", - "Shield", - "Signer", - "SimSpaceWeaver", - "SnowDeviceManagement", - "Snowball", - "SsmSap", - "StepFunctions", - "StorageGateway", - "Support", - "SupportApp", - "Synthetics", - "Textract", - "TimestreamQuery", - "TimestreamWrite", - "TranscribeService", - "Transfer", - "Translate", - "VoiceID", - "WAF", - "WAFRegional", - "WAFV2", - "WellArchitected", - "Wisdom", - "WorkDocs", - "WorkLink", - "WorkMail", - "WorkMailMessageFlow", - "WorkSpaces", - "WorkSpacesWeb", - "XRay" - ]; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts -var CLIENT_PACKAGE_NAMES_MAP; -var init_client_package_names_map = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { - "use strict"; - init_client_names(); - CLIENT_PACKAGE_NAMES_MAP = { - ...CLIENT_NAMES.reduce( - (acc, name) => ({ - ...acc, - [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") - }), - {} - ), - AccessAnalyzer: "client-accessanalyzer", - ACMPCA: "client-acm-pca", - APIGateway: "client-api-gateway", - ApiGatewayManagementApi: "client-apigatewaymanagementapi", - ApiGatewayV2: "client-apigatewayv2", - AppConfig: "client-appconfig", - AppConfigData: "client-appconfigdata", - AppIntegrations: "client-appintegrations", - AppRunner: "client-apprunner", - AppStream: "client-appstream", - AppSync: "client-appsync", - ApplicationCostProfiler: "client-applicationcostprofiler", - ARCZonalShift: "client-arc-zonal-shift", - AugmentedAIRuntime: "client-sage-maker-a2iruntime", - AuditManager: "client-auditmanager", - BackupStorage: "client-backupstorage", - CUR: "client-cost-and-usage-report-service", - CloudHSMV2: "client-cloudhsm-v2", - CodeGuruProfiler: "client-codeguruprofiler", - CodeStarconnections: "client-codestar-connections", - CognitoIdentityServiceProvider: "client-cognito-identity-provider", - ComprehendMedical: "client-comprehendmedical", - ConnectContactLens: "client-connect-contact-lens", - ControlTower: "client-controltower", - DMS: "client-database-migration-service", - DataPipeline: "client-data-pipeline", - Discovery: "client-application-discovery-service", - DevOpsGuru: "client-devops-guru", - DynamoDB: "client-dynamodb", - DynamoDBStreams: "client-dynamodb-streams", - DocDB: "client-docdb", - DocDBElastic: "client-docdb-elastic", - EC2InstanceConnect: "client-ec2-instance-connect", - ECRPUBLIC: "client-ecr-public", - ELB: "client-elastic-load-balancing", - ELBv2: "client-elastic-load-balancing-v2", - ElastiCache: "client-elasticache", - EMRcontainers: "client-emr-containers", - EMRServerless: "client-emr-serverless", - ES: "client-elasticsearch-service", - EventBridge: "client-eventbridge", - Finspacedata: "client-finspace-data", - ForecastQueryService: "client-forecastquery", - ForecastService: "client-forecast", - FraudDetector: "client-frauddetector", - GameLift: "client-gamelift", - GameSparks: "client-gamesparks", - GreengrassV2: "client-greengrassv2", - GroundStation: "client-groundstation", - GuardDuty: "client-guardduty", - HealthLake: "client-healthlake", - IdentityStore: "client-identitystore", - IoTAnalytics: "client-iotanalytics", - IotData: "client-iot-data-plane", - IotDeviceAdvisor: "client-iotdeviceadvisor", - IoTSecureTunneling: "client-iotsecuretunneling", - IoTSiteWise: "client-iotsitewise", - IoTThingsGraph: "client-iotthingsgraph", - IoTTwinMaker: "client-iottwinmaker", - IoTRoboRunner: "client-iot-roborunner", - KafkaConnect: "client-kafkaconnect", - KinesisVideoSignalingChannels: "client-kinesis-video-signaling", - KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", - LakeFormation: "client-lakeformation", - LexRuntime: "client-lex-runtime-service", - ManagedBlockchain: "client-managedblockchain", - MigrationHubConfig: "client-migrationhub-config", - MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", - NetworkManager: "client-networkmanager", - OpenSearch: "client-opensearch", - OpenSearchServerless: "client-opensearchserverless", - OpsWorks: "client-opsworks", - OpsWorksCM: "client-opsworkscm", - PrivateNetworks: "client-privatenetworks", - QLDBSession: "client-qldb-session", - QuickSight: "client-quicksight", - ResourceExplorer2: "client-resource-explorer-2", - RDSDataService: "client-rds-data", - RoboMaker: "client-robomaker", - RolesAnywhere: "client-rolesanywhere", - Route53: "client-route-53", - Route53Domains: "client-route-53-domains", - Route53Resolver: "client-route53resolver", - S3Control: "client-s3-control", - SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", - SavingsPlans: "client-savingsplans", - SecurityHub: "client-securityhub", - ServerlessApplicationRepository: "client-serverlessapplicationrepository", - ServiceCatalogAppRegistry: "client-service-catalog-appregistry", - ServiceDiscovery: "client-servicediscovery", - SimSpaceWeaver: "client-simspaceweaver", - SSMContacts: "client-ssm-contacts", - SSMIncidents: "client-ssm-incidents", - SSOAdmin: "client-sso-admin", - SSOOIDC: "client-sso-oidc", - StepFunctions: "client-sfn", - TranscribeService: "client-transcribe", - WAFRegional: "client-waf-regional", - WellArchitected: "client-wellarchitected", - WorkMailMessageFlow: "client-workmailmessageflow" - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts -var get_v3_client_package_name_exports = {}; -__export(get_v3_client_package_name_exports, { - getV3ClientPackageName: () => getV3ClientPackageName -}); -var getV3ClientPackageName; -var init_get_v3_client_package_name = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { - "use strict"; - init_client_package_names_map(); - getV3ClientPackageName = (clientName) => { - if (clientName in CLIENT_PACKAGE_NAMES_MAP) { - return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; - } - throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts -var find_client_constructor_exports = {}; -__export(find_client_constructor_exports, { - findV3ClientConstructor: () => findV3ClientConstructor -}); -function findV3ClientConstructor(pkg) { - const [_clientName, ServiceClient] = Object.entries(pkg).find( - ([name]) => { - return name.endsWith("Client") && name !== "__Client"; - } - ); - return ServiceClient; -} -var init_find_client_constructor = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { - "use strict"; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js -var require_lib = __commonJS({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; - var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); - Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { - return get_v3_client_package_name_1.getV3ClientPackageName; - } }); - var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); - Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { - return find_client_constructor_1.findV3ClientConstructor; - } }); - } -}); - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var aws_sdk_v3_handler_exports = {}; -__export(aws_sdk_v3_handler_exports, { - forceSdkInstallation: () => forceSdkInstallation, - handler: () => handler -}); -module.exports = __toCommonJS(aws_sdk_v3_handler_exports); -var import_child_process = require("child_process"); -var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); - -// custom-resources/lib/aws-custom-resource/runtime/shared.ts -var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; -function flatten(object) { - return Object.assign( - {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) - ); -} -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -function filterKeys(object, pred) { - return Object.entries(object).reduce( - (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, - {} - ); -} -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data - }); - console.log("Responding", responseBody); - const parsedUrl = require("url").parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { - "content-type": "", - "content-length": Buffer.byteLength(responseBody, "utf8") - } - }; - return new Promise((resolve, reject) => { - try { - const request = require("https").request(requestOptions, resolve); - request.on("error", reject); - request.write(responseBody); - request.end(); - } catch (e) { - reject(e); - } - }); -} -function decodeCall(call) { - if (!call) { - return void 0; - } - return JSON.parse(call); -} -function startsWithOneOf(searchStrings) { - return function(string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var installedSdk = {}; -function forceSdkInstallation() { - installedSdk = {}; -} -function installLatestSdk(packageName) { - console.log(`Installing latest AWS SDK v3: ${packageName}`); - (0, import_child_process.execSync)( - `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` - ); - installedSdk = { - ...installedSdk, - [packageName]: true - }; -} -async function loadAwsSdk(packageName, installLatestAwsSdk) { - let awsSdk; - try { - if (!installedSdk[packageName] && installLatestAwsSdk === "true") { - try { - installLatestSdk(packageName); - awsSdk = require(`/tmp/node_modules/${packageName}`); - } catch (e) { - console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); - return require(packageName); - } - } else if (installedSdk[packageName]) { - awsSdk = require(`/tmp/node_modules/${packageName}`); - } else { - awsSdk = require(packageName); - } - } catch (error) { - throw Error(`Package ${packageName} does not exist.`); - } - return awsSdk; -} -async function handler(event, context) { - try { - event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); - event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); - event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); - let data = {}; - let physicalResourceId; - switch (event.RequestType) { - case "Create": - physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; - break; - case "Update": - case "Delete": - physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; - break; - } - const call = event.ResourceProperties[event.RequestType]; - if (call) { - const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); - let awsSdk = loadAwsSdk( - packageName, - event.ResourceProperties.InstallLatestAwsSdk - ); - console.log(JSON.stringify({ ...event, ResponseURL: "..." })); - let credentials; - if (call.assumedRoleArn) { - const timestamp = (/* @__PURE__ */ new Date()).getTime(); - const params = { - RoleArn: call.assumedRoleArn, - RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) - }; - const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); - credentials = fromTemporaryCredentials({ - params - }); - } - awsSdk = await awsSdk; - const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); - const client = new ServiceClient({ - apiVersion: call.apiVersion, - credentials, - region: call.region - }); - const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; - const Command = Object.entries(awsSdk).find( - ([name]) => name.toLowerCase() === commandName.toLowerCase() - )?.[1]; - let flatData = {}; - try { - const response = await client.send( - new Command( - (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} - ) - ); - flatData = { - apiVersion: client.config.apiVersion, - // For test purposes: check if apiVersion was correctly passed. - region: await client.config.region().catch(() => void 0), - // For test purposes: check if region was correctly passed. - ...flatten(response) - }; - let outputPaths; - if (call.outputPath) { - outputPaths = [call.outputPath]; - } else if (call.outputPaths) { - outputPaths = call.outputPaths; - } - if (outputPaths) { - data = filterKeys(flatData, startsWithOneOf(outputPaths)); - } else { - data = flatData; - } - } catch (e) { - const exceptionName = e.name ?? e.constructor.name; - if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { - throw e; - } - } - if (call.physicalResourceId?.responsePath) { - physicalResourceId = flatData[call.physicalResourceId.responsePath]; - } - } - await respond(event, "SUCCESS", "OK", physicalResourceId, data); - } catch (e) { - console.log(e); - await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - forceSdkInstallation, - handler -}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js deleted file mode 100644 index 6c53eaeef8cd1..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -exports.decodeSpecialValues = decodeSpecialValues; -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -exports.filterKeys = filterKeys; -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - // eslint-disable-next-line no-console - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': Buffer.byteLength(responseBody, 'utf8'), - }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -exports.respond = respond; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -exports.decodeCall = decodeCall; -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} -exports.startsWithOneOf = startsWithOneOf; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7Ozs7R0FLRztBQUNILFNBQWdCLE9BQU8sQ0FBQyxNQUFjO0lBQ3BDLE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FDbEIsRUFBRSxFQUNGLEdBQUcsU0FBUyxRQUFRLENBQUMsS0FBVSxFQUFFLE9BQWlCLEVBQUU7UUFDbEQsT0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUM7YUFDbkMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxFQUFFO1lBQ1QsTUFBTSxRQUFRLEdBQUcsTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1lBQ3hGLE9BQU8sT0FBTyxRQUFRLEtBQUssUUFBUSxJQUFJLFFBQVEsS0FBSyxJQUFJO2dCQUN0RCxDQUFDLENBQUMsUUFBUSxDQUFDLFFBQVEsRUFBRSxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQztnQkFDeEMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0F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AgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXJlcXVpcmUtaW1wb3J0c1xuICAgICAgY29uc3QgcmVxdWVzdCA9IHJlcXVpcmUoJ2h0dHBzJykucmVxdWVzdChyZXF1ZXN0T3B0aW9ucywgcmVzb2x2ZSk7XG4gICAgICByZXF1ZXN0Lm9uKCdlcnJvcicsIHJlamVjdCk7XG4gICAgICByZXF1ZXN0LndyaXRlKHJlc3BvbnNlQm9keSk7XG4gICAgICByZXF1ZXN0LmVuZCgpO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIHJlamVjdChlKTtcbiAgICB9XG4gIH0pO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZGVjb2RlQ2FsbChjYWxsOiBzdHJpbmcgfCB1bmRlZmluZWQpIHtcbiAgaWYgKCFjYWxsKSB7IHJldHVybiB1bmRlZmluZWQ7IH1cbiAgcmV0dXJuIEpTT04ucGFyc2UoY2FsbCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzdGFydHNXaXRoT25lT2Yoc2VhcmNoU3RyaW5nczogc3RyaW5nW10pOiAoc3RyaW5nOiBzdHJpbmcpID0+IGJvb2xlYW4ge1xuICByZXR1cm4gZnVuY3Rpb24oc3RyaW5nOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgICBmb3IgKGNvbnN0IHNlYXJjaFN0cmluZyBvZiBzZWFyY2hTdHJpbmdzKSB7XG4gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/integ-globalaccelerator.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/integ-globalaccelerator.assets.json index 6b06882937c12..4b3bc8117dea4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/integ-globalaccelerator.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/integ-globalaccelerator.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "b22f407a50269df52f0053453119aaa83f7af1ddc90b84487a0670bf23fec2fa": { + "5d06550cb3aa28ad881835bfafbbd4fcacbb8c47a366a31f8b5b8d9458f6802e": { "source": { "path": "integ-globalaccelerator.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b22f407a50269df52f0053453119aaa83f7af1ddc90b84487a0670bf23fec2fa.json", + "objectKey": "5d06550cb3aa28ad881835bfafbbd4fcacbb8c47a366a31f8b5b8d9458f6802e.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/integ-globalaccelerator.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/integ-globalaccelerator.template.json index 25982da4d6f9b..9aa705b6d4c89 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/integ-globalaccelerator.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/integ-globalaccelerator.template.json @@ -817,7 +817,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/manifest.json index 52f05f96e6200..0e8dcd8de040b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/b22f407a50269df52f0053453119aaa83f7af1ddc90b84487a0670bf23fec2fa.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5d06550cb3aa28ad881835bfafbbd4fcacbb8c47a366a31f8b5b8d9458f6802e.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/tree.json index 89e77db2a6de1..b9799ef33f642 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator-endpoints/test/integ.globalaccelerator.js.snapshot/tree.json @@ -1408,7 +1408,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015.assets.json new file mode 100644 index 0000000000000..093dbaf41efd1 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015.assets.json @@ -0,0 +1,19 @@ +{ + "version": "33.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/cdk-integ-lambda-nodejs-esm.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/cdk-integ-lambda-nodejs-esm.assets.json index c19d24e5bb499..66a53be2b5a66 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/cdk-integ-lambda-nodejs-esm.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/cdk-integ-lambda-nodejs-esm.assets.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "33.0.0", "files": { "b1fe61f2900194572e27cce06c685324999fd8e34728c4ffc45e81f234b79e3f": { "source": { @@ -14,7 +14,7 @@ } } }, - "6ae70d9cadb5311510f7423a4502e70982bde6b4c21d58d0e2cd031c2041689d": { + "2f14fc060bb60751213b507a2252cd34052b5da4fd8778ddfd34cf233124612f": { "source": { "path": "cdk-integ-lambda-nodejs-esm.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "6ae70d9cadb5311510f7423a4502e70982bde6b4c21d58d0e2cd031c2041689d.json", + "objectKey": "2f14fc060bb60751213b507a2252cd34052b5da4fd8778ddfd34cf233124612f.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/cdk-integ-lambda-nodejs-esm.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/cdk-integ-lambda-nodejs-esm.template.json index b42d6814d3e1c..b419b9d6a9f52 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/cdk-integ-lambda-nodejs-esm.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/cdk-integ-lambda-nodejs-esm.template.json @@ -40,18 +40,18 @@ }, "S3Key": "b1fe61f2900194572e27cce06c685324999fd8e34728c4ffc45e81f234b79e3f.zip" }, - "Role": { - "Fn::GetAtt": [ - "esmServiceRole84AC2522", - "Arn" - ] - }, "Environment": { "Variables": { "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" } }, "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "esmServiceRole84AC2522", + "Arn" + ] + }, "Runtime": "nodejs18.x" }, "DependsOn": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/cdk.out index f0b901e7c06e5..560dae10d018f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/integ.json index 0e51f6f0b625f..0e1f762ec8534 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/integ.json @@ -1,14 +1,13 @@ { - "version": "32.0.0", + "version": "33.0.0", "testCases": { - "integ.esm": { + "LambdaNodeJsEsmInteg/DefaultTest": { "stacks": [ "cdk-integ-lambda-nodejs-esm" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "diffAssets": true, + "assertionStack": "LambdaNodeJsEsmInteg/DefaultTest/DeployAssert", + "assertionStackName": "LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/manifest.json index d3d433b1690c9..3cfb1047d6712 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "33.0.0", "artifacts": { "cdk-integ-lambda-nodejs-esm.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/6ae70d9cadb5311510f7423a4502e70982bde6b4c21d58d0e2cd031c2041689d.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2f14fc060bb60751213b507a2252cd34052b5da4fd8778ddfd34cf233124612f.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -60,6 +60,53 @@ }, "displayName": "cdk-integ-lambda-nodejs-esm" }, + "LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "LambdaNodeJsEsmIntegDefaultTestDeployAssert03DFA015.assets" + ], + "metadata": { + "/LambdaNodeJsEsmInteg/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/LambdaNodeJsEsmInteg/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "LambdaNodeJsEsmInteg/DefaultTest/DeployAssert" + }, "Tree": { "type": "cdk:tree", "properties": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/tree.json index 30d66dfe47469..e9a425f29ff31 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.esm.js.snapshot/tree.json @@ -107,18 +107,18 @@ }, "s3Key": "b1fe61f2900194572e27cce06c685324999fd8e34728c4ffc45e81f234b79e3f.zip" }, - "role": { - "Fn::GetAtt": [ - "esmServiceRole84AC2522", - "Arn" - ] - }, "environment": { "variables": { "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" } }, "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "esmServiceRole84AC2522", + "Arn" + ] + }, "runtime": "nodejs18.x" } }, @@ -155,12 +155,66 @@ "version": "0.0.0" } }, + "LambdaNodeJsEsmInteg": { + "id": "LambdaNodeJsEsmInteg", + "path": "LambdaNodeJsEsmInteg", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "LambdaNodeJsEsmInteg/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "LambdaNodeJsEsmInteg/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.69" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "LambdaNodeJsEsmInteg/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "LambdaNodeJsEsmInteg/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "LambdaNodeJsEsmInteg/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, "Tree": { "id": "Tree", "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.55" + "version": "10.2.69" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.modules.js.snapshot/.cache/2149a129ab87c93e19bbdbfc0f861cefeee8f1fe360b256c7f66b9bc521c11e3.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.modules.js.snapshot/.cache/2149a129ab87c93e19bbdbfc0f861cefeee8f1fe360b256c7f66b9bc521c11e3.zip new file mode 100644 index 0000000000000000000000000000000000000000..8ccd5f1f80c3ffa8038241bba530e9c283a0d139 GIT binary patch literal 1002 zcmWIWW@Zs#-~d7f21Ou70FX##UP@|(URH5w=vQa)4?o+ttFc;gzSXYvYEK+@8m^YS*}3w-rO4`7PTTThMn*1c-psRT z%$g-}lYI}1L#mF_L*LcY0MYwXp(QNqLAsmz0FfnwEEqqrE>Jg_ex6B)TCwcoOSzXK-gb{N zCZ;Aon*5O0Urq2z>!K6aRln9)UV6#CNNi$A-y1dKndT7BTs%p`xk0zL-s zJJGym;W?XkR^Q;dyjD~A%Dc&$nb}@m1||2Go0N%2Mg=ELbo}ny+&}$pr%m)@pRVN= z$E5V1y9fkZFJ_2X`=OlGPT*D8vL2l*_24DGo*F*4HP@Aw27mT+66|4>XL+=M*E#c! zZ4SG8=v{#y3nbW|Zcx6Y(Nm{#I;4qLSOJf3Td=HcNm7p4Dx)X`8Fe{KlB&x7B{>&N*3i`tga(M1R@Yg7x1w^y>V*etp`af(tE$ zP2WGN1-x6r?Gw(K{32tAU+cwlCR5DPySG z(0y%d*>{N9w*Ath&0ijxujM^`|6Q8f@yYtnZ~pu_Wwt@ii!F0rKTx;K+H|MZ`LYT3 zR>ox|w!!xq1H9Qe9x`ZmWiT@^B(XCv1b8zt=`thoC$bzUe?ou)!;(f23zl00yjj^m Qd`2KN1Jd(=rZF%802;@<2LJ#7 literal 0 HcmV?d00001 diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.modules.js.snapshot/.cache/28de77e42ea798836445f0dd73c84320861bfe911d58e603bee8767c2d6e9e8a.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.modules.js.snapshot/.cache/28de77e42ea798836445f0dd73c84320861bfe911d58e603bee8767c2d6e9e8a.zip new file mode 100644 index 0000000000000000000000000000000000000000..ed99294eabc559784c95723284616066ed971e21 GIT binary patch literal 332 zcmWIWW@Zs#-~d7f21Ou70FX##UP@|(URJSb@4>vo3IZ7I7c!#&I!{~yu5Es(B#WYVbz=Xu3< zT{F8K(!#dCc>i=Gz59Z>D<`VieTYBY7m>8=n4QlbE%Ixc{XTcd=fA(TBez#$x7oQ{ zJ7%yYz5L=~p6j!IUe?OO(@$P(yQapYUa_a|!Ohk20p9E!XXRLDoC5kzijjdKz?+dt jml+WP$a0_%fB*%CC5<2!EIb0dS=m5*Mj$kUFn}ZgrVDkp literal 0 HcmV?d00001 diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.modules.js.snapshot/.cache/3df927e5941c39836eafe07496dc13c1c6935e59b0490249af5b05a1becfb7ab.zip b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.modules.js.snapshot/.cache/3df927e5941c39836eafe07496dc13c1c6935e59b0490249af5b05a1becfb7ab.zip new file mode 100644 index 0000000000000000000000000000000000000000..99ef52652f442b6957e1e2afeea90ee29b6e1dec GIT binary patch literal 331 zcmWIWW@Zs#-~d7f21Ou70FX##UP@|(URJSb@4>vo3IZH743>g#6~{>J$w=}gn6Eq>v+QXt{5#bXbddmj(!ExXCN@rhAe@!_d@ zThHo=FEo5(^JXdQ_46(3uDHb4JlNkhd&81esdkM&Ja$~G<#PmX=T7EQ&-ik;Sa~u3 zqPGhs-D--*p$hxn+|5 zI#{mr=!?#Ew{AJwUWp2hKXJKqwXcL { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => AlgorithmId.SHA256, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => AlgorithmId.MD5, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + } + }; + }; + exports.getChecksumConfiguration = getChecksumConfiguration; + var resolveChecksumRuntimeConfig = (clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; + }; + exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; + } +}); + +// ../../../node_modules/@smithy/types/dist-cjs/extensions/defaultClientConfiguration.js +var require_defaultClientConfiguration = __commonJS({ + "../../../node_modules/@smithy/types/dist-cjs/extensions/defaultClientConfiguration.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; + var checksum_1 = require_checksum2(); + var getDefaultClientConfiguration = (runtimeConfig) => { + return { + ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig) + }; + }; + exports.getDefaultClientConfiguration = getDefaultClientConfiguration; + var resolveDefaultRuntimeConfig = (config) => { + return { + ...(0, checksum_1.resolveChecksumRuntimeConfig)(config) + }; + }; + exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; + } +}); + +// ../../../node_modules/@smithy/types/dist-cjs/extensions/index.js +var require_extensions = __commonJS({ + "../../../node_modules/@smithy/types/dist-cjs/extensions/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + tslib_1.__exportStar(require_defaultClientConfiguration(), exports); + } +}); + // ../../../node_modules/@smithy/types/dist-cjs/http.js var require_http = __commonJS({ "../../../node_modules/@smithy/types/dist-cjs/http.js"(exports) { @@ -1756,6 +1838,7 @@ var require_dist_cjs = __commonJS({ tslib_1.__exportStar(require_endpoint(), exports); tslib_1.__exportStar(require_endpoints(), exports); tslib_1.__exportStar(require_eventStream(), exports); + tslib_1.__exportStar(require_extensions(), exports); tslib_1.__exportStar(require_http(), exports); tslib_1.__exportStar(require_identity2(), exports); tslib_1.__exportStar(require_logger(), exports); @@ -5224,7 +5307,7 @@ var require_blob_types = __commonJS({ }); // ../../../node_modules/@aws-sdk/types/dist-cjs/checksum.js -var require_checksum2 = __commonJS({ +var require_checksum3 = __commonJS({ "../../../node_modules/@aws-sdk/types/dist-cjs/checksum.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -5518,7 +5601,7 @@ var require_dist_cjs17 = __commonJS({ tslib_1.__exportStar(require_abort2(), exports); tslib_1.__exportStar(require_auth2(), exports); tslib_1.__exportStar(require_blob_types(), exports); - tslib_1.__exportStar(require_checksum2(), exports); + tslib_1.__exportStar(require_checksum3(), exports); tslib_1.__exportStar(require_client2(), exports); tslib_1.__exportStar(require_command2(), exports); tslib_1.__exportStar(require_connection2(), exports); @@ -10396,7 +10479,7 @@ var require_package = __commonJS({ module2.exports = { name: "@aws-sdk/client-sfn", description: "AWS SDK for JavaScript Sfn Client for Node.js, Browser and React Native", - version: "3.388.0", + version: "3.391.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -10416,37 +10499,37 @@ var require_package = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/client-sts": "3.388.0", - "@aws-sdk/credential-provider-node": "3.388.0", - "@aws-sdk/middleware-host-header": "3.387.0", - "@aws-sdk/middleware-logger": "3.387.0", - "@aws-sdk/middleware-recursion-detection": "3.387.0", - "@aws-sdk/middleware-signing": "3.387.0", - "@aws-sdk/middleware-user-agent": "3.387.0", - "@aws-sdk/types": "3.387.0", - "@aws-sdk/util-endpoints": "3.387.0", - "@aws-sdk/util-user-agent-browser": "3.387.0", - "@aws-sdk/util-user-agent-node": "3.387.0", - "@smithy/config-resolver": "^2.0.2", - "@smithy/fetch-http-handler": "^2.0.2", - "@smithy/hash-node": "^2.0.2", - "@smithy/invalid-dependency": "^2.0.2", - "@smithy/middleware-content-length": "^2.0.2", - "@smithy/middleware-endpoint": "^2.0.2", - "@smithy/middleware-retry": "^2.0.2", - "@smithy/middleware-serde": "^2.0.2", + "@aws-sdk/client-sts": "3.391.0", + "@aws-sdk/credential-provider-node": "3.391.0", + "@aws-sdk/middleware-host-header": "3.391.0", + "@aws-sdk/middleware-logger": "3.391.0", + "@aws-sdk/middleware-recursion-detection": "3.391.0", + "@aws-sdk/middleware-signing": "3.391.0", + "@aws-sdk/middleware-user-agent": "3.391.0", + "@aws-sdk/types": "3.391.0", + "@aws-sdk/util-endpoints": "3.391.0", + "@aws-sdk/util-user-agent-browser": "3.391.0", + "@aws-sdk/util-user-agent-node": "3.391.0", + "@smithy/config-resolver": "^2.0.3", + "@smithy/fetch-http-handler": "^2.0.3", + "@smithy/hash-node": "^2.0.3", + "@smithy/invalid-dependency": "^2.0.3", + "@smithy/middleware-content-length": "^2.0.3", + "@smithy/middleware-endpoint": "^2.0.3", + "@smithy/middleware-retry": "^2.0.3", + "@smithy/middleware-serde": "^2.0.3", "@smithy/middleware-stack": "^2.0.0", - "@smithy/node-config-provider": "^2.0.2", - "@smithy/node-http-handler": "^2.0.2", - "@smithy/protocol-http": "^2.0.2", - "@smithy/smithy-client": "^2.0.2", - "@smithy/types": "^2.1.0", - "@smithy/url-parser": "^2.0.2", + "@smithy/node-config-provider": "^2.0.3", + "@smithy/node-http-handler": "^2.0.3", + "@smithy/protocol-http": "^2.0.3", + "@smithy/smithy-client": "^2.0.3", + "@smithy/types": "^2.2.0", + "@smithy/url-parser": "^2.0.3", "@smithy/util-base64": "^2.0.0", "@smithy/util-body-length-browser": "^2.0.0", "@smithy/util-body-length-node": "^2.0.0", - "@smithy/util-defaults-mode-browser": "^2.0.2", - "@smithy/util-defaults-mode-node": "^2.0.2", + "@smithy/util-defaults-mode-browser": "^2.0.3", + "@smithy/util-defaults-mode-node": "^2.0.3", "@smithy/util-retry": "^2.0.0", "@smithy/util-utf8": "^2.0.0", tslib: "^2.5.0" @@ -10535,7 +10618,7 @@ var require_package2 = __commonJS({ module2.exports = { name: "@aws-sdk/client-sts", description: "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native", - version: "3.388.0", + version: "3.391.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -10557,37 +10640,37 @@ var require_package2 = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/credential-provider-node": "3.388.0", - "@aws-sdk/middleware-host-header": "3.387.0", - "@aws-sdk/middleware-logger": "3.387.0", - "@aws-sdk/middleware-recursion-detection": "3.387.0", - "@aws-sdk/middleware-sdk-sts": "3.387.0", - "@aws-sdk/middleware-signing": "3.387.0", - "@aws-sdk/middleware-user-agent": "3.387.0", - "@aws-sdk/types": "3.387.0", - "@aws-sdk/util-endpoints": "3.387.0", - "@aws-sdk/util-user-agent-browser": "3.387.0", - "@aws-sdk/util-user-agent-node": "3.387.0", - "@smithy/config-resolver": "^2.0.2", - "@smithy/fetch-http-handler": "^2.0.2", - "@smithy/hash-node": "^2.0.2", - "@smithy/invalid-dependency": "^2.0.2", - "@smithy/middleware-content-length": "^2.0.2", - "@smithy/middleware-endpoint": "^2.0.2", - "@smithy/middleware-retry": "^2.0.2", - "@smithy/middleware-serde": "^2.0.2", + "@aws-sdk/credential-provider-node": "3.391.0", + "@aws-sdk/middleware-host-header": "3.391.0", + "@aws-sdk/middleware-logger": "3.391.0", + "@aws-sdk/middleware-recursion-detection": "3.391.0", + "@aws-sdk/middleware-sdk-sts": "3.391.0", + "@aws-sdk/middleware-signing": "3.391.0", + "@aws-sdk/middleware-user-agent": "3.391.0", + "@aws-sdk/types": "3.391.0", + "@aws-sdk/util-endpoints": "3.391.0", + "@aws-sdk/util-user-agent-browser": "3.391.0", + "@aws-sdk/util-user-agent-node": "3.391.0", + "@smithy/config-resolver": "^2.0.3", + "@smithy/fetch-http-handler": "^2.0.3", + "@smithy/hash-node": "^2.0.3", + "@smithy/invalid-dependency": "^2.0.3", + "@smithy/middleware-content-length": "^2.0.3", + "@smithy/middleware-endpoint": "^2.0.3", + "@smithy/middleware-retry": "^2.0.3", + "@smithy/middleware-serde": "^2.0.3", "@smithy/middleware-stack": "^2.0.0", - "@smithy/node-config-provider": "^2.0.2", - "@smithy/node-http-handler": "^2.0.2", - "@smithy/protocol-http": "^2.0.2", - "@smithy/smithy-client": "^2.0.2", - "@smithy/types": "^2.1.0", - "@smithy/url-parser": "^2.0.2", + "@smithy/node-config-provider": "^2.0.3", + "@smithy/node-http-handler": "^2.0.3", + "@smithy/protocol-http": "^2.0.3", + "@smithy/smithy-client": "^2.0.3", + "@smithy/types": "^2.2.0", + "@smithy/url-parser": "^2.0.3", "@smithy/util-base64": "^2.0.0", "@smithy/util-body-length-browser": "^2.0.0", "@smithy/util-body-length-node": "^2.0.0", - "@smithy/util-defaults-mode-browser": "^2.0.2", - "@smithy/util-defaults-mode-node": "^2.0.2", + "@smithy/util-defaults-mode-browser": "^2.0.3", + "@smithy/util-defaults-mode-node": "^2.0.3", "@smithy/util-retry": "^2.0.0", "@smithy/util-utf8": "^2.0.0", "fast-xml-parser": "4.2.5", @@ -14806,7 +14889,7 @@ var require_package3 = __commonJS({ module2.exports = { name: "@aws-sdk/client-sso", description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native", - version: "3.387.0", + version: "3.391.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", @@ -14826,34 +14909,34 @@ var require_package3 = __commonJS({ dependencies: { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/middleware-host-header": "3.387.0", - "@aws-sdk/middleware-logger": "3.387.0", - "@aws-sdk/middleware-recursion-detection": "3.387.0", - "@aws-sdk/middleware-user-agent": "3.387.0", - "@aws-sdk/types": "3.387.0", - "@aws-sdk/util-endpoints": "3.387.0", - "@aws-sdk/util-user-agent-browser": "3.387.0", - "@aws-sdk/util-user-agent-node": "3.387.0", - "@smithy/config-resolver": "^2.0.2", - "@smithy/fetch-http-handler": "^2.0.2", - "@smithy/hash-node": "^2.0.2", - "@smithy/invalid-dependency": "^2.0.2", - "@smithy/middleware-content-length": "^2.0.2", - "@smithy/middleware-endpoint": "^2.0.2", - "@smithy/middleware-retry": "^2.0.2", - "@smithy/middleware-serde": "^2.0.2", + "@aws-sdk/middleware-host-header": "3.391.0", + "@aws-sdk/middleware-logger": "3.391.0", + "@aws-sdk/middleware-recursion-detection": "3.391.0", + "@aws-sdk/middleware-user-agent": "3.391.0", + "@aws-sdk/types": "3.391.0", + "@aws-sdk/util-endpoints": "3.391.0", + "@aws-sdk/util-user-agent-browser": "3.391.0", + "@aws-sdk/util-user-agent-node": "3.391.0", + "@smithy/config-resolver": "^2.0.3", + "@smithy/fetch-http-handler": "^2.0.3", + "@smithy/hash-node": "^2.0.3", + "@smithy/invalid-dependency": "^2.0.3", + "@smithy/middleware-content-length": "^2.0.3", + "@smithy/middleware-endpoint": "^2.0.3", + "@smithy/middleware-retry": "^2.0.3", + "@smithy/middleware-serde": "^2.0.3", "@smithy/middleware-stack": "^2.0.0", - "@smithy/node-config-provider": "^2.0.2", - "@smithy/node-http-handler": "^2.0.2", - "@smithy/protocol-http": "^2.0.2", - "@smithy/smithy-client": "^2.0.2", - "@smithy/types": "^2.1.0", - "@smithy/url-parser": "^2.0.2", + "@smithy/node-config-provider": "^2.0.3", + "@smithy/node-http-handler": "^2.0.3", + "@smithy/protocol-http": "^2.0.3", + "@smithy/smithy-client": "^2.0.3", + "@smithy/types": "^2.2.0", + "@smithy/url-parser": "^2.0.3", "@smithy/util-base64": "^2.0.0", "@smithy/util-body-length-browser": "^2.0.0", "@smithy/util-body-length-node": "^2.0.0", - "@smithy/util-defaults-mode-browser": "^2.0.2", - "@smithy/util-defaults-mode-node": "^2.0.2", + "@smithy/util-defaults-mode-browser": "^2.0.3", + "@smithy/util-defaults-mode-node": "^2.0.3", "@smithy/util-retry": "^2.0.0", "@smithy/util-utf8": "^2.0.0", tslib: "^2.5.0" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js new file mode 100644 index 0000000000000..9f6e97928f257 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -0,0 +1,779 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts +var CLIENT_NAMES; +var init_client_names = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { + "use strict"; + CLIENT_NAMES = [ + "ACM", + "ACMPCA", + "APIGateway", + "ARCZonalShift", + "AccessAnalyzer", + "Account", + "AlexaForBusiness", + "Amp", + "Amplify", + "AmplifyBackend", + "AmplifyUIBuilder", + "ApiGatewayManagementApi", + "ApiGatewayV2", + "AppConfig", + "AppConfigData", + "AppIntegrations", + "AppMesh", + "AppRunner", + "AppStream", + "AppSync", + "Appflow", + "ApplicationAutoScaling", + "ApplicationCostProfiler", + "ApplicationInsights", + "Athena", + "AuditManager", + "AugmentedAIRuntime", + "AutoScaling", + "AutoScalingPlans", + "Backup", + "BackupGateway", + "BackupStorage", + "Batch", + "Billingconductor", + "Braket", + "Budgets", + "CUR", + "Chime", + "ChimeSDKIdentity", + "ChimeSDKMediaPipelines", + "ChimeSDKMeetings", + "ChimeSDKMessaging", + "ChimeSDKVoice", + "Cloud9", + "CloudControl", + "CloudDirectory", + "CloudFormation", + "CloudFront", + "CloudHSM", + "CloudHSMV2", + "CloudSearch", + "CloudSearchDomain", + "CloudTrail", + "CloudWatch", + "CloudWatchEvents", + "CloudWatchLogs", + "CodeArtifact", + "CodeBuild", + "CodeCatalyst", + "CodeCommit", + "CodeDeploy", + "CodeGuruProfiler", + "CodeGuruReviewer", + "CodePipeline", + "CodeStar", + "CodeStarNotifications", + "CodeStarconnections", + "CognitoIdentity", + "CognitoIdentityServiceProvider", + "CognitoSync", + "Comprehend", + "ComprehendMedical", + "ComputeOptimizer", + "ConfigService", + "Connect", + "ConnectCampaigns", + "ConnectCases", + "ConnectContactLens", + "ConnectParticipant", + "ControlTower", + "CostExplorer", + "CustomerProfiles", + "DAX", + "DLM", + "DMS", + "DataBrew", + "DataExchange", + "DataPipeline", + "DataSync", + "Detective", + "DevOpsGuru", + "DeviceFarm", + "DirectConnect", + "DirectoryService", + "Discovery", + "DocDB", + "DocDBElastic", + "Drs", + "DynamoDB", + "DynamoDBStreams", + "EBS", + "EC2", + "EC2InstanceConnect", + "ECR", + "ECRPUBLIC", + "ECS", + "EFS", + "EKS", + "ELB", + "ELBv2", + "EMR", + "EMRServerless", + "EMRcontainers", + "ES", + "ElastiCache", + "ElasticBeanstalk", + "ElasticInference", + "ElasticTranscoder", + "EventBridge", + "Evidently", + "FMS", + "FSx", + "Finspace", + "Finspacedata", + "Firehose", + "Fis", + "ForecastQueryService", + "ForecastService", + "FraudDetector", + "GameLift", + "GameSparks", + "Glacier", + "GlobalAccelerator", + "Glue", + "Grafana", + "Greengrass", + "GreengrassV2", + "GroundStation", + "GuardDuty", + "Health", + "HealthLake", + "Honeycode", + "IAM", + "IVS", + "IdentityStore", + "Imagebuilder", + "Inspector", + "Inspector2", + "IoT1ClickDevicesService", + "IoT1ClickProjects", + "IoTAnalytics", + "IoTEvents", + "IoTEventsData", + "IoTFleetHub", + "IoTFleetWise", + "IoTJobsDataPlane", + "IoTRoboRunner", + "IoTSecureTunneling", + "IoTSiteWise", + "IoTThingsGraph", + "IoTTwinMaker", + "IoTWireless", + "Iot", + "IotData", + "IotDeviceAdvisor", + "Ivschat", + "KMS", + "Kafka", + "KafkaConnect", + "Kendra", + "Keyspaces", + "Kinesis", + "KinesisAnalytics", + "KinesisAnalyticsV2", + "KinesisVideo", + "KinesisVideoArchivedMedia", + "KinesisVideoMedia", + "KinesisVideoSignalingChannels", + "KinesisVideoWebRTCStorage", + "LakeFormation", + "Lambda", + "LexModelBuildingService", + "LexModelsV2", + "LexRuntime", + "LexRuntimeV2", + "LicenseManager", + "LicenseManagerLinuxSubscriptions", + "LicenseManagerUserSubscriptions", + "Lightsail", + "Location", + "LookoutEquipment", + "LookoutMetrics", + "LookoutVision", + "M2", + "MQ", + "MTurk", + "MWAA", + "MachineLearning", + "Macie", + "Macie2", + "ManagedBlockchain", + "MarketplaceCatalog", + "MarketplaceCommerceAnalytics", + "MarketplaceEntitlementService", + "MarketplaceMetering", + "MediaConnect", + "MediaConvert", + "MediaLive", + "MediaPackage", + "MediaPackageVod", + "MediaStore", + "MediaStoreData", + "MediaTailor", + "MemoryDB", + "Mgn", + "MigrationHub", + "MigrationHubConfig", + "MigrationHubOrchestrator", + "MigrationHubRefactorSpaces", + "MigrationHubStrategy", + "Mobile", + "Neptune", + "NetworkFirewall", + "NetworkManager", + "Nimble", + "OAM", + "Omics", + "OpenSearch", + "OpenSearchServerless", + "OpsWorks", + "OpsWorksCM", + "Organizations", + "Outposts", + "PI", + "Panorama", + "Personalize", + "PersonalizeEvents", + "PersonalizeRuntime", + "Pinpoint", + "PinpointEmail", + "PinpointSMSVoice", + "PinpointSMSVoiceV2", + "Pipes", + "Polly", + "Pricing", + "PrivateNetworks", + "Proton", + "QLDB", + "QLDBSession", + "QuickSight", + "RAM", + "RDS", + "RDSDataService", + "RUM", + "Rbin", + "Redshift", + "RedshiftData", + "RedshiftServerless", + "Rekognition", + "Resiliencehub", + "ResourceExplorer2", + "ResourceGroups", + "ResourceGroupsTaggingAPI", + "RoboMaker", + "RolesAnywhere", + "Route53", + "Route53Domains", + "Route53RecoveryCluster", + "Route53RecoveryControlConfig", + "Route53RecoveryReadiness", + "Route53Resolver", + "S3", + "S3Control", + "S3Outposts", + "SES", + "SESV2", + "SMS", + "SNS", + "SQS", + "SSM", + "SSMContacts", + "SSMIncidents", + "SSO", + "SSOAdmin", + "SSOOIDC", + "STS", + "SWF", + "SageMaker", + "SageMakerFeatureStoreRuntime", + "SageMakerGeospatial", + "SageMakerMetrics", + "SageMakerRuntime", + "SagemakerEdge", + "SavingsPlans", + "Scheduler", + "Schemas", + "SecretsManager", + "SecurityHub", + "SecurityLake", + "ServerlessApplicationRepository", + "ServiceCatalog", + "ServiceCatalogAppRegistry", + "ServiceDiscovery", + "ServiceQuotas", + "Shield", + "Signer", + "SimSpaceWeaver", + "SnowDeviceManagement", + "Snowball", + "SsmSap", + "StepFunctions", + "StorageGateway", + "Support", + "SupportApp", + "Synthetics", + "Textract", + "TimestreamQuery", + "TimestreamWrite", + "TranscribeService", + "Transfer", + "Translate", + "VoiceID", + "WAF", + "WAFRegional", + "WAFV2", + "WellArchitected", + "Wisdom", + "WorkDocs", + "WorkLink", + "WorkMail", + "WorkMailMessageFlow", + "WorkSpaces", + "WorkSpacesWeb", + "XRay" + ]; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts +var CLIENT_PACKAGE_NAMES_MAP; +var init_client_package_names_map = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { + "use strict"; + init_client_names(); + CLIENT_PACKAGE_NAMES_MAP = { + ...CLIENT_NAMES.reduce( + (acc, name) => ({ + ...acc, + [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") + }), + {} + ), + AccessAnalyzer: "client-accessanalyzer", + ACMPCA: "client-acm-pca", + APIGateway: "client-api-gateway", + ApiGatewayManagementApi: "client-apigatewaymanagementapi", + ApiGatewayV2: "client-apigatewayv2", + AppConfig: "client-appconfig", + AppConfigData: "client-appconfigdata", + AppIntegrations: "client-appintegrations", + AppRunner: "client-apprunner", + AppStream: "client-appstream", + AppSync: "client-appsync", + ApplicationCostProfiler: "client-applicationcostprofiler", + ARCZonalShift: "client-arc-zonal-shift", + AugmentedAIRuntime: "client-sage-maker-a2iruntime", + AuditManager: "client-auditmanager", + BackupStorage: "client-backupstorage", + CUR: "client-cost-and-usage-report-service", + CloudHSMV2: "client-cloudhsm-v2", + CodeGuruProfiler: "client-codeguruprofiler", + CodeStarconnections: "client-codestar-connections", + CognitoIdentityServiceProvider: "client-cognito-identity-provider", + ComprehendMedical: "client-comprehendmedical", + ConnectContactLens: "client-connect-contact-lens", + ControlTower: "client-controltower", + DMS: "client-database-migration-service", + DataPipeline: "client-data-pipeline", + Discovery: "client-application-discovery-service", + DevOpsGuru: "client-devops-guru", + DynamoDB: "client-dynamodb", + DynamoDBStreams: "client-dynamodb-streams", + DocDB: "client-docdb", + DocDBElastic: "client-docdb-elastic", + EC2InstanceConnect: "client-ec2-instance-connect", + ECRPUBLIC: "client-ecr-public", + ELB: "client-elastic-load-balancing", + ELBv2: "client-elastic-load-balancing-v2", + ElastiCache: "client-elasticache", + EMRcontainers: "client-emr-containers", + EMRServerless: "client-emr-serverless", + ES: "client-elasticsearch-service", + EventBridge: "client-eventbridge", + Finspacedata: "client-finspace-data", + ForecastQueryService: "client-forecastquery", + ForecastService: "client-forecast", + FraudDetector: "client-frauddetector", + GameLift: "client-gamelift", + GameSparks: "client-gamesparks", + GreengrassV2: "client-greengrassv2", + GroundStation: "client-groundstation", + GuardDuty: "client-guardduty", + HealthLake: "client-healthlake", + IdentityStore: "client-identitystore", + IoTAnalytics: "client-iotanalytics", + IotData: "client-iot-data-plane", + IotDeviceAdvisor: "client-iotdeviceadvisor", + IoTSecureTunneling: "client-iotsecuretunneling", + IoTSiteWise: "client-iotsitewise", + IoTThingsGraph: "client-iotthingsgraph", + IoTTwinMaker: "client-iottwinmaker", + IoTRoboRunner: "client-iot-roborunner", + KafkaConnect: "client-kafkaconnect", + KinesisVideoSignalingChannels: "client-kinesis-video-signaling", + KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", + LakeFormation: "client-lakeformation", + LexRuntime: "client-lex-runtime-service", + ManagedBlockchain: "client-managedblockchain", + MigrationHubConfig: "client-migrationhub-config", + MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", + NetworkManager: "client-networkmanager", + OpenSearch: "client-opensearch", + OpenSearchServerless: "client-opensearchserverless", + OpsWorks: "client-opsworks", + OpsWorksCM: "client-opsworkscm", + PrivateNetworks: "client-privatenetworks", + QLDBSession: "client-qldb-session", + QuickSight: "client-quicksight", + ResourceExplorer2: "client-resource-explorer-2", + RDSDataService: "client-rds-data", + RoboMaker: "client-robomaker", + RolesAnywhere: "client-rolesanywhere", + Route53: "client-route-53", + Route53Domains: "client-route-53-domains", + Route53Resolver: "client-route53resolver", + S3Control: "client-s3-control", + SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", + SavingsPlans: "client-savingsplans", + SecurityHub: "client-securityhub", + ServerlessApplicationRepository: "client-serverlessapplicationrepository", + ServiceCatalogAppRegistry: "client-service-catalog-appregistry", + ServiceDiscovery: "client-servicediscovery", + SimSpaceWeaver: "client-simspaceweaver", + SSMContacts: "client-ssm-contacts", + SSMIncidents: "client-ssm-incidents", + SSOAdmin: "client-sso-admin", + SSOOIDC: "client-sso-oidc", + StepFunctions: "client-sfn", + TranscribeService: "client-transcribe", + WAFRegional: "client-waf-regional", + WellArchitected: "client-wellarchitected", + WorkMailMessageFlow: "client-workmailmessageflow" + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts +var get_v3_client_package_name_exports = {}; +__export(get_v3_client_package_name_exports, { + getV3ClientPackageName: () => getV3ClientPackageName +}); +var getV3ClientPackageName; +var init_get_v3_client_package_name = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { + "use strict"; + init_client_package_names_map(); + getV3ClientPackageName = (clientName) => { + if (clientName in CLIENT_PACKAGE_NAMES_MAP) { + return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; + } + throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts +var find_client_constructor_exports = {}; +__export(find_client_constructor_exports, { + findV3ClientConstructor: () => findV3ClientConstructor +}); +function findV3ClientConstructor(pkg) { + const [_clientName, ServiceClient] = Object.entries(pkg).find( + ([name]) => { + return name.endsWith("Client") && name !== "__Client"; + } + ); + return ServiceClient; +} +var init_find_client_constructor = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { + "use strict"; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js +var require_lib = __commonJS({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; + var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); + Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { + return get_v3_client_package_name_1.getV3ClientPackageName; + } }); + var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); + Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { + return find_client_constructor_1.findV3ClientConstructor; + } }); + } +}); + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var aws_sdk_v3_handler_exports = {}; +__export(aws_sdk_v3_handler_exports, { + forceSdkInstallation: () => forceSdkInstallation, + handler: () => handler +}); +module.exports = __toCommonJS(aws_sdk_v3_handler_exports); +var import_child_process = require("child_process"); +var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); + +// custom-resources/lib/aws-custom-resource/runtime/shared.ts +var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } + return Object.assign( + {}, + ..._flatten(object) + ); +} +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +function filterKeys(object, pred) { + return Object.entries(object).reduce( + (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, + {} + ); +} +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data + }); + console.log("Responding", responseBody); + const parsedUrl = require("url").parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { + "content-type": "", + "content-length": Buffer.byteLength(responseBody, "utf8") + } + }; + return new Promise((resolve, reject) => { + try { + const request = require("https").request(requestOptions, resolve); + request.on("error", reject); + request.write(responseBody); + request.end(); + } catch (e) { + reject(e); + } + }); +} +function decodeCall(call) { + if (!call) { + return void 0; + } + return JSON.parse(call); +} +function startsWithOneOf(searchStrings) { + return function(string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var installedSdk = {}; +function forceSdkInstallation() { + installedSdk = {}; +} +function installLatestSdk(packageName) { + console.log(`Installing latest AWS SDK v3: ${packageName}`); + (0, import_child_process.execSync)( + `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` + ); + installedSdk = { + ...installedSdk, + [packageName]: true + }; +} +async function loadAwsSdk(packageName, installLatestAwsSdk) { + let awsSdk; + try { + if (!installedSdk[packageName] && installLatestAwsSdk === "true") { + try { + installLatestSdk(packageName); + awsSdk = require(`/tmp/node_modules/${packageName}`); + } catch (e) { + console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); + return require(packageName); + } + } else if (installedSdk[packageName]) { + awsSdk = require(`/tmp/node_modules/${packageName}`); + } else { + awsSdk = require(packageName); + } + } catch (error) { + throw Error(`Package ${packageName} does not exist.`); + } + return awsSdk; +} +async function handler(event, context) { + try { + event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); + event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); + event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); + let data = {}; + let physicalResourceId; + switch (event.RequestType) { + case "Create": + physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; + break; + case "Update": + case "Delete": + physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; + break; + } + const call = event.ResourceProperties[event.RequestType]; + if (call) { + const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); + let awsSdk = loadAwsSdk( + packageName, + event.ResourceProperties.InstallLatestAwsSdk + ); + console.log(JSON.stringify({ ...event, ResponseURL: "..." })); + let credentials; + if (call.assumedRoleArn) { + const timestamp = (/* @__PURE__ */ new Date()).getTime(); + const params = { + RoleArn: call.assumedRoleArn, + RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) + }; + const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); + credentials = fromTemporaryCredentials({ + params + }); + } + awsSdk = await awsSdk; + const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); + const client = new ServiceClient({ + apiVersion: call.apiVersion, + credentials, + region: call.region + }); + const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; + const Command = Object.entries(awsSdk).find( + ([name]) => name.toLowerCase() === commandName.toLowerCase() + )?.[1]; + let flatData = {}; + try { + const response = await client.send( + new Command( + (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} + ) + ); + flatData = { + apiVersion: client.config.apiVersion, + // For test purposes: check if apiVersion was correctly passed. + region: await client.config.region().catch(() => void 0), + // For test purposes: check if region was correctly passed. + ...flatten(response) + }; + let outputPaths; + if (call.outputPath) { + outputPaths = [call.outputPath]; + } else if (call.outputPaths) { + outputPaths = call.outputPaths; + } + if (outputPaths) { + data = filterKeys(flatData, startsWithOneOf(outputPaths)); + } else { + data = flatData; + } + } catch (e) { + const exceptionName = e.name ?? e.constructor.name; + if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { + throw e; + } + } + if (call.physicalResourceId?.responsePath) { + physicalResourceId = flatData[call.physicalResourceId.responsePath]; + } + } + await respond(event, "SUCCESS", "OK", physicalResourceId, data); + } catch (e) { + console.log(e); + await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + forceSdkInstallation, + handler +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +exports.startsWithOneOf = startsWithOneOf; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7R0FFRztBQUNILE1BQU0sT0FBTyxHQUFHLElBQUksV0FBVyxFQUFFLENBQUM7QUFFbEM7O0dBRUc7QUFDSCxTQUFTLFVBQVUsQ0FBQyxLQUFVO0lBQzVCLElBQUksTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsRUFBRTtRQUMxQixPQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDL0I7U0FBTSxJQUFJLFdBQVcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLEVBQUU7UUFDcEMsT0FBTyxPQUFPLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQztLQUNyQztJQUVELE9BQU8sS0FBSyxDQUFDO0FBQ2YsQ0FBQztBQUNEOzs7OztHQUtHO0FBQ0gsU0FBZ0IsT0FBTyxDQUFDLE1BQWM7SUFDcEMsU0FBUyxRQUFRLENBQUMsS0FBVSxFQUFFLE9BQWlCLEVBQUU7UUFDL0MsT0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUM7YUFDbkMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxFQUFFO1lBQ1QsTUFBTSxRQUFRLEdBQUcsVUFBVSxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO1lBQ3hD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ywgcmVqZWN0KTtcbiAgICAgIHJlcXVlc3Qud3JpdGUocmVzcG9uc2VCb2R5KTtcbiAgICAgIHJlcXVlc3QuZW5kKCk7XG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgcmVqZWN0KGUpO1xuICAgIH1cbiAgfSk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBkZWNvZGVDYWxsKGNhbGw6IHN0cmluZyB8IHVuZGVmaW5lZCkge1xuICBpZiAoIWNhbGwpIHsgcmV0dXJuIHVuZGVmaW5lZDsgfVxuICByZXR1cm4gSlNPTi5wYXJzZShjYWxsKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHN0YXJ0c1dpdGhPbmVPZihzZWFyY2hTdHJpbmdzOiBzdHJpbmdbXSk6IChzdHJpbmc6IHN0cmluZykgPT4gYm9vbGVhbiB7XG4gIHJldHVybiBmdW5jdGlvbihzdHJpbmc6IHN0cmluZyk6IGJvb2xlYW4ge1xuICAgIGZvciAoY29uc3Qgc2VhcmNoU3RyaW5nIG9mIHNlYXJjaFN0cmluZ3MpIHtcbiAgICAgIGlmIChzdHJpbmcuc3RhcnRzV2l0aChzZWFyY2hTdHJpbmcpKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js deleted file mode 100644 index 1b662725f1b0b..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js +++ /dev/null @@ -1,769 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts -var CLIENT_NAMES; -var init_client_names = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { - "use strict"; - CLIENT_NAMES = [ - "ACM", - "ACMPCA", - "APIGateway", - "ARCZonalShift", - "AccessAnalyzer", - "Account", - "AlexaForBusiness", - "Amp", - "Amplify", - "AmplifyBackend", - "AmplifyUIBuilder", - "ApiGatewayManagementApi", - "ApiGatewayV2", - "AppConfig", - "AppConfigData", - "AppIntegrations", - "AppMesh", - "AppRunner", - "AppStream", - "AppSync", - "Appflow", - "ApplicationAutoScaling", - "ApplicationCostProfiler", - "ApplicationInsights", - "Athena", - "AuditManager", - "AugmentedAIRuntime", - "AutoScaling", - "AutoScalingPlans", - "Backup", - "BackupGateway", - "BackupStorage", - "Batch", - "Billingconductor", - "Braket", - "Budgets", - "CUR", - "Chime", - "ChimeSDKIdentity", - "ChimeSDKMediaPipelines", - "ChimeSDKMeetings", - "ChimeSDKMessaging", - "ChimeSDKVoice", - "Cloud9", - "CloudControl", - "CloudDirectory", - "CloudFormation", - "CloudFront", - "CloudHSM", - "CloudHSMV2", - "CloudSearch", - "CloudSearchDomain", - "CloudTrail", - "CloudWatch", - "CloudWatchEvents", - "CloudWatchLogs", - "CodeArtifact", - "CodeBuild", - "CodeCatalyst", - "CodeCommit", - "CodeDeploy", - "CodeGuruProfiler", - "CodeGuruReviewer", - "CodePipeline", - "CodeStar", - "CodeStarNotifications", - "CodeStarconnections", - "CognitoIdentity", - "CognitoIdentityServiceProvider", - "CognitoSync", - "Comprehend", - "ComprehendMedical", - "ComputeOptimizer", - "ConfigService", - "Connect", - "ConnectCampaigns", - "ConnectCases", - "ConnectContactLens", - "ConnectParticipant", - "ControlTower", - "CostExplorer", - "CustomerProfiles", - "DAX", - "DLM", - "DMS", - "DataBrew", - "DataExchange", - "DataPipeline", - "DataSync", - "Detective", - "DevOpsGuru", - "DeviceFarm", - "DirectConnect", - "DirectoryService", - "Discovery", - "DocDB", - "DocDBElastic", - "Drs", - "DynamoDB", - "DynamoDBStreams", - "EBS", - "EC2", - "EC2InstanceConnect", - "ECR", - "ECRPUBLIC", - "ECS", - "EFS", - "EKS", - "ELB", - "ELBv2", - "EMR", - "EMRServerless", - "EMRcontainers", - "ES", - "ElastiCache", - "ElasticBeanstalk", - "ElasticInference", - "ElasticTranscoder", - "EventBridge", - "Evidently", - "FMS", - "FSx", - "Finspace", - "Finspacedata", - "Firehose", - "Fis", - "ForecastQueryService", - "ForecastService", - "FraudDetector", - "GameLift", - "GameSparks", - "Glacier", - "GlobalAccelerator", - "Glue", - "Grafana", - "Greengrass", - "GreengrassV2", - "GroundStation", - "GuardDuty", - "Health", - "HealthLake", - "Honeycode", - "IAM", - "IVS", - "IdentityStore", - "Imagebuilder", - "Inspector", - "Inspector2", - "IoT1ClickDevicesService", - "IoT1ClickProjects", - "IoTAnalytics", - "IoTEvents", - "IoTEventsData", - "IoTFleetHub", - "IoTFleetWise", - "IoTJobsDataPlane", - "IoTRoboRunner", - "IoTSecureTunneling", - "IoTSiteWise", - "IoTThingsGraph", - "IoTTwinMaker", - "IoTWireless", - "Iot", - "IotData", - "IotDeviceAdvisor", - "Ivschat", - "KMS", - "Kafka", - "KafkaConnect", - "Kendra", - "Keyspaces", - "Kinesis", - "KinesisAnalytics", - "KinesisAnalyticsV2", - "KinesisVideo", - "KinesisVideoArchivedMedia", - "KinesisVideoMedia", - "KinesisVideoSignalingChannels", - "KinesisVideoWebRTCStorage", - "LakeFormation", - "Lambda", - "LexModelBuildingService", - "LexModelsV2", - "LexRuntime", - "LexRuntimeV2", - "LicenseManager", - "LicenseManagerLinuxSubscriptions", - "LicenseManagerUserSubscriptions", - "Lightsail", - "Location", - "LookoutEquipment", - "LookoutMetrics", - "LookoutVision", - "M2", - "MQ", - "MTurk", - "MWAA", - "MachineLearning", - "Macie", - "Macie2", - "ManagedBlockchain", - "MarketplaceCatalog", - "MarketplaceCommerceAnalytics", - "MarketplaceEntitlementService", - "MarketplaceMetering", - "MediaConnect", - "MediaConvert", - "MediaLive", - "MediaPackage", - "MediaPackageVod", - "MediaStore", - "MediaStoreData", - "MediaTailor", - "MemoryDB", - "Mgn", - "MigrationHub", - "MigrationHubConfig", - "MigrationHubOrchestrator", - "MigrationHubRefactorSpaces", - "MigrationHubStrategy", - "Mobile", - "Neptune", - "NetworkFirewall", - "NetworkManager", - "Nimble", - "OAM", - "Omics", - "OpenSearch", - "OpenSearchServerless", - "OpsWorks", - "OpsWorksCM", - "Organizations", - "Outposts", - "PI", - "Panorama", - "Personalize", - "PersonalizeEvents", - "PersonalizeRuntime", - "Pinpoint", - "PinpointEmail", - "PinpointSMSVoice", - "PinpointSMSVoiceV2", - "Pipes", - "Polly", - "Pricing", - "PrivateNetworks", - "Proton", - "QLDB", - "QLDBSession", - "QuickSight", - "RAM", - "RDS", - "RDSDataService", - "RUM", - "Rbin", - "Redshift", - "RedshiftData", - "RedshiftServerless", - "Rekognition", - "Resiliencehub", - "ResourceExplorer2", - "ResourceGroups", - "ResourceGroupsTaggingAPI", - "RoboMaker", - "RolesAnywhere", - "Route53", - "Route53Domains", - "Route53RecoveryCluster", - "Route53RecoveryControlConfig", - "Route53RecoveryReadiness", - "Route53Resolver", - "S3", - "S3Control", - "S3Outposts", - "SES", - "SESV2", - "SMS", - "SNS", - "SQS", - "SSM", - "SSMContacts", - "SSMIncidents", - "SSO", - "SSOAdmin", - "SSOOIDC", - "STS", - "SWF", - "SageMaker", - "SageMakerFeatureStoreRuntime", - "SageMakerGeospatial", - "SageMakerMetrics", - "SageMakerRuntime", - "SagemakerEdge", - "SavingsPlans", - "Scheduler", - "Schemas", - "SecretsManager", - "SecurityHub", - "SecurityLake", - "ServerlessApplicationRepository", - "ServiceCatalog", - "ServiceCatalogAppRegistry", - "ServiceDiscovery", - "ServiceQuotas", - "Shield", - "Signer", - "SimSpaceWeaver", - "SnowDeviceManagement", - "Snowball", - "SsmSap", - "StepFunctions", - "StorageGateway", - "Support", - "SupportApp", - "Synthetics", - "Textract", - "TimestreamQuery", - "TimestreamWrite", - "TranscribeService", - "Transfer", - "Translate", - "VoiceID", - "WAF", - "WAFRegional", - "WAFV2", - "WellArchitected", - "Wisdom", - "WorkDocs", - "WorkLink", - "WorkMail", - "WorkMailMessageFlow", - "WorkSpaces", - "WorkSpacesWeb", - "XRay" - ]; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts -var CLIENT_PACKAGE_NAMES_MAP; -var init_client_package_names_map = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { - "use strict"; - init_client_names(); - CLIENT_PACKAGE_NAMES_MAP = { - ...CLIENT_NAMES.reduce( - (acc, name) => ({ - ...acc, - [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") - }), - {} - ), - AccessAnalyzer: "client-accessanalyzer", - ACMPCA: "client-acm-pca", - APIGateway: "client-api-gateway", - ApiGatewayManagementApi: "client-apigatewaymanagementapi", - ApiGatewayV2: "client-apigatewayv2", - AppConfig: "client-appconfig", - AppConfigData: "client-appconfigdata", - AppIntegrations: "client-appintegrations", - AppRunner: "client-apprunner", - AppStream: "client-appstream", - AppSync: "client-appsync", - ApplicationCostProfiler: "client-applicationcostprofiler", - ARCZonalShift: "client-arc-zonal-shift", - AugmentedAIRuntime: "client-sage-maker-a2iruntime", - AuditManager: "client-auditmanager", - BackupStorage: "client-backupstorage", - CUR: "client-cost-and-usage-report-service", - CloudHSMV2: "client-cloudhsm-v2", - CodeGuruProfiler: "client-codeguruprofiler", - CodeStarconnections: "client-codestar-connections", - CognitoIdentityServiceProvider: "client-cognito-identity-provider", - ComprehendMedical: "client-comprehendmedical", - ConnectContactLens: "client-connect-contact-lens", - ControlTower: "client-controltower", - DMS: "client-database-migration-service", - DataPipeline: "client-data-pipeline", - Discovery: "client-application-discovery-service", - DevOpsGuru: "client-devops-guru", - DynamoDB: "client-dynamodb", - DynamoDBStreams: "client-dynamodb-streams", - DocDB: "client-docdb", - DocDBElastic: "client-docdb-elastic", - EC2InstanceConnect: "client-ec2-instance-connect", - ECRPUBLIC: "client-ecr-public", - ELB: "client-elastic-load-balancing", - ELBv2: "client-elastic-load-balancing-v2", - ElastiCache: "client-elasticache", - EMRcontainers: "client-emr-containers", - EMRServerless: "client-emr-serverless", - ES: "client-elasticsearch-service", - EventBridge: "client-eventbridge", - Finspacedata: "client-finspace-data", - ForecastQueryService: "client-forecastquery", - ForecastService: "client-forecast", - FraudDetector: "client-frauddetector", - GameLift: "client-gamelift", - GameSparks: "client-gamesparks", - GreengrassV2: "client-greengrassv2", - GroundStation: "client-groundstation", - GuardDuty: "client-guardduty", - HealthLake: "client-healthlake", - IdentityStore: "client-identitystore", - IoTAnalytics: "client-iotanalytics", - IotData: "client-iot-data-plane", - IotDeviceAdvisor: "client-iotdeviceadvisor", - IoTSecureTunneling: "client-iotsecuretunneling", - IoTSiteWise: "client-iotsitewise", - IoTThingsGraph: "client-iotthingsgraph", - IoTTwinMaker: "client-iottwinmaker", - IoTRoboRunner: "client-iot-roborunner", - KafkaConnect: "client-kafkaconnect", - KinesisVideoSignalingChannels: "client-kinesis-video-signaling", - KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", - LakeFormation: "client-lakeformation", - LexRuntime: "client-lex-runtime-service", - ManagedBlockchain: "client-managedblockchain", - MigrationHubConfig: "client-migrationhub-config", - MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", - NetworkManager: "client-networkmanager", - OpenSearch: "client-opensearch", - OpenSearchServerless: "client-opensearchserverless", - OpsWorks: "client-opsworks", - OpsWorksCM: "client-opsworkscm", - PrivateNetworks: "client-privatenetworks", - QLDBSession: "client-qldb-session", - QuickSight: "client-quicksight", - ResourceExplorer2: "client-resource-explorer-2", - RDSDataService: "client-rds-data", - RoboMaker: "client-robomaker", - RolesAnywhere: "client-rolesanywhere", - Route53: "client-route-53", - Route53Domains: "client-route-53-domains", - Route53Resolver: "client-route53resolver", - S3Control: "client-s3-control", - SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", - SavingsPlans: "client-savingsplans", - SecurityHub: "client-securityhub", - ServerlessApplicationRepository: "client-serverlessapplicationrepository", - ServiceCatalogAppRegistry: "client-service-catalog-appregistry", - ServiceDiscovery: "client-servicediscovery", - SimSpaceWeaver: "client-simspaceweaver", - SSMContacts: "client-ssm-contacts", - SSMIncidents: "client-ssm-incidents", - SSOAdmin: "client-sso-admin", - SSOOIDC: "client-sso-oidc", - StepFunctions: "client-sfn", - TranscribeService: "client-transcribe", - WAFRegional: "client-waf-regional", - WellArchitected: "client-wellarchitected", - WorkMailMessageFlow: "client-workmailmessageflow" - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts -var get_v3_client_package_name_exports = {}; -__export(get_v3_client_package_name_exports, { - getV3ClientPackageName: () => getV3ClientPackageName -}); -var getV3ClientPackageName; -var init_get_v3_client_package_name = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { - "use strict"; - init_client_package_names_map(); - getV3ClientPackageName = (clientName) => { - if (clientName in CLIENT_PACKAGE_NAMES_MAP) { - return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; - } - throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts -var find_client_constructor_exports = {}; -__export(find_client_constructor_exports, { - findV3ClientConstructor: () => findV3ClientConstructor -}); -function findV3ClientConstructor(pkg) { - const [_clientName, ServiceClient] = Object.entries(pkg).find( - ([name]) => { - return name.endsWith("Client") && name !== "__Client"; - } - ); - return ServiceClient; -} -var init_find_client_constructor = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { - "use strict"; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js -var require_lib = __commonJS({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; - var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); - Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { - return get_v3_client_package_name_1.getV3ClientPackageName; - } }); - var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); - Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { - return find_client_constructor_1.findV3ClientConstructor; - } }); - } -}); - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var aws_sdk_v3_handler_exports = {}; -__export(aws_sdk_v3_handler_exports, { - forceSdkInstallation: () => forceSdkInstallation, - handler: () => handler -}); -module.exports = __toCommonJS(aws_sdk_v3_handler_exports); -var import_child_process = require("child_process"); -var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); - -// custom-resources/lib/aws-custom-resource/runtime/shared.ts -var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; -function flatten(object) { - return Object.assign( - {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) - ); -} -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -function filterKeys(object, pred) { - return Object.entries(object).reduce( - (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, - {} - ); -} -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data - }); - console.log("Responding", responseBody); - const parsedUrl = require("url").parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { - "content-type": "", - "content-length": Buffer.byteLength(responseBody, "utf8") - } - }; - return new Promise((resolve, reject) => { - try { - const request = require("https").request(requestOptions, resolve); - request.on("error", reject); - request.write(responseBody); - request.end(); - } catch (e) { - reject(e); - } - }); -} -function decodeCall(call) { - if (!call) { - return void 0; - } - return JSON.parse(call); -} -function startsWithOneOf(searchStrings) { - return function(string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var installedSdk = {}; -function forceSdkInstallation() { - installedSdk = {}; -} -function installLatestSdk(packageName) { - console.log(`Installing latest AWS SDK v3: ${packageName}`); - (0, import_child_process.execSync)( - `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` - ); - installedSdk = { - ...installedSdk, - [packageName]: true - }; -} -async function loadAwsSdk(packageName, installLatestAwsSdk) { - let awsSdk; - try { - if (!installedSdk[packageName] && installLatestAwsSdk === "true") { - try { - installLatestSdk(packageName); - awsSdk = require(`/tmp/node_modules/${packageName}`); - } catch (e) { - console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); - return require(packageName); - } - } else if (installedSdk[packageName]) { - awsSdk = require(`/tmp/node_modules/${packageName}`); - } else { - awsSdk = require(packageName); - } - } catch (error) { - throw Error(`Package ${packageName} does not exist.`); - } - return awsSdk; -} -async function handler(event, context) { - try { - event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); - event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); - event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); - let data = {}; - let physicalResourceId; - switch (event.RequestType) { - case "Create": - physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; - break; - case "Update": - case "Delete": - physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; - break; - } - const call = event.ResourceProperties[event.RequestType]; - if (call) { - const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); - let awsSdk = loadAwsSdk( - packageName, - event.ResourceProperties.InstallLatestAwsSdk - ); - console.log(JSON.stringify({ ...event, ResponseURL: "..." })); - let credentials; - if (call.assumedRoleArn) { - const timestamp = (/* @__PURE__ */ new Date()).getTime(); - const params = { - RoleArn: call.assumedRoleArn, - RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) - }; - const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); - credentials = fromTemporaryCredentials({ - params - }); - } - awsSdk = await awsSdk; - const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); - const client = new ServiceClient({ - apiVersion: call.apiVersion, - credentials, - region: call.region - }); - const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; - const Command = Object.entries(awsSdk).find( - ([name]) => name.toLowerCase() === commandName.toLowerCase() - )?.[1]; - let flatData = {}; - try { - const response = await client.send( - new Command( - (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} - ) - ); - flatData = { - apiVersion: client.config.apiVersion, - // For test purposes: check if apiVersion was correctly passed. - region: await client.config.region().catch(() => void 0), - // For test purposes: check if region was correctly passed. - ...flatten(response) - }; - let outputPaths; - if (call.outputPath) { - outputPaths = [call.outputPath]; - } else if (call.outputPaths) { - outputPaths = call.outputPaths; - } - if (outputPaths) { - data = filterKeys(flatData, startsWithOneOf(outputPaths)); - } else { - data = flatData; - } - } catch (e) { - const exceptionName = e.name ?? e.constructor.name; - if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { - throw e; - } - } - if (call.physicalResourceId?.responsePath) { - physicalResourceId = flatData[call.physicalResourceId.responsePath]; - } - } - await respond(event, "SUCCESS", "OK", physicalResourceId, data); - } catch (e) { - console.log(e); - await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - forceSdkInstallation, - handler -}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js deleted file mode 100644 index 6c53eaeef8cd1..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -exports.decodeSpecialValues = decodeSpecialValues; -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -exports.filterKeys = filterKeys; -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - // eslint-disable-next-line no-console - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': Buffer.byteLength(responseBody, 'utf8'), - }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -exports.respond = respond; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -exports.decodeCall = decodeCall; -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} -exports.startsWithOneOf = startsWithOneOf; -//# sourceMappingURL=data:application/json;base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taW1wb3J0c1xuICAgICAgY29uc3QgcmVxdWVzdCA9IHJlcXVpcmUoJ2h0dHBzJykucmVxdWVzdChyZXF1ZXN0T3B0aW9ucywgcmVzb2x2ZSk7XG4gICAgICByZXF1ZXN0Lm9uKCdlcnJvcicsIHJlamVjdCk7XG4gICAgICByZXF1ZXN0LndyaXRlKHJlc3BvbnNlQm9keSk7XG4gICAgICByZXF1ZXN0LmVuZCgpO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIHJlamVjdChlKTtcbiAgICB9XG4gIH0pO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZGVjb2RlQ2FsbChjYWxsOiBzdHJpbmcgfCB1bmRlZmluZWQpIHtcbiAgaWYgKCFjYWxsKSB7IHJldHVybiB1bmRlZmluZWQ7IH1cbiAgcmV0dXJuIEpTT04ucGFyc2UoY2FsbCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzdGFydHNXaXRoT25lT2Yoc2VhcmNoU3RyaW5nczogc3RyaW5nW10pOiAoc3RyaW5nOiBzdHJpbmcpID0+IGJvb2xlYW4ge1xuICByZXR1cm4gZnVuY3Rpb24oc3RyaW5nOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgICBmb3IgKGNvbnN0IHNlYXJjaFN0cmluZyBvZiBzZWFyY2hTdHJpbmdzKSB7XG4gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/lambda-logssubscription-integ.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/lambda-logssubscription-integ.assets.json index 020b2327680e7..6e7e5bc6cdeef 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/lambda-logssubscription-integ.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/lambda-logssubscription-integ.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "d338402de2b8b5577dc1a0490725a97b1ba218a8d0b2d35ea0ced080554a6ee5": { + "bd78339fed9b30f484dc9edf39147adec5b2092338273253436cbd20bb244339": { "source": { "path": "lambda-logssubscription-integ.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "d338402de2b8b5577dc1a0490725a97b1ba218a8d0b2d35ea0ced080554a6ee5.json", + "objectKey": "bd78339fed9b30f484dc9edf39147adec5b2092338273253436cbd20bb244339.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/lambda-logssubscription-integ.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/lambda-logssubscription-integ.template.json index 7752a275ad436..43b11c219956a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/lambda-logssubscription-integ.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/lambda-logssubscription-integ.template.json @@ -238,7 +238,7 @@ ] }, "Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"lambdalogssubscriptionintegEventsLogGroupPolicylambdalogssubscriptionintegCustomRuleBA3E2AD7F3616134\"},\"ignoreErrorCodesMatching\":\"ResourceNotFoundException\"}", - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "EventsLogGroupPolicylambdalogssubscriptionintegCustomRuleBA3E2AD7CustomResourcePolicy0DA87EF1" @@ -308,7 +308,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/manifest.json index d453b59895a03..f353daa198d9e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d338402de2b8b5577dc1a0490725a97b1ba218a8d0b2d35ea0ced080554a6ee5.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/bd78339fed9b30f484dc9edf39147adec5b2092338273253436cbd20bb244339.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -87,6 +87,12 @@ "data": "CustomRuleB1CBBADE" } ], + "/lambda-logssubscription-integ/EventsLogGroupPolicylambdalogssubscriptionintegCustomRuleBA3E2AD7": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/lambda-logssubscription-integ/EventsLogGroupPolicylambdalogssubscriptionintegCustomRuleBA3E2AD7/Resource/Default": [ { "type": "aws:cdk:logicalId", @@ -148,7 +154,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c1d2086d6e491024ccf5ae6e2ec76bc1cb174a150a7a0f66465dc299575182e1.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/725f3f8ae4d3206e7efe91a058bf9c3e31ee64bb5dad9c3c2dd1197e60a32c76.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/tree.json index 3153cf32cd800..4f7d49bd9149e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-logs-destinations/test/integ.lambda.js.snapshot/tree.json @@ -531,7 +531,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js new file mode 100644 index 0000000000000..9f6e97928f257 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -0,0 +1,779 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts +var CLIENT_NAMES; +var init_client_names = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { + "use strict"; + CLIENT_NAMES = [ + "ACM", + "ACMPCA", + "APIGateway", + "ARCZonalShift", + "AccessAnalyzer", + "Account", + "AlexaForBusiness", + "Amp", + "Amplify", + "AmplifyBackend", + "AmplifyUIBuilder", + "ApiGatewayManagementApi", + "ApiGatewayV2", + "AppConfig", + "AppConfigData", + "AppIntegrations", + "AppMesh", + "AppRunner", + "AppStream", + "AppSync", + "Appflow", + "ApplicationAutoScaling", + "ApplicationCostProfiler", + "ApplicationInsights", + "Athena", + "AuditManager", + "AugmentedAIRuntime", + "AutoScaling", + "AutoScalingPlans", + "Backup", + "BackupGateway", + "BackupStorage", + "Batch", + "Billingconductor", + "Braket", + "Budgets", + "CUR", + "Chime", + "ChimeSDKIdentity", + "ChimeSDKMediaPipelines", + "ChimeSDKMeetings", + "ChimeSDKMessaging", + "ChimeSDKVoice", + "Cloud9", + "CloudControl", + "CloudDirectory", + "CloudFormation", + "CloudFront", + "CloudHSM", + "CloudHSMV2", + "CloudSearch", + "CloudSearchDomain", + "CloudTrail", + "CloudWatch", + "CloudWatchEvents", + "CloudWatchLogs", + "CodeArtifact", + "CodeBuild", + "CodeCatalyst", + "CodeCommit", + "CodeDeploy", + "CodeGuruProfiler", + "CodeGuruReviewer", + "CodePipeline", + "CodeStar", + "CodeStarNotifications", + "CodeStarconnections", + "CognitoIdentity", + "CognitoIdentityServiceProvider", + "CognitoSync", + "Comprehend", + "ComprehendMedical", + "ComputeOptimizer", + "ConfigService", + "Connect", + "ConnectCampaigns", + "ConnectCases", + "ConnectContactLens", + "ConnectParticipant", + "ControlTower", + "CostExplorer", + "CustomerProfiles", + "DAX", + "DLM", + "DMS", + "DataBrew", + "DataExchange", + "DataPipeline", + "DataSync", + "Detective", + "DevOpsGuru", + "DeviceFarm", + "DirectConnect", + "DirectoryService", + "Discovery", + "DocDB", + "DocDBElastic", + "Drs", + "DynamoDB", + "DynamoDBStreams", + "EBS", + "EC2", + "EC2InstanceConnect", + "ECR", + "ECRPUBLIC", + "ECS", + "EFS", + "EKS", + "ELB", + "ELBv2", + "EMR", + "EMRServerless", + "EMRcontainers", + "ES", + "ElastiCache", + "ElasticBeanstalk", + "ElasticInference", + "ElasticTranscoder", + "EventBridge", + "Evidently", + "FMS", + "FSx", + "Finspace", + "Finspacedata", + "Firehose", + "Fis", + "ForecastQueryService", + "ForecastService", + "FraudDetector", + "GameLift", + "GameSparks", + "Glacier", + "GlobalAccelerator", + "Glue", + "Grafana", + "Greengrass", + "GreengrassV2", + "GroundStation", + "GuardDuty", + "Health", + "HealthLake", + "Honeycode", + "IAM", + "IVS", + "IdentityStore", + "Imagebuilder", + "Inspector", + "Inspector2", + "IoT1ClickDevicesService", + "IoT1ClickProjects", + "IoTAnalytics", + "IoTEvents", + "IoTEventsData", + "IoTFleetHub", + "IoTFleetWise", + "IoTJobsDataPlane", + "IoTRoboRunner", + "IoTSecureTunneling", + "IoTSiteWise", + "IoTThingsGraph", + "IoTTwinMaker", + "IoTWireless", + "Iot", + "IotData", + "IotDeviceAdvisor", + "Ivschat", + "KMS", + "Kafka", + "KafkaConnect", + "Kendra", + "Keyspaces", + "Kinesis", + "KinesisAnalytics", + "KinesisAnalyticsV2", + "KinesisVideo", + "KinesisVideoArchivedMedia", + "KinesisVideoMedia", + "KinesisVideoSignalingChannels", + "KinesisVideoWebRTCStorage", + "LakeFormation", + "Lambda", + "LexModelBuildingService", + "LexModelsV2", + "LexRuntime", + "LexRuntimeV2", + "LicenseManager", + "LicenseManagerLinuxSubscriptions", + "LicenseManagerUserSubscriptions", + "Lightsail", + "Location", + "LookoutEquipment", + "LookoutMetrics", + "LookoutVision", + "M2", + "MQ", + "MTurk", + "MWAA", + "MachineLearning", + "Macie", + "Macie2", + "ManagedBlockchain", + "MarketplaceCatalog", + "MarketplaceCommerceAnalytics", + "MarketplaceEntitlementService", + "MarketplaceMetering", + "MediaConnect", + "MediaConvert", + "MediaLive", + "MediaPackage", + "MediaPackageVod", + "MediaStore", + "MediaStoreData", + "MediaTailor", + "MemoryDB", + "Mgn", + "MigrationHub", + "MigrationHubConfig", + "MigrationHubOrchestrator", + "MigrationHubRefactorSpaces", + "MigrationHubStrategy", + "Mobile", + "Neptune", + "NetworkFirewall", + "NetworkManager", + "Nimble", + "OAM", + "Omics", + "OpenSearch", + "OpenSearchServerless", + "OpsWorks", + "OpsWorksCM", + "Organizations", + "Outposts", + "PI", + "Panorama", + "Personalize", + "PersonalizeEvents", + "PersonalizeRuntime", + "Pinpoint", + "PinpointEmail", + "PinpointSMSVoice", + "PinpointSMSVoiceV2", + "Pipes", + "Polly", + "Pricing", + "PrivateNetworks", + "Proton", + "QLDB", + "QLDBSession", + "QuickSight", + "RAM", + "RDS", + "RDSDataService", + "RUM", + "Rbin", + "Redshift", + "RedshiftData", + "RedshiftServerless", + "Rekognition", + "Resiliencehub", + "ResourceExplorer2", + "ResourceGroups", + "ResourceGroupsTaggingAPI", + "RoboMaker", + "RolesAnywhere", + "Route53", + "Route53Domains", + "Route53RecoveryCluster", + "Route53RecoveryControlConfig", + "Route53RecoveryReadiness", + "Route53Resolver", + "S3", + "S3Control", + "S3Outposts", + "SES", + "SESV2", + "SMS", + "SNS", + "SQS", + "SSM", + "SSMContacts", + "SSMIncidents", + "SSO", + "SSOAdmin", + "SSOOIDC", + "STS", + "SWF", + "SageMaker", + "SageMakerFeatureStoreRuntime", + "SageMakerGeospatial", + "SageMakerMetrics", + "SageMakerRuntime", + "SagemakerEdge", + "SavingsPlans", + "Scheduler", + "Schemas", + "SecretsManager", + "SecurityHub", + "SecurityLake", + "ServerlessApplicationRepository", + "ServiceCatalog", + "ServiceCatalogAppRegistry", + "ServiceDiscovery", + "ServiceQuotas", + "Shield", + "Signer", + "SimSpaceWeaver", + "SnowDeviceManagement", + "Snowball", + "SsmSap", + "StepFunctions", + "StorageGateway", + "Support", + "SupportApp", + "Synthetics", + "Textract", + "TimestreamQuery", + "TimestreamWrite", + "TranscribeService", + "Transfer", + "Translate", + "VoiceID", + "WAF", + "WAFRegional", + "WAFV2", + "WellArchitected", + "Wisdom", + "WorkDocs", + "WorkLink", + "WorkMail", + "WorkMailMessageFlow", + "WorkSpaces", + "WorkSpacesWeb", + "XRay" + ]; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts +var CLIENT_PACKAGE_NAMES_MAP; +var init_client_package_names_map = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { + "use strict"; + init_client_names(); + CLIENT_PACKAGE_NAMES_MAP = { + ...CLIENT_NAMES.reduce( + (acc, name) => ({ + ...acc, + [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") + }), + {} + ), + AccessAnalyzer: "client-accessanalyzer", + ACMPCA: "client-acm-pca", + APIGateway: "client-api-gateway", + ApiGatewayManagementApi: "client-apigatewaymanagementapi", + ApiGatewayV2: "client-apigatewayv2", + AppConfig: "client-appconfig", + AppConfigData: "client-appconfigdata", + AppIntegrations: "client-appintegrations", + AppRunner: "client-apprunner", + AppStream: "client-appstream", + AppSync: "client-appsync", + ApplicationCostProfiler: "client-applicationcostprofiler", + ARCZonalShift: "client-arc-zonal-shift", + AugmentedAIRuntime: "client-sage-maker-a2iruntime", + AuditManager: "client-auditmanager", + BackupStorage: "client-backupstorage", + CUR: "client-cost-and-usage-report-service", + CloudHSMV2: "client-cloudhsm-v2", + CodeGuruProfiler: "client-codeguruprofiler", + CodeStarconnections: "client-codestar-connections", + CognitoIdentityServiceProvider: "client-cognito-identity-provider", + ComprehendMedical: "client-comprehendmedical", + ConnectContactLens: "client-connect-contact-lens", + ControlTower: "client-controltower", + DMS: "client-database-migration-service", + DataPipeline: "client-data-pipeline", + Discovery: "client-application-discovery-service", + DevOpsGuru: "client-devops-guru", + DynamoDB: "client-dynamodb", + DynamoDBStreams: "client-dynamodb-streams", + DocDB: "client-docdb", + DocDBElastic: "client-docdb-elastic", + EC2InstanceConnect: "client-ec2-instance-connect", + ECRPUBLIC: "client-ecr-public", + ELB: "client-elastic-load-balancing", + ELBv2: "client-elastic-load-balancing-v2", + ElastiCache: "client-elasticache", + EMRcontainers: "client-emr-containers", + EMRServerless: "client-emr-serverless", + ES: "client-elasticsearch-service", + EventBridge: "client-eventbridge", + Finspacedata: "client-finspace-data", + ForecastQueryService: "client-forecastquery", + ForecastService: "client-forecast", + FraudDetector: "client-frauddetector", + GameLift: "client-gamelift", + GameSparks: "client-gamesparks", + GreengrassV2: "client-greengrassv2", + GroundStation: "client-groundstation", + GuardDuty: "client-guardduty", + HealthLake: "client-healthlake", + IdentityStore: "client-identitystore", + IoTAnalytics: "client-iotanalytics", + IotData: "client-iot-data-plane", + IotDeviceAdvisor: "client-iotdeviceadvisor", + IoTSecureTunneling: "client-iotsecuretunneling", + IoTSiteWise: "client-iotsitewise", + IoTThingsGraph: "client-iotthingsgraph", + IoTTwinMaker: "client-iottwinmaker", + IoTRoboRunner: "client-iot-roborunner", + KafkaConnect: "client-kafkaconnect", + KinesisVideoSignalingChannels: "client-kinesis-video-signaling", + KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", + LakeFormation: "client-lakeformation", + LexRuntime: "client-lex-runtime-service", + ManagedBlockchain: "client-managedblockchain", + MigrationHubConfig: "client-migrationhub-config", + MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", + NetworkManager: "client-networkmanager", + OpenSearch: "client-opensearch", + OpenSearchServerless: "client-opensearchserverless", + OpsWorks: "client-opsworks", + OpsWorksCM: "client-opsworkscm", + PrivateNetworks: "client-privatenetworks", + QLDBSession: "client-qldb-session", + QuickSight: "client-quicksight", + ResourceExplorer2: "client-resource-explorer-2", + RDSDataService: "client-rds-data", + RoboMaker: "client-robomaker", + RolesAnywhere: "client-rolesanywhere", + Route53: "client-route-53", + Route53Domains: "client-route-53-domains", + Route53Resolver: "client-route53resolver", + S3Control: "client-s3-control", + SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", + SavingsPlans: "client-savingsplans", + SecurityHub: "client-securityhub", + ServerlessApplicationRepository: "client-serverlessapplicationrepository", + ServiceCatalogAppRegistry: "client-service-catalog-appregistry", + ServiceDiscovery: "client-servicediscovery", + SimSpaceWeaver: "client-simspaceweaver", + SSMContacts: "client-ssm-contacts", + SSMIncidents: "client-ssm-incidents", + SSOAdmin: "client-sso-admin", + SSOOIDC: "client-sso-oidc", + StepFunctions: "client-sfn", + TranscribeService: "client-transcribe", + WAFRegional: "client-waf-regional", + WellArchitected: "client-wellarchitected", + WorkMailMessageFlow: "client-workmailmessageflow" + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts +var get_v3_client_package_name_exports = {}; +__export(get_v3_client_package_name_exports, { + getV3ClientPackageName: () => getV3ClientPackageName +}); +var getV3ClientPackageName; +var init_get_v3_client_package_name = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { + "use strict"; + init_client_package_names_map(); + getV3ClientPackageName = (clientName) => { + if (clientName in CLIENT_PACKAGE_NAMES_MAP) { + return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; + } + throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts +var find_client_constructor_exports = {}; +__export(find_client_constructor_exports, { + findV3ClientConstructor: () => findV3ClientConstructor +}); +function findV3ClientConstructor(pkg) { + const [_clientName, ServiceClient] = Object.entries(pkg).find( + ([name]) => { + return name.endsWith("Client") && name !== "__Client"; + } + ); + return ServiceClient; +} +var init_find_client_constructor = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { + "use strict"; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js +var require_lib = __commonJS({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; + var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); + Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { + return get_v3_client_package_name_1.getV3ClientPackageName; + } }); + var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); + Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { + return find_client_constructor_1.findV3ClientConstructor; + } }); + } +}); + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var aws_sdk_v3_handler_exports = {}; +__export(aws_sdk_v3_handler_exports, { + forceSdkInstallation: () => forceSdkInstallation, + handler: () => handler +}); +module.exports = __toCommonJS(aws_sdk_v3_handler_exports); +var import_child_process = require("child_process"); +var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); + +// custom-resources/lib/aws-custom-resource/runtime/shared.ts +var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } + return Object.assign( + {}, + ..._flatten(object) + ); +} +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +function filterKeys(object, pred) { + return Object.entries(object).reduce( + (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, + {} + ); +} +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data + }); + console.log("Responding", responseBody); + const parsedUrl = require("url").parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { + "content-type": "", + "content-length": Buffer.byteLength(responseBody, "utf8") + } + }; + return new Promise((resolve, reject) => { + try { + const request = require("https").request(requestOptions, resolve); + request.on("error", reject); + request.write(responseBody); + request.end(); + } catch (e) { + reject(e); + } + }); +} +function decodeCall(call) { + if (!call) { + return void 0; + } + return JSON.parse(call); +} +function startsWithOneOf(searchStrings) { + return function(string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var installedSdk = {}; +function forceSdkInstallation() { + installedSdk = {}; +} +function installLatestSdk(packageName) { + console.log(`Installing latest AWS SDK v3: ${packageName}`); + (0, import_child_process.execSync)( + `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` + ); + installedSdk = { + ...installedSdk, + [packageName]: true + }; +} +async function loadAwsSdk(packageName, installLatestAwsSdk) { + let awsSdk; + try { + if (!installedSdk[packageName] && installLatestAwsSdk === "true") { + try { + installLatestSdk(packageName); + awsSdk = require(`/tmp/node_modules/${packageName}`); + } catch (e) { + console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); + return require(packageName); + } + } else if (installedSdk[packageName]) { + awsSdk = require(`/tmp/node_modules/${packageName}`); + } else { + awsSdk = require(packageName); + } + } catch (error) { + throw Error(`Package ${packageName} does not exist.`); + } + return awsSdk; +} +async function handler(event, context) { + try { + event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); + event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); + event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); + let data = {}; + let physicalResourceId; + switch (event.RequestType) { + case "Create": + physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; + break; + case "Update": + case "Delete": + physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; + break; + } + const call = event.ResourceProperties[event.RequestType]; + if (call) { + const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); + let awsSdk = loadAwsSdk( + packageName, + event.ResourceProperties.InstallLatestAwsSdk + ); + console.log(JSON.stringify({ ...event, ResponseURL: "..." })); + let credentials; + if (call.assumedRoleArn) { + const timestamp = (/* @__PURE__ */ new Date()).getTime(); + const params = { + RoleArn: call.assumedRoleArn, + RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) + }; + const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); + credentials = fromTemporaryCredentials({ + params + }); + } + awsSdk = await awsSdk; + const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); + const client = new ServiceClient({ + apiVersion: call.apiVersion, + credentials, + region: call.region + }); + const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; + const Command = Object.entries(awsSdk).find( + ([name]) => name.toLowerCase() === commandName.toLowerCase() + )?.[1]; + let flatData = {}; + try { + const response = await client.send( + new Command( + (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} + ) + ); + flatData = { + apiVersion: client.config.apiVersion, + // For test purposes: check if apiVersion was correctly passed. + region: await client.config.region().catch(() => void 0), + // For test purposes: check if region was correctly passed. + ...flatten(response) + }; + let outputPaths; + if (call.outputPath) { + outputPaths = [call.outputPath]; + } else if (call.outputPaths) { + outputPaths = call.outputPaths; + } + if (outputPaths) { + data = filterKeys(flatData, startsWithOneOf(outputPaths)); + } else { + data = flatData; + } + } catch (e) { + const exceptionName = e.name ?? e.constructor.name; + if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { + throw e; + } + } + if (call.physicalResourceId?.responsePath) { + physicalResourceId = flatData[call.physicalResourceId.responsePath]; + } + } + await respond(event, "SUCCESS", "OK", physicalResourceId, data); + } catch (e) { + console.log(e); + await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + forceSdkInstallation, + handler +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +exports.startsWithOneOf = startsWithOneOf; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7R0FFRztBQUNILE1BQU0sT0FBTyxHQUFHLElBQUksV0FBVyxFQUFFLENBQUM7QUFFbEM7O0dBRUc7QUFDSCxTQUFTLFVBQVUsQ0FBQyxLQUFVO0lBQzVCLElBQUksTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsRUFBRTtRQUMxQixPQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDL0I7U0FBTSxJQUFJLFdBQVcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLEVBQUU7UUFDcEMsT0FBTyxPQUFPLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQztLQUNyQztJQUVELE9BQU8sS0FBSyxDQUFDO0FBQ2YsQ0FBQztBQUNEOzs7OztHQUtHO0FBQ0gsU0FBZ0IsT0FBTyxDQUFDLE1BQWM7SUFDcEMsU0FBUyxRQUFRLENBQUMsS0FBVSxFQUFFLE9BQWlCLEVBQUU7UUFDL0MsT0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUM7YUFDbkMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxFQUFFO1lBQ1QsTUFBTSxRQUFRLEdBQUcsVUFBVSxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQ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IHJlcXVlc3Qub24oJ2Vycm9yJywgcmVqZWN0KTtcbiAgICAgIHJlcXVlc3Qud3JpdGUocmVzcG9uc2VCb2R5KTtcbiAgICAgIHJlcXVlc3QuZW5kKCk7XG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgcmVqZWN0KGUpO1xuICAgIH1cbiAgfSk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBkZWNvZGVDYWxsKGNhbGw6IHN0cmluZyB8IHVuZGVmaW5lZCkge1xuICBpZiAoIWNhbGwpIHsgcmV0dXJuIHVuZGVmaW5lZDsgfVxuICByZXR1cm4gSlNPTi5wYXJzZShjYWxsKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHN0YXJ0c1dpdGhPbmVPZihzZWFyY2hTdHJpbmdzOiBzdHJpbmdbXSk6IChzdHJpbmc6IHN0cmluZykgPT4gYm9vbGVhbiB7XG4gIHJldHVybiBmdW5jdGlvbihzdHJpbmc6IHN0cmluZyk6IGJvb2xlYW4ge1xuICAgIGZvciAoY29uc3Qgc2VhcmNoU3RyaW5nIG9mIHNlYXJjaFN0cmluZ3MpIHtcbiAgICAgIGlmIChzdHJpbmcuc3RhcnRzV2l0aChzZWFyY2hTdHJpbmcpKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js deleted file mode 100644 index 1b662725f1b0b..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js +++ /dev/null @@ -1,769 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts -var CLIENT_NAMES; -var init_client_names = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { - "use strict"; - CLIENT_NAMES = [ - "ACM", - "ACMPCA", - "APIGateway", - "ARCZonalShift", - "AccessAnalyzer", - "Account", - "AlexaForBusiness", - "Amp", - "Amplify", - "AmplifyBackend", - "AmplifyUIBuilder", - "ApiGatewayManagementApi", - "ApiGatewayV2", - "AppConfig", - "AppConfigData", - "AppIntegrations", - "AppMesh", - "AppRunner", - "AppStream", - "AppSync", - "Appflow", - "ApplicationAutoScaling", - "ApplicationCostProfiler", - "ApplicationInsights", - "Athena", - "AuditManager", - "AugmentedAIRuntime", - "AutoScaling", - "AutoScalingPlans", - "Backup", - "BackupGateway", - "BackupStorage", - "Batch", - "Billingconductor", - "Braket", - "Budgets", - "CUR", - "Chime", - "ChimeSDKIdentity", - "ChimeSDKMediaPipelines", - "ChimeSDKMeetings", - "ChimeSDKMessaging", - "ChimeSDKVoice", - "Cloud9", - "CloudControl", - "CloudDirectory", - "CloudFormation", - "CloudFront", - "CloudHSM", - "CloudHSMV2", - "CloudSearch", - "CloudSearchDomain", - "CloudTrail", - "CloudWatch", - "CloudWatchEvents", - "CloudWatchLogs", - "CodeArtifact", - "CodeBuild", - "CodeCatalyst", - "CodeCommit", - "CodeDeploy", - "CodeGuruProfiler", - "CodeGuruReviewer", - "CodePipeline", - "CodeStar", - "CodeStarNotifications", - "CodeStarconnections", - "CognitoIdentity", - "CognitoIdentityServiceProvider", - "CognitoSync", - "Comprehend", - "ComprehendMedical", - "ComputeOptimizer", - "ConfigService", - "Connect", - "ConnectCampaigns", - "ConnectCases", - "ConnectContactLens", - "ConnectParticipant", - "ControlTower", - "CostExplorer", - "CustomerProfiles", - "DAX", - "DLM", - "DMS", - "DataBrew", - "DataExchange", - "DataPipeline", - "DataSync", - "Detective", - "DevOpsGuru", - "DeviceFarm", - "DirectConnect", - "DirectoryService", - "Discovery", - "DocDB", - "DocDBElastic", - "Drs", - "DynamoDB", - "DynamoDBStreams", - "EBS", - "EC2", - "EC2InstanceConnect", - "ECR", - "ECRPUBLIC", - "ECS", - "EFS", - "EKS", - "ELB", - "ELBv2", - "EMR", - "EMRServerless", - "EMRcontainers", - "ES", - "ElastiCache", - "ElasticBeanstalk", - "ElasticInference", - "ElasticTranscoder", - "EventBridge", - "Evidently", - "FMS", - "FSx", - "Finspace", - "Finspacedata", - "Firehose", - "Fis", - "ForecastQueryService", - "ForecastService", - "FraudDetector", - "GameLift", - "GameSparks", - "Glacier", - "GlobalAccelerator", - "Glue", - "Grafana", - "Greengrass", - "GreengrassV2", - "GroundStation", - "GuardDuty", - "Health", - "HealthLake", - "Honeycode", - "IAM", - "IVS", - "IdentityStore", - "Imagebuilder", - "Inspector", - "Inspector2", - "IoT1ClickDevicesService", - "IoT1ClickProjects", - "IoTAnalytics", - "IoTEvents", - "IoTEventsData", - "IoTFleetHub", - "IoTFleetWise", - "IoTJobsDataPlane", - "IoTRoboRunner", - "IoTSecureTunneling", - "IoTSiteWise", - "IoTThingsGraph", - "IoTTwinMaker", - "IoTWireless", - "Iot", - "IotData", - "IotDeviceAdvisor", - "Ivschat", - "KMS", - "Kafka", - "KafkaConnect", - "Kendra", - "Keyspaces", - "Kinesis", - "KinesisAnalytics", - "KinesisAnalyticsV2", - "KinesisVideo", - "KinesisVideoArchivedMedia", - "KinesisVideoMedia", - "KinesisVideoSignalingChannels", - "KinesisVideoWebRTCStorage", - "LakeFormation", - "Lambda", - "LexModelBuildingService", - "LexModelsV2", - "LexRuntime", - "LexRuntimeV2", - "LicenseManager", - "LicenseManagerLinuxSubscriptions", - "LicenseManagerUserSubscriptions", - "Lightsail", - "Location", - "LookoutEquipment", - "LookoutMetrics", - "LookoutVision", - "M2", - "MQ", - "MTurk", - "MWAA", - "MachineLearning", - "Macie", - "Macie2", - "ManagedBlockchain", - "MarketplaceCatalog", - "MarketplaceCommerceAnalytics", - "MarketplaceEntitlementService", - "MarketplaceMetering", - "MediaConnect", - "MediaConvert", - "MediaLive", - "MediaPackage", - "MediaPackageVod", - "MediaStore", - "MediaStoreData", - "MediaTailor", - "MemoryDB", - "Mgn", - "MigrationHub", - "MigrationHubConfig", - "MigrationHubOrchestrator", - "MigrationHubRefactorSpaces", - "MigrationHubStrategy", - "Mobile", - "Neptune", - "NetworkFirewall", - "NetworkManager", - "Nimble", - "OAM", - "Omics", - "OpenSearch", - "OpenSearchServerless", - "OpsWorks", - "OpsWorksCM", - "Organizations", - "Outposts", - "PI", - "Panorama", - "Personalize", - "PersonalizeEvents", - "PersonalizeRuntime", - "Pinpoint", - "PinpointEmail", - "PinpointSMSVoice", - "PinpointSMSVoiceV2", - "Pipes", - "Polly", - "Pricing", - "PrivateNetworks", - "Proton", - "QLDB", - "QLDBSession", - "QuickSight", - "RAM", - "RDS", - "RDSDataService", - "RUM", - "Rbin", - "Redshift", - "RedshiftData", - "RedshiftServerless", - "Rekognition", - "Resiliencehub", - "ResourceExplorer2", - "ResourceGroups", - "ResourceGroupsTaggingAPI", - "RoboMaker", - "RolesAnywhere", - "Route53", - "Route53Domains", - "Route53RecoveryCluster", - "Route53RecoveryControlConfig", - "Route53RecoveryReadiness", - "Route53Resolver", - "S3", - "S3Control", - "S3Outposts", - "SES", - "SESV2", - "SMS", - "SNS", - "SQS", - "SSM", - "SSMContacts", - "SSMIncidents", - "SSO", - "SSOAdmin", - "SSOOIDC", - "STS", - "SWF", - "SageMaker", - "SageMakerFeatureStoreRuntime", - "SageMakerGeospatial", - "SageMakerMetrics", - "SageMakerRuntime", - "SagemakerEdge", - "SavingsPlans", - "Scheduler", - "Schemas", - "SecretsManager", - "SecurityHub", - "SecurityLake", - "ServerlessApplicationRepository", - "ServiceCatalog", - "ServiceCatalogAppRegistry", - "ServiceDiscovery", - "ServiceQuotas", - "Shield", - "Signer", - "SimSpaceWeaver", - "SnowDeviceManagement", - "Snowball", - "SsmSap", - "StepFunctions", - "StorageGateway", - "Support", - "SupportApp", - "Synthetics", - "Textract", - "TimestreamQuery", - "TimestreamWrite", - "TranscribeService", - "Transfer", - "Translate", - "VoiceID", - "WAF", - "WAFRegional", - "WAFV2", - "WellArchitected", - "Wisdom", - "WorkDocs", - "WorkLink", - "WorkMail", - "WorkMailMessageFlow", - "WorkSpaces", - "WorkSpacesWeb", - "XRay" - ]; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts -var CLIENT_PACKAGE_NAMES_MAP; -var init_client_package_names_map = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { - "use strict"; - init_client_names(); - CLIENT_PACKAGE_NAMES_MAP = { - ...CLIENT_NAMES.reduce( - (acc, name) => ({ - ...acc, - [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") - }), - {} - ), - AccessAnalyzer: "client-accessanalyzer", - ACMPCA: "client-acm-pca", - APIGateway: "client-api-gateway", - ApiGatewayManagementApi: "client-apigatewaymanagementapi", - ApiGatewayV2: "client-apigatewayv2", - AppConfig: "client-appconfig", - AppConfigData: "client-appconfigdata", - AppIntegrations: "client-appintegrations", - AppRunner: "client-apprunner", - AppStream: "client-appstream", - AppSync: "client-appsync", - ApplicationCostProfiler: "client-applicationcostprofiler", - ARCZonalShift: "client-arc-zonal-shift", - AugmentedAIRuntime: "client-sage-maker-a2iruntime", - AuditManager: "client-auditmanager", - BackupStorage: "client-backupstorage", - CUR: "client-cost-and-usage-report-service", - CloudHSMV2: "client-cloudhsm-v2", - CodeGuruProfiler: "client-codeguruprofiler", - CodeStarconnections: "client-codestar-connections", - CognitoIdentityServiceProvider: "client-cognito-identity-provider", - ComprehendMedical: "client-comprehendmedical", - ConnectContactLens: "client-connect-contact-lens", - ControlTower: "client-controltower", - DMS: "client-database-migration-service", - DataPipeline: "client-data-pipeline", - Discovery: "client-application-discovery-service", - DevOpsGuru: "client-devops-guru", - DynamoDB: "client-dynamodb", - DynamoDBStreams: "client-dynamodb-streams", - DocDB: "client-docdb", - DocDBElastic: "client-docdb-elastic", - EC2InstanceConnect: "client-ec2-instance-connect", - ECRPUBLIC: "client-ecr-public", - ELB: "client-elastic-load-balancing", - ELBv2: "client-elastic-load-balancing-v2", - ElastiCache: "client-elasticache", - EMRcontainers: "client-emr-containers", - EMRServerless: "client-emr-serverless", - ES: "client-elasticsearch-service", - EventBridge: "client-eventbridge", - Finspacedata: "client-finspace-data", - ForecastQueryService: "client-forecastquery", - ForecastService: "client-forecast", - FraudDetector: "client-frauddetector", - GameLift: "client-gamelift", - GameSparks: "client-gamesparks", - GreengrassV2: "client-greengrassv2", - GroundStation: "client-groundstation", - GuardDuty: "client-guardduty", - HealthLake: "client-healthlake", - IdentityStore: "client-identitystore", - IoTAnalytics: "client-iotanalytics", - IotData: "client-iot-data-plane", - IotDeviceAdvisor: "client-iotdeviceadvisor", - IoTSecureTunneling: "client-iotsecuretunneling", - IoTSiteWise: "client-iotsitewise", - IoTThingsGraph: "client-iotthingsgraph", - IoTTwinMaker: "client-iottwinmaker", - IoTRoboRunner: "client-iot-roborunner", - KafkaConnect: "client-kafkaconnect", - KinesisVideoSignalingChannels: "client-kinesis-video-signaling", - KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", - LakeFormation: "client-lakeformation", - LexRuntime: "client-lex-runtime-service", - ManagedBlockchain: "client-managedblockchain", - MigrationHubConfig: "client-migrationhub-config", - MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", - NetworkManager: "client-networkmanager", - OpenSearch: "client-opensearch", - OpenSearchServerless: "client-opensearchserverless", - OpsWorks: "client-opsworks", - OpsWorksCM: "client-opsworkscm", - PrivateNetworks: "client-privatenetworks", - QLDBSession: "client-qldb-session", - QuickSight: "client-quicksight", - ResourceExplorer2: "client-resource-explorer-2", - RDSDataService: "client-rds-data", - RoboMaker: "client-robomaker", - RolesAnywhere: "client-rolesanywhere", - Route53: "client-route-53", - Route53Domains: "client-route-53-domains", - Route53Resolver: "client-route53resolver", - S3Control: "client-s3-control", - SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", - SavingsPlans: "client-savingsplans", - SecurityHub: "client-securityhub", - ServerlessApplicationRepository: "client-serverlessapplicationrepository", - ServiceCatalogAppRegistry: "client-service-catalog-appregistry", - ServiceDiscovery: "client-servicediscovery", - SimSpaceWeaver: "client-simspaceweaver", - SSMContacts: "client-ssm-contacts", - SSMIncidents: "client-ssm-incidents", - SSOAdmin: "client-sso-admin", - SSOOIDC: "client-sso-oidc", - StepFunctions: "client-sfn", - TranscribeService: "client-transcribe", - WAFRegional: "client-waf-regional", - WellArchitected: "client-wellarchitected", - WorkMailMessageFlow: "client-workmailmessageflow" - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts -var get_v3_client_package_name_exports = {}; -__export(get_v3_client_package_name_exports, { - getV3ClientPackageName: () => getV3ClientPackageName -}); -var getV3ClientPackageName; -var init_get_v3_client_package_name = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { - "use strict"; - init_client_package_names_map(); - getV3ClientPackageName = (clientName) => { - if (clientName in CLIENT_PACKAGE_NAMES_MAP) { - return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; - } - throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts -var find_client_constructor_exports = {}; -__export(find_client_constructor_exports, { - findV3ClientConstructor: () => findV3ClientConstructor -}); -function findV3ClientConstructor(pkg) { - const [_clientName, ServiceClient] = Object.entries(pkg).find( - ([name]) => { - return name.endsWith("Client") && name !== "__Client"; - } - ); - return ServiceClient; -} -var init_find_client_constructor = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { - "use strict"; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js -var require_lib = __commonJS({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; - var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); - Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { - return get_v3_client_package_name_1.getV3ClientPackageName; - } }); - var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); - Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { - return find_client_constructor_1.findV3ClientConstructor; - } }); - } -}); - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var aws_sdk_v3_handler_exports = {}; -__export(aws_sdk_v3_handler_exports, { - forceSdkInstallation: () => forceSdkInstallation, - handler: () => handler -}); -module.exports = __toCommonJS(aws_sdk_v3_handler_exports); -var import_child_process = require("child_process"); -var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); - -// custom-resources/lib/aws-custom-resource/runtime/shared.ts -var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; -function flatten(object) { - return Object.assign( - {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) - ); -} -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -function filterKeys(object, pred) { - return Object.entries(object).reduce( - (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, - {} - ); -} -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data - }); - console.log("Responding", responseBody); - const parsedUrl = require("url").parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { - "content-type": "", - "content-length": Buffer.byteLength(responseBody, "utf8") - } - }; - return new Promise((resolve, reject) => { - try { - const request = require("https").request(requestOptions, resolve); - request.on("error", reject); - request.write(responseBody); - request.end(); - } catch (e) { - reject(e); - } - }); -} -function decodeCall(call) { - if (!call) { - return void 0; - } - return JSON.parse(call); -} -function startsWithOneOf(searchStrings) { - return function(string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var installedSdk = {}; -function forceSdkInstallation() { - installedSdk = {}; -} -function installLatestSdk(packageName) { - console.log(`Installing latest AWS SDK v3: ${packageName}`); - (0, import_child_process.execSync)( - `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` - ); - installedSdk = { - ...installedSdk, - [packageName]: true - }; -} -async function loadAwsSdk(packageName, installLatestAwsSdk) { - let awsSdk; - try { - if (!installedSdk[packageName] && installLatestAwsSdk === "true") { - try { - installLatestSdk(packageName); - awsSdk = require(`/tmp/node_modules/${packageName}`); - } catch (e) { - console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); - return require(packageName); - } - } else if (installedSdk[packageName]) { - awsSdk = require(`/tmp/node_modules/${packageName}`); - } else { - awsSdk = require(packageName); - } - } catch (error) { - throw Error(`Package ${packageName} does not exist.`); - } - return awsSdk; -} -async function handler(event, context) { - try { - event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); - event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); - event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); - let data = {}; - let physicalResourceId; - switch (event.RequestType) { - case "Create": - physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; - break; - case "Update": - case "Delete": - physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; - break; - } - const call = event.ResourceProperties[event.RequestType]; - if (call) { - const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); - let awsSdk = loadAwsSdk( - packageName, - event.ResourceProperties.InstallLatestAwsSdk - ); - console.log(JSON.stringify({ ...event, ResponseURL: "..." })); - let credentials; - if (call.assumedRoleArn) { - const timestamp = (/* @__PURE__ */ new Date()).getTime(); - const params = { - RoleArn: call.assumedRoleArn, - RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) - }; - const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); - credentials = fromTemporaryCredentials({ - params - }); - } - awsSdk = await awsSdk; - const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); - const client = new ServiceClient({ - apiVersion: call.apiVersion, - credentials, - region: call.region - }); - const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; - const Command = Object.entries(awsSdk).find( - ([name]) => name.toLowerCase() === commandName.toLowerCase() - )?.[1]; - let flatData = {}; - try { - const response = await client.send( - new Command( - (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} - ) - ); - flatData = { - apiVersion: client.config.apiVersion, - // For test purposes: check if apiVersion was correctly passed. - region: await client.config.region().catch(() => void 0), - // For test purposes: check if region was correctly passed. - ...flatten(response) - }; - let outputPaths; - if (call.outputPath) { - outputPaths = [call.outputPath]; - } else if (call.outputPaths) { - outputPaths = call.outputPaths; - } - if (outputPaths) { - data = filterKeys(flatData, startsWithOneOf(outputPaths)); - } else { - data = flatData; - } - } catch (e) { - const exceptionName = e.name ?? e.constructor.name; - if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { - throw e; - } - } - if (call.physicalResourceId?.responsePath) { - physicalResourceId = flatData[call.physicalResourceId.responsePath]; - } - } - await respond(event, "SUCCESS", "OK", physicalResourceId, data); - } catch (e) { - console.log(e); - await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - forceSdkInstallation, - handler -}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js deleted file mode 100644 index 6c53eaeef8cd1..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -exports.decodeSpecialValues = decodeSpecialValues; -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -exports.filterKeys = filterKeys; -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - // eslint-disable-next-line no-console - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': Buffer.byteLength(responseBody, 'utf8'), - }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -exports.respond = respond; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -exports.decodeCall = decodeCall; -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} -exports.startsWithOneOf = startsWithOneOf; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7Ozs7R0FLRztBQUNILFNBQWdCLE9BQU8sQ0FBQyxNQUFjO0lBQ3BDLE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FDbEIsRUFBRSxFQUNGLEdBQUcsU0FBUyxRQUFRLENBQUMsS0FBVSxFQUFFLE9BQWlCLEVBQUU7UUFDbEQsT0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUM7YUFDbkMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxFQUFFO1lBQ1QsTUFBTSxRQUFRLEdBQUcsTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1lBQ3hGLE9BQU8sT0FBTyxRQUFRLEtBQUssUUFBUSxJQUFJLFFBQVEsS0FBSyxJQUFJO2dCQUN0RCxDQUFDLENBQUMsUUFBUSxDQUFDLFFBQVEsRUFBRSxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQztnQkFDeEMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0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ICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXJlcXVpcmUtaW1wb3J0c1xuICAgICAgY29uc3QgcmVxdWVzdCA9IHJlcXVpcmUoJ2h0dHBzJykucmVxdWVzdChyZXF1ZXN0T3B0aW9ucywgcmVzb2x2ZSk7XG4gICAgICByZXF1ZXN0Lm9uKCdlcnJvcicsIHJlamVjdCk7XG4gICAgICByZXF1ZXN0LndyaXRlKHJlc3BvbnNlQm9keSk7XG4gICAgICByZXF1ZXN0LmVuZCgpO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIHJlamVjdChlKTtcbiAgICB9XG4gIH0pO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZGVjb2RlQ2FsbChjYWxsOiBzdHJpbmcgfCB1bmRlZmluZWQpIHtcbiAgaWYgKCFjYWxsKSB7IHJldHVybiB1bmRlZmluZWQ7IH1cbiAgcmV0dXJuIEpTT04ucGFyc2UoY2FsbCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzdGFydHNXaXRoT25lT2Yoc2VhcmNoU3RyaW5nczogc3RyaW5nW10pOiAoc3RyaW5nOiBzdHJpbmcpID0+IGJvb2xlYW4ge1xuICByZXR1cm4gZnVuY3Rpb24oc3RyaW5nOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgICBmb3IgKGNvbnN0IHNlYXJjaFN0cmluZyBvZiBzZWFyY2hTdHJpbmdzKSB7XG4gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/cdk-integ-opensearch-custom-kms-key.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/cdk-integ-opensearch-custom-kms-key.assets.json index e658964c087f8..6a1ef6e46a9d5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/cdk-integ-opensearch-custom-kms-key.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/cdk-integ-opensearch-custom-kms-key.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "cf6d254bc4102ef4b7aa36d06d8731088f36337c132dfc14b47376b8ff673920": { + "b072c207781a5005869487486f0102e1e46667f0349c3b3123f7b96c86bab019": { "source": { "path": "cdk-integ-opensearch-custom-kms-key.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cf6d254bc4102ef4b7aa36d06d8731088f36337c132dfc14b47376b8ff673920.json", + "objectKey": "b072c207781a5005869487486f0102e1e46667f0349c3b3123f7b96c86bab019.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/cdk-integ-opensearch-custom-kms-key.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/cdk-integ-opensearch-custom-kms-key.template.json index 084fd98d30fb8..93a24757445d4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/cdk-integ-opensearch-custom-kms-key.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/cdk-integ-opensearch-custom-kms-key.template.json @@ -126,7 +126,7 @@ ] ] }, - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "DomainAccessPolicyCustomResourcePolicyE61F1845" @@ -228,7 +228,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/manifest.json index 378cca77158a3..8f2e49a8dbf9a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/cf6d254bc4102ef4b7aa36d06d8731088f36337c132dfc14b47376b8ff673920.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/b072c207781a5005869487486f0102e1e46667f0349c3b3123f7b96c86bab019.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -45,6 +45,12 @@ "data": "Domain66AC69E0" } ], + "/cdk-integ-opensearch-custom-kms-key/Domain/AccessPolicy": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/cdk-integ-opensearch-custom-kms-key/Domain/AccessPolicy/Resource/Default": [ { "type": "aws:cdk:logicalId", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/tree.json index abf3c259aef4d..14c2a416f4c27 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.custom-kms-key.js.snapshot/tree.json @@ -334,7 +334,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js new file mode 100644 index 0000000000000..9f6e97928f257 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -0,0 +1,779 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts +var CLIENT_NAMES; +var init_client_names = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { + "use strict"; + CLIENT_NAMES = [ + "ACM", + "ACMPCA", + "APIGateway", + "ARCZonalShift", + "AccessAnalyzer", + "Account", + "AlexaForBusiness", + "Amp", + "Amplify", + "AmplifyBackend", + "AmplifyUIBuilder", + "ApiGatewayManagementApi", + "ApiGatewayV2", + "AppConfig", + "AppConfigData", + "AppIntegrations", + "AppMesh", + "AppRunner", + "AppStream", + "AppSync", + "Appflow", + "ApplicationAutoScaling", + "ApplicationCostProfiler", + "ApplicationInsights", + "Athena", + "AuditManager", + "AugmentedAIRuntime", + "AutoScaling", + "AutoScalingPlans", + "Backup", + "BackupGateway", + "BackupStorage", + "Batch", + "Billingconductor", + "Braket", + "Budgets", + "CUR", + "Chime", + "ChimeSDKIdentity", + "ChimeSDKMediaPipelines", + "ChimeSDKMeetings", + "ChimeSDKMessaging", + "ChimeSDKVoice", + "Cloud9", + "CloudControl", + "CloudDirectory", + "CloudFormation", + "CloudFront", + "CloudHSM", + "CloudHSMV2", + "CloudSearch", + "CloudSearchDomain", + "CloudTrail", + "CloudWatch", + "CloudWatchEvents", + "CloudWatchLogs", + "CodeArtifact", + "CodeBuild", + "CodeCatalyst", + "CodeCommit", + "CodeDeploy", + "CodeGuruProfiler", + "CodeGuruReviewer", + "CodePipeline", + "CodeStar", + "CodeStarNotifications", + "CodeStarconnections", + "CognitoIdentity", + "CognitoIdentityServiceProvider", + "CognitoSync", + "Comprehend", + "ComprehendMedical", + "ComputeOptimizer", + "ConfigService", + "Connect", + "ConnectCampaigns", + "ConnectCases", + "ConnectContactLens", + "ConnectParticipant", + "ControlTower", + "CostExplorer", + "CustomerProfiles", + "DAX", + "DLM", + "DMS", + "DataBrew", + "DataExchange", + "DataPipeline", + "DataSync", + "Detective", + "DevOpsGuru", + "DeviceFarm", + "DirectConnect", + "DirectoryService", + "Discovery", + "DocDB", + "DocDBElastic", + "Drs", + "DynamoDB", + "DynamoDBStreams", + "EBS", + "EC2", + "EC2InstanceConnect", + "ECR", + "ECRPUBLIC", + "ECS", + "EFS", + "EKS", + "ELB", + "ELBv2", + "EMR", + "EMRServerless", + "EMRcontainers", + "ES", + "ElastiCache", + "ElasticBeanstalk", + "ElasticInference", + "ElasticTranscoder", + "EventBridge", + "Evidently", + "FMS", + "FSx", + "Finspace", + "Finspacedata", + "Firehose", + "Fis", + "ForecastQueryService", + "ForecastService", + "FraudDetector", + "GameLift", + "GameSparks", + "Glacier", + "GlobalAccelerator", + "Glue", + "Grafana", + "Greengrass", + "GreengrassV2", + "GroundStation", + "GuardDuty", + "Health", + "HealthLake", + "Honeycode", + "IAM", + "IVS", + "IdentityStore", + "Imagebuilder", + "Inspector", + "Inspector2", + "IoT1ClickDevicesService", + "IoT1ClickProjects", + "IoTAnalytics", + "IoTEvents", + "IoTEventsData", + "IoTFleetHub", + "IoTFleetWise", + "IoTJobsDataPlane", + "IoTRoboRunner", + "IoTSecureTunneling", + "IoTSiteWise", + "IoTThingsGraph", + "IoTTwinMaker", + "IoTWireless", + "Iot", + "IotData", + "IotDeviceAdvisor", + "Ivschat", + "KMS", + "Kafka", + "KafkaConnect", + "Kendra", + "Keyspaces", + "Kinesis", + "KinesisAnalytics", + "KinesisAnalyticsV2", + "KinesisVideo", + "KinesisVideoArchivedMedia", + "KinesisVideoMedia", + "KinesisVideoSignalingChannels", + "KinesisVideoWebRTCStorage", + "LakeFormation", + "Lambda", + "LexModelBuildingService", + "LexModelsV2", + "LexRuntime", + "LexRuntimeV2", + "LicenseManager", + "LicenseManagerLinuxSubscriptions", + "LicenseManagerUserSubscriptions", + "Lightsail", + "Location", + "LookoutEquipment", + "LookoutMetrics", + "LookoutVision", + "M2", + "MQ", + "MTurk", + "MWAA", + "MachineLearning", + "Macie", + "Macie2", + "ManagedBlockchain", + "MarketplaceCatalog", + "MarketplaceCommerceAnalytics", + "MarketplaceEntitlementService", + "MarketplaceMetering", + "MediaConnect", + "MediaConvert", + "MediaLive", + "MediaPackage", + "MediaPackageVod", + "MediaStore", + "MediaStoreData", + "MediaTailor", + "MemoryDB", + "Mgn", + "MigrationHub", + "MigrationHubConfig", + "MigrationHubOrchestrator", + "MigrationHubRefactorSpaces", + "MigrationHubStrategy", + "Mobile", + "Neptune", + "NetworkFirewall", + "NetworkManager", + "Nimble", + "OAM", + "Omics", + "OpenSearch", + "OpenSearchServerless", + "OpsWorks", + "OpsWorksCM", + "Organizations", + "Outposts", + "PI", + "Panorama", + "Personalize", + "PersonalizeEvents", + "PersonalizeRuntime", + "Pinpoint", + "PinpointEmail", + "PinpointSMSVoice", + "PinpointSMSVoiceV2", + "Pipes", + "Polly", + "Pricing", + "PrivateNetworks", + "Proton", + "QLDB", + "QLDBSession", + "QuickSight", + "RAM", + "RDS", + "RDSDataService", + "RUM", + "Rbin", + "Redshift", + "RedshiftData", + "RedshiftServerless", + "Rekognition", + "Resiliencehub", + "ResourceExplorer2", + "ResourceGroups", + "ResourceGroupsTaggingAPI", + "RoboMaker", + "RolesAnywhere", + "Route53", + "Route53Domains", + "Route53RecoveryCluster", + "Route53RecoveryControlConfig", + "Route53RecoveryReadiness", + "Route53Resolver", + "S3", + "S3Control", + "S3Outposts", + "SES", + "SESV2", + "SMS", + "SNS", + "SQS", + "SSM", + "SSMContacts", + "SSMIncidents", + "SSO", + "SSOAdmin", + "SSOOIDC", + "STS", + "SWF", + "SageMaker", + "SageMakerFeatureStoreRuntime", + "SageMakerGeospatial", + "SageMakerMetrics", + "SageMakerRuntime", + "SagemakerEdge", + "SavingsPlans", + "Scheduler", + "Schemas", + "SecretsManager", + "SecurityHub", + "SecurityLake", + "ServerlessApplicationRepository", + "ServiceCatalog", + "ServiceCatalogAppRegistry", + "ServiceDiscovery", + "ServiceQuotas", + "Shield", + "Signer", + "SimSpaceWeaver", + "SnowDeviceManagement", + "Snowball", + "SsmSap", + "StepFunctions", + "StorageGateway", + "Support", + "SupportApp", + "Synthetics", + "Textract", + "TimestreamQuery", + "TimestreamWrite", + "TranscribeService", + "Transfer", + "Translate", + "VoiceID", + "WAF", + "WAFRegional", + "WAFV2", + "WellArchitected", + "Wisdom", + "WorkDocs", + "WorkLink", + "WorkMail", + "WorkMailMessageFlow", + "WorkSpaces", + "WorkSpacesWeb", + "XRay" + ]; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts +var CLIENT_PACKAGE_NAMES_MAP; +var init_client_package_names_map = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { + "use strict"; + init_client_names(); + CLIENT_PACKAGE_NAMES_MAP = { + ...CLIENT_NAMES.reduce( + (acc, name) => ({ + ...acc, + [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") + }), + {} + ), + AccessAnalyzer: "client-accessanalyzer", + ACMPCA: "client-acm-pca", + APIGateway: "client-api-gateway", + ApiGatewayManagementApi: "client-apigatewaymanagementapi", + ApiGatewayV2: "client-apigatewayv2", + AppConfig: "client-appconfig", + AppConfigData: "client-appconfigdata", + AppIntegrations: "client-appintegrations", + AppRunner: "client-apprunner", + AppStream: "client-appstream", + AppSync: "client-appsync", + ApplicationCostProfiler: "client-applicationcostprofiler", + ARCZonalShift: "client-arc-zonal-shift", + AugmentedAIRuntime: "client-sage-maker-a2iruntime", + AuditManager: "client-auditmanager", + BackupStorage: "client-backupstorage", + CUR: "client-cost-and-usage-report-service", + CloudHSMV2: "client-cloudhsm-v2", + CodeGuruProfiler: "client-codeguruprofiler", + CodeStarconnections: "client-codestar-connections", + CognitoIdentityServiceProvider: "client-cognito-identity-provider", + ComprehendMedical: "client-comprehendmedical", + ConnectContactLens: "client-connect-contact-lens", + ControlTower: "client-controltower", + DMS: "client-database-migration-service", + DataPipeline: "client-data-pipeline", + Discovery: "client-application-discovery-service", + DevOpsGuru: "client-devops-guru", + DynamoDB: "client-dynamodb", + DynamoDBStreams: "client-dynamodb-streams", + DocDB: "client-docdb", + DocDBElastic: "client-docdb-elastic", + EC2InstanceConnect: "client-ec2-instance-connect", + ECRPUBLIC: "client-ecr-public", + ELB: "client-elastic-load-balancing", + ELBv2: "client-elastic-load-balancing-v2", + ElastiCache: "client-elasticache", + EMRcontainers: "client-emr-containers", + EMRServerless: "client-emr-serverless", + ES: "client-elasticsearch-service", + EventBridge: "client-eventbridge", + Finspacedata: "client-finspace-data", + ForecastQueryService: "client-forecastquery", + ForecastService: "client-forecast", + FraudDetector: "client-frauddetector", + GameLift: "client-gamelift", + GameSparks: "client-gamesparks", + GreengrassV2: "client-greengrassv2", + GroundStation: "client-groundstation", + GuardDuty: "client-guardduty", + HealthLake: "client-healthlake", + IdentityStore: "client-identitystore", + IoTAnalytics: "client-iotanalytics", + IotData: "client-iot-data-plane", + IotDeviceAdvisor: "client-iotdeviceadvisor", + IoTSecureTunneling: "client-iotsecuretunneling", + IoTSiteWise: "client-iotsitewise", + IoTThingsGraph: "client-iotthingsgraph", + IoTTwinMaker: "client-iottwinmaker", + IoTRoboRunner: "client-iot-roborunner", + KafkaConnect: "client-kafkaconnect", + KinesisVideoSignalingChannels: "client-kinesis-video-signaling", + KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", + LakeFormation: "client-lakeformation", + LexRuntime: "client-lex-runtime-service", + ManagedBlockchain: "client-managedblockchain", + MigrationHubConfig: "client-migrationhub-config", + MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", + NetworkManager: "client-networkmanager", + OpenSearch: "client-opensearch", + OpenSearchServerless: "client-opensearchserverless", + OpsWorks: "client-opsworks", + OpsWorksCM: "client-opsworkscm", + PrivateNetworks: "client-privatenetworks", + QLDBSession: "client-qldb-session", + QuickSight: "client-quicksight", + ResourceExplorer2: "client-resource-explorer-2", + RDSDataService: "client-rds-data", + RoboMaker: "client-robomaker", + RolesAnywhere: "client-rolesanywhere", + Route53: "client-route-53", + Route53Domains: "client-route-53-domains", + Route53Resolver: "client-route53resolver", + S3Control: "client-s3-control", + SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", + SavingsPlans: "client-savingsplans", + SecurityHub: "client-securityhub", + ServerlessApplicationRepository: "client-serverlessapplicationrepository", + ServiceCatalogAppRegistry: "client-service-catalog-appregistry", + ServiceDiscovery: "client-servicediscovery", + SimSpaceWeaver: "client-simspaceweaver", + SSMContacts: "client-ssm-contacts", + SSMIncidents: "client-ssm-incidents", + SSOAdmin: "client-sso-admin", + SSOOIDC: "client-sso-oidc", + StepFunctions: "client-sfn", + TranscribeService: "client-transcribe", + WAFRegional: "client-waf-regional", + WellArchitected: "client-wellarchitected", + WorkMailMessageFlow: "client-workmailmessageflow" + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts +var get_v3_client_package_name_exports = {}; +__export(get_v3_client_package_name_exports, { + getV3ClientPackageName: () => getV3ClientPackageName +}); +var getV3ClientPackageName; +var init_get_v3_client_package_name = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { + "use strict"; + init_client_package_names_map(); + getV3ClientPackageName = (clientName) => { + if (clientName in CLIENT_PACKAGE_NAMES_MAP) { + return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; + } + throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts +var find_client_constructor_exports = {}; +__export(find_client_constructor_exports, { + findV3ClientConstructor: () => findV3ClientConstructor +}); +function findV3ClientConstructor(pkg) { + const [_clientName, ServiceClient] = Object.entries(pkg).find( + ([name]) => { + return name.endsWith("Client") && name !== "__Client"; + } + ); + return ServiceClient; +} +var init_find_client_constructor = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { + "use strict"; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js +var require_lib = __commonJS({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; + var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); + Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { + return get_v3_client_package_name_1.getV3ClientPackageName; + } }); + var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); + Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { + return find_client_constructor_1.findV3ClientConstructor; + } }); + } +}); + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var aws_sdk_v3_handler_exports = {}; +__export(aws_sdk_v3_handler_exports, { + forceSdkInstallation: () => forceSdkInstallation, + handler: () => handler +}); +module.exports = __toCommonJS(aws_sdk_v3_handler_exports); +var import_child_process = require("child_process"); +var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); + +// custom-resources/lib/aws-custom-resource/runtime/shared.ts +var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } + return Object.assign( + {}, + ..._flatten(object) + ); +} +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +function filterKeys(object, pred) { + return Object.entries(object).reduce( + (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, + {} + ); +} +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data + }); + console.log("Responding", responseBody); + const parsedUrl = require("url").parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { + "content-type": "", + "content-length": Buffer.byteLength(responseBody, "utf8") + } + }; + return new Promise((resolve, reject) => { + try { + const request = require("https").request(requestOptions, resolve); + request.on("error", reject); + request.write(responseBody); + request.end(); + } catch (e) { + reject(e); + } + }); +} +function decodeCall(call) { + if (!call) { + return void 0; + } + return JSON.parse(call); +} +function startsWithOneOf(searchStrings) { + return function(string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var installedSdk = {}; +function forceSdkInstallation() { + installedSdk = {}; +} +function installLatestSdk(packageName) { + console.log(`Installing latest AWS SDK v3: ${packageName}`); + (0, import_child_process.execSync)( + `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` + ); + installedSdk = { + ...installedSdk, + [packageName]: true + }; +} +async function loadAwsSdk(packageName, installLatestAwsSdk) { + let awsSdk; + try { + if (!installedSdk[packageName] && installLatestAwsSdk === "true") { + try { + installLatestSdk(packageName); + awsSdk = require(`/tmp/node_modules/${packageName}`); + } catch (e) { + console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); + return require(packageName); + } + } else if (installedSdk[packageName]) { + awsSdk = require(`/tmp/node_modules/${packageName}`); + } else { + awsSdk = require(packageName); + } + } catch (error) { + throw Error(`Package ${packageName} does not exist.`); + } + return awsSdk; +} +async function handler(event, context) { + try { + event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); + event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); + event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); + let data = {}; + let physicalResourceId; + switch (event.RequestType) { + case "Create": + physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; + break; + case "Update": + case "Delete": + physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; + break; + } + const call = event.ResourceProperties[event.RequestType]; + if (call) { + const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); + let awsSdk = loadAwsSdk( + packageName, + event.ResourceProperties.InstallLatestAwsSdk + ); + console.log(JSON.stringify({ ...event, ResponseURL: "..." })); + let credentials; + if (call.assumedRoleArn) { + const timestamp = (/* @__PURE__ */ new Date()).getTime(); + const params = { + RoleArn: call.assumedRoleArn, + RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) + }; + const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); + credentials = fromTemporaryCredentials({ + params + }); + } + awsSdk = await awsSdk; + const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); + const client = new ServiceClient({ + apiVersion: call.apiVersion, + credentials, + region: call.region + }); + const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; + const Command = Object.entries(awsSdk).find( + ([name]) => name.toLowerCase() === commandName.toLowerCase() + )?.[1]; + let flatData = {}; + try { + const response = await client.send( + new Command( + (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} + ) + ); + flatData = { + apiVersion: client.config.apiVersion, + // For test purposes: check if apiVersion was correctly passed. + region: await client.config.region().catch(() => void 0), + // For test purposes: check if region was correctly passed. + ...flatten(response) + }; + let outputPaths; + if (call.outputPath) { + outputPaths = [call.outputPath]; + } else if (call.outputPaths) { + outputPaths = call.outputPaths; + } + if (outputPaths) { + data = filterKeys(flatData, startsWithOneOf(outputPaths)); + } else { + data = flatData; + } + } catch (e) { + const exceptionName = e.name ?? e.constructor.name; + if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { + throw e; + } + } + if (call.physicalResourceId?.responsePath) { + physicalResourceId = flatData[call.physicalResourceId.responsePath]; + } + } + await respond(event, "SUCCESS", "OK", physicalResourceId, data); + } catch (e) { + console.log(e); + await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + forceSdkInstallation, + handler +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +exports.startsWithOneOf = startsWithOneOf; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7R0FFRztBQUNILE1BQU0sT0FBTyxHQUFHLElBQUksV0FBVyxFQUFFLENBQUM7QUFFbEM7O0dBRUc7QUFDSCxTQUFTLFVBQVUsQ0FBQyxLQUFVO0lBQzVCLElBQUksTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsRUFBRTtRQUMxQixPQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsTUFBTS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vciAoY29uc3Qgc2VhcmNoU3RyaW5nIG9mIHNlYXJjaFN0cmluZ3MpIHtcbiAgICAgIGlmIChzdHJpbmcuc3RhcnRzV2l0aChzZWFyY2hTdHJpbmcpKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js deleted file mode 100644 index 1b662725f1b0b..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js +++ /dev/null @@ -1,769 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts -var CLIENT_NAMES; -var init_client_names = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { - "use strict"; - CLIENT_NAMES = [ - "ACM", - "ACMPCA", - "APIGateway", - "ARCZonalShift", - "AccessAnalyzer", - "Account", - "AlexaForBusiness", - "Amp", - "Amplify", - "AmplifyBackend", - "AmplifyUIBuilder", - "ApiGatewayManagementApi", - "ApiGatewayV2", - "AppConfig", - "AppConfigData", - "AppIntegrations", - "AppMesh", - "AppRunner", - "AppStream", - "AppSync", - "Appflow", - "ApplicationAutoScaling", - "ApplicationCostProfiler", - "ApplicationInsights", - "Athena", - "AuditManager", - "AugmentedAIRuntime", - "AutoScaling", - "AutoScalingPlans", - "Backup", - "BackupGateway", - "BackupStorage", - "Batch", - "Billingconductor", - "Braket", - "Budgets", - "CUR", - "Chime", - "ChimeSDKIdentity", - "ChimeSDKMediaPipelines", - "ChimeSDKMeetings", - "ChimeSDKMessaging", - "ChimeSDKVoice", - "Cloud9", - "CloudControl", - "CloudDirectory", - "CloudFormation", - "CloudFront", - "CloudHSM", - "CloudHSMV2", - "CloudSearch", - "CloudSearchDomain", - "CloudTrail", - "CloudWatch", - "CloudWatchEvents", - "CloudWatchLogs", - "CodeArtifact", - "CodeBuild", - "CodeCatalyst", - "CodeCommit", - "CodeDeploy", - "CodeGuruProfiler", - "CodeGuruReviewer", - "CodePipeline", - "CodeStar", - "CodeStarNotifications", - "CodeStarconnections", - "CognitoIdentity", - "CognitoIdentityServiceProvider", - "CognitoSync", - "Comprehend", - "ComprehendMedical", - "ComputeOptimizer", - "ConfigService", - "Connect", - "ConnectCampaigns", - "ConnectCases", - "ConnectContactLens", - "ConnectParticipant", - "ControlTower", - "CostExplorer", - "CustomerProfiles", - "DAX", - "DLM", - "DMS", - "DataBrew", - "DataExchange", - "DataPipeline", - "DataSync", - "Detective", - "DevOpsGuru", - "DeviceFarm", - "DirectConnect", - "DirectoryService", - "Discovery", - "DocDB", - "DocDBElastic", - "Drs", - "DynamoDB", - "DynamoDBStreams", - "EBS", - "EC2", - "EC2InstanceConnect", - "ECR", - "ECRPUBLIC", - "ECS", - "EFS", - "EKS", - "ELB", - "ELBv2", - "EMR", - "EMRServerless", - "EMRcontainers", - "ES", - "ElastiCache", - "ElasticBeanstalk", - "ElasticInference", - "ElasticTranscoder", - "EventBridge", - "Evidently", - "FMS", - "FSx", - "Finspace", - "Finspacedata", - "Firehose", - "Fis", - "ForecastQueryService", - "ForecastService", - "FraudDetector", - "GameLift", - "GameSparks", - "Glacier", - "GlobalAccelerator", - "Glue", - "Grafana", - "Greengrass", - "GreengrassV2", - "GroundStation", - "GuardDuty", - "Health", - "HealthLake", - "Honeycode", - "IAM", - "IVS", - "IdentityStore", - "Imagebuilder", - "Inspector", - "Inspector2", - "IoT1ClickDevicesService", - "IoT1ClickProjects", - "IoTAnalytics", - "IoTEvents", - "IoTEventsData", - "IoTFleetHub", - "IoTFleetWise", - "IoTJobsDataPlane", - "IoTRoboRunner", - "IoTSecureTunneling", - "IoTSiteWise", - "IoTThingsGraph", - "IoTTwinMaker", - "IoTWireless", - "Iot", - "IotData", - "IotDeviceAdvisor", - "Ivschat", - "KMS", - "Kafka", - "KafkaConnect", - "Kendra", - "Keyspaces", - "Kinesis", - "KinesisAnalytics", - "KinesisAnalyticsV2", - "KinesisVideo", - "KinesisVideoArchivedMedia", - "KinesisVideoMedia", - "KinesisVideoSignalingChannels", - "KinesisVideoWebRTCStorage", - "LakeFormation", - "Lambda", - "LexModelBuildingService", - "LexModelsV2", - "LexRuntime", - "LexRuntimeV2", - "LicenseManager", - "LicenseManagerLinuxSubscriptions", - "LicenseManagerUserSubscriptions", - "Lightsail", - "Location", - "LookoutEquipment", - "LookoutMetrics", - "LookoutVision", - "M2", - "MQ", - "MTurk", - "MWAA", - "MachineLearning", - "Macie", - "Macie2", - "ManagedBlockchain", - "MarketplaceCatalog", - "MarketplaceCommerceAnalytics", - "MarketplaceEntitlementService", - "MarketplaceMetering", - "MediaConnect", - "MediaConvert", - "MediaLive", - "MediaPackage", - "MediaPackageVod", - "MediaStore", - "MediaStoreData", - "MediaTailor", - "MemoryDB", - "Mgn", - "MigrationHub", - "MigrationHubConfig", - "MigrationHubOrchestrator", - "MigrationHubRefactorSpaces", - "MigrationHubStrategy", - "Mobile", - "Neptune", - "NetworkFirewall", - "NetworkManager", - "Nimble", - "OAM", - "Omics", - "OpenSearch", - "OpenSearchServerless", - "OpsWorks", - "OpsWorksCM", - "Organizations", - "Outposts", - "PI", - "Panorama", - "Personalize", - "PersonalizeEvents", - "PersonalizeRuntime", - "Pinpoint", - "PinpointEmail", - "PinpointSMSVoice", - "PinpointSMSVoiceV2", - "Pipes", - "Polly", - "Pricing", - "PrivateNetworks", - "Proton", - "QLDB", - "QLDBSession", - "QuickSight", - "RAM", - "RDS", - "RDSDataService", - "RUM", - "Rbin", - "Redshift", - "RedshiftData", - "RedshiftServerless", - "Rekognition", - "Resiliencehub", - "ResourceExplorer2", - "ResourceGroups", - "ResourceGroupsTaggingAPI", - "RoboMaker", - "RolesAnywhere", - "Route53", - "Route53Domains", - "Route53RecoveryCluster", - "Route53RecoveryControlConfig", - "Route53RecoveryReadiness", - "Route53Resolver", - "S3", - "S3Control", - "S3Outposts", - "SES", - "SESV2", - "SMS", - "SNS", - "SQS", - "SSM", - "SSMContacts", - "SSMIncidents", - "SSO", - "SSOAdmin", - "SSOOIDC", - "STS", - "SWF", - "SageMaker", - "SageMakerFeatureStoreRuntime", - "SageMakerGeospatial", - "SageMakerMetrics", - "SageMakerRuntime", - "SagemakerEdge", - "SavingsPlans", - "Scheduler", - "Schemas", - "SecretsManager", - "SecurityHub", - "SecurityLake", - "ServerlessApplicationRepository", - "ServiceCatalog", - "ServiceCatalogAppRegistry", - "ServiceDiscovery", - "ServiceQuotas", - "Shield", - "Signer", - "SimSpaceWeaver", - "SnowDeviceManagement", - "Snowball", - "SsmSap", - "StepFunctions", - "StorageGateway", - "Support", - "SupportApp", - "Synthetics", - "Textract", - "TimestreamQuery", - "TimestreamWrite", - "TranscribeService", - "Transfer", - "Translate", - "VoiceID", - "WAF", - "WAFRegional", - "WAFV2", - "WellArchitected", - "Wisdom", - "WorkDocs", - "WorkLink", - "WorkMail", - "WorkMailMessageFlow", - "WorkSpaces", - "WorkSpacesWeb", - "XRay" - ]; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts -var CLIENT_PACKAGE_NAMES_MAP; -var init_client_package_names_map = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { - "use strict"; - init_client_names(); - CLIENT_PACKAGE_NAMES_MAP = { - ...CLIENT_NAMES.reduce( - (acc, name) => ({ - ...acc, - [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") - }), - {} - ), - AccessAnalyzer: "client-accessanalyzer", - ACMPCA: "client-acm-pca", - APIGateway: "client-api-gateway", - ApiGatewayManagementApi: "client-apigatewaymanagementapi", - ApiGatewayV2: "client-apigatewayv2", - AppConfig: "client-appconfig", - AppConfigData: "client-appconfigdata", - AppIntegrations: "client-appintegrations", - AppRunner: "client-apprunner", - AppStream: "client-appstream", - AppSync: "client-appsync", - ApplicationCostProfiler: "client-applicationcostprofiler", - ARCZonalShift: "client-arc-zonal-shift", - AugmentedAIRuntime: "client-sage-maker-a2iruntime", - AuditManager: "client-auditmanager", - BackupStorage: "client-backupstorage", - CUR: "client-cost-and-usage-report-service", - CloudHSMV2: "client-cloudhsm-v2", - CodeGuruProfiler: "client-codeguruprofiler", - CodeStarconnections: "client-codestar-connections", - CognitoIdentityServiceProvider: "client-cognito-identity-provider", - ComprehendMedical: "client-comprehendmedical", - ConnectContactLens: "client-connect-contact-lens", - ControlTower: "client-controltower", - DMS: "client-database-migration-service", - DataPipeline: "client-data-pipeline", - Discovery: "client-application-discovery-service", - DevOpsGuru: "client-devops-guru", - DynamoDB: "client-dynamodb", - DynamoDBStreams: "client-dynamodb-streams", - DocDB: "client-docdb", - DocDBElastic: "client-docdb-elastic", - EC2InstanceConnect: "client-ec2-instance-connect", - ECRPUBLIC: "client-ecr-public", - ELB: "client-elastic-load-balancing", - ELBv2: "client-elastic-load-balancing-v2", - ElastiCache: "client-elasticache", - EMRcontainers: "client-emr-containers", - EMRServerless: "client-emr-serverless", - ES: "client-elasticsearch-service", - EventBridge: "client-eventbridge", - Finspacedata: "client-finspace-data", - ForecastQueryService: "client-forecastquery", - ForecastService: "client-forecast", - FraudDetector: "client-frauddetector", - GameLift: "client-gamelift", - GameSparks: "client-gamesparks", - GreengrassV2: "client-greengrassv2", - GroundStation: "client-groundstation", - GuardDuty: "client-guardduty", - HealthLake: "client-healthlake", - IdentityStore: "client-identitystore", - IoTAnalytics: "client-iotanalytics", - IotData: "client-iot-data-plane", - IotDeviceAdvisor: "client-iotdeviceadvisor", - IoTSecureTunneling: "client-iotsecuretunneling", - IoTSiteWise: "client-iotsitewise", - IoTThingsGraph: "client-iotthingsgraph", - IoTTwinMaker: "client-iottwinmaker", - IoTRoboRunner: "client-iot-roborunner", - KafkaConnect: "client-kafkaconnect", - KinesisVideoSignalingChannels: "client-kinesis-video-signaling", - KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", - LakeFormation: "client-lakeformation", - LexRuntime: "client-lex-runtime-service", - ManagedBlockchain: "client-managedblockchain", - MigrationHubConfig: "client-migrationhub-config", - MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", - NetworkManager: "client-networkmanager", - OpenSearch: "client-opensearch", - OpenSearchServerless: "client-opensearchserverless", - OpsWorks: "client-opsworks", - OpsWorksCM: "client-opsworkscm", - PrivateNetworks: "client-privatenetworks", - QLDBSession: "client-qldb-session", - QuickSight: "client-quicksight", - ResourceExplorer2: "client-resource-explorer-2", - RDSDataService: "client-rds-data", - RoboMaker: "client-robomaker", - RolesAnywhere: "client-rolesanywhere", - Route53: "client-route-53", - Route53Domains: "client-route-53-domains", - Route53Resolver: "client-route53resolver", - S3Control: "client-s3-control", - SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", - SavingsPlans: "client-savingsplans", - SecurityHub: "client-securityhub", - ServerlessApplicationRepository: "client-serverlessapplicationrepository", - ServiceCatalogAppRegistry: "client-service-catalog-appregistry", - ServiceDiscovery: "client-servicediscovery", - SimSpaceWeaver: "client-simspaceweaver", - SSMContacts: "client-ssm-contacts", - SSMIncidents: "client-ssm-incidents", - SSOAdmin: "client-sso-admin", - SSOOIDC: "client-sso-oidc", - StepFunctions: "client-sfn", - TranscribeService: "client-transcribe", - WAFRegional: "client-waf-regional", - WellArchitected: "client-wellarchitected", - WorkMailMessageFlow: "client-workmailmessageflow" - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts -var get_v3_client_package_name_exports = {}; -__export(get_v3_client_package_name_exports, { - getV3ClientPackageName: () => getV3ClientPackageName -}); -var getV3ClientPackageName; -var init_get_v3_client_package_name = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { - "use strict"; - init_client_package_names_map(); - getV3ClientPackageName = (clientName) => { - if (clientName in CLIENT_PACKAGE_NAMES_MAP) { - return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; - } - throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts -var find_client_constructor_exports = {}; -__export(find_client_constructor_exports, { - findV3ClientConstructor: () => findV3ClientConstructor -}); -function findV3ClientConstructor(pkg) { - const [_clientName, ServiceClient] = Object.entries(pkg).find( - ([name]) => { - return name.endsWith("Client") && name !== "__Client"; - } - ); - return ServiceClient; -} -var init_find_client_constructor = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { - "use strict"; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js -var require_lib = __commonJS({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; - var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); - Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { - return get_v3_client_package_name_1.getV3ClientPackageName; - } }); - var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); - Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { - return find_client_constructor_1.findV3ClientConstructor; - } }); - } -}); - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var aws_sdk_v3_handler_exports = {}; -__export(aws_sdk_v3_handler_exports, { - forceSdkInstallation: () => forceSdkInstallation, - handler: () => handler -}); -module.exports = __toCommonJS(aws_sdk_v3_handler_exports); -var import_child_process = require("child_process"); -var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); - -// custom-resources/lib/aws-custom-resource/runtime/shared.ts -var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; -function flatten(object) { - return Object.assign( - {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) - ); -} -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -function filterKeys(object, pred) { - return Object.entries(object).reduce( - (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, - {} - ); -} -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data - }); - console.log("Responding", responseBody); - const parsedUrl = require("url").parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { - "content-type": "", - "content-length": Buffer.byteLength(responseBody, "utf8") - } - }; - return new Promise((resolve, reject) => { - try { - const request = require("https").request(requestOptions, resolve); - request.on("error", reject); - request.write(responseBody); - request.end(); - } catch (e) { - reject(e); - } - }); -} -function decodeCall(call) { - if (!call) { - return void 0; - } - return JSON.parse(call); -} -function startsWithOneOf(searchStrings) { - return function(string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var installedSdk = {}; -function forceSdkInstallation() { - installedSdk = {}; -} -function installLatestSdk(packageName) { - console.log(`Installing latest AWS SDK v3: ${packageName}`); - (0, import_child_process.execSync)( - `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` - ); - installedSdk = { - ...installedSdk, - [packageName]: true - }; -} -async function loadAwsSdk(packageName, installLatestAwsSdk) { - let awsSdk; - try { - if (!installedSdk[packageName] && installLatestAwsSdk === "true") { - try { - installLatestSdk(packageName); - awsSdk = require(`/tmp/node_modules/${packageName}`); - } catch (e) { - console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); - return require(packageName); - } - } else if (installedSdk[packageName]) { - awsSdk = require(`/tmp/node_modules/${packageName}`); - } else { - awsSdk = require(packageName); - } - } catch (error) { - throw Error(`Package ${packageName} does not exist.`); - } - return awsSdk; -} -async function handler(event, context) { - try { - event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); - event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); - event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); - let data = {}; - let physicalResourceId; - switch (event.RequestType) { - case "Create": - physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; - break; - case "Update": - case "Delete": - physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; - break; - } - const call = event.ResourceProperties[event.RequestType]; - if (call) { - const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); - let awsSdk = loadAwsSdk( - packageName, - event.ResourceProperties.InstallLatestAwsSdk - ); - console.log(JSON.stringify({ ...event, ResponseURL: "..." })); - let credentials; - if (call.assumedRoleArn) { - const timestamp = (/* @__PURE__ */ new Date()).getTime(); - const params = { - RoleArn: call.assumedRoleArn, - RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) - }; - const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); - credentials = fromTemporaryCredentials({ - params - }); - } - awsSdk = await awsSdk; - const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); - const client = new ServiceClient({ - apiVersion: call.apiVersion, - credentials, - region: call.region - }); - const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; - const Command = Object.entries(awsSdk).find( - ([name]) => name.toLowerCase() === commandName.toLowerCase() - )?.[1]; - let flatData = {}; - try { - const response = await client.send( - new Command( - (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} - ) - ); - flatData = { - apiVersion: client.config.apiVersion, - // For test purposes: check if apiVersion was correctly passed. - region: await client.config.region().catch(() => void 0), - // For test purposes: check if region was correctly passed. - ...flatten(response) - }; - let outputPaths; - if (call.outputPath) { - outputPaths = [call.outputPath]; - } else if (call.outputPaths) { - outputPaths = call.outputPaths; - } - if (outputPaths) { - data = filterKeys(flatData, startsWithOneOf(outputPaths)); - } else { - data = flatData; - } - } catch (e) { - const exceptionName = e.name ?? e.constructor.name; - if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { - throw e; - } - } - if (call.physicalResourceId?.responsePath) { - physicalResourceId = flatData[call.physicalResourceId.responsePath]; - } - } - await respond(event, "SUCCESS", "OK", physicalResourceId, data); - } catch (e) { - console.log(e); - await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - forceSdkInstallation, - handler -}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js deleted file mode 100644 index 6c53eaeef8cd1..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -exports.decodeSpecialValues = decodeSpecialValues; -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -exports.filterKeys = filterKeys; -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - // eslint-disable-next-line no-console - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': Buffer.byteLength(responseBody, 'utf8'), - }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -exports.respond = respond; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -exports.decodeCall = decodeCall; -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} -exports.startsWithOneOf = startsWithOneOf; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7Ozs7R0FLRztBQUNILFNBQWdCLE9BQU8sQ0FBQyxNQUFjO0lBQ3BDLE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FDbEIsRUFBRSxFQUNGLEdBQUcsU0FBUyxRQUFRLENBQUMsS0FBVSxFQUFFLE9BQWlCLEVBQUU7UUFDbEQsT0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUM7YUFDbkMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxFQUFFO1lBQ1QsTUFBT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2Yoc2VhcmNoU3RyaW5nczogc3RyaW5nW10pOiAoc3RyaW5nOiBzdHJpbmcpID0+IGJvb2xlYW4ge1xuICByZXR1cm4gZnVuY3Rpb24oc3RyaW5nOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgICBmb3IgKGNvbnN0IHNlYXJjaFN0cmluZyBvZiBzZWFyY2hTdHJpbmdzKSB7XG4gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/cdk-integ-opensearch.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/cdk-integ-opensearch.assets.json index a05a46a351204..7344c9b35946f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/cdk-integ-opensearch.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/cdk-integ-opensearch.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "ce6e75bf3cdf510cdcdbfa8a7df2329ae432033c5c58209c24a71caddaa49e4c": { + "4bbcc696b5ac8948a1ae22b870387ba4be60c6381cc91f0beb6d22fa8385dbd0": { "source": { "path": "cdk-integ-opensearch.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ce6e75bf3cdf510cdcdbfa8a7df2329ae432033c5c58209c24a71caddaa49e4c.json", + "objectKey": "4bbcc696b5ac8948a1ae22b870387ba4be60c6381cc91f0beb6d22fa8385dbd0.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/cdk-integ-opensearch.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/cdk-integ-opensearch.template.json index 76da9abc36c86..1aa9c92319c0b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/cdk-integ-opensearch.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/cdk-integ-opensearch.template.json @@ -70,7 +70,7 @@ ] }, "Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"ESLogPolicyc881416c4fcb1ec2b4bf7f47a5cde4097f01ec50fc\"},\"ignoreErrorCodesMatching\":\"ResourceNotFoundException\"}", - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "Domain1ESLogGroupPolicyc881416c4fcb1ec2b4bf7f47a5cde4097f01ec50fcCustomResourcePolicyBE9BFE5D" @@ -230,7 +230,7 @@ ] ] }, - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "Domain1AccessPolicyCustomResourcePolicy3BA04487" @@ -302,7 +302,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { @@ -388,7 +388,7 @@ ] }, "Delete": "{\"service\":\"CloudWatchLogs\",\"action\":\"deleteResourcePolicy\",\"parameters\":{\"policyName\":\"ESLogPolicyc80140a7754e9c0dd4e81167ef19e15da5b55dca02\"},\"ignoreErrorCodesMatching\":\"ResourceNotFoundException\"}", - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "Domain2ESLogGroupPolicyc80140a7754e9c0dd4e81167ef19e15da5b55dca02CustomResourcePolicy2DB46870" @@ -548,7 +548,7 @@ ] ] }, - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "Domain2AccessPolicyCustomResourcePolicy7C8260FD" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/manifest.json index cdb842dcc7f78..cc01086951771 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ce6e75bf3cdf510cdcdbfa8a7df2329ae432033c5c58209c24a71caddaa49e4c.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/4bbcc696b5ac8948a1ae22b870387ba4be60c6381cc91f0beb6d22fa8385dbd0.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -45,6 +45,12 @@ "data": "Domain1AppLogs6E8D1D67" } ], + "/cdk-integ-opensearch/Domain1/ESLogGroupPolicyc881416c4fcb1ec2b4bf7f47a5cde4097f01ec50fc": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/cdk-integ-opensearch/Domain1/ESLogGroupPolicyc881416c4fcb1ec2b4bf7f47a5cde4097f01ec50fc/Resource/Default": [ { "type": "aws:cdk:logicalId", @@ -63,6 +69,12 @@ "data": "Domain19FCBCB91" } ], + "/cdk-integ-opensearch/Domain1/AccessPolicy": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/cdk-integ-opensearch/Domain1/AccessPolicy/Resource/Default": [ { "type": "aws:cdk:logicalId", @@ -99,6 +111,12 @@ "data": "Domain2AppLogs810876E2" } ], + "/cdk-integ-opensearch/Domain2/ESLogGroupPolicyc80140a7754e9c0dd4e81167ef19e15da5b55dca02": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/cdk-integ-opensearch/Domain2/ESLogGroupPolicyc80140a7754e9c0dd4e81167ef19e15da5b55dca02/Resource/Default": [ { "type": "aws:cdk:logicalId", @@ -117,6 +135,12 @@ "data": "Domain2644FE48C" } ], + "/cdk-integ-opensearch/Domain2/AccessPolicy": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/cdk-integ-opensearch/Domain2/AccessPolicy/Resource/Default": [ { "type": "aws:cdk:logicalId", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/tree.json index ec612b6486cd8..db51f98296ff2 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.js.snapshot/tree.json @@ -394,7 +394,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js new file mode 100644 index 0000000000000..9f6e97928f257 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -0,0 +1,779 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts +var CLIENT_NAMES; +var init_client_names = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { + "use strict"; + CLIENT_NAMES = [ + "ACM", + "ACMPCA", + "APIGateway", + "ARCZonalShift", + "AccessAnalyzer", + "Account", + "AlexaForBusiness", + "Amp", + "Amplify", + "AmplifyBackend", + "AmplifyUIBuilder", + "ApiGatewayManagementApi", + "ApiGatewayV2", + "AppConfig", + "AppConfigData", + "AppIntegrations", + "AppMesh", + "AppRunner", + "AppStream", + "AppSync", + "Appflow", + "ApplicationAutoScaling", + "ApplicationCostProfiler", + "ApplicationInsights", + "Athena", + "AuditManager", + "AugmentedAIRuntime", + "AutoScaling", + "AutoScalingPlans", + "Backup", + "BackupGateway", + "BackupStorage", + "Batch", + "Billingconductor", + "Braket", + "Budgets", + "CUR", + "Chime", + "ChimeSDKIdentity", + "ChimeSDKMediaPipelines", + "ChimeSDKMeetings", + "ChimeSDKMessaging", + "ChimeSDKVoice", + "Cloud9", + "CloudControl", + "CloudDirectory", + "CloudFormation", + "CloudFront", + "CloudHSM", + "CloudHSMV2", + "CloudSearch", + "CloudSearchDomain", + "CloudTrail", + "CloudWatch", + "CloudWatchEvents", + "CloudWatchLogs", + "CodeArtifact", + "CodeBuild", + "CodeCatalyst", + "CodeCommit", + "CodeDeploy", + "CodeGuruProfiler", + "CodeGuruReviewer", + "CodePipeline", + "CodeStar", + "CodeStarNotifications", + "CodeStarconnections", + "CognitoIdentity", + "CognitoIdentityServiceProvider", + "CognitoSync", + "Comprehend", + "ComprehendMedical", + "ComputeOptimizer", + "ConfigService", + "Connect", + "ConnectCampaigns", + "ConnectCases", + "ConnectContactLens", + "ConnectParticipant", + "ControlTower", + "CostExplorer", + "CustomerProfiles", + "DAX", + "DLM", + "DMS", + "DataBrew", + "DataExchange", + "DataPipeline", + "DataSync", + "Detective", + "DevOpsGuru", + "DeviceFarm", + "DirectConnect", + "DirectoryService", + "Discovery", + "DocDB", + "DocDBElastic", + "Drs", + "DynamoDB", + "DynamoDBStreams", + "EBS", + "EC2", + "EC2InstanceConnect", + "ECR", + "ECRPUBLIC", + "ECS", + "EFS", + "EKS", + "ELB", + "ELBv2", + "EMR", + "EMRServerless", + "EMRcontainers", + "ES", + "ElastiCache", + "ElasticBeanstalk", + "ElasticInference", + "ElasticTranscoder", + "EventBridge", + "Evidently", + "FMS", + "FSx", + "Finspace", + "Finspacedata", + "Firehose", + "Fis", + "ForecastQueryService", + "ForecastService", + "FraudDetector", + "GameLift", + "GameSparks", + "Glacier", + "GlobalAccelerator", + "Glue", + "Grafana", + "Greengrass", + "GreengrassV2", + "GroundStation", + "GuardDuty", + "Health", + "HealthLake", + "Honeycode", + "IAM", + "IVS", + "IdentityStore", + "Imagebuilder", + "Inspector", + "Inspector2", + "IoT1ClickDevicesService", + "IoT1ClickProjects", + "IoTAnalytics", + "IoTEvents", + "IoTEventsData", + "IoTFleetHub", + "IoTFleetWise", + "IoTJobsDataPlane", + "IoTRoboRunner", + "IoTSecureTunneling", + "IoTSiteWise", + "IoTThingsGraph", + "IoTTwinMaker", + "IoTWireless", + "Iot", + "IotData", + "IotDeviceAdvisor", + "Ivschat", + "KMS", + "Kafka", + "KafkaConnect", + "Kendra", + "Keyspaces", + "Kinesis", + "KinesisAnalytics", + "KinesisAnalyticsV2", + "KinesisVideo", + "KinesisVideoArchivedMedia", + "KinesisVideoMedia", + "KinesisVideoSignalingChannels", + "KinesisVideoWebRTCStorage", + "LakeFormation", + "Lambda", + "LexModelBuildingService", + "LexModelsV2", + "LexRuntime", + "LexRuntimeV2", + "LicenseManager", + "LicenseManagerLinuxSubscriptions", + "LicenseManagerUserSubscriptions", + "Lightsail", + "Location", + "LookoutEquipment", + "LookoutMetrics", + "LookoutVision", + "M2", + "MQ", + "MTurk", + "MWAA", + "MachineLearning", + "Macie", + "Macie2", + "ManagedBlockchain", + "MarketplaceCatalog", + "MarketplaceCommerceAnalytics", + "MarketplaceEntitlementService", + "MarketplaceMetering", + "MediaConnect", + "MediaConvert", + "MediaLive", + "MediaPackage", + "MediaPackageVod", + "MediaStore", + "MediaStoreData", + "MediaTailor", + "MemoryDB", + "Mgn", + "MigrationHub", + "MigrationHubConfig", + "MigrationHubOrchestrator", + "MigrationHubRefactorSpaces", + "MigrationHubStrategy", + "Mobile", + "Neptune", + "NetworkFirewall", + "NetworkManager", + "Nimble", + "OAM", + "Omics", + "OpenSearch", + "OpenSearchServerless", + "OpsWorks", + "OpsWorksCM", + "Organizations", + "Outposts", + "PI", + "Panorama", + "Personalize", + "PersonalizeEvents", + "PersonalizeRuntime", + "Pinpoint", + "PinpointEmail", + "PinpointSMSVoice", + "PinpointSMSVoiceV2", + "Pipes", + "Polly", + "Pricing", + "PrivateNetworks", + "Proton", + "QLDB", + "QLDBSession", + "QuickSight", + "RAM", + "RDS", + "RDSDataService", + "RUM", + "Rbin", + "Redshift", + "RedshiftData", + "RedshiftServerless", + "Rekognition", + "Resiliencehub", + "ResourceExplorer2", + "ResourceGroups", + "ResourceGroupsTaggingAPI", + "RoboMaker", + "RolesAnywhere", + "Route53", + "Route53Domains", + "Route53RecoveryCluster", + "Route53RecoveryControlConfig", + "Route53RecoveryReadiness", + "Route53Resolver", + "S3", + "S3Control", + "S3Outposts", + "SES", + "SESV2", + "SMS", + "SNS", + "SQS", + "SSM", + "SSMContacts", + "SSMIncidents", + "SSO", + "SSOAdmin", + "SSOOIDC", + "STS", + "SWF", + "SageMaker", + "SageMakerFeatureStoreRuntime", + "SageMakerGeospatial", + "SageMakerMetrics", + "SageMakerRuntime", + "SagemakerEdge", + "SavingsPlans", + "Scheduler", + "Schemas", + "SecretsManager", + "SecurityHub", + "SecurityLake", + "ServerlessApplicationRepository", + "ServiceCatalog", + "ServiceCatalogAppRegistry", + "ServiceDiscovery", + "ServiceQuotas", + "Shield", + "Signer", + "SimSpaceWeaver", + "SnowDeviceManagement", + "Snowball", + "SsmSap", + "StepFunctions", + "StorageGateway", + "Support", + "SupportApp", + "Synthetics", + "Textract", + "TimestreamQuery", + "TimestreamWrite", + "TranscribeService", + "Transfer", + "Translate", + "VoiceID", + "WAF", + "WAFRegional", + "WAFV2", + "WellArchitected", + "Wisdom", + "WorkDocs", + "WorkLink", + "WorkMail", + "WorkMailMessageFlow", + "WorkSpaces", + "WorkSpacesWeb", + "XRay" + ]; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts +var CLIENT_PACKAGE_NAMES_MAP; +var init_client_package_names_map = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { + "use strict"; + init_client_names(); + CLIENT_PACKAGE_NAMES_MAP = { + ...CLIENT_NAMES.reduce( + (acc, name) => ({ + ...acc, + [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") + }), + {} + ), + AccessAnalyzer: "client-accessanalyzer", + ACMPCA: "client-acm-pca", + APIGateway: "client-api-gateway", + ApiGatewayManagementApi: "client-apigatewaymanagementapi", + ApiGatewayV2: "client-apigatewayv2", + AppConfig: "client-appconfig", + AppConfigData: "client-appconfigdata", + AppIntegrations: "client-appintegrations", + AppRunner: "client-apprunner", + AppStream: "client-appstream", + AppSync: "client-appsync", + ApplicationCostProfiler: "client-applicationcostprofiler", + ARCZonalShift: "client-arc-zonal-shift", + AugmentedAIRuntime: "client-sage-maker-a2iruntime", + AuditManager: "client-auditmanager", + BackupStorage: "client-backupstorage", + CUR: "client-cost-and-usage-report-service", + CloudHSMV2: "client-cloudhsm-v2", + CodeGuruProfiler: "client-codeguruprofiler", + CodeStarconnections: "client-codestar-connections", + CognitoIdentityServiceProvider: "client-cognito-identity-provider", + ComprehendMedical: "client-comprehendmedical", + ConnectContactLens: "client-connect-contact-lens", + ControlTower: "client-controltower", + DMS: "client-database-migration-service", + DataPipeline: "client-data-pipeline", + Discovery: "client-application-discovery-service", + DevOpsGuru: "client-devops-guru", + DynamoDB: "client-dynamodb", + DynamoDBStreams: "client-dynamodb-streams", + DocDB: "client-docdb", + DocDBElastic: "client-docdb-elastic", + EC2InstanceConnect: "client-ec2-instance-connect", + ECRPUBLIC: "client-ecr-public", + ELB: "client-elastic-load-balancing", + ELBv2: "client-elastic-load-balancing-v2", + ElastiCache: "client-elasticache", + EMRcontainers: "client-emr-containers", + EMRServerless: "client-emr-serverless", + ES: "client-elasticsearch-service", + EventBridge: "client-eventbridge", + Finspacedata: "client-finspace-data", + ForecastQueryService: "client-forecastquery", + ForecastService: "client-forecast", + FraudDetector: "client-frauddetector", + GameLift: "client-gamelift", + GameSparks: "client-gamesparks", + GreengrassV2: "client-greengrassv2", + GroundStation: "client-groundstation", + GuardDuty: "client-guardduty", + HealthLake: "client-healthlake", + IdentityStore: "client-identitystore", + IoTAnalytics: "client-iotanalytics", + IotData: "client-iot-data-plane", + IotDeviceAdvisor: "client-iotdeviceadvisor", + IoTSecureTunneling: "client-iotsecuretunneling", + IoTSiteWise: "client-iotsitewise", + IoTThingsGraph: "client-iotthingsgraph", + IoTTwinMaker: "client-iottwinmaker", + IoTRoboRunner: "client-iot-roborunner", + KafkaConnect: "client-kafkaconnect", + KinesisVideoSignalingChannels: "client-kinesis-video-signaling", + KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", + LakeFormation: "client-lakeformation", + LexRuntime: "client-lex-runtime-service", + ManagedBlockchain: "client-managedblockchain", + MigrationHubConfig: "client-migrationhub-config", + MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", + NetworkManager: "client-networkmanager", + OpenSearch: "client-opensearch", + OpenSearchServerless: "client-opensearchserverless", + OpsWorks: "client-opsworks", + OpsWorksCM: "client-opsworkscm", + PrivateNetworks: "client-privatenetworks", + QLDBSession: "client-qldb-session", + QuickSight: "client-quicksight", + ResourceExplorer2: "client-resource-explorer-2", + RDSDataService: "client-rds-data", + RoboMaker: "client-robomaker", + RolesAnywhere: "client-rolesanywhere", + Route53: "client-route-53", + Route53Domains: "client-route-53-domains", + Route53Resolver: "client-route53resolver", + S3Control: "client-s3-control", + SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", + SavingsPlans: "client-savingsplans", + SecurityHub: "client-securityhub", + ServerlessApplicationRepository: "client-serverlessapplicationrepository", + ServiceCatalogAppRegistry: "client-service-catalog-appregistry", + ServiceDiscovery: "client-servicediscovery", + SimSpaceWeaver: "client-simspaceweaver", + SSMContacts: "client-ssm-contacts", + SSMIncidents: "client-ssm-incidents", + SSOAdmin: "client-sso-admin", + SSOOIDC: "client-sso-oidc", + StepFunctions: "client-sfn", + TranscribeService: "client-transcribe", + WAFRegional: "client-waf-regional", + WellArchitected: "client-wellarchitected", + WorkMailMessageFlow: "client-workmailmessageflow" + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts +var get_v3_client_package_name_exports = {}; +__export(get_v3_client_package_name_exports, { + getV3ClientPackageName: () => getV3ClientPackageName +}); +var getV3ClientPackageName; +var init_get_v3_client_package_name = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { + "use strict"; + init_client_package_names_map(); + getV3ClientPackageName = (clientName) => { + if (clientName in CLIENT_PACKAGE_NAMES_MAP) { + return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; + } + throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts +var find_client_constructor_exports = {}; +__export(find_client_constructor_exports, { + findV3ClientConstructor: () => findV3ClientConstructor +}); +function findV3ClientConstructor(pkg) { + const [_clientName, ServiceClient] = Object.entries(pkg).find( + ([name]) => { + return name.endsWith("Client") && name !== "__Client"; + } + ); + return ServiceClient; +} +var init_find_client_constructor = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { + "use strict"; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js +var require_lib = __commonJS({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; + var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); + Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { + return get_v3_client_package_name_1.getV3ClientPackageName; + } }); + var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); + Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { + return find_client_constructor_1.findV3ClientConstructor; + } }); + } +}); + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var aws_sdk_v3_handler_exports = {}; +__export(aws_sdk_v3_handler_exports, { + forceSdkInstallation: () => forceSdkInstallation, + handler: () => handler +}); +module.exports = __toCommonJS(aws_sdk_v3_handler_exports); +var import_child_process = require("child_process"); +var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); + +// custom-resources/lib/aws-custom-resource/runtime/shared.ts +var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } + return Object.assign( + {}, + ..._flatten(object) + ); +} +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +function filterKeys(object, pred) { + return Object.entries(object).reduce( + (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, + {} + ); +} +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data + }); + console.log("Responding", responseBody); + const parsedUrl = require("url").parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { + "content-type": "", + "content-length": Buffer.byteLength(responseBody, "utf8") + } + }; + return new Promise((resolve, reject) => { + try { + const request = require("https").request(requestOptions, resolve); + request.on("error", reject); + request.write(responseBody); + request.end(); + } catch (e) { + reject(e); + } + }); +} +function decodeCall(call) { + if (!call) { + return void 0; + } + return JSON.parse(call); +} +function startsWithOneOf(searchStrings) { + return function(string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var installedSdk = {}; +function forceSdkInstallation() { + installedSdk = {}; +} +function installLatestSdk(packageName) { + console.log(`Installing latest AWS SDK v3: ${packageName}`); + (0, import_child_process.execSync)( + `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` + ); + installedSdk = { + ...installedSdk, + [packageName]: true + }; +} +async function loadAwsSdk(packageName, installLatestAwsSdk) { + let awsSdk; + try { + if (!installedSdk[packageName] && installLatestAwsSdk === "true") { + try { + installLatestSdk(packageName); + awsSdk = require(`/tmp/node_modules/${packageName}`); + } catch (e) { + console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); + return require(packageName); + } + } else if (installedSdk[packageName]) { + awsSdk = require(`/tmp/node_modules/${packageName}`); + } else { + awsSdk = require(packageName); + } + } catch (error) { + throw Error(`Package ${packageName} does not exist.`); + } + return awsSdk; +} +async function handler(event, context) { + try { + event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); + event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); + event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); + let data = {}; + let physicalResourceId; + switch (event.RequestType) { + case "Create": + physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; + break; + case "Update": + case "Delete": + physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; + break; + } + const call = event.ResourceProperties[event.RequestType]; + if (call) { + const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); + let awsSdk = loadAwsSdk( + packageName, + event.ResourceProperties.InstallLatestAwsSdk + ); + console.log(JSON.stringify({ ...event, ResponseURL: "..." })); + let credentials; + if (call.assumedRoleArn) { + const timestamp = (/* @__PURE__ */ new Date()).getTime(); + const params = { + RoleArn: call.assumedRoleArn, + RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) + }; + const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); + credentials = fromTemporaryCredentials({ + params + }); + } + awsSdk = await awsSdk; + const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); + const client = new ServiceClient({ + apiVersion: call.apiVersion, + credentials, + region: call.region + }); + const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; + const Command = Object.entries(awsSdk).find( + ([name]) => name.toLowerCase() === commandName.toLowerCase() + )?.[1]; + let flatData = {}; + try { + const response = await client.send( + new Command( + (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} + ) + ); + flatData = { + apiVersion: client.config.apiVersion, + // For test purposes: check if apiVersion was correctly passed. + region: await client.config.region().catch(() => void 0), + // For test purposes: check if region was correctly passed. + ...flatten(response) + }; + let outputPaths; + if (call.outputPath) { + outputPaths = [call.outputPath]; + } else if (call.outputPaths) { + outputPaths = call.outputPaths; + } + if (outputPaths) { + data = filterKeys(flatData, startsWithOneOf(outputPaths)); + } else { + data = flatData; + } + } catch (e) { + const exceptionName = e.name ?? e.constructor.name; + if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { + throw e; + } + } + if (call.physicalResourceId?.responsePath) { + physicalResourceId = flatData[call.physicalResourceId.responsePath]; + } + } + await respond(event, "SUCCESS", "OK", physicalResourceId, data); + } catch (e) { + console.log(e); + await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + forceSdkInstallation, + handler +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +exports.startsWithOneOf = startsWithOneOf; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7R0FFRztBQUNILE1BQU0sT0FBTyxHQUFHLElBQUksV0FBVyxFQUFFLENBQUM7QUFFbEM7O0dBRUc7QUFDSCxTQUFTLFVBQVUsQ0FBQyxLQUFVO0lBQzVCLElBQUksTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsRUFBRTtRQUMxQixPQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDL0I7U0FBTSxJQUFJLFdBQVcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLEVBQUU7U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cnRzV2l0aChzZWFyY2hTdHJpbmcpKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js deleted file mode 100644 index 1b662725f1b0b..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js +++ /dev/null @@ -1,769 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts -var CLIENT_NAMES; -var init_client_names = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { - "use strict"; - CLIENT_NAMES = [ - "ACM", - "ACMPCA", - "APIGateway", - "ARCZonalShift", - "AccessAnalyzer", - "Account", - "AlexaForBusiness", - "Amp", - "Amplify", - "AmplifyBackend", - "AmplifyUIBuilder", - "ApiGatewayManagementApi", - "ApiGatewayV2", - "AppConfig", - "AppConfigData", - "AppIntegrations", - "AppMesh", - "AppRunner", - "AppStream", - "AppSync", - "Appflow", - "ApplicationAutoScaling", - "ApplicationCostProfiler", - "ApplicationInsights", - "Athena", - "AuditManager", - "AugmentedAIRuntime", - "AutoScaling", - "AutoScalingPlans", - "Backup", - "BackupGateway", - "BackupStorage", - "Batch", - "Billingconductor", - "Braket", - "Budgets", - "CUR", - "Chime", - "ChimeSDKIdentity", - "ChimeSDKMediaPipelines", - "ChimeSDKMeetings", - "ChimeSDKMessaging", - "ChimeSDKVoice", - "Cloud9", - "CloudControl", - "CloudDirectory", - "CloudFormation", - "CloudFront", - "CloudHSM", - "CloudHSMV2", - "CloudSearch", - "CloudSearchDomain", - "CloudTrail", - "CloudWatch", - "CloudWatchEvents", - "CloudWatchLogs", - "CodeArtifact", - "CodeBuild", - "CodeCatalyst", - "CodeCommit", - "CodeDeploy", - "CodeGuruProfiler", - "CodeGuruReviewer", - "CodePipeline", - "CodeStar", - "CodeStarNotifications", - "CodeStarconnections", - "CognitoIdentity", - "CognitoIdentityServiceProvider", - "CognitoSync", - "Comprehend", - "ComprehendMedical", - "ComputeOptimizer", - "ConfigService", - "Connect", - "ConnectCampaigns", - "ConnectCases", - "ConnectContactLens", - "ConnectParticipant", - "ControlTower", - "CostExplorer", - "CustomerProfiles", - "DAX", - "DLM", - "DMS", - "DataBrew", - "DataExchange", - "DataPipeline", - "DataSync", - "Detective", - "DevOpsGuru", - "DeviceFarm", - "DirectConnect", - "DirectoryService", - "Discovery", - "DocDB", - "DocDBElastic", - "Drs", - "DynamoDB", - "DynamoDBStreams", - "EBS", - "EC2", - "EC2InstanceConnect", - "ECR", - "ECRPUBLIC", - "ECS", - "EFS", - "EKS", - "ELB", - "ELBv2", - "EMR", - "EMRServerless", - "EMRcontainers", - "ES", - "ElastiCache", - "ElasticBeanstalk", - "ElasticInference", - "ElasticTranscoder", - "EventBridge", - "Evidently", - "FMS", - "FSx", - "Finspace", - "Finspacedata", - "Firehose", - "Fis", - "ForecastQueryService", - "ForecastService", - "FraudDetector", - "GameLift", - "GameSparks", - "Glacier", - "GlobalAccelerator", - "Glue", - "Grafana", - "Greengrass", - "GreengrassV2", - "GroundStation", - "GuardDuty", - "Health", - "HealthLake", - "Honeycode", - "IAM", - "IVS", - "IdentityStore", - "Imagebuilder", - "Inspector", - "Inspector2", - "IoT1ClickDevicesService", - "IoT1ClickProjects", - "IoTAnalytics", - "IoTEvents", - "IoTEventsData", - "IoTFleetHub", - "IoTFleetWise", - "IoTJobsDataPlane", - "IoTRoboRunner", - "IoTSecureTunneling", - "IoTSiteWise", - "IoTThingsGraph", - "IoTTwinMaker", - "IoTWireless", - "Iot", - "IotData", - "IotDeviceAdvisor", - "Ivschat", - "KMS", - "Kafka", - "KafkaConnect", - "Kendra", - "Keyspaces", - "Kinesis", - "KinesisAnalytics", - "KinesisAnalyticsV2", - "KinesisVideo", - "KinesisVideoArchivedMedia", - "KinesisVideoMedia", - "KinesisVideoSignalingChannels", - "KinesisVideoWebRTCStorage", - "LakeFormation", - "Lambda", - "LexModelBuildingService", - "LexModelsV2", - "LexRuntime", - "LexRuntimeV2", - "LicenseManager", - "LicenseManagerLinuxSubscriptions", - "LicenseManagerUserSubscriptions", - "Lightsail", - "Location", - "LookoutEquipment", - "LookoutMetrics", - "LookoutVision", - "M2", - "MQ", - "MTurk", - "MWAA", - "MachineLearning", - "Macie", - "Macie2", - "ManagedBlockchain", - "MarketplaceCatalog", - "MarketplaceCommerceAnalytics", - "MarketplaceEntitlementService", - "MarketplaceMetering", - "MediaConnect", - "MediaConvert", - "MediaLive", - "MediaPackage", - "MediaPackageVod", - "MediaStore", - "MediaStoreData", - "MediaTailor", - "MemoryDB", - "Mgn", - "MigrationHub", - "MigrationHubConfig", - "MigrationHubOrchestrator", - "MigrationHubRefactorSpaces", - "MigrationHubStrategy", - "Mobile", - "Neptune", - "NetworkFirewall", - "NetworkManager", - "Nimble", - "OAM", - "Omics", - "OpenSearch", - "OpenSearchServerless", - "OpsWorks", - "OpsWorksCM", - "Organizations", - "Outposts", - "PI", - "Panorama", - "Personalize", - "PersonalizeEvents", - "PersonalizeRuntime", - "Pinpoint", - "PinpointEmail", - "PinpointSMSVoice", - "PinpointSMSVoiceV2", - "Pipes", - "Polly", - "Pricing", - "PrivateNetworks", - "Proton", - "QLDB", - "QLDBSession", - "QuickSight", - "RAM", - "RDS", - "RDSDataService", - "RUM", - "Rbin", - "Redshift", - "RedshiftData", - "RedshiftServerless", - "Rekognition", - "Resiliencehub", - "ResourceExplorer2", - "ResourceGroups", - "ResourceGroupsTaggingAPI", - "RoboMaker", - "RolesAnywhere", - "Route53", - "Route53Domains", - "Route53RecoveryCluster", - "Route53RecoveryControlConfig", - "Route53RecoveryReadiness", - "Route53Resolver", - "S3", - "S3Control", - "S3Outposts", - "SES", - "SESV2", - "SMS", - "SNS", - "SQS", - "SSM", - "SSMContacts", - "SSMIncidents", - "SSO", - "SSOAdmin", - "SSOOIDC", - "STS", - "SWF", - "SageMaker", - "SageMakerFeatureStoreRuntime", - "SageMakerGeospatial", - "SageMakerMetrics", - "SageMakerRuntime", - "SagemakerEdge", - "SavingsPlans", - "Scheduler", - "Schemas", - "SecretsManager", - "SecurityHub", - "SecurityLake", - "ServerlessApplicationRepository", - "ServiceCatalog", - "ServiceCatalogAppRegistry", - "ServiceDiscovery", - "ServiceQuotas", - "Shield", - "Signer", - "SimSpaceWeaver", - "SnowDeviceManagement", - "Snowball", - "SsmSap", - "StepFunctions", - "StorageGateway", - "Support", - "SupportApp", - "Synthetics", - "Textract", - "TimestreamQuery", - "TimestreamWrite", - "TranscribeService", - "Transfer", - "Translate", - "VoiceID", - "WAF", - "WAFRegional", - "WAFV2", - "WellArchitected", - "Wisdom", - "WorkDocs", - "WorkLink", - "WorkMail", - "WorkMailMessageFlow", - "WorkSpaces", - "WorkSpacesWeb", - "XRay" - ]; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts -var CLIENT_PACKAGE_NAMES_MAP; -var init_client_package_names_map = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { - "use strict"; - init_client_names(); - CLIENT_PACKAGE_NAMES_MAP = { - ...CLIENT_NAMES.reduce( - (acc, name) => ({ - ...acc, - [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") - }), - {} - ), - AccessAnalyzer: "client-accessanalyzer", - ACMPCA: "client-acm-pca", - APIGateway: "client-api-gateway", - ApiGatewayManagementApi: "client-apigatewaymanagementapi", - ApiGatewayV2: "client-apigatewayv2", - AppConfig: "client-appconfig", - AppConfigData: "client-appconfigdata", - AppIntegrations: "client-appintegrations", - AppRunner: "client-apprunner", - AppStream: "client-appstream", - AppSync: "client-appsync", - ApplicationCostProfiler: "client-applicationcostprofiler", - ARCZonalShift: "client-arc-zonal-shift", - AugmentedAIRuntime: "client-sage-maker-a2iruntime", - AuditManager: "client-auditmanager", - BackupStorage: "client-backupstorage", - CUR: "client-cost-and-usage-report-service", - CloudHSMV2: "client-cloudhsm-v2", - CodeGuruProfiler: "client-codeguruprofiler", - CodeStarconnections: "client-codestar-connections", - CognitoIdentityServiceProvider: "client-cognito-identity-provider", - ComprehendMedical: "client-comprehendmedical", - ConnectContactLens: "client-connect-contact-lens", - ControlTower: "client-controltower", - DMS: "client-database-migration-service", - DataPipeline: "client-data-pipeline", - Discovery: "client-application-discovery-service", - DevOpsGuru: "client-devops-guru", - DynamoDB: "client-dynamodb", - DynamoDBStreams: "client-dynamodb-streams", - DocDB: "client-docdb", - DocDBElastic: "client-docdb-elastic", - EC2InstanceConnect: "client-ec2-instance-connect", - ECRPUBLIC: "client-ecr-public", - ELB: "client-elastic-load-balancing", - ELBv2: "client-elastic-load-balancing-v2", - ElastiCache: "client-elasticache", - EMRcontainers: "client-emr-containers", - EMRServerless: "client-emr-serverless", - ES: "client-elasticsearch-service", - EventBridge: "client-eventbridge", - Finspacedata: "client-finspace-data", - ForecastQueryService: "client-forecastquery", - ForecastService: "client-forecast", - FraudDetector: "client-frauddetector", - GameLift: "client-gamelift", - GameSparks: "client-gamesparks", - GreengrassV2: "client-greengrassv2", - GroundStation: "client-groundstation", - GuardDuty: "client-guardduty", - HealthLake: "client-healthlake", - IdentityStore: "client-identitystore", - IoTAnalytics: "client-iotanalytics", - IotData: "client-iot-data-plane", - IotDeviceAdvisor: "client-iotdeviceadvisor", - IoTSecureTunneling: "client-iotsecuretunneling", - IoTSiteWise: "client-iotsitewise", - IoTThingsGraph: "client-iotthingsgraph", - IoTTwinMaker: "client-iottwinmaker", - IoTRoboRunner: "client-iot-roborunner", - KafkaConnect: "client-kafkaconnect", - KinesisVideoSignalingChannels: "client-kinesis-video-signaling", - KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", - LakeFormation: "client-lakeformation", - LexRuntime: "client-lex-runtime-service", - ManagedBlockchain: "client-managedblockchain", - MigrationHubConfig: "client-migrationhub-config", - MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", - NetworkManager: "client-networkmanager", - OpenSearch: "client-opensearch", - OpenSearchServerless: "client-opensearchserverless", - OpsWorks: "client-opsworks", - OpsWorksCM: "client-opsworkscm", - PrivateNetworks: "client-privatenetworks", - QLDBSession: "client-qldb-session", - QuickSight: "client-quicksight", - ResourceExplorer2: "client-resource-explorer-2", - RDSDataService: "client-rds-data", - RoboMaker: "client-robomaker", - RolesAnywhere: "client-rolesanywhere", - Route53: "client-route-53", - Route53Domains: "client-route-53-domains", - Route53Resolver: "client-route53resolver", - S3Control: "client-s3-control", - SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", - SavingsPlans: "client-savingsplans", - SecurityHub: "client-securityhub", - ServerlessApplicationRepository: "client-serverlessapplicationrepository", - ServiceCatalogAppRegistry: "client-service-catalog-appregistry", - ServiceDiscovery: "client-servicediscovery", - SimSpaceWeaver: "client-simspaceweaver", - SSMContacts: "client-ssm-contacts", - SSMIncidents: "client-ssm-incidents", - SSOAdmin: "client-sso-admin", - SSOOIDC: "client-sso-oidc", - StepFunctions: "client-sfn", - TranscribeService: "client-transcribe", - WAFRegional: "client-waf-regional", - WellArchitected: "client-wellarchitected", - WorkMailMessageFlow: "client-workmailmessageflow" - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts -var get_v3_client_package_name_exports = {}; -__export(get_v3_client_package_name_exports, { - getV3ClientPackageName: () => getV3ClientPackageName -}); -var getV3ClientPackageName; -var init_get_v3_client_package_name = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { - "use strict"; - init_client_package_names_map(); - getV3ClientPackageName = (clientName) => { - if (clientName in CLIENT_PACKAGE_NAMES_MAP) { - return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; - } - throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts -var find_client_constructor_exports = {}; -__export(find_client_constructor_exports, { - findV3ClientConstructor: () => findV3ClientConstructor -}); -function findV3ClientConstructor(pkg) { - const [_clientName, ServiceClient] = Object.entries(pkg).find( - ([name]) => { - return name.endsWith("Client") && name !== "__Client"; - } - ); - return ServiceClient; -} -var init_find_client_constructor = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { - "use strict"; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js -var require_lib = __commonJS({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; - var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); - Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { - return get_v3_client_package_name_1.getV3ClientPackageName; - } }); - var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); - Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { - return find_client_constructor_1.findV3ClientConstructor; - } }); - } -}); - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var aws_sdk_v3_handler_exports = {}; -__export(aws_sdk_v3_handler_exports, { - forceSdkInstallation: () => forceSdkInstallation, - handler: () => handler -}); -module.exports = __toCommonJS(aws_sdk_v3_handler_exports); -var import_child_process = require("child_process"); -var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); - -// custom-resources/lib/aws-custom-resource/runtime/shared.ts -var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; -function flatten(object) { - return Object.assign( - {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) - ); -} -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -function filterKeys(object, pred) { - return Object.entries(object).reduce( - (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, - {} - ); -} -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data - }); - console.log("Responding", responseBody); - const parsedUrl = require("url").parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { - "content-type": "", - "content-length": Buffer.byteLength(responseBody, "utf8") - } - }; - return new Promise((resolve, reject) => { - try { - const request = require("https").request(requestOptions, resolve); - request.on("error", reject); - request.write(responseBody); - request.end(); - } catch (e) { - reject(e); - } - }); -} -function decodeCall(call) { - if (!call) { - return void 0; - } - return JSON.parse(call); -} -function startsWithOneOf(searchStrings) { - return function(string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var installedSdk = {}; -function forceSdkInstallation() { - installedSdk = {}; -} -function installLatestSdk(packageName) { - console.log(`Installing latest AWS SDK v3: ${packageName}`); - (0, import_child_process.execSync)( - `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` - ); - installedSdk = { - ...installedSdk, - [packageName]: true - }; -} -async function loadAwsSdk(packageName, installLatestAwsSdk) { - let awsSdk; - try { - if (!installedSdk[packageName] && installLatestAwsSdk === "true") { - try { - installLatestSdk(packageName); - awsSdk = require(`/tmp/node_modules/${packageName}`); - } catch (e) { - console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); - return require(packageName); - } - } else if (installedSdk[packageName]) { - awsSdk = require(`/tmp/node_modules/${packageName}`); - } else { - awsSdk = require(packageName); - } - } catch (error) { - throw Error(`Package ${packageName} does not exist.`); - } - return awsSdk; -} -async function handler(event, context) { - try { - event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); - event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); - event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); - let data = {}; - let physicalResourceId; - switch (event.RequestType) { - case "Create": - physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; - break; - case "Update": - case "Delete": - physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; - break; - } - const call = event.ResourceProperties[event.RequestType]; - if (call) { - const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); - let awsSdk = loadAwsSdk( - packageName, - event.ResourceProperties.InstallLatestAwsSdk - ); - console.log(JSON.stringify({ ...event, ResponseURL: "..." })); - let credentials; - if (call.assumedRoleArn) { - const timestamp = (/* @__PURE__ */ new Date()).getTime(); - const params = { - RoleArn: call.assumedRoleArn, - RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) - }; - const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); - credentials = fromTemporaryCredentials({ - params - }); - } - awsSdk = await awsSdk; - const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); - const client = new ServiceClient({ - apiVersion: call.apiVersion, - credentials, - region: call.region - }); - const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; - const Command = Object.entries(awsSdk).find( - ([name]) => name.toLowerCase() === commandName.toLowerCase() - )?.[1]; - let flatData = {}; - try { - const response = await client.send( - new Command( - (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} - ) - ); - flatData = { - apiVersion: client.config.apiVersion, - // For test purposes: check if apiVersion was correctly passed. - region: await client.config.region().catch(() => void 0), - // For test purposes: check if region was correctly passed. - ...flatten(response) - }; - let outputPaths; - if (call.outputPath) { - outputPaths = [call.outputPath]; - } else if (call.outputPaths) { - outputPaths = call.outputPaths; - } - if (outputPaths) { - data = filterKeys(flatData, startsWithOneOf(outputPaths)); - } else { - data = flatData; - } - } catch (e) { - const exceptionName = e.name ?? e.constructor.name; - if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { - throw e; - } - } - if (call.physicalResourceId?.responsePath) { - physicalResourceId = flatData[call.physicalResourceId.responsePath]; - } - } - await respond(event, "SUCCESS", "OK", physicalResourceId, data); - } catch (e) { - console.log(e); - await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - forceSdkInstallation, - handler -}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js deleted file mode 100644 index 6c53eaeef8cd1..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -exports.decodeSpecialValues = decodeSpecialValues; -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -exports.filterKeys = filterKeys; -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - // eslint-disable-next-line no-console - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': Buffer.byteLength(responseBody, 'utf8'), - }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -exports.respond = respond; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -exports.decodeCall = decodeCall; -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} -exports.startsWithOneOf = startsWithOneOf; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7Ozs7R0FLRztBQUNILFNBQWdCLE9BQU8sQ0FBQyxNQUFjO0lBQ3BDLE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FDbEIsRUFBRSxFQUNGLEdBQUcsU0FBUyxRQUFRLENBQUMsS0FBVSxFQUFFLE9BQWlCLEVBQUU7UUFDbEQsT0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUM7YUFDbkMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxFQUFFO1lBQ1QsTUFBTSxRQUFRLEdBQUcsTUFBTSx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c3RyaW5nW10pOiAoc3RyaW5nOiBzdHJpbmcpID0+IGJvb2xlYW4ge1xuICByZXR1cm4gZnVuY3Rpb24oc3RyaW5nOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgICBmb3IgKGNvbnN0IHNlYXJjaFN0cmluZyBvZiBzZWFyY2hTdHJpbmdzKSB7XG4gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/cdk-integ-opensearch-unsignedbasicauth.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/cdk-integ-opensearch-unsignedbasicauth.assets.json index b64843c3bb10a..b2bedef44af22 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/cdk-integ-opensearch-unsignedbasicauth.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/cdk-integ-opensearch-unsignedbasicauth.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "816cbbbf0f44e5a9de745cf16f2324b2ac634287e31a48abf79f9217ca563d70": { + "06e19620909f22ac507df5eab09e0137ca6fae1d9c26b2f7d17495a203ba4aab": { "source": { "path": "cdk-integ-opensearch-unsignedbasicauth.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "816cbbbf0f44e5a9de745cf16f2324b2ac634287e31a48abf79f9217ca563d70.json", + "objectKey": "06e19620909f22ac507df5eab09e0137ca6fae1d9c26b2f7d17495a203ba4aab.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/cdk-integ-opensearch-unsignedbasicauth.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/cdk-integ-opensearch-unsignedbasicauth.template.json index 45395f9622ad5..928cb4014e24c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/cdk-integ-opensearch-unsignedbasicauth.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/cdk-integ-opensearch-unsignedbasicauth.template.json @@ -117,7 +117,7 @@ ] ] }, - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "DomainAccessPolicyCustomResourcePolicyE61F1845" @@ -189,7 +189,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/manifest.json index 664447f41ccd5..631a082782ce2 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/816cbbbf0f44e5a9de745cf16f2324b2ac634287e31a48abf79f9217ca563d70.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/06e19620909f22ac507df5eab09e0137ca6fae1d9c26b2f7d17495a203ba4aab.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -45,6 +45,12 @@ "data": "Domain66AC69E0" } ], + "/cdk-integ-opensearch-unsignedbasicauth/Domain/AccessPolicy": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/cdk-integ-opensearch-unsignedbasicauth/Domain/AccessPolicy/Resource/Default": [ { "type": "aws:cdk:logicalId", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/tree.json index f675e6caf3055..0003b23d11583 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.unsignedbasicauth.js.snapshot/tree.json @@ -279,7 +279,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js new file mode 100644 index 0000000000000..9f6e97928f257 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -0,0 +1,779 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts +var CLIENT_NAMES; +var init_client_names = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { + "use strict"; + CLIENT_NAMES = [ + "ACM", + "ACMPCA", + "APIGateway", + "ARCZonalShift", + "AccessAnalyzer", + "Account", + "AlexaForBusiness", + "Amp", + "Amplify", + "AmplifyBackend", + "AmplifyUIBuilder", + "ApiGatewayManagementApi", + "ApiGatewayV2", + "AppConfig", + "AppConfigData", + "AppIntegrations", + "AppMesh", + "AppRunner", + "AppStream", + "AppSync", + "Appflow", + "ApplicationAutoScaling", + "ApplicationCostProfiler", + "ApplicationInsights", + "Athena", + "AuditManager", + "AugmentedAIRuntime", + "AutoScaling", + "AutoScalingPlans", + "Backup", + "BackupGateway", + "BackupStorage", + "Batch", + "Billingconductor", + "Braket", + "Budgets", + "CUR", + "Chime", + "ChimeSDKIdentity", + "ChimeSDKMediaPipelines", + "ChimeSDKMeetings", + "ChimeSDKMessaging", + "ChimeSDKVoice", + "Cloud9", + "CloudControl", + "CloudDirectory", + "CloudFormation", + "CloudFront", + "CloudHSM", + "CloudHSMV2", + "CloudSearch", + "CloudSearchDomain", + "CloudTrail", + "CloudWatch", + "CloudWatchEvents", + "CloudWatchLogs", + "CodeArtifact", + "CodeBuild", + "CodeCatalyst", + "CodeCommit", + "CodeDeploy", + "CodeGuruProfiler", + "CodeGuruReviewer", + "CodePipeline", + "CodeStar", + "CodeStarNotifications", + "CodeStarconnections", + "CognitoIdentity", + "CognitoIdentityServiceProvider", + "CognitoSync", + "Comprehend", + "ComprehendMedical", + "ComputeOptimizer", + "ConfigService", + "Connect", + "ConnectCampaigns", + "ConnectCases", + "ConnectContactLens", + "ConnectParticipant", + "ControlTower", + "CostExplorer", + "CustomerProfiles", + "DAX", + "DLM", + "DMS", + "DataBrew", + "DataExchange", + "DataPipeline", + "DataSync", + "Detective", + "DevOpsGuru", + "DeviceFarm", + "DirectConnect", + "DirectoryService", + "Discovery", + "DocDB", + "DocDBElastic", + "Drs", + "DynamoDB", + "DynamoDBStreams", + "EBS", + "EC2", + "EC2InstanceConnect", + "ECR", + "ECRPUBLIC", + "ECS", + "EFS", + "EKS", + "ELB", + "ELBv2", + "EMR", + "EMRServerless", + "EMRcontainers", + "ES", + "ElastiCache", + "ElasticBeanstalk", + "ElasticInference", + "ElasticTranscoder", + "EventBridge", + "Evidently", + "FMS", + "FSx", + "Finspace", + "Finspacedata", + "Firehose", + "Fis", + "ForecastQueryService", + "ForecastService", + "FraudDetector", + "GameLift", + "GameSparks", + "Glacier", + "GlobalAccelerator", + "Glue", + "Grafana", + "Greengrass", + "GreengrassV2", + "GroundStation", + "GuardDuty", + "Health", + "HealthLake", + "Honeycode", + "IAM", + "IVS", + "IdentityStore", + "Imagebuilder", + "Inspector", + "Inspector2", + "IoT1ClickDevicesService", + "IoT1ClickProjects", + "IoTAnalytics", + "IoTEvents", + "IoTEventsData", + "IoTFleetHub", + "IoTFleetWise", + "IoTJobsDataPlane", + "IoTRoboRunner", + "IoTSecureTunneling", + "IoTSiteWise", + "IoTThingsGraph", + "IoTTwinMaker", + "IoTWireless", + "Iot", + "IotData", + "IotDeviceAdvisor", + "Ivschat", + "KMS", + "Kafka", + "KafkaConnect", + "Kendra", + "Keyspaces", + "Kinesis", + "KinesisAnalytics", + "KinesisAnalyticsV2", + "KinesisVideo", + "KinesisVideoArchivedMedia", + "KinesisVideoMedia", + "KinesisVideoSignalingChannels", + "KinesisVideoWebRTCStorage", + "LakeFormation", + "Lambda", + "LexModelBuildingService", + "LexModelsV2", + "LexRuntime", + "LexRuntimeV2", + "LicenseManager", + "LicenseManagerLinuxSubscriptions", + "LicenseManagerUserSubscriptions", + "Lightsail", + "Location", + "LookoutEquipment", + "LookoutMetrics", + "LookoutVision", + "M2", + "MQ", + "MTurk", + "MWAA", + "MachineLearning", + "Macie", + "Macie2", + "ManagedBlockchain", + "MarketplaceCatalog", + "MarketplaceCommerceAnalytics", + "MarketplaceEntitlementService", + "MarketplaceMetering", + "MediaConnect", + "MediaConvert", + "MediaLive", + "MediaPackage", + "MediaPackageVod", + "MediaStore", + "MediaStoreData", + "MediaTailor", + "MemoryDB", + "Mgn", + "MigrationHub", + "MigrationHubConfig", + "MigrationHubOrchestrator", + "MigrationHubRefactorSpaces", + "MigrationHubStrategy", + "Mobile", + "Neptune", + "NetworkFirewall", + "NetworkManager", + "Nimble", + "OAM", + "Omics", + "OpenSearch", + "OpenSearchServerless", + "OpsWorks", + "OpsWorksCM", + "Organizations", + "Outposts", + "PI", + "Panorama", + "Personalize", + "PersonalizeEvents", + "PersonalizeRuntime", + "Pinpoint", + "PinpointEmail", + "PinpointSMSVoice", + "PinpointSMSVoiceV2", + "Pipes", + "Polly", + "Pricing", + "PrivateNetworks", + "Proton", + "QLDB", + "QLDBSession", + "QuickSight", + "RAM", + "RDS", + "RDSDataService", + "RUM", + "Rbin", + "Redshift", + "RedshiftData", + "RedshiftServerless", + "Rekognition", + "Resiliencehub", + "ResourceExplorer2", + "ResourceGroups", + "ResourceGroupsTaggingAPI", + "RoboMaker", + "RolesAnywhere", + "Route53", + "Route53Domains", + "Route53RecoveryCluster", + "Route53RecoveryControlConfig", + "Route53RecoveryReadiness", + "Route53Resolver", + "S3", + "S3Control", + "S3Outposts", + "SES", + "SESV2", + "SMS", + "SNS", + "SQS", + "SSM", + "SSMContacts", + "SSMIncidents", + "SSO", + "SSOAdmin", + "SSOOIDC", + "STS", + "SWF", + "SageMaker", + "SageMakerFeatureStoreRuntime", + "SageMakerGeospatial", + "SageMakerMetrics", + "SageMakerRuntime", + "SagemakerEdge", + "SavingsPlans", + "Scheduler", + "Schemas", + "SecretsManager", + "SecurityHub", + "SecurityLake", + "ServerlessApplicationRepository", + "ServiceCatalog", + "ServiceCatalogAppRegistry", + "ServiceDiscovery", + "ServiceQuotas", + "Shield", + "Signer", + "SimSpaceWeaver", + "SnowDeviceManagement", + "Snowball", + "SsmSap", + "StepFunctions", + "StorageGateway", + "Support", + "SupportApp", + "Synthetics", + "Textract", + "TimestreamQuery", + "TimestreamWrite", + "TranscribeService", + "Transfer", + "Translate", + "VoiceID", + "WAF", + "WAFRegional", + "WAFV2", + "WellArchitected", + "Wisdom", + "WorkDocs", + "WorkLink", + "WorkMail", + "WorkMailMessageFlow", + "WorkSpaces", + "WorkSpacesWeb", + "XRay" + ]; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts +var CLIENT_PACKAGE_NAMES_MAP; +var init_client_package_names_map = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { + "use strict"; + init_client_names(); + CLIENT_PACKAGE_NAMES_MAP = { + ...CLIENT_NAMES.reduce( + (acc, name) => ({ + ...acc, + [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") + }), + {} + ), + AccessAnalyzer: "client-accessanalyzer", + ACMPCA: "client-acm-pca", + APIGateway: "client-api-gateway", + ApiGatewayManagementApi: "client-apigatewaymanagementapi", + ApiGatewayV2: "client-apigatewayv2", + AppConfig: "client-appconfig", + AppConfigData: "client-appconfigdata", + AppIntegrations: "client-appintegrations", + AppRunner: "client-apprunner", + AppStream: "client-appstream", + AppSync: "client-appsync", + ApplicationCostProfiler: "client-applicationcostprofiler", + ARCZonalShift: "client-arc-zonal-shift", + AugmentedAIRuntime: "client-sage-maker-a2iruntime", + AuditManager: "client-auditmanager", + BackupStorage: "client-backupstorage", + CUR: "client-cost-and-usage-report-service", + CloudHSMV2: "client-cloudhsm-v2", + CodeGuruProfiler: "client-codeguruprofiler", + CodeStarconnections: "client-codestar-connections", + CognitoIdentityServiceProvider: "client-cognito-identity-provider", + ComprehendMedical: "client-comprehendmedical", + ConnectContactLens: "client-connect-contact-lens", + ControlTower: "client-controltower", + DMS: "client-database-migration-service", + DataPipeline: "client-data-pipeline", + Discovery: "client-application-discovery-service", + DevOpsGuru: "client-devops-guru", + DynamoDB: "client-dynamodb", + DynamoDBStreams: "client-dynamodb-streams", + DocDB: "client-docdb", + DocDBElastic: "client-docdb-elastic", + EC2InstanceConnect: "client-ec2-instance-connect", + ECRPUBLIC: "client-ecr-public", + ELB: "client-elastic-load-balancing", + ELBv2: "client-elastic-load-balancing-v2", + ElastiCache: "client-elasticache", + EMRcontainers: "client-emr-containers", + EMRServerless: "client-emr-serverless", + ES: "client-elasticsearch-service", + EventBridge: "client-eventbridge", + Finspacedata: "client-finspace-data", + ForecastQueryService: "client-forecastquery", + ForecastService: "client-forecast", + FraudDetector: "client-frauddetector", + GameLift: "client-gamelift", + GameSparks: "client-gamesparks", + GreengrassV2: "client-greengrassv2", + GroundStation: "client-groundstation", + GuardDuty: "client-guardduty", + HealthLake: "client-healthlake", + IdentityStore: "client-identitystore", + IoTAnalytics: "client-iotanalytics", + IotData: "client-iot-data-plane", + IotDeviceAdvisor: "client-iotdeviceadvisor", + IoTSecureTunneling: "client-iotsecuretunneling", + IoTSiteWise: "client-iotsitewise", + IoTThingsGraph: "client-iotthingsgraph", + IoTTwinMaker: "client-iottwinmaker", + IoTRoboRunner: "client-iot-roborunner", + KafkaConnect: "client-kafkaconnect", + KinesisVideoSignalingChannels: "client-kinesis-video-signaling", + KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", + LakeFormation: "client-lakeformation", + LexRuntime: "client-lex-runtime-service", + ManagedBlockchain: "client-managedblockchain", + MigrationHubConfig: "client-migrationhub-config", + MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", + NetworkManager: "client-networkmanager", + OpenSearch: "client-opensearch", + OpenSearchServerless: "client-opensearchserverless", + OpsWorks: "client-opsworks", + OpsWorksCM: "client-opsworkscm", + PrivateNetworks: "client-privatenetworks", + QLDBSession: "client-qldb-session", + QuickSight: "client-quicksight", + ResourceExplorer2: "client-resource-explorer-2", + RDSDataService: "client-rds-data", + RoboMaker: "client-robomaker", + RolesAnywhere: "client-rolesanywhere", + Route53: "client-route-53", + Route53Domains: "client-route-53-domains", + Route53Resolver: "client-route53resolver", + S3Control: "client-s3-control", + SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", + SavingsPlans: "client-savingsplans", + SecurityHub: "client-securityhub", + ServerlessApplicationRepository: "client-serverlessapplicationrepository", + ServiceCatalogAppRegistry: "client-service-catalog-appregistry", + ServiceDiscovery: "client-servicediscovery", + SimSpaceWeaver: "client-simspaceweaver", + SSMContacts: "client-ssm-contacts", + SSMIncidents: "client-ssm-incidents", + SSOAdmin: "client-sso-admin", + SSOOIDC: "client-sso-oidc", + StepFunctions: "client-sfn", + TranscribeService: "client-transcribe", + WAFRegional: "client-waf-regional", + WellArchitected: "client-wellarchitected", + WorkMailMessageFlow: "client-workmailmessageflow" + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts +var get_v3_client_package_name_exports = {}; +__export(get_v3_client_package_name_exports, { + getV3ClientPackageName: () => getV3ClientPackageName +}); +var getV3ClientPackageName; +var init_get_v3_client_package_name = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { + "use strict"; + init_client_package_names_map(); + getV3ClientPackageName = (clientName) => { + if (clientName in CLIENT_PACKAGE_NAMES_MAP) { + return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; + } + throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts +var find_client_constructor_exports = {}; +__export(find_client_constructor_exports, { + findV3ClientConstructor: () => findV3ClientConstructor +}); +function findV3ClientConstructor(pkg) { + const [_clientName, ServiceClient] = Object.entries(pkg).find( + ([name]) => { + return name.endsWith("Client") && name !== "__Client"; + } + ); + return ServiceClient; +} +var init_find_client_constructor = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { + "use strict"; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js +var require_lib = __commonJS({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; + var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); + Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { + return get_v3_client_package_name_1.getV3ClientPackageName; + } }); + var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); + Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { + return find_client_constructor_1.findV3ClientConstructor; + } }); + } +}); + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var aws_sdk_v3_handler_exports = {}; +__export(aws_sdk_v3_handler_exports, { + forceSdkInstallation: () => forceSdkInstallation, + handler: () => handler +}); +module.exports = __toCommonJS(aws_sdk_v3_handler_exports); +var import_child_process = require("child_process"); +var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); + +// custom-resources/lib/aws-custom-resource/runtime/shared.ts +var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } + return Object.assign( + {}, + ..._flatten(object) + ); +} +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +function filterKeys(object, pred) { + return Object.entries(object).reduce( + (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, + {} + ); +} +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data + }); + console.log("Responding", responseBody); + const parsedUrl = require("url").parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { + "content-type": "", + "content-length": Buffer.byteLength(responseBody, "utf8") + } + }; + return new Promise((resolve, reject) => { + try { + const request = require("https").request(requestOptions, resolve); + request.on("error", reject); + request.write(responseBody); + request.end(); + } catch (e) { + reject(e); + } + }); +} +function decodeCall(call) { + if (!call) { + return void 0; + } + return JSON.parse(call); +} +function startsWithOneOf(searchStrings) { + return function(string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var installedSdk = {}; +function forceSdkInstallation() { + installedSdk = {}; +} +function installLatestSdk(packageName) { + console.log(`Installing latest AWS SDK v3: ${packageName}`); + (0, import_child_process.execSync)( + `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` + ); + installedSdk = { + ...installedSdk, + [packageName]: true + }; +} +async function loadAwsSdk(packageName, installLatestAwsSdk) { + let awsSdk; + try { + if (!installedSdk[packageName] && installLatestAwsSdk === "true") { + try { + installLatestSdk(packageName); + awsSdk = require(`/tmp/node_modules/${packageName}`); + } catch (e) { + console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); + return require(packageName); + } + } else if (installedSdk[packageName]) { + awsSdk = require(`/tmp/node_modules/${packageName}`); + } else { + awsSdk = require(packageName); + } + } catch (error) { + throw Error(`Package ${packageName} does not exist.`); + } + return awsSdk; +} +async function handler(event, context) { + try { + event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); + event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); + event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); + let data = {}; + let physicalResourceId; + switch (event.RequestType) { + case "Create": + physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; + break; + case "Update": + case "Delete": + physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; + break; + } + const call = event.ResourceProperties[event.RequestType]; + if (call) { + const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); + let awsSdk = loadAwsSdk( + packageName, + event.ResourceProperties.InstallLatestAwsSdk + ); + console.log(JSON.stringify({ ...event, ResponseURL: "..." })); + let credentials; + if (call.assumedRoleArn) { + const timestamp = (/* @__PURE__ */ new Date()).getTime(); + const params = { + RoleArn: call.assumedRoleArn, + RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) + }; + const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); + credentials = fromTemporaryCredentials({ + params + }); + } + awsSdk = await awsSdk; + const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); + const client = new ServiceClient({ + apiVersion: call.apiVersion, + credentials, + region: call.region + }); + const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; + const Command = Object.entries(awsSdk).find( + ([name]) => name.toLowerCase() === commandName.toLowerCase() + )?.[1]; + let flatData = {}; + try { + const response = await client.send( + new Command( + (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} + ) + ); + flatData = { + apiVersion: client.config.apiVersion, + // For test purposes: check if apiVersion was correctly passed. + region: await client.config.region().catch(() => void 0), + // For test purposes: check if region was correctly passed. + ...flatten(response) + }; + let outputPaths; + if (call.outputPath) { + outputPaths = [call.outputPath]; + } else if (call.outputPaths) { + outputPaths = call.outputPaths; + } + if (outputPaths) { + data = filterKeys(flatData, startsWithOneOf(outputPaths)); + } else { + data = flatData; + } + } catch (e) { + const exceptionName = e.name ?? e.constructor.name; + if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { + throw e; + } + } + if (call.physicalResourceId?.responsePath) { + physicalResourceId = flatData[call.physicalResourceId.responsePath]; + } + } + await respond(event, "SUCCESS", "OK", physicalResourceId, data); + } catch (e) { + console.log(e); + await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + forceSdkInstallation, + handler +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +exports.startsWithOneOf = startsWithOneOf; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7R0FFRztBQUNILE1BQU0sT0FBTyxHQUFHLElBQUksV0FBVyxFQUFFLENBQUM7QUFFbEM7O0dBRUc7QUFDSCxTQUFTLFVBQVUsQ0FBQyxLQUFVO0lBQzVCLElBQUksTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsRUFBRTtRQUMxQixPQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDL0I7U0FBTSxJQUFJLFdBQVcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLEVBQUU7UUFDcEMsT0FBTyxPQUFPLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQztLQUNyQztJQUVELE9BQU8sS0FBSyxDQUFDO0FBQ2YsQ0FBQztBQUNEOzs7OztHQUtHO0FBQ0gsU0FBZ0IsT0FBTyxDQUFDLE1BQWM7SUFDcEMsU0FBUyxRQUFRLENBQUMsS0FBVSxFQUFFLE9BQWlCLEVBQUU7UUFDL0MsT0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUM7YUFDbkMsR0FBRyxDQUFDLEdBQUcsQ0FBQ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VxdWlyZSgnaHR0cHMnKS5yZXF1ZXN0KHJlcXVlc3RPcHRpb25zLCByZXNvbHZlKTtcbiAgICAgIHJlcXVlc3Qub24oJ2Vycm9yJywgcmVqZWN0KTtcbiAgICAgIHJlcXVlc3Qud3JpdGUocmVzcG9uc2VCb2R5KTtcbiAgICAgIHJlcXVlc3QuZW5kKCk7XG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgcmVqZWN0KGUpO1xuICAgIH1cbiAgfSk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBkZWNvZGVDYWxsKGNhbGw6IHN0cmluZyB8IHVuZGVmaW5lZCkge1xuICBpZiAoIWNhbGwpIHsgcmV0dXJuIHVuZGVmaW5lZDsgfVxuICByZXR1cm4gSlNPTi5wYXJzZShjYWxsKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHN0YXJ0c1dpdGhPbmVPZihzZWFyY2hTdHJpbmdzOiBzdHJpbmdbXSk6IChzdHJpbmc6IHN0cmluZykgPT4gYm9vbGVhbiB7XG4gIHJldHVybiBmdW5jdGlvbihzdHJpbmc6IHN0cmluZyk6IGJvb2xlYW4ge1xuICAgIGZvciAoY29uc3Qgc2VhcmNoU3RyaW5nIG9mIHNlYXJjaFN0cmluZ3MpIHtcbiAgICAgIGlmIChzdHJpbmcuc3RhcnRzV2l0aChzZWFyY2hTdHJpbmcpKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js deleted file mode 100644 index 1b662725f1b0b..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js +++ /dev/null @@ -1,769 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts -var CLIENT_NAMES; -var init_client_names = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { - "use strict"; - CLIENT_NAMES = [ - "ACM", - "ACMPCA", - "APIGateway", - "ARCZonalShift", - "AccessAnalyzer", - "Account", - "AlexaForBusiness", - "Amp", - "Amplify", - "AmplifyBackend", - "AmplifyUIBuilder", - "ApiGatewayManagementApi", - "ApiGatewayV2", - "AppConfig", - "AppConfigData", - "AppIntegrations", - "AppMesh", - "AppRunner", - "AppStream", - "AppSync", - "Appflow", - "ApplicationAutoScaling", - "ApplicationCostProfiler", - "ApplicationInsights", - "Athena", - "AuditManager", - "AugmentedAIRuntime", - "AutoScaling", - "AutoScalingPlans", - "Backup", - "BackupGateway", - "BackupStorage", - "Batch", - "Billingconductor", - "Braket", - "Budgets", - "CUR", - "Chime", - "ChimeSDKIdentity", - "ChimeSDKMediaPipelines", - "ChimeSDKMeetings", - "ChimeSDKMessaging", - "ChimeSDKVoice", - "Cloud9", - "CloudControl", - "CloudDirectory", - "CloudFormation", - "CloudFront", - "CloudHSM", - "CloudHSMV2", - "CloudSearch", - "CloudSearchDomain", - "CloudTrail", - "CloudWatch", - "CloudWatchEvents", - "CloudWatchLogs", - "CodeArtifact", - "CodeBuild", - "CodeCatalyst", - "CodeCommit", - "CodeDeploy", - "CodeGuruProfiler", - "CodeGuruReviewer", - "CodePipeline", - "CodeStar", - "CodeStarNotifications", - "CodeStarconnections", - "CognitoIdentity", - "CognitoIdentityServiceProvider", - "CognitoSync", - "Comprehend", - "ComprehendMedical", - "ComputeOptimizer", - "ConfigService", - "Connect", - "ConnectCampaigns", - "ConnectCases", - "ConnectContactLens", - "ConnectParticipant", - "ControlTower", - "CostExplorer", - "CustomerProfiles", - "DAX", - "DLM", - "DMS", - "DataBrew", - "DataExchange", - "DataPipeline", - "DataSync", - "Detective", - "DevOpsGuru", - "DeviceFarm", - "DirectConnect", - "DirectoryService", - "Discovery", - "DocDB", - "DocDBElastic", - "Drs", - "DynamoDB", - "DynamoDBStreams", - "EBS", - "EC2", - "EC2InstanceConnect", - "ECR", - "ECRPUBLIC", - "ECS", - "EFS", - "EKS", - "ELB", - "ELBv2", - "EMR", - "EMRServerless", - "EMRcontainers", - "ES", - "ElastiCache", - "ElasticBeanstalk", - "ElasticInference", - "ElasticTranscoder", - "EventBridge", - "Evidently", - "FMS", - "FSx", - "Finspace", - "Finspacedata", - "Firehose", - "Fis", - "ForecastQueryService", - "ForecastService", - "FraudDetector", - "GameLift", - "GameSparks", - "Glacier", - "GlobalAccelerator", - "Glue", - "Grafana", - "Greengrass", - "GreengrassV2", - "GroundStation", - "GuardDuty", - "Health", - "HealthLake", - "Honeycode", - "IAM", - "IVS", - "IdentityStore", - "Imagebuilder", - "Inspector", - "Inspector2", - "IoT1ClickDevicesService", - "IoT1ClickProjects", - "IoTAnalytics", - "IoTEvents", - "IoTEventsData", - "IoTFleetHub", - "IoTFleetWise", - "IoTJobsDataPlane", - "IoTRoboRunner", - "IoTSecureTunneling", - "IoTSiteWise", - "IoTThingsGraph", - "IoTTwinMaker", - "IoTWireless", - "Iot", - "IotData", - "IotDeviceAdvisor", - "Ivschat", - "KMS", - "Kafka", - "KafkaConnect", - "Kendra", - "Keyspaces", - "Kinesis", - "KinesisAnalytics", - "KinesisAnalyticsV2", - "KinesisVideo", - "KinesisVideoArchivedMedia", - "KinesisVideoMedia", - "KinesisVideoSignalingChannels", - "KinesisVideoWebRTCStorage", - "LakeFormation", - "Lambda", - "LexModelBuildingService", - "LexModelsV2", - "LexRuntime", - "LexRuntimeV2", - "LicenseManager", - "LicenseManagerLinuxSubscriptions", - "LicenseManagerUserSubscriptions", - "Lightsail", - "Location", - "LookoutEquipment", - "LookoutMetrics", - "LookoutVision", - "M2", - "MQ", - "MTurk", - "MWAA", - "MachineLearning", - "Macie", - "Macie2", - "ManagedBlockchain", - "MarketplaceCatalog", - "MarketplaceCommerceAnalytics", - "MarketplaceEntitlementService", - "MarketplaceMetering", - "MediaConnect", - "MediaConvert", - "MediaLive", - "MediaPackage", - "MediaPackageVod", - "MediaStore", - "MediaStoreData", - "MediaTailor", - "MemoryDB", - "Mgn", - "MigrationHub", - "MigrationHubConfig", - "MigrationHubOrchestrator", - "MigrationHubRefactorSpaces", - "MigrationHubStrategy", - "Mobile", - "Neptune", - "NetworkFirewall", - "NetworkManager", - "Nimble", - "OAM", - "Omics", - "OpenSearch", - "OpenSearchServerless", - "OpsWorks", - "OpsWorksCM", - "Organizations", - "Outposts", - "PI", - "Panorama", - "Personalize", - "PersonalizeEvents", - "PersonalizeRuntime", - "Pinpoint", - "PinpointEmail", - "PinpointSMSVoice", - "PinpointSMSVoiceV2", - "Pipes", - "Polly", - "Pricing", - "PrivateNetworks", - "Proton", - "QLDB", - "QLDBSession", - "QuickSight", - "RAM", - "RDS", - "RDSDataService", - "RUM", - "Rbin", - "Redshift", - "RedshiftData", - "RedshiftServerless", - "Rekognition", - "Resiliencehub", - "ResourceExplorer2", - "ResourceGroups", - "ResourceGroupsTaggingAPI", - "RoboMaker", - "RolesAnywhere", - "Route53", - "Route53Domains", - "Route53RecoveryCluster", - "Route53RecoveryControlConfig", - "Route53RecoveryReadiness", - "Route53Resolver", - "S3", - "S3Control", - "S3Outposts", - "SES", - "SESV2", - "SMS", - "SNS", - "SQS", - "SSM", - "SSMContacts", - "SSMIncidents", - "SSO", - "SSOAdmin", - "SSOOIDC", - "STS", - "SWF", - "SageMaker", - "SageMakerFeatureStoreRuntime", - "SageMakerGeospatial", - "SageMakerMetrics", - "SageMakerRuntime", - "SagemakerEdge", - "SavingsPlans", - "Scheduler", - "Schemas", - "SecretsManager", - "SecurityHub", - "SecurityLake", - "ServerlessApplicationRepository", - "ServiceCatalog", - "ServiceCatalogAppRegistry", - "ServiceDiscovery", - "ServiceQuotas", - "Shield", - "Signer", - "SimSpaceWeaver", - "SnowDeviceManagement", - "Snowball", - "SsmSap", - "StepFunctions", - "StorageGateway", - "Support", - "SupportApp", - "Synthetics", - "Textract", - "TimestreamQuery", - "TimestreamWrite", - "TranscribeService", - "Transfer", - "Translate", - "VoiceID", - "WAF", - "WAFRegional", - "WAFV2", - "WellArchitected", - "Wisdom", - "WorkDocs", - "WorkLink", - "WorkMail", - "WorkMailMessageFlow", - "WorkSpaces", - "WorkSpacesWeb", - "XRay" - ]; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts -var CLIENT_PACKAGE_NAMES_MAP; -var init_client_package_names_map = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { - "use strict"; - init_client_names(); - CLIENT_PACKAGE_NAMES_MAP = { - ...CLIENT_NAMES.reduce( - (acc, name) => ({ - ...acc, - [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") - }), - {} - ), - AccessAnalyzer: "client-accessanalyzer", - ACMPCA: "client-acm-pca", - APIGateway: "client-api-gateway", - ApiGatewayManagementApi: "client-apigatewaymanagementapi", - ApiGatewayV2: "client-apigatewayv2", - AppConfig: "client-appconfig", - AppConfigData: "client-appconfigdata", - AppIntegrations: "client-appintegrations", - AppRunner: "client-apprunner", - AppStream: "client-appstream", - AppSync: "client-appsync", - ApplicationCostProfiler: "client-applicationcostprofiler", - ARCZonalShift: "client-arc-zonal-shift", - AugmentedAIRuntime: "client-sage-maker-a2iruntime", - AuditManager: "client-auditmanager", - BackupStorage: "client-backupstorage", - CUR: "client-cost-and-usage-report-service", - CloudHSMV2: "client-cloudhsm-v2", - CodeGuruProfiler: "client-codeguruprofiler", - CodeStarconnections: "client-codestar-connections", - CognitoIdentityServiceProvider: "client-cognito-identity-provider", - ComprehendMedical: "client-comprehendmedical", - ConnectContactLens: "client-connect-contact-lens", - ControlTower: "client-controltower", - DMS: "client-database-migration-service", - DataPipeline: "client-data-pipeline", - Discovery: "client-application-discovery-service", - DevOpsGuru: "client-devops-guru", - DynamoDB: "client-dynamodb", - DynamoDBStreams: "client-dynamodb-streams", - DocDB: "client-docdb", - DocDBElastic: "client-docdb-elastic", - EC2InstanceConnect: "client-ec2-instance-connect", - ECRPUBLIC: "client-ecr-public", - ELB: "client-elastic-load-balancing", - ELBv2: "client-elastic-load-balancing-v2", - ElastiCache: "client-elasticache", - EMRcontainers: "client-emr-containers", - EMRServerless: "client-emr-serverless", - ES: "client-elasticsearch-service", - EventBridge: "client-eventbridge", - Finspacedata: "client-finspace-data", - ForecastQueryService: "client-forecastquery", - ForecastService: "client-forecast", - FraudDetector: "client-frauddetector", - GameLift: "client-gamelift", - GameSparks: "client-gamesparks", - GreengrassV2: "client-greengrassv2", - GroundStation: "client-groundstation", - GuardDuty: "client-guardduty", - HealthLake: "client-healthlake", - IdentityStore: "client-identitystore", - IoTAnalytics: "client-iotanalytics", - IotData: "client-iot-data-plane", - IotDeviceAdvisor: "client-iotdeviceadvisor", - IoTSecureTunneling: "client-iotsecuretunneling", - IoTSiteWise: "client-iotsitewise", - IoTThingsGraph: "client-iotthingsgraph", - IoTTwinMaker: "client-iottwinmaker", - IoTRoboRunner: "client-iot-roborunner", - KafkaConnect: "client-kafkaconnect", - KinesisVideoSignalingChannels: "client-kinesis-video-signaling", - KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", - LakeFormation: "client-lakeformation", - LexRuntime: "client-lex-runtime-service", - ManagedBlockchain: "client-managedblockchain", - MigrationHubConfig: "client-migrationhub-config", - MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", - NetworkManager: "client-networkmanager", - OpenSearch: "client-opensearch", - OpenSearchServerless: "client-opensearchserverless", - OpsWorks: "client-opsworks", - OpsWorksCM: "client-opsworkscm", - PrivateNetworks: "client-privatenetworks", - QLDBSession: "client-qldb-session", - QuickSight: "client-quicksight", - ResourceExplorer2: "client-resource-explorer-2", - RDSDataService: "client-rds-data", - RoboMaker: "client-robomaker", - RolesAnywhere: "client-rolesanywhere", - Route53: "client-route-53", - Route53Domains: "client-route-53-domains", - Route53Resolver: "client-route53resolver", - S3Control: "client-s3-control", - SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", - SavingsPlans: "client-savingsplans", - SecurityHub: "client-securityhub", - ServerlessApplicationRepository: "client-serverlessapplicationrepository", - ServiceCatalogAppRegistry: "client-service-catalog-appregistry", - ServiceDiscovery: "client-servicediscovery", - SimSpaceWeaver: "client-simspaceweaver", - SSMContacts: "client-ssm-contacts", - SSMIncidents: "client-ssm-incidents", - SSOAdmin: "client-sso-admin", - SSOOIDC: "client-sso-oidc", - StepFunctions: "client-sfn", - TranscribeService: "client-transcribe", - WAFRegional: "client-waf-regional", - WellArchitected: "client-wellarchitected", - WorkMailMessageFlow: "client-workmailmessageflow" - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts -var get_v3_client_package_name_exports = {}; -__export(get_v3_client_package_name_exports, { - getV3ClientPackageName: () => getV3ClientPackageName -}); -var getV3ClientPackageName; -var init_get_v3_client_package_name = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { - "use strict"; - init_client_package_names_map(); - getV3ClientPackageName = (clientName) => { - if (clientName in CLIENT_PACKAGE_NAMES_MAP) { - return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; - } - throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts -var find_client_constructor_exports = {}; -__export(find_client_constructor_exports, { - findV3ClientConstructor: () => findV3ClientConstructor -}); -function findV3ClientConstructor(pkg) { - const [_clientName, ServiceClient] = Object.entries(pkg).find( - ([name]) => { - return name.endsWith("Client") && name !== "__Client"; - } - ); - return ServiceClient; -} -var init_find_client_constructor = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { - "use strict"; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js -var require_lib = __commonJS({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; - var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); - Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { - return get_v3_client_package_name_1.getV3ClientPackageName; - } }); - var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); - Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { - return find_client_constructor_1.findV3ClientConstructor; - } }); - } -}); - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var aws_sdk_v3_handler_exports = {}; -__export(aws_sdk_v3_handler_exports, { - forceSdkInstallation: () => forceSdkInstallation, - handler: () => handler -}); -module.exports = __toCommonJS(aws_sdk_v3_handler_exports); -var import_child_process = require("child_process"); -var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); - -// custom-resources/lib/aws-custom-resource/runtime/shared.ts -var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; -function flatten(object) { - return Object.assign( - {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) - ); -} -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -function filterKeys(object, pred) { - return Object.entries(object).reduce( - (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, - {} - ); -} -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data - }); - console.log("Responding", responseBody); - const parsedUrl = require("url").parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { - "content-type": "", - "content-length": Buffer.byteLength(responseBody, "utf8") - } - }; - return new Promise((resolve, reject) => { - try { - const request = require("https").request(requestOptions, resolve); - request.on("error", reject); - request.write(responseBody); - request.end(); - } catch (e) { - reject(e); - } - }); -} -function decodeCall(call) { - if (!call) { - return void 0; - } - return JSON.parse(call); -} -function startsWithOneOf(searchStrings) { - return function(string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var installedSdk = {}; -function forceSdkInstallation() { - installedSdk = {}; -} -function installLatestSdk(packageName) { - console.log(`Installing latest AWS SDK v3: ${packageName}`); - (0, import_child_process.execSync)( - `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` - ); - installedSdk = { - ...installedSdk, - [packageName]: true - }; -} -async function loadAwsSdk(packageName, installLatestAwsSdk) { - let awsSdk; - try { - if (!installedSdk[packageName] && installLatestAwsSdk === "true") { - try { - installLatestSdk(packageName); - awsSdk = require(`/tmp/node_modules/${packageName}`); - } catch (e) { - console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); - return require(packageName); - } - } else if (installedSdk[packageName]) { - awsSdk = require(`/tmp/node_modules/${packageName}`); - } else { - awsSdk = require(packageName); - } - } catch (error) { - throw Error(`Package ${packageName} does not exist.`); - } - return awsSdk; -} -async function handler(event, context) { - try { - event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); - event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); - event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); - let data = {}; - let physicalResourceId; - switch (event.RequestType) { - case "Create": - physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; - break; - case "Update": - case "Delete": - physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; - break; - } - const call = event.ResourceProperties[event.RequestType]; - if (call) { - const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); - let awsSdk = loadAwsSdk( - packageName, - event.ResourceProperties.InstallLatestAwsSdk - ); - console.log(JSON.stringify({ ...event, ResponseURL: "..." })); - let credentials; - if (call.assumedRoleArn) { - const timestamp = (/* @__PURE__ */ new Date()).getTime(); - const params = { - RoleArn: call.assumedRoleArn, - RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) - }; - const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); - credentials = fromTemporaryCredentials({ - params - }); - } - awsSdk = await awsSdk; - const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); - const client = new ServiceClient({ - apiVersion: call.apiVersion, - credentials, - region: call.region - }); - const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; - const Command = Object.entries(awsSdk).find( - ([name]) => name.toLowerCase() === commandName.toLowerCase() - )?.[1]; - let flatData = {}; - try { - const response = await client.send( - new Command( - (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} - ) - ); - flatData = { - apiVersion: client.config.apiVersion, - // For test purposes: check if apiVersion was correctly passed. - region: await client.config.region().catch(() => void 0), - // For test purposes: check if region was correctly passed. - ...flatten(response) - }; - let outputPaths; - if (call.outputPath) { - outputPaths = [call.outputPath]; - } else if (call.outputPaths) { - outputPaths = call.outputPaths; - } - if (outputPaths) { - data = filterKeys(flatData, startsWithOneOf(outputPaths)); - } else { - data = flatData; - } - } catch (e) { - const exceptionName = e.name ?? e.constructor.name; - if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { - throw e; - } - } - if (call.physicalResourceId?.responsePath) { - physicalResourceId = flatData[call.physicalResourceId.responsePath]; - } - } - await respond(event, "SUCCESS", "OK", physicalResourceId, data); - } catch (e) { - console.log(e); - await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - forceSdkInstallation, - handler -}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js deleted file mode 100644 index 6c53eaeef8cd1..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -exports.decodeSpecialValues = decodeSpecialValues; -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -exports.filterKeys = filterKeys; -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - // eslint-disable-next-line no-console - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': Buffer.byteLength(responseBody, 'utf8'), - }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -exports.respond = respond; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -exports.decodeCall = decodeCall; -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} -exports.startsWithOneOf = startsWithOneOf; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7Ozs7R0FLRztBQUNILFNBQWdCLE9BQU8sQ0FBQyxNQUFjO0lBQ3BDLE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FDbEIsRUFBRSxFQUNGLEdBQUcsU0FBUyxRQUFRLENBQUMsS0FBVSxFQUFFLE9BQWlCLEVBQUU7UUFDbEQsT0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUM7YUFDbkMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxFQUFFO1lBQ1QsTUFBTSxRQUFRLEdBQUcsTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1lBQ3hGLE9BQU8sT0FBTyxRQUFRLEtBQUssUUFBUSxJQUFJLFFBQVEsS0FBSyxJQUFJO2dCQUN0RCxDQUFDLENBQUMsUUFBUSxDQUFDLFFBQVEsRUFBRSxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQztnQkF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XR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgIHRyeSB7XG4gICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXJlcXVpcmUtaW1wb3J0c1xuICAgICAgY29uc3QgcmVxdWVzdCA9IHJlcXVpcmUoJ2h0dHBzJykucmVxdWVzdChyZXF1ZXN0T3B0aW9ucywgcmVzb2x2ZSk7XG4gICAgICByZXF1ZXN0Lm9uKCdlcnJvcicsIHJlamVjdCk7XG4gICAgICByZXF1ZXN0LndyaXRlKHJlc3BvbnNlQm9keSk7XG4gICAgICByZXF1ZXN0LmVuZCgpO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIHJlamVjdChlKTtcbiAgICB9XG4gIH0pO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZGVjb2RlQ2FsbChjYWxsOiBzdHJpbmcgfCB1bmRlZmluZWQpIHtcbiAgaWYgKCFjYWxsKSB7IHJldHVybiB1bmRlZmluZWQ7IH1cbiAgcmV0dXJuIEpTT04ucGFyc2UoY2FsbCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzdGFydHNXaXRoT25lT2Yoc2VhcmNoU3RyaW5nczogc3RyaW5nW10pOiAoc3RyaW5nOiBzdHJpbmcpID0+IGJvb2xlYW4ge1xuICByZXR1cm4gZnVuY3Rpb24oc3RyaW5nOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgICBmb3IgKGNvbnN0IHNlYXJjaFN0cmluZyBvZiBzZWFyY2hTdHJpbmdzKSB7XG4gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/aws-cdk-vpc-endpoint-dns-integ.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/aws-cdk-vpc-endpoint-dns-integ.assets.json index 3c16da8013044..1f04cf1b8d0bb 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/aws-cdk-vpc-endpoint-dns-integ.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/aws-cdk-vpc-endpoint-dns-integ.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "8973d9342d0142923a7754dc2fa4648ef9211d90607c7000c2d37b80d363b219": { + "2dd1aeed92e7c095ab32b5f30ab9df95f2fc00f51b9aca50d23de6454817bf29": { "source": { "path": "aws-cdk-vpc-endpoint-dns-integ.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "8973d9342d0142923a7754dc2fa4648ef9211d90607c7000c2d37b80d363b219.json", + "objectKey": "2dd1aeed92e7c095ab32b5f30ab9df95f2fc00f51b9aca50d23de6454817bf29.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/aws-cdk-vpc-endpoint-dns-integ.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/aws-cdk-vpc-endpoint-dns-integ.template.json index 160dfa961f486..8f3252da3c100 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/aws-cdk-vpc-endpoint-dns-integ.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/aws-cdk-vpc-endpoint-dns-integ.template.json @@ -815,7 +815,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/manifest.json index 3789c6d5396a7..9637b0d6415f4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8973d9342d0142923a7754dc2fa4648ef9211d90607c7000c2d37b80d363b219.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2dd1aeed92e7c095ab32b5f30ab9df95f2fc00f51b9aca50d23de6454817bf29.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/tree.json index 99a56eeecca24..a1756e54eadb9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.vpc-endpoint-service-domain-name.js.snapshot/tree.json @@ -1159,7 +1159,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js new file mode 100644 index 0000000000000..9f6e97928f257 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -0,0 +1,779 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts +var CLIENT_NAMES; +var init_client_names = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { + "use strict"; + CLIENT_NAMES = [ + "ACM", + "ACMPCA", + "APIGateway", + "ARCZonalShift", + "AccessAnalyzer", + "Account", + "AlexaForBusiness", + "Amp", + "Amplify", + "AmplifyBackend", + "AmplifyUIBuilder", + "ApiGatewayManagementApi", + "ApiGatewayV2", + "AppConfig", + "AppConfigData", + "AppIntegrations", + "AppMesh", + "AppRunner", + "AppStream", + "AppSync", + "Appflow", + "ApplicationAutoScaling", + "ApplicationCostProfiler", + "ApplicationInsights", + "Athena", + "AuditManager", + "AugmentedAIRuntime", + "AutoScaling", + "AutoScalingPlans", + "Backup", + "BackupGateway", + "BackupStorage", + "Batch", + "Billingconductor", + "Braket", + "Budgets", + "CUR", + "Chime", + "ChimeSDKIdentity", + "ChimeSDKMediaPipelines", + "ChimeSDKMeetings", + "ChimeSDKMessaging", + "ChimeSDKVoice", + "Cloud9", + "CloudControl", + "CloudDirectory", + "CloudFormation", + "CloudFront", + "CloudHSM", + "CloudHSMV2", + "CloudSearch", + "CloudSearchDomain", + "CloudTrail", + "CloudWatch", + "CloudWatchEvents", + "CloudWatchLogs", + "CodeArtifact", + "CodeBuild", + "CodeCatalyst", + "CodeCommit", + "CodeDeploy", + "CodeGuruProfiler", + "CodeGuruReviewer", + "CodePipeline", + "CodeStar", + "CodeStarNotifications", + "CodeStarconnections", + "CognitoIdentity", + "CognitoIdentityServiceProvider", + "CognitoSync", + "Comprehend", + "ComprehendMedical", + "ComputeOptimizer", + "ConfigService", + "Connect", + "ConnectCampaigns", + "ConnectCases", + "ConnectContactLens", + "ConnectParticipant", + "ControlTower", + "CostExplorer", + "CustomerProfiles", + "DAX", + "DLM", + "DMS", + "DataBrew", + "DataExchange", + "DataPipeline", + "DataSync", + "Detective", + "DevOpsGuru", + "DeviceFarm", + "DirectConnect", + "DirectoryService", + "Discovery", + "DocDB", + "DocDBElastic", + "Drs", + "DynamoDB", + "DynamoDBStreams", + "EBS", + "EC2", + "EC2InstanceConnect", + "ECR", + "ECRPUBLIC", + "ECS", + "EFS", + "EKS", + "ELB", + "ELBv2", + "EMR", + "EMRServerless", + "EMRcontainers", + "ES", + "ElastiCache", + "ElasticBeanstalk", + "ElasticInference", + "ElasticTranscoder", + "EventBridge", + "Evidently", + "FMS", + "FSx", + "Finspace", + "Finspacedata", + "Firehose", + "Fis", + "ForecastQueryService", + "ForecastService", + "FraudDetector", + "GameLift", + "GameSparks", + "Glacier", + "GlobalAccelerator", + "Glue", + "Grafana", + "Greengrass", + "GreengrassV2", + "GroundStation", + "GuardDuty", + "Health", + "HealthLake", + "Honeycode", + "IAM", + "IVS", + "IdentityStore", + "Imagebuilder", + "Inspector", + "Inspector2", + "IoT1ClickDevicesService", + "IoT1ClickProjects", + "IoTAnalytics", + "IoTEvents", + "IoTEventsData", + "IoTFleetHub", + "IoTFleetWise", + "IoTJobsDataPlane", + "IoTRoboRunner", + "IoTSecureTunneling", + "IoTSiteWise", + "IoTThingsGraph", + "IoTTwinMaker", + "IoTWireless", + "Iot", + "IotData", + "IotDeviceAdvisor", + "Ivschat", + "KMS", + "Kafka", + "KafkaConnect", + "Kendra", + "Keyspaces", + "Kinesis", + "KinesisAnalytics", + "KinesisAnalyticsV2", + "KinesisVideo", + "KinesisVideoArchivedMedia", + "KinesisVideoMedia", + "KinesisVideoSignalingChannels", + "KinesisVideoWebRTCStorage", + "LakeFormation", + "Lambda", + "LexModelBuildingService", + "LexModelsV2", + "LexRuntime", + "LexRuntimeV2", + "LicenseManager", + "LicenseManagerLinuxSubscriptions", + "LicenseManagerUserSubscriptions", + "Lightsail", + "Location", + "LookoutEquipment", + "LookoutMetrics", + "LookoutVision", + "M2", + "MQ", + "MTurk", + "MWAA", + "MachineLearning", + "Macie", + "Macie2", + "ManagedBlockchain", + "MarketplaceCatalog", + "MarketplaceCommerceAnalytics", + "MarketplaceEntitlementService", + "MarketplaceMetering", + "MediaConnect", + "MediaConvert", + "MediaLive", + "MediaPackage", + "MediaPackageVod", + "MediaStore", + "MediaStoreData", + "MediaTailor", + "MemoryDB", + "Mgn", + "MigrationHub", + "MigrationHubConfig", + "MigrationHubOrchestrator", + "MigrationHubRefactorSpaces", + "MigrationHubStrategy", + "Mobile", + "Neptune", + "NetworkFirewall", + "NetworkManager", + "Nimble", + "OAM", + "Omics", + "OpenSearch", + "OpenSearchServerless", + "OpsWorks", + "OpsWorksCM", + "Organizations", + "Outposts", + "PI", + "Panorama", + "Personalize", + "PersonalizeEvents", + "PersonalizeRuntime", + "Pinpoint", + "PinpointEmail", + "PinpointSMSVoice", + "PinpointSMSVoiceV2", + "Pipes", + "Polly", + "Pricing", + "PrivateNetworks", + "Proton", + "QLDB", + "QLDBSession", + "QuickSight", + "RAM", + "RDS", + "RDSDataService", + "RUM", + "Rbin", + "Redshift", + "RedshiftData", + "RedshiftServerless", + "Rekognition", + "Resiliencehub", + "ResourceExplorer2", + "ResourceGroups", + "ResourceGroupsTaggingAPI", + "RoboMaker", + "RolesAnywhere", + "Route53", + "Route53Domains", + "Route53RecoveryCluster", + "Route53RecoveryControlConfig", + "Route53RecoveryReadiness", + "Route53Resolver", + "S3", + "S3Control", + "S3Outposts", + "SES", + "SESV2", + "SMS", + "SNS", + "SQS", + "SSM", + "SSMContacts", + "SSMIncidents", + "SSO", + "SSOAdmin", + "SSOOIDC", + "STS", + "SWF", + "SageMaker", + "SageMakerFeatureStoreRuntime", + "SageMakerGeospatial", + "SageMakerMetrics", + "SageMakerRuntime", + "SagemakerEdge", + "SavingsPlans", + "Scheduler", + "Schemas", + "SecretsManager", + "SecurityHub", + "SecurityLake", + "ServerlessApplicationRepository", + "ServiceCatalog", + "ServiceCatalogAppRegistry", + "ServiceDiscovery", + "ServiceQuotas", + "Shield", + "Signer", + "SimSpaceWeaver", + "SnowDeviceManagement", + "Snowball", + "SsmSap", + "StepFunctions", + "StorageGateway", + "Support", + "SupportApp", + "Synthetics", + "Textract", + "TimestreamQuery", + "TimestreamWrite", + "TranscribeService", + "Transfer", + "Translate", + "VoiceID", + "WAF", + "WAFRegional", + "WAFV2", + "WellArchitected", + "Wisdom", + "WorkDocs", + "WorkLink", + "WorkMail", + "WorkMailMessageFlow", + "WorkSpaces", + "WorkSpacesWeb", + "XRay" + ]; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts +var CLIENT_PACKAGE_NAMES_MAP; +var init_client_package_names_map = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { + "use strict"; + init_client_names(); + CLIENT_PACKAGE_NAMES_MAP = { + ...CLIENT_NAMES.reduce( + (acc, name) => ({ + ...acc, + [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") + }), + {} + ), + AccessAnalyzer: "client-accessanalyzer", + ACMPCA: "client-acm-pca", + APIGateway: "client-api-gateway", + ApiGatewayManagementApi: "client-apigatewaymanagementapi", + ApiGatewayV2: "client-apigatewayv2", + AppConfig: "client-appconfig", + AppConfigData: "client-appconfigdata", + AppIntegrations: "client-appintegrations", + AppRunner: "client-apprunner", + AppStream: "client-appstream", + AppSync: "client-appsync", + ApplicationCostProfiler: "client-applicationcostprofiler", + ARCZonalShift: "client-arc-zonal-shift", + AugmentedAIRuntime: "client-sage-maker-a2iruntime", + AuditManager: "client-auditmanager", + BackupStorage: "client-backupstorage", + CUR: "client-cost-and-usage-report-service", + CloudHSMV2: "client-cloudhsm-v2", + CodeGuruProfiler: "client-codeguruprofiler", + CodeStarconnections: "client-codestar-connections", + CognitoIdentityServiceProvider: "client-cognito-identity-provider", + ComprehendMedical: "client-comprehendmedical", + ConnectContactLens: "client-connect-contact-lens", + ControlTower: "client-controltower", + DMS: "client-database-migration-service", + DataPipeline: "client-data-pipeline", + Discovery: "client-application-discovery-service", + DevOpsGuru: "client-devops-guru", + DynamoDB: "client-dynamodb", + DynamoDBStreams: "client-dynamodb-streams", + DocDB: "client-docdb", + DocDBElastic: "client-docdb-elastic", + EC2InstanceConnect: "client-ec2-instance-connect", + ECRPUBLIC: "client-ecr-public", + ELB: "client-elastic-load-balancing", + ELBv2: "client-elastic-load-balancing-v2", + ElastiCache: "client-elasticache", + EMRcontainers: "client-emr-containers", + EMRServerless: "client-emr-serverless", + ES: "client-elasticsearch-service", + EventBridge: "client-eventbridge", + Finspacedata: "client-finspace-data", + ForecastQueryService: "client-forecastquery", + ForecastService: "client-forecast", + FraudDetector: "client-frauddetector", + GameLift: "client-gamelift", + GameSparks: "client-gamesparks", + GreengrassV2: "client-greengrassv2", + GroundStation: "client-groundstation", + GuardDuty: "client-guardduty", + HealthLake: "client-healthlake", + IdentityStore: "client-identitystore", + IoTAnalytics: "client-iotanalytics", + IotData: "client-iot-data-plane", + IotDeviceAdvisor: "client-iotdeviceadvisor", + IoTSecureTunneling: "client-iotsecuretunneling", + IoTSiteWise: "client-iotsitewise", + IoTThingsGraph: "client-iotthingsgraph", + IoTTwinMaker: "client-iottwinmaker", + IoTRoboRunner: "client-iot-roborunner", + KafkaConnect: "client-kafkaconnect", + KinesisVideoSignalingChannels: "client-kinesis-video-signaling", + KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", + LakeFormation: "client-lakeformation", + LexRuntime: "client-lex-runtime-service", + ManagedBlockchain: "client-managedblockchain", + MigrationHubConfig: "client-migrationhub-config", + MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", + NetworkManager: "client-networkmanager", + OpenSearch: "client-opensearch", + OpenSearchServerless: "client-opensearchserverless", + OpsWorks: "client-opsworks", + OpsWorksCM: "client-opsworkscm", + PrivateNetworks: "client-privatenetworks", + QLDBSession: "client-qldb-session", + QuickSight: "client-quicksight", + ResourceExplorer2: "client-resource-explorer-2", + RDSDataService: "client-rds-data", + RoboMaker: "client-robomaker", + RolesAnywhere: "client-rolesanywhere", + Route53: "client-route-53", + Route53Domains: "client-route-53-domains", + Route53Resolver: "client-route53resolver", + S3Control: "client-s3-control", + SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", + SavingsPlans: "client-savingsplans", + SecurityHub: "client-securityhub", + ServerlessApplicationRepository: "client-serverlessapplicationrepository", + ServiceCatalogAppRegistry: "client-service-catalog-appregistry", + ServiceDiscovery: "client-servicediscovery", + SimSpaceWeaver: "client-simspaceweaver", + SSMContacts: "client-ssm-contacts", + SSMIncidents: "client-ssm-incidents", + SSOAdmin: "client-sso-admin", + SSOOIDC: "client-sso-oidc", + StepFunctions: "client-sfn", + TranscribeService: "client-transcribe", + WAFRegional: "client-waf-regional", + WellArchitected: "client-wellarchitected", + WorkMailMessageFlow: "client-workmailmessageflow" + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts +var get_v3_client_package_name_exports = {}; +__export(get_v3_client_package_name_exports, { + getV3ClientPackageName: () => getV3ClientPackageName +}); +var getV3ClientPackageName; +var init_get_v3_client_package_name = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { + "use strict"; + init_client_package_names_map(); + getV3ClientPackageName = (clientName) => { + if (clientName in CLIENT_PACKAGE_NAMES_MAP) { + return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; + } + throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts +var find_client_constructor_exports = {}; +__export(find_client_constructor_exports, { + findV3ClientConstructor: () => findV3ClientConstructor +}); +function findV3ClientConstructor(pkg) { + const [_clientName, ServiceClient] = Object.entries(pkg).find( + ([name]) => { + return name.endsWith("Client") && name !== "__Client"; + } + ); + return ServiceClient; +} +var init_find_client_constructor = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { + "use strict"; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js +var require_lib = __commonJS({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; + var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); + Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { + return get_v3_client_package_name_1.getV3ClientPackageName; + } }); + var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); + Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { + return find_client_constructor_1.findV3ClientConstructor; + } }); + } +}); + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var aws_sdk_v3_handler_exports = {}; +__export(aws_sdk_v3_handler_exports, { + forceSdkInstallation: () => forceSdkInstallation, + handler: () => handler +}); +module.exports = __toCommonJS(aws_sdk_v3_handler_exports); +var import_child_process = require("child_process"); +var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); + +// custom-resources/lib/aws-custom-resource/runtime/shared.ts +var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } + return Object.assign( + {}, + ..._flatten(object) + ); +} +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +function filterKeys(object, pred) { + return Object.entries(object).reduce( + (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, + {} + ); +} +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data + }); + console.log("Responding", responseBody); + const parsedUrl = require("url").parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { + "content-type": "", + "content-length": Buffer.byteLength(responseBody, "utf8") + } + }; + return new Promise((resolve, reject) => { + try { + const request = require("https").request(requestOptions, resolve); + request.on("error", reject); + request.write(responseBody); + request.end(); + } catch (e) { + reject(e); + } + }); +} +function decodeCall(call) { + if (!call) { + return void 0; + } + return JSON.parse(call); +} +function startsWithOneOf(searchStrings) { + return function(string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var installedSdk = {}; +function forceSdkInstallation() { + installedSdk = {}; +} +function installLatestSdk(packageName) { + console.log(`Installing latest AWS SDK v3: ${packageName}`); + (0, import_child_process.execSync)( + `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` + ); + installedSdk = { + ...installedSdk, + [packageName]: true + }; +} +async function loadAwsSdk(packageName, installLatestAwsSdk) { + let awsSdk; + try { + if (!installedSdk[packageName] && installLatestAwsSdk === "true") { + try { + installLatestSdk(packageName); + awsSdk = require(`/tmp/node_modules/${packageName}`); + } catch (e) { + console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); + return require(packageName); + } + } else if (installedSdk[packageName]) { + awsSdk = require(`/tmp/node_modules/${packageName}`); + } else { + awsSdk = require(packageName); + } + } catch (error) { + throw Error(`Package ${packageName} does not exist.`); + } + return awsSdk; +} +async function handler(event, context) { + try { + event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); + event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); + event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); + let data = {}; + let physicalResourceId; + switch (event.RequestType) { + case "Create": + physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; + break; + case "Update": + case "Delete": + physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; + break; + } + const call = event.ResourceProperties[event.RequestType]; + if (call) { + const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); + let awsSdk = loadAwsSdk( + packageName, + event.ResourceProperties.InstallLatestAwsSdk + ); + console.log(JSON.stringify({ ...event, ResponseURL: "..." })); + let credentials; + if (call.assumedRoleArn) { + const timestamp = (/* @__PURE__ */ new Date()).getTime(); + const params = { + RoleArn: call.assumedRoleArn, + RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) + }; + const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); + credentials = fromTemporaryCredentials({ + params + }); + } + awsSdk = await awsSdk; + const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); + const client = new ServiceClient({ + apiVersion: call.apiVersion, + credentials, + region: call.region + }); + const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; + const Command = Object.entries(awsSdk).find( + ([name]) => name.toLowerCase() === commandName.toLowerCase() + )?.[1]; + let flatData = {}; + try { + const response = await client.send( + new Command( + (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} + ) + ); + flatData = { + apiVersion: client.config.apiVersion, + // For test purposes: check if apiVersion was correctly passed. + region: await client.config.region().catch(() => void 0), + // For test purposes: check if region was correctly passed. + ...flatten(response) + }; + let outputPaths; + if (call.outputPath) { + outputPaths = [call.outputPath]; + } else if (call.outputPaths) { + outputPaths = call.outputPaths; + } + if (outputPaths) { + data = filterKeys(flatData, startsWithOneOf(outputPaths)); + } else { + data = flatData; + } + } catch (e) { + const exceptionName = e.name ?? e.constructor.name; + if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { + throw e; + } + } + if (call.physicalResourceId?.responsePath) { + physicalResourceId = flatData[call.physicalResourceId.responsePath]; + } + } + await respond(event, "SUCCESS", "OK", physicalResourceId, data); + } catch (e) { + console.log(e); + await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + forceSdkInstallation, + handler +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +exports.startsWithOneOf = startsWithOneOf; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7R0FFRztBQUNILE1BQU0sT0FBTyxHQUFHLElBQUksV0FBVyxFQUFFLENBQUM7QUFFbEM7O0dBRUc7QUFDSCxTQUFTLFVBQVUsQ0FBQyxLQUFVO0lBQzVCLElBQUksTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsRUFBRTtRQUMxQixPQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDL0I7U0FBTSxJQUFJLFdBQVcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLEVBQUU7UUFDcEMsT0FBTyxPQUFPLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQztLQUNyQztJQUVELE9BQU8sS0FBSyxDQUFDO0FBQ2YsQ0FBQztBQUNEOzs7OztHQUtHO0FB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dk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js deleted file mode 100644 index 1b662725f1b0b..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js +++ /dev/null @@ -1,769 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts -var CLIENT_NAMES; -var init_client_names = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { - "use strict"; - CLIENT_NAMES = [ - "ACM", - "ACMPCA", - "APIGateway", - "ARCZonalShift", - "AccessAnalyzer", - "Account", - "AlexaForBusiness", - "Amp", - "Amplify", - "AmplifyBackend", - "AmplifyUIBuilder", - "ApiGatewayManagementApi", - "ApiGatewayV2", - "AppConfig", - "AppConfigData", - "AppIntegrations", - "AppMesh", - "AppRunner", - "AppStream", - "AppSync", - "Appflow", - "ApplicationAutoScaling", - "ApplicationCostProfiler", - "ApplicationInsights", - "Athena", - "AuditManager", - "AugmentedAIRuntime", - "AutoScaling", - "AutoScalingPlans", - "Backup", - "BackupGateway", - "BackupStorage", - "Batch", - "Billingconductor", - "Braket", - "Budgets", - "CUR", - "Chime", - "ChimeSDKIdentity", - "ChimeSDKMediaPipelines", - "ChimeSDKMeetings", - "ChimeSDKMessaging", - "ChimeSDKVoice", - "Cloud9", - "CloudControl", - "CloudDirectory", - "CloudFormation", - "CloudFront", - "CloudHSM", - "CloudHSMV2", - "CloudSearch", - "CloudSearchDomain", - "CloudTrail", - "CloudWatch", - "CloudWatchEvents", - "CloudWatchLogs", - "CodeArtifact", - "CodeBuild", - "CodeCatalyst", - "CodeCommit", - "CodeDeploy", - "CodeGuruProfiler", - "CodeGuruReviewer", - "CodePipeline", - "CodeStar", - "CodeStarNotifications", - "CodeStarconnections", - "CognitoIdentity", - "CognitoIdentityServiceProvider", - "CognitoSync", - "Comprehend", - "ComprehendMedical", - "ComputeOptimizer", - "ConfigService", - "Connect", - "ConnectCampaigns", - "ConnectCases", - "ConnectContactLens", - "ConnectParticipant", - "ControlTower", - "CostExplorer", - "CustomerProfiles", - "DAX", - "DLM", - "DMS", - "DataBrew", - "DataExchange", - "DataPipeline", - "DataSync", - "Detective", - "DevOpsGuru", - "DeviceFarm", - "DirectConnect", - "DirectoryService", - "Discovery", - "DocDB", - "DocDBElastic", - "Drs", - "DynamoDB", - "DynamoDBStreams", - "EBS", - "EC2", - "EC2InstanceConnect", - "ECR", - "ECRPUBLIC", - "ECS", - "EFS", - "EKS", - "ELB", - "ELBv2", - "EMR", - "EMRServerless", - "EMRcontainers", - "ES", - "ElastiCache", - "ElasticBeanstalk", - "ElasticInference", - "ElasticTranscoder", - "EventBridge", - "Evidently", - "FMS", - "FSx", - "Finspace", - "Finspacedata", - "Firehose", - "Fis", - "ForecastQueryService", - "ForecastService", - "FraudDetector", - "GameLift", - "GameSparks", - "Glacier", - "GlobalAccelerator", - "Glue", - "Grafana", - "Greengrass", - "GreengrassV2", - "GroundStation", - "GuardDuty", - "Health", - "HealthLake", - "Honeycode", - "IAM", - "IVS", - "IdentityStore", - "Imagebuilder", - "Inspector", - "Inspector2", - "IoT1ClickDevicesService", - "IoT1ClickProjects", - "IoTAnalytics", - "IoTEvents", - "IoTEventsData", - "IoTFleetHub", - "IoTFleetWise", - "IoTJobsDataPlane", - "IoTRoboRunner", - "IoTSecureTunneling", - "IoTSiteWise", - "IoTThingsGraph", - "IoTTwinMaker", - "IoTWireless", - "Iot", - "IotData", - "IotDeviceAdvisor", - "Ivschat", - "KMS", - "Kafka", - "KafkaConnect", - "Kendra", - "Keyspaces", - "Kinesis", - "KinesisAnalytics", - "KinesisAnalyticsV2", - "KinesisVideo", - "KinesisVideoArchivedMedia", - "KinesisVideoMedia", - "KinesisVideoSignalingChannels", - "KinesisVideoWebRTCStorage", - "LakeFormation", - "Lambda", - "LexModelBuildingService", - "LexModelsV2", - "LexRuntime", - "LexRuntimeV2", - "LicenseManager", - "LicenseManagerLinuxSubscriptions", - "LicenseManagerUserSubscriptions", - "Lightsail", - "Location", - "LookoutEquipment", - "LookoutMetrics", - "LookoutVision", - "M2", - "MQ", - "MTurk", - "MWAA", - "MachineLearning", - "Macie", - "Macie2", - "ManagedBlockchain", - "MarketplaceCatalog", - "MarketplaceCommerceAnalytics", - "MarketplaceEntitlementService", - "MarketplaceMetering", - "MediaConnect", - "MediaConvert", - "MediaLive", - "MediaPackage", - "MediaPackageVod", - "MediaStore", - "MediaStoreData", - "MediaTailor", - "MemoryDB", - "Mgn", - "MigrationHub", - "MigrationHubConfig", - "MigrationHubOrchestrator", - "MigrationHubRefactorSpaces", - "MigrationHubStrategy", - "Mobile", - "Neptune", - "NetworkFirewall", - "NetworkManager", - "Nimble", - "OAM", - "Omics", - "OpenSearch", - "OpenSearchServerless", - "OpsWorks", - "OpsWorksCM", - "Organizations", - "Outposts", - "PI", - "Panorama", - "Personalize", - "PersonalizeEvents", - "PersonalizeRuntime", - "Pinpoint", - "PinpointEmail", - "PinpointSMSVoice", - "PinpointSMSVoiceV2", - "Pipes", - "Polly", - "Pricing", - "PrivateNetworks", - "Proton", - "QLDB", - "QLDBSession", - "QuickSight", - "RAM", - "RDS", - "RDSDataService", - "RUM", - "Rbin", - "Redshift", - "RedshiftData", - "RedshiftServerless", - "Rekognition", - "Resiliencehub", - "ResourceExplorer2", - "ResourceGroups", - "ResourceGroupsTaggingAPI", - "RoboMaker", - "RolesAnywhere", - "Route53", - "Route53Domains", - "Route53RecoveryCluster", - "Route53RecoveryControlConfig", - "Route53RecoveryReadiness", - "Route53Resolver", - "S3", - "S3Control", - "S3Outposts", - "SES", - "SESV2", - "SMS", - "SNS", - "SQS", - "SSM", - "SSMContacts", - "SSMIncidents", - "SSO", - "SSOAdmin", - "SSOOIDC", - "STS", - "SWF", - "SageMaker", - "SageMakerFeatureStoreRuntime", - "SageMakerGeospatial", - "SageMakerMetrics", - "SageMakerRuntime", - "SagemakerEdge", - "SavingsPlans", - "Scheduler", - "Schemas", - "SecretsManager", - "SecurityHub", - "SecurityLake", - "ServerlessApplicationRepository", - "ServiceCatalog", - "ServiceCatalogAppRegistry", - "ServiceDiscovery", - "ServiceQuotas", - "Shield", - "Signer", - "SimSpaceWeaver", - "SnowDeviceManagement", - "Snowball", - "SsmSap", - "StepFunctions", - "StorageGateway", - "Support", - "SupportApp", - "Synthetics", - "Textract", - "TimestreamQuery", - "TimestreamWrite", - "TranscribeService", - "Transfer", - "Translate", - "VoiceID", - "WAF", - "WAFRegional", - "WAFV2", - "WellArchitected", - "Wisdom", - "WorkDocs", - "WorkLink", - "WorkMail", - "WorkMailMessageFlow", - "WorkSpaces", - "WorkSpacesWeb", - "XRay" - ]; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts -var CLIENT_PACKAGE_NAMES_MAP; -var init_client_package_names_map = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { - "use strict"; - init_client_names(); - CLIENT_PACKAGE_NAMES_MAP = { - ...CLIENT_NAMES.reduce( - (acc, name) => ({ - ...acc, - [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") - }), - {} - ), - AccessAnalyzer: "client-accessanalyzer", - ACMPCA: "client-acm-pca", - APIGateway: "client-api-gateway", - ApiGatewayManagementApi: "client-apigatewaymanagementapi", - ApiGatewayV2: "client-apigatewayv2", - AppConfig: "client-appconfig", - AppConfigData: "client-appconfigdata", - AppIntegrations: "client-appintegrations", - AppRunner: "client-apprunner", - AppStream: "client-appstream", - AppSync: "client-appsync", - ApplicationCostProfiler: "client-applicationcostprofiler", - ARCZonalShift: "client-arc-zonal-shift", - AugmentedAIRuntime: "client-sage-maker-a2iruntime", - AuditManager: "client-auditmanager", - BackupStorage: "client-backupstorage", - CUR: "client-cost-and-usage-report-service", - CloudHSMV2: "client-cloudhsm-v2", - CodeGuruProfiler: "client-codeguruprofiler", - CodeStarconnections: "client-codestar-connections", - CognitoIdentityServiceProvider: "client-cognito-identity-provider", - ComprehendMedical: "client-comprehendmedical", - ConnectContactLens: "client-connect-contact-lens", - ControlTower: "client-controltower", - DMS: "client-database-migration-service", - DataPipeline: "client-data-pipeline", - Discovery: "client-application-discovery-service", - DevOpsGuru: "client-devops-guru", - DynamoDB: "client-dynamodb", - DynamoDBStreams: "client-dynamodb-streams", - DocDB: "client-docdb", - DocDBElastic: "client-docdb-elastic", - EC2InstanceConnect: "client-ec2-instance-connect", - ECRPUBLIC: "client-ecr-public", - ELB: "client-elastic-load-balancing", - ELBv2: "client-elastic-load-balancing-v2", - ElastiCache: "client-elasticache", - EMRcontainers: "client-emr-containers", - EMRServerless: "client-emr-serverless", - ES: "client-elasticsearch-service", - EventBridge: "client-eventbridge", - Finspacedata: "client-finspace-data", - ForecastQueryService: "client-forecastquery", - ForecastService: "client-forecast", - FraudDetector: "client-frauddetector", - GameLift: "client-gamelift", - GameSparks: "client-gamesparks", - GreengrassV2: "client-greengrassv2", - GroundStation: "client-groundstation", - GuardDuty: "client-guardduty", - HealthLake: "client-healthlake", - IdentityStore: "client-identitystore", - IoTAnalytics: "client-iotanalytics", - IotData: "client-iot-data-plane", - IotDeviceAdvisor: "client-iotdeviceadvisor", - IoTSecureTunneling: "client-iotsecuretunneling", - IoTSiteWise: "client-iotsitewise", - IoTThingsGraph: "client-iotthingsgraph", - IoTTwinMaker: "client-iottwinmaker", - IoTRoboRunner: "client-iot-roborunner", - KafkaConnect: "client-kafkaconnect", - KinesisVideoSignalingChannels: "client-kinesis-video-signaling", - KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", - LakeFormation: "client-lakeformation", - LexRuntime: "client-lex-runtime-service", - ManagedBlockchain: "client-managedblockchain", - MigrationHubConfig: "client-migrationhub-config", - MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", - NetworkManager: "client-networkmanager", - OpenSearch: "client-opensearch", - OpenSearchServerless: "client-opensearchserverless", - OpsWorks: "client-opsworks", - OpsWorksCM: "client-opsworkscm", - PrivateNetworks: "client-privatenetworks", - QLDBSession: "client-qldb-session", - QuickSight: "client-quicksight", - ResourceExplorer2: "client-resource-explorer-2", - RDSDataService: "client-rds-data", - RoboMaker: "client-robomaker", - RolesAnywhere: "client-rolesanywhere", - Route53: "client-route-53", - Route53Domains: "client-route-53-domains", - Route53Resolver: "client-route53resolver", - S3Control: "client-s3-control", - SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", - SavingsPlans: "client-savingsplans", - SecurityHub: "client-securityhub", - ServerlessApplicationRepository: "client-serverlessapplicationrepository", - ServiceCatalogAppRegistry: "client-service-catalog-appregistry", - ServiceDiscovery: "client-servicediscovery", - SimSpaceWeaver: "client-simspaceweaver", - SSMContacts: "client-ssm-contacts", - SSMIncidents: "client-ssm-incidents", - SSOAdmin: "client-sso-admin", - SSOOIDC: "client-sso-oidc", - StepFunctions: "client-sfn", - TranscribeService: "client-transcribe", - WAFRegional: "client-waf-regional", - WellArchitected: "client-wellarchitected", - WorkMailMessageFlow: "client-workmailmessageflow" - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts -var get_v3_client_package_name_exports = {}; -__export(get_v3_client_package_name_exports, { - getV3ClientPackageName: () => getV3ClientPackageName -}); -var getV3ClientPackageName; -var init_get_v3_client_package_name = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { - "use strict"; - init_client_package_names_map(); - getV3ClientPackageName = (clientName) => { - if (clientName in CLIENT_PACKAGE_NAMES_MAP) { - return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; - } - throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts -var find_client_constructor_exports = {}; -__export(find_client_constructor_exports, { - findV3ClientConstructor: () => findV3ClientConstructor -}); -function findV3ClientConstructor(pkg) { - const [_clientName, ServiceClient] = Object.entries(pkg).find( - ([name]) => { - return name.endsWith("Client") && name !== "__Client"; - } - ); - return ServiceClient; -} -var init_find_client_constructor = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { - "use strict"; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js -var require_lib = __commonJS({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; - var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); - Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { - return get_v3_client_package_name_1.getV3ClientPackageName; - } }); - var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); - Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { - return find_client_constructor_1.findV3ClientConstructor; - } }); - } -}); - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var aws_sdk_v3_handler_exports = {}; -__export(aws_sdk_v3_handler_exports, { - forceSdkInstallation: () => forceSdkInstallation, - handler: () => handler -}); -module.exports = __toCommonJS(aws_sdk_v3_handler_exports); -var import_child_process = require("child_process"); -var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); - -// custom-resources/lib/aws-custom-resource/runtime/shared.ts -var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; -function flatten(object) { - return Object.assign( - {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) - ); -} -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -function filterKeys(object, pred) { - return Object.entries(object).reduce( - (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, - {} - ); -} -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data - }); - console.log("Responding", responseBody); - const parsedUrl = require("url").parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { - "content-type": "", - "content-length": Buffer.byteLength(responseBody, "utf8") - } - }; - return new Promise((resolve, reject) => { - try { - const request = require("https").request(requestOptions, resolve); - request.on("error", reject); - request.write(responseBody); - request.end(); - } catch (e) { - reject(e); - } - }); -} -function decodeCall(call) { - if (!call) { - return void 0; - } - return JSON.parse(call); -} -function startsWithOneOf(searchStrings) { - return function(string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var installedSdk = {}; -function forceSdkInstallation() { - installedSdk = {}; -} -function installLatestSdk(packageName) { - console.log(`Installing latest AWS SDK v3: ${packageName}`); - (0, import_child_process.execSync)( - `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` - ); - installedSdk = { - ...installedSdk, - [packageName]: true - }; -} -async function loadAwsSdk(packageName, installLatestAwsSdk) { - let awsSdk; - try { - if (!installedSdk[packageName] && installLatestAwsSdk === "true") { - try { - installLatestSdk(packageName); - awsSdk = require(`/tmp/node_modules/${packageName}`); - } catch (e) { - console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); - return require(packageName); - } - } else if (installedSdk[packageName]) { - awsSdk = require(`/tmp/node_modules/${packageName}`); - } else { - awsSdk = require(packageName); - } - } catch (error) { - throw Error(`Package ${packageName} does not exist.`); - } - return awsSdk; -} -async function handler(event, context) { - try { - event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); - event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); - event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); - let data = {}; - let physicalResourceId; - switch (event.RequestType) { - case "Create": - physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; - break; - case "Update": - case "Delete": - physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; - break; - } - const call = event.ResourceProperties[event.RequestType]; - if (call) { - const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); - let awsSdk = loadAwsSdk( - packageName, - event.ResourceProperties.InstallLatestAwsSdk - ); - console.log(JSON.stringify({ ...event, ResponseURL: "..." })); - let credentials; - if (call.assumedRoleArn) { - const timestamp = (/* @__PURE__ */ new Date()).getTime(); - const params = { - RoleArn: call.assumedRoleArn, - RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) - }; - const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); - credentials = fromTemporaryCredentials({ - params - }); - } - awsSdk = await awsSdk; - const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); - const client = new ServiceClient({ - apiVersion: call.apiVersion, - credentials, - region: call.region - }); - const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; - const Command = Object.entries(awsSdk).find( - ([name]) => name.toLowerCase() === commandName.toLowerCase() - )?.[1]; - let flatData = {}; - try { - const response = await client.send( - new Command( - (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} - ) - ); - flatData = { - apiVersion: client.config.apiVersion, - // For test purposes: check if apiVersion was correctly passed. - region: await client.config.region().catch(() => void 0), - // For test purposes: check if region was correctly passed. - ...flatten(response) - }; - let outputPaths; - if (call.outputPath) { - outputPaths = [call.outputPath]; - } else if (call.outputPaths) { - outputPaths = call.outputPaths; - } - if (outputPaths) { - data = filterKeys(flatData, startsWithOneOf(outputPaths)); - } else { - data = flatData; - } - } catch (e) { - const exceptionName = e.name ?? e.constructor.name; - if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { - throw e; - } - } - if (call.physicalResourceId?.responsePath) { - physicalResourceId = flatData[call.physicalResourceId.responsePath]; - } - } - await respond(event, "SUCCESS", "OK", physicalResourceId, data); - } catch (e) { - console.log(e); - await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - forceSdkInstallation, - handler -}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js deleted file mode 100644 index 6c53eaeef8cd1..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -exports.decodeSpecialValues = decodeSpecialValues; -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -exports.filterKeys = filterKeys; -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - // eslint-disable-next-line no-console - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': Buffer.byteLength(responseBody, 'utf8'), - }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -exports.respond = respond; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -exports.decodeCall = decodeCall; -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} -exports.startsWithOneOf = startsWithOneOf; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7Ozs7R0FLRztBQUNILFNBQWdCLE9BQU8sQ0FBQyxNQUFjO0lBQ3BDLE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FDbEIsRUFBRSxFQUNGLEdBQUcsU0FBUyxRQUFRLENBQUMsS0FBVSxFQUFFLE9BQWlCLEVBQUU7UUFDbEQsT0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUM7YUFDbkMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxFQUFFO1lBQ1QsTUFBTSxRQUFRLEdBQUcsTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsQ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gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.assets.json index befd65f1d3146..e5a83da44f6d1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.assets.json @@ -27,20 +27,20 @@ } } }, - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "41e9944f400b2655416b1af760056d00f3aa0a91d1b01c857fe04b621f00b097": { + "79fa68e972898219a5b9dc2b9ff159d76c901fff8c49cff22afe786fd60315bd": { "source": { "path": "cdk-s3-bucket-auto-delete-objects.template.json", "packaging": "file" @@ -48,7 +48,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "41e9944f400b2655416b1af760056d00f3aa0a91d1b01c857fe04b621f00b097.json", + "objectKey": "79fa68e972898219a5b9dc2b9ff159d76c901fff8c49cff22afe786fd60315bd.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.template.json index 6d548ed2c311d..2f9ef14e4dcff 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/cdk-s3-bucket-auto-delete-objects.template.json @@ -342,7 +342,7 @@ ] ] }, - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "DeleteBucketCustomResourcePolicy99AB6B27" @@ -414,7 +414,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/manifest.json index 4eae6320c2f59..09ed08ea9c6b4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/41e9944f400b2655416b1af760056d00f3aa0a91d1b01c857fe04b621f00b097.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/79fa68e972898219a5b9dc2b9ff159d76c901fff8c49cff22afe786fd60315bd.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -99,6 +99,12 @@ "data": "RemovedBucketAutoDeleteObjectsCustomResourceDE96EADE" } ], + "/cdk-s3-bucket-auto-delete-objects/DeleteBucket": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/cdk-s3-bucket-auto-delete-objects/DeleteBucket/Resource/Default": [ { "type": "aws:cdk:logicalId", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/tree.json index e84e2c4b8c303..19e3ea7545a3a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.js.snapshot/tree.json @@ -503,7 +503,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js rename to packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js new file mode 100644 index 0000000000000..9f6e97928f257 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -0,0 +1,779 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts +var CLIENT_NAMES; +var init_client_names = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { + "use strict"; + CLIENT_NAMES = [ + "ACM", + "ACMPCA", + "APIGateway", + "ARCZonalShift", + "AccessAnalyzer", + "Account", + "AlexaForBusiness", + "Amp", + "Amplify", + "AmplifyBackend", + "AmplifyUIBuilder", + "ApiGatewayManagementApi", + "ApiGatewayV2", + "AppConfig", + "AppConfigData", + "AppIntegrations", + "AppMesh", + "AppRunner", + "AppStream", + "AppSync", + "Appflow", + "ApplicationAutoScaling", + "ApplicationCostProfiler", + "ApplicationInsights", + "Athena", + "AuditManager", + "AugmentedAIRuntime", + "AutoScaling", + "AutoScalingPlans", + "Backup", + "BackupGateway", + "BackupStorage", + "Batch", + "Billingconductor", + "Braket", + "Budgets", + "CUR", + "Chime", + "ChimeSDKIdentity", + "ChimeSDKMediaPipelines", + "ChimeSDKMeetings", + "ChimeSDKMessaging", + "ChimeSDKVoice", + "Cloud9", + "CloudControl", + "CloudDirectory", + "CloudFormation", + "CloudFront", + "CloudHSM", + "CloudHSMV2", + "CloudSearch", + "CloudSearchDomain", + "CloudTrail", + "CloudWatch", + "CloudWatchEvents", + "CloudWatchLogs", + "CodeArtifact", + "CodeBuild", + "CodeCatalyst", + "CodeCommit", + "CodeDeploy", + "CodeGuruProfiler", + "CodeGuruReviewer", + "CodePipeline", + "CodeStar", + "CodeStarNotifications", + "CodeStarconnections", + "CognitoIdentity", + "CognitoIdentityServiceProvider", + "CognitoSync", + "Comprehend", + "ComprehendMedical", + "ComputeOptimizer", + "ConfigService", + "Connect", + "ConnectCampaigns", + "ConnectCases", + "ConnectContactLens", + "ConnectParticipant", + "ControlTower", + "CostExplorer", + "CustomerProfiles", + "DAX", + "DLM", + "DMS", + "DataBrew", + "DataExchange", + "DataPipeline", + "DataSync", + "Detective", + "DevOpsGuru", + "DeviceFarm", + "DirectConnect", + "DirectoryService", + "Discovery", + "DocDB", + "DocDBElastic", + "Drs", + "DynamoDB", + "DynamoDBStreams", + "EBS", + "EC2", + "EC2InstanceConnect", + "ECR", + "ECRPUBLIC", + "ECS", + "EFS", + "EKS", + "ELB", + "ELBv2", + "EMR", + "EMRServerless", + "EMRcontainers", + "ES", + "ElastiCache", + "ElasticBeanstalk", + "ElasticInference", + "ElasticTranscoder", + "EventBridge", + "Evidently", + "FMS", + "FSx", + "Finspace", + "Finspacedata", + "Firehose", + "Fis", + "ForecastQueryService", + "ForecastService", + "FraudDetector", + "GameLift", + "GameSparks", + "Glacier", + "GlobalAccelerator", + "Glue", + "Grafana", + "Greengrass", + "GreengrassV2", + "GroundStation", + "GuardDuty", + "Health", + "HealthLake", + "Honeycode", + "IAM", + "IVS", + "IdentityStore", + "Imagebuilder", + "Inspector", + "Inspector2", + "IoT1ClickDevicesService", + "IoT1ClickProjects", + "IoTAnalytics", + "IoTEvents", + "IoTEventsData", + "IoTFleetHub", + "IoTFleetWise", + "IoTJobsDataPlane", + "IoTRoboRunner", + "IoTSecureTunneling", + "IoTSiteWise", + "IoTThingsGraph", + "IoTTwinMaker", + "IoTWireless", + "Iot", + "IotData", + "IotDeviceAdvisor", + "Ivschat", + "KMS", + "Kafka", + "KafkaConnect", + "Kendra", + "Keyspaces", + "Kinesis", + "KinesisAnalytics", + "KinesisAnalyticsV2", + "KinesisVideo", + "KinesisVideoArchivedMedia", + "KinesisVideoMedia", + "KinesisVideoSignalingChannels", + "KinesisVideoWebRTCStorage", + "LakeFormation", + "Lambda", + "LexModelBuildingService", + "LexModelsV2", + "LexRuntime", + "LexRuntimeV2", + "LicenseManager", + "LicenseManagerLinuxSubscriptions", + "LicenseManagerUserSubscriptions", + "Lightsail", + "Location", + "LookoutEquipment", + "LookoutMetrics", + "LookoutVision", + "M2", + "MQ", + "MTurk", + "MWAA", + "MachineLearning", + "Macie", + "Macie2", + "ManagedBlockchain", + "MarketplaceCatalog", + "MarketplaceCommerceAnalytics", + "MarketplaceEntitlementService", + "MarketplaceMetering", + "MediaConnect", + "MediaConvert", + "MediaLive", + "MediaPackage", + "MediaPackageVod", + "MediaStore", + "MediaStoreData", + "MediaTailor", + "MemoryDB", + "Mgn", + "MigrationHub", + "MigrationHubConfig", + "MigrationHubOrchestrator", + "MigrationHubRefactorSpaces", + "MigrationHubStrategy", + "Mobile", + "Neptune", + "NetworkFirewall", + "NetworkManager", + "Nimble", + "OAM", + "Omics", + "OpenSearch", + "OpenSearchServerless", + "OpsWorks", + "OpsWorksCM", + "Organizations", + "Outposts", + "PI", + "Panorama", + "Personalize", + "PersonalizeEvents", + "PersonalizeRuntime", + "Pinpoint", + "PinpointEmail", + "PinpointSMSVoice", + "PinpointSMSVoiceV2", + "Pipes", + "Polly", + "Pricing", + "PrivateNetworks", + "Proton", + "QLDB", + "QLDBSession", + "QuickSight", + "RAM", + "RDS", + "RDSDataService", + "RUM", + "Rbin", + "Redshift", + "RedshiftData", + "RedshiftServerless", + "Rekognition", + "Resiliencehub", + "ResourceExplorer2", + "ResourceGroups", + "ResourceGroupsTaggingAPI", + "RoboMaker", + "RolesAnywhere", + "Route53", + "Route53Domains", + "Route53RecoveryCluster", + "Route53RecoveryControlConfig", + "Route53RecoveryReadiness", + "Route53Resolver", + "S3", + "S3Control", + "S3Outposts", + "SES", + "SESV2", + "SMS", + "SNS", + "SQS", + "SSM", + "SSMContacts", + "SSMIncidents", + "SSO", + "SSOAdmin", + "SSOOIDC", + "STS", + "SWF", + "SageMaker", + "SageMakerFeatureStoreRuntime", + "SageMakerGeospatial", + "SageMakerMetrics", + "SageMakerRuntime", + "SagemakerEdge", + "SavingsPlans", + "Scheduler", + "Schemas", + "SecretsManager", + "SecurityHub", + "SecurityLake", + "ServerlessApplicationRepository", + "ServiceCatalog", + "ServiceCatalogAppRegistry", + "ServiceDiscovery", + "ServiceQuotas", + "Shield", + "Signer", + "SimSpaceWeaver", + "SnowDeviceManagement", + "Snowball", + "SsmSap", + "StepFunctions", + "StorageGateway", + "Support", + "SupportApp", + "Synthetics", + "Textract", + "TimestreamQuery", + "TimestreamWrite", + "TranscribeService", + "Transfer", + "Translate", + "VoiceID", + "WAF", + "WAFRegional", + "WAFV2", + "WellArchitected", + "Wisdom", + "WorkDocs", + "WorkLink", + "WorkMail", + "WorkMailMessageFlow", + "WorkSpaces", + "WorkSpacesWeb", + "XRay" + ]; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts +var CLIENT_PACKAGE_NAMES_MAP; +var init_client_package_names_map = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { + "use strict"; + init_client_names(); + CLIENT_PACKAGE_NAMES_MAP = { + ...CLIENT_NAMES.reduce( + (acc, name) => ({ + ...acc, + [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") + }), + {} + ), + AccessAnalyzer: "client-accessanalyzer", + ACMPCA: "client-acm-pca", + APIGateway: "client-api-gateway", + ApiGatewayManagementApi: "client-apigatewaymanagementapi", + ApiGatewayV2: "client-apigatewayv2", + AppConfig: "client-appconfig", + AppConfigData: "client-appconfigdata", + AppIntegrations: "client-appintegrations", + AppRunner: "client-apprunner", + AppStream: "client-appstream", + AppSync: "client-appsync", + ApplicationCostProfiler: "client-applicationcostprofiler", + ARCZonalShift: "client-arc-zonal-shift", + AugmentedAIRuntime: "client-sage-maker-a2iruntime", + AuditManager: "client-auditmanager", + BackupStorage: "client-backupstorage", + CUR: "client-cost-and-usage-report-service", + CloudHSMV2: "client-cloudhsm-v2", + CodeGuruProfiler: "client-codeguruprofiler", + CodeStarconnections: "client-codestar-connections", + CognitoIdentityServiceProvider: "client-cognito-identity-provider", + ComprehendMedical: "client-comprehendmedical", + ConnectContactLens: "client-connect-contact-lens", + ControlTower: "client-controltower", + DMS: "client-database-migration-service", + DataPipeline: "client-data-pipeline", + Discovery: "client-application-discovery-service", + DevOpsGuru: "client-devops-guru", + DynamoDB: "client-dynamodb", + DynamoDBStreams: "client-dynamodb-streams", + DocDB: "client-docdb", + DocDBElastic: "client-docdb-elastic", + EC2InstanceConnect: "client-ec2-instance-connect", + ECRPUBLIC: "client-ecr-public", + ELB: "client-elastic-load-balancing", + ELBv2: "client-elastic-load-balancing-v2", + ElastiCache: "client-elasticache", + EMRcontainers: "client-emr-containers", + EMRServerless: "client-emr-serverless", + ES: "client-elasticsearch-service", + EventBridge: "client-eventbridge", + Finspacedata: "client-finspace-data", + ForecastQueryService: "client-forecastquery", + ForecastService: "client-forecast", + FraudDetector: "client-frauddetector", + GameLift: "client-gamelift", + GameSparks: "client-gamesparks", + GreengrassV2: "client-greengrassv2", + GroundStation: "client-groundstation", + GuardDuty: "client-guardduty", + HealthLake: "client-healthlake", + IdentityStore: "client-identitystore", + IoTAnalytics: "client-iotanalytics", + IotData: "client-iot-data-plane", + IotDeviceAdvisor: "client-iotdeviceadvisor", + IoTSecureTunneling: "client-iotsecuretunneling", + IoTSiteWise: "client-iotsitewise", + IoTThingsGraph: "client-iotthingsgraph", + IoTTwinMaker: "client-iottwinmaker", + IoTRoboRunner: "client-iot-roborunner", + KafkaConnect: "client-kafkaconnect", + KinesisVideoSignalingChannels: "client-kinesis-video-signaling", + KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", + LakeFormation: "client-lakeformation", + LexRuntime: "client-lex-runtime-service", + ManagedBlockchain: "client-managedblockchain", + MigrationHubConfig: "client-migrationhub-config", + MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", + NetworkManager: "client-networkmanager", + OpenSearch: "client-opensearch", + OpenSearchServerless: "client-opensearchserverless", + OpsWorks: "client-opsworks", + OpsWorksCM: "client-opsworkscm", + PrivateNetworks: "client-privatenetworks", + QLDBSession: "client-qldb-session", + QuickSight: "client-quicksight", + ResourceExplorer2: "client-resource-explorer-2", + RDSDataService: "client-rds-data", + RoboMaker: "client-robomaker", + RolesAnywhere: "client-rolesanywhere", + Route53: "client-route-53", + Route53Domains: "client-route-53-domains", + Route53Resolver: "client-route53resolver", + S3Control: "client-s3-control", + SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", + SavingsPlans: "client-savingsplans", + SecurityHub: "client-securityhub", + ServerlessApplicationRepository: "client-serverlessapplicationrepository", + ServiceCatalogAppRegistry: "client-service-catalog-appregistry", + ServiceDiscovery: "client-servicediscovery", + SimSpaceWeaver: "client-simspaceweaver", + SSMContacts: "client-ssm-contacts", + SSMIncidents: "client-ssm-incidents", + SSOAdmin: "client-sso-admin", + SSOOIDC: "client-sso-oidc", + StepFunctions: "client-sfn", + TranscribeService: "client-transcribe", + WAFRegional: "client-waf-regional", + WellArchitected: "client-wellarchitected", + WorkMailMessageFlow: "client-workmailmessageflow" + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts +var get_v3_client_package_name_exports = {}; +__export(get_v3_client_package_name_exports, { + getV3ClientPackageName: () => getV3ClientPackageName +}); +var getV3ClientPackageName; +var init_get_v3_client_package_name = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { + "use strict"; + init_client_package_names_map(); + getV3ClientPackageName = (clientName) => { + if (clientName in CLIENT_PACKAGE_NAMES_MAP) { + return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; + } + throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts +var find_client_constructor_exports = {}; +__export(find_client_constructor_exports, { + findV3ClientConstructor: () => findV3ClientConstructor +}); +function findV3ClientConstructor(pkg) { + const [_clientName, ServiceClient] = Object.entries(pkg).find( + ([name]) => { + return name.endsWith("Client") && name !== "__Client"; + } + ); + return ServiceClient; +} +var init_find_client_constructor = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { + "use strict"; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js +var require_lib = __commonJS({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; + var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); + Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { + return get_v3_client_package_name_1.getV3ClientPackageName; + } }); + var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); + Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { + return find_client_constructor_1.findV3ClientConstructor; + } }); + } +}); + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var aws_sdk_v3_handler_exports = {}; +__export(aws_sdk_v3_handler_exports, { + forceSdkInstallation: () => forceSdkInstallation, + handler: () => handler +}); +module.exports = __toCommonJS(aws_sdk_v3_handler_exports); +var import_child_process = require("child_process"); +var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); + +// custom-resources/lib/aws-custom-resource/runtime/shared.ts +var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } + return Object.assign( + {}, + ..._flatten(object) + ); +} +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +function filterKeys(object, pred) { + return Object.entries(object).reduce( + (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, + {} + ); +} +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data + }); + console.log("Responding", responseBody); + const parsedUrl = require("url").parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { + "content-type": "", + "content-length": Buffer.byteLength(responseBody, "utf8") + } + }; + return new Promise((resolve, reject) => { + try { + const request = require("https").request(requestOptions, resolve); + request.on("error", reject); + request.write(responseBody); + request.end(); + } catch (e) { + reject(e); + } + }); +} +function decodeCall(call) { + if (!call) { + return void 0; + } + return JSON.parse(call); +} +function startsWithOneOf(searchStrings) { + return function(string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var installedSdk = {}; +function forceSdkInstallation() { + installedSdk = {}; +} +function installLatestSdk(packageName) { + console.log(`Installing latest AWS SDK v3: ${packageName}`); + (0, import_child_process.execSync)( + `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` + ); + installedSdk = { + ...installedSdk, + [packageName]: true + }; +} +async function loadAwsSdk(packageName, installLatestAwsSdk) { + let awsSdk; + try { + if (!installedSdk[packageName] && installLatestAwsSdk === "true") { + try { + installLatestSdk(packageName); + awsSdk = require(`/tmp/node_modules/${packageName}`); + } catch (e) { + console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); + return require(packageName); + } + } else if (installedSdk[packageName]) { + awsSdk = require(`/tmp/node_modules/${packageName}`); + } else { + awsSdk = require(packageName); + } + } catch (error) { + throw Error(`Package ${packageName} does not exist.`); + } + return awsSdk; +} +async function handler(event, context) { + try { + event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); + event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); + event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); + let data = {}; + let physicalResourceId; + switch (event.RequestType) { + case "Create": + physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; + break; + case "Update": + case "Delete": + physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; + break; + } + const call = event.ResourceProperties[event.RequestType]; + if (call) { + const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); + let awsSdk = loadAwsSdk( + packageName, + event.ResourceProperties.InstallLatestAwsSdk + ); + console.log(JSON.stringify({ ...event, ResponseURL: "..." })); + let credentials; + if (call.assumedRoleArn) { + const timestamp = (/* @__PURE__ */ new Date()).getTime(); + const params = { + RoleArn: call.assumedRoleArn, + RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) + }; + const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); + credentials = fromTemporaryCredentials({ + params + }); + } + awsSdk = await awsSdk; + const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); + const client = new ServiceClient({ + apiVersion: call.apiVersion, + credentials, + region: call.region + }); + const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; + const Command = Object.entries(awsSdk).find( + ([name]) => name.toLowerCase() === commandName.toLowerCase() + )?.[1]; + let flatData = {}; + try { + const response = await client.send( + new Command( + (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} + ) + ); + flatData = { + apiVersion: client.config.apiVersion, + // For test purposes: check if apiVersion was correctly passed. + region: await client.config.region().catch(() => void 0), + // For test purposes: check if region was correctly passed. + ...flatten(response) + }; + let outputPaths; + if (call.outputPath) { + outputPaths = [call.outputPath]; + } else if (call.outputPaths) { + outputPaths = call.outputPaths; + } + if (outputPaths) { + data = filterKeys(flatData, startsWithOneOf(outputPaths)); + } else { + data = flatData; + } + } catch (e) { + const exceptionName = e.name ?? e.constructor.name; + if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { + throw e; + } + } + if (call.physicalResourceId?.responsePath) { + physicalResourceId = flatData[call.physicalResourceId.responsePath]; + } + } + await respond(event, "SUCCESS", "OK", physicalResourceId, data); + } catch (e) { + console.log(e); + await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + forceSdkInstallation, + handler +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js rename to packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +exports.startsWithOneOf = startsWithOneOf; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjo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ZWN0KGUpO1xuICAgIH1cbiAgfSk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBkZWNvZGVDYWxsKGNhbGw6IHN0cmluZyB8IHVuZGVmaW5lZCkge1xuICBpZiAoIWNhbGwpIHsgcmV0dXJuIHVuZGVmaW5lZDsgfVxuICByZXR1cm4gSlNPTi5wYXJzZShjYWxsKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHN0YXJ0c1dpdGhPbmVPZihzZWFyY2hTdHJpbmdzOiBzdHJpbmdbXSk6IChzdHJpbmc6IHN0cmluZykgPT4gYm9vbGVhbiB7XG4gIHJldHVybiBmdW5jdGlvbihzdHJpbmc6IHN0cmluZyk6IGJvb2xlYW4ge1xuICAgIGZvciAoY29uc3Qgc2VhcmNoU3RyaW5nIG9mIHNlYXJjaFN0cmluZ3MpIHtcbiAgICAgIGlmIChzdHJpbmcuc3RhcnRzV2l0aChzZWFyY2hTdHJpbmcpKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js deleted file mode 100644 index 1b662725f1b0b..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js +++ /dev/null @@ -1,769 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts -var CLIENT_NAMES; -var init_client_names = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { - "use strict"; - CLIENT_NAMES = [ - "ACM", - "ACMPCA", - "APIGateway", - "ARCZonalShift", - "AccessAnalyzer", - "Account", - "AlexaForBusiness", - "Amp", - "Amplify", - "AmplifyBackend", - "AmplifyUIBuilder", - "ApiGatewayManagementApi", - "ApiGatewayV2", - "AppConfig", - "AppConfigData", - "AppIntegrations", - "AppMesh", - "AppRunner", - "AppStream", - "AppSync", - "Appflow", - "ApplicationAutoScaling", - "ApplicationCostProfiler", - "ApplicationInsights", - "Athena", - "AuditManager", - "AugmentedAIRuntime", - "AutoScaling", - "AutoScalingPlans", - "Backup", - "BackupGateway", - "BackupStorage", - "Batch", - "Billingconductor", - "Braket", - "Budgets", - "CUR", - "Chime", - "ChimeSDKIdentity", - "ChimeSDKMediaPipelines", - "ChimeSDKMeetings", - "ChimeSDKMessaging", - "ChimeSDKVoice", - "Cloud9", - "CloudControl", - "CloudDirectory", - "CloudFormation", - "CloudFront", - "CloudHSM", - "CloudHSMV2", - "CloudSearch", - "CloudSearchDomain", - "CloudTrail", - "CloudWatch", - "CloudWatchEvents", - "CloudWatchLogs", - "CodeArtifact", - "CodeBuild", - "CodeCatalyst", - "CodeCommit", - "CodeDeploy", - "CodeGuruProfiler", - "CodeGuruReviewer", - "CodePipeline", - "CodeStar", - "CodeStarNotifications", - "CodeStarconnections", - "CognitoIdentity", - "CognitoIdentityServiceProvider", - "CognitoSync", - "Comprehend", - "ComprehendMedical", - "ComputeOptimizer", - "ConfigService", - "Connect", - "ConnectCampaigns", - "ConnectCases", - "ConnectContactLens", - "ConnectParticipant", - "ControlTower", - "CostExplorer", - "CustomerProfiles", - "DAX", - "DLM", - "DMS", - "DataBrew", - "DataExchange", - "DataPipeline", - "DataSync", - "Detective", - "DevOpsGuru", - "DeviceFarm", - "DirectConnect", - "DirectoryService", - "Discovery", - "DocDB", - "DocDBElastic", - "Drs", - "DynamoDB", - "DynamoDBStreams", - "EBS", - "EC2", - "EC2InstanceConnect", - "ECR", - "ECRPUBLIC", - "ECS", - "EFS", - "EKS", - "ELB", - "ELBv2", - "EMR", - "EMRServerless", - "EMRcontainers", - "ES", - "ElastiCache", - "ElasticBeanstalk", - "ElasticInference", - "ElasticTranscoder", - "EventBridge", - "Evidently", - "FMS", - "FSx", - "Finspace", - "Finspacedata", - "Firehose", - "Fis", - "ForecastQueryService", - "ForecastService", - "FraudDetector", - "GameLift", - "GameSparks", - "Glacier", - "GlobalAccelerator", - "Glue", - "Grafana", - "Greengrass", - "GreengrassV2", - "GroundStation", - "GuardDuty", - "Health", - "HealthLake", - "Honeycode", - "IAM", - "IVS", - "IdentityStore", - "Imagebuilder", - "Inspector", - "Inspector2", - "IoT1ClickDevicesService", - "IoT1ClickProjects", - "IoTAnalytics", - "IoTEvents", - "IoTEventsData", - "IoTFleetHub", - "IoTFleetWise", - "IoTJobsDataPlane", - "IoTRoboRunner", - "IoTSecureTunneling", - "IoTSiteWise", - "IoTThingsGraph", - "IoTTwinMaker", - "IoTWireless", - "Iot", - "IotData", - "IotDeviceAdvisor", - "Ivschat", - "KMS", - "Kafka", - "KafkaConnect", - "Kendra", - "Keyspaces", - "Kinesis", - "KinesisAnalytics", - "KinesisAnalyticsV2", - "KinesisVideo", - "KinesisVideoArchivedMedia", - "KinesisVideoMedia", - "KinesisVideoSignalingChannels", - "KinesisVideoWebRTCStorage", - "LakeFormation", - "Lambda", - "LexModelBuildingService", - "LexModelsV2", - "LexRuntime", - "LexRuntimeV2", - "LicenseManager", - "LicenseManagerLinuxSubscriptions", - "LicenseManagerUserSubscriptions", - "Lightsail", - "Location", - "LookoutEquipment", - "LookoutMetrics", - "LookoutVision", - "M2", - "MQ", - "MTurk", - "MWAA", - "MachineLearning", - "Macie", - "Macie2", - "ManagedBlockchain", - "MarketplaceCatalog", - "MarketplaceCommerceAnalytics", - "MarketplaceEntitlementService", - "MarketplaceMetering", - "MediaConnect", - "MediaConvert", - "MediaLive", - "MediaPackage", - "MediaPackageVod", - "MediaStore", - "MediaStoreData", - "MediaTailor", - "MemoryDB", - "Mgn", - "MigrationHub", - "MigrationHubConfig", - "MigrationHubOrchestrator", - "MigrationHubRefactorSpaces", - "MigrationHubStrategy", - "Mobile", - "Neptune", - "NetworkFirewall", - "NetworkManager", - "Nimble", - "OAM", - "Omics", - "OpenSearch", - "OpenSearchServerless", - "OpsWorks", - "OpsWorksCM", - "Organizations", - "Outposts", - "PI", - "Panorama", - "Personalize", - "PersonalizeEvents", - "PersonalizeRuntime", - "Pinpoint", - "PinpointEmail", - "PinpointSMSVoice", - "PinpointSMSVoiceV2", - "Pipes", - "Polly", - "Pricing", - "PrivateNetworks", - "Proton", - "QLDB", - "QLDBSession", - "QuickSight", - "RAM", - "RDS", - "RDSDataService", - "RUM", - "Rbin", - "Redshift", - "RedshiftData", - "RedshiftServerless", - "Rekognition", - "Resiliencehub", - "ResourceExplorer2", - "ResourceGroups", - "ResourceGroupsTaggingAPI", - "RoboMaker", - "RolesAnywhere", - "Route53", - "Route53Domains", - "Route53RecoveryCluster", - "Route53RecoveryControlConfig", - "Route53RecoveryReadiness", - "Route53Resolver", - "S3", - "S3Control", - "S3Outposts", - "SES", - "SESV2", - "SMS", - "SNS", - "SQS", - "SSM", - "SSMContacts", - "SSMIncidents", - "SSO", - "SSOAdmin", - "SSOOIDC", - "STS", - "SWF", - "SageMaker", - "SageMakerFeatureStoreRuntime", - "SageMakerGeospatial", - "SageMakerMetrics", - "SageMakerRuntime", - "SagemakerEdge", - "SavingsPlans", - "Scheduler", - "Schemas", - "SecretsManager", - "SecurityHub", - "SecurityLake", - "ServerlessApplicationRepository", - "ServiceCatalog", - "ServiceCatalogAppRegistry", - "ServiceDiscovery", - "ServiceQuotas", - "Shield", - "Signer", - "SimSpaceWeaver", - "SnowDeviceManagement", - "Snowball", - "SsmSap", - "StepFunctions", - "StorageGateway", - "Support", - "SupportApp", - "Synthetics", - "Textract", - "TimestreamQuery", - "TimestreamWrite", - "TranscribeService", - "Transfer", - "Translate", - "VoiceID", - "WAF", - "WAFRegional", - "WAFV2", - "WellArchitected", - "Wisdom", - "WorkDocs", - "WorkLink", - "WorkMail", - "WorkMailMessageFlow", - "WorkSpaces", - "WorkSpacesWeb", - "XRay" - ]; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts -var CLIENT_PACKAGE_NAMES_MAP; -var init_client_package_names_map = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { - "use strict"; - init_client_names(); - CLIENT_PACKAGE_NAMES_MAP = { - ...CLIENT_NAMES.reduce( - (acc, name) => ({ - ...acc, - [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") - }), - {} - ), - AccessAnalyzer: "client-accessanalyzer", - ACMPCA: "client-acm-pca", - APIGateway: "client-api-gateway", - ApiGatewayManagementApi: "client-apigatewaymanagementapi", - ApiGatewayV2: "client-apigatewayv2", - AppConfig: "client-appconfig", - AppConfigData: "client-appconfigdata", - AppIntegrations: "client-appintegrations", - AppRunner: "client-apprunner", - AppStream: "client-appstream", - AppSync: "client-appsync", - ApplicationCostProfiler: "client-applicationcostprofiler", - ARCZonalShift: "client-arc-zonal-shift", - AugmentedAIRuntime: "client-sage-maker-a2iruntime", - AuditManager: "client-auditmanager", - BackupStorage: "client-backupstorage", - CUR: "client-cost-and-usage-report-service", - CloudHSMV2: "client-cloudhsm-v2", - CodeGuruProfiler: "client-codeguruprofiler", - CodeStarconnections: "client-codestar-connections", - CognitoIdentityServiceProvider: "client-cognito-identity-provider", - ComprehendMedical: "client-comprehendmedical", - ConnectContactLens: "client-connect-contact-lens", - ControlTower: "client-controltower", - DMS: "client-database-migration-service", - DataPipeline: "client-data-pipeline", - Discovery: "client-application-discovery-service", - DevOpsGuru: "client-devops-guru", - DynamoDB: "client-dynamodb", - DynamoDBStreams: "client-dynamodb-streams", - DocDB: "client-docdb", - DocDBElastic: "client-docdb-elastic", - EC2InstanceConnect: "client-ec2-instance-connect", - ECRPUBLIC: "client-ecr-public", - ELB: "client-elastic-load-balancing", - ELBv2: "client-elastic-load-balancing-v2", - ElastiCache: "client-elasticache", - EMRcontainers: "client-emr-containers", - EMRServerless: "client-emr-serverless", - ES: "client-elasticsearch-service", - EventBridge: "client-eventbridge", - Finspacedata: "client-finspace-data", - ForecastQueryService: "client-forecastquery", - ForecastService: "client-forecast", - FraudDetector: "client-frauddetector", - GameLift: "client-gamelift", - GameSparks: "client-gamesparks", - GreengrassV2: "client-greengrassv2", - GroundStation: "client-groundstation", - GuardDuty: "client-guardduty", - HealthLake: "client-healthlake", - IdentityStore: "client-identitystore", - IoTAnalytics: "client-iotanalytics", - IotData: "client-iot-data-plane", - IotDeviceAdvisor: "client-iotdeviceadvisor", - IoTSecureTunneling: "client-iotsecuretunneling", - IoTSiteWise: "client-iotsitewise", - IoTThingsGraph: "client-iotthingsgraph", - IoTTwinMaker: "client-iottwinmaker", - IoTRoboRunner: "client-iot-roborunner", - KafkaConnect: "client-kafkaconnect", - KinesisVideoSignalingChannels: "client-kinesis-video-signaling", - KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", - LakeFormation: "client-lakeformation", - LexRuntime: "client-lex-runtime-service", - ManagedBlockchain: "client-managedblockchain", - MigrationHubConfig: "client-migrationhub-config", - MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", - NetworkManager: "client-networkmanager", - OpenSearch: "client-opensearch", - OpenSearchServerless: "client-opensearchserverless", - OpsWorks: "client-opsworks", - OpsWorksCM: "client-opsworkscm", - PrivateNetworks: "client-privatenetworks", - QLDBSession: "client-qldb-session", - QuickSight: "client-quicksight", - ResourceExplorer2: "client-resource-explorer-2", - RDSDataService: "client-rds-data", - RoboMaker: "client-robomaker", - RolesAnywhere: "client-rolesanywhere", - Route53: "client-route-53", - Route53Domains: "client-route-53-domains", - Route53Resolver: "client-route53resolver", - S3Control: "client-s3-control", - SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", - SavingsPlans: "client-savingsplans", - SecurityHub: "client-securityhub", - ServerlessApplicationRepository: "client-serverlessapplicationrepository", - ServiceCatalogAppRegistry: "client-service-catalog-appregistry", - ServiceDiscovery: "client-servicediscovery", - SimSpaceWeaver: "client-simspaceweaver", - SSMContacts: "client-ssm-contacts", - SSMIncidents: "client-ssm-incidents", - SSOAdmin: "client-sso-admin", - SSOOIDC: "client-sso-oidc", - StepFunctions: "client-sfn", - TranscribeService: "client-transcribe", - WAFRegional: "client-waf-regional", - WellArchitected: "client-wellarchitected", - WorkMailMessageFlow: "client-workmailmessageflow" - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts -var get_v3_client_package_name_exports = {}; -__export(get_v3_client_package_name_exports, { - getV3ClientPackageName: () => getV3ClientPackageName -}); -var getV3ClientPackageName; -var init_get_v3_client_package_name = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { - "use strict"; - init_client_package_names_map(); - getV3ClientPackageName = (clientName) => { - if (clientName in CLIENT_PACKAGE_NAMES_MAP) { - return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; - } - throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts -var find_client_constructor_exports = {}; -__export(find_client_constructor_exports, { - findV3ClientConstructor: () => findV3ClientConstructor -}); -function findV3ClientConstructor(pkg) { - const [_clientName, ServiceClient] = Object.entries(pkg).find( - ([name]) => { - return name.endsWith("Client") && name !== "__Client"; - } - ); - return ServiceClient; -} -var init_find_client_constructor = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { - "use strict"; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js -var require_lib = __commonJS({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; - var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); - Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { - return get_v3_client_package_name_1.getV3ClientPackageName; - } }); - var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); - Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { - return find_client_constructor_1.findV3ClientConstructor; - } }); - } -}); - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var aws_sdk_v3_handler_exports = {}; -__export(aws_sdk_v3_handler_exports, { - forceSdkInstallation: () => forceSdkInstallation, - handler: () => handler -}); -module.exports = __toCommonJS(aws_sdk_v3_handler_exports); -var import_child_process = require("child_process"); -var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); - -// custom-resources/lib/aws-custom-resource/runtime/shared.ts -var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; -function flatten(object) { - return Object.assign( - {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) - ); -} -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -function filterKeys(object, pred) { - return Object.entries(object).reduce( - (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, - {} - ); -} -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data - }); - console.log("Responding", responseBody); - const parsedUrl = require("url").parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { - "content-type": "", - "content-length": Buffer.byteLength(responseBody, "utf8") - } - }; - return new Promise((resolve, reject) => { - try { - const request = require("https").request(requestOptions, resolve); - request.on("error", reject); - request.write(responseBody); - request.end(); - } catch (e) { - reject(e); - } - }); -} -function decodeCall(call) { - if (!call) { - return void 0; - } - return JSON.parse(call); -} -function startsWithOneOf(searchStrings) { - return function(string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var installedSdk = {}; -function forceSdkInstallation() { - installedSdk = {}; -} -function installLatestSdk(packageName) { - console.log(`Installing latest AWS SDK v3: ${packageName}`); - (0, import_child_process.execSync)( - `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` - ); - installedSdk = { - ...installedSdk, - [packageName]: true - }; -} -async function loadAwsSdk(packageName, installLatestAwsSdk) { - let awsSdk; - try { - if (!installedSdk[packageName] && installLatestAwsSdk === "true") { - try { - installLatestSdk(packageName); - awsSdk = require(`/tmp/node_modules/${packageName}`); - } catch (e) { - console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); - return require(packageName); - } - } else if (installedSdk[packageName]) { - awsSdk = require(`/tmp/node_modules/${packageName}`); - } else { - awsSdk = require(packageName); - } - } catch (error) { - throw Error(`Package ${packageName} does not exist.`); - } - return awsSdk; -} -async function handler(event, context) { - try { - event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); - event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); - event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); - let data = {}; - let physicalResourceId; - switch (event.RequestType) { - case "Create": - physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; - break; - case "Update": - case "Delete": - physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; - break; - } - const call = event.ResourceProperties[event.RequestType]; - if (call) { - const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); - let awsSdk = loadAwsSdk( - packageName, - event.ResourceProperties.InstallLatestAwsSdk - ); - console.log(JSON.stringify({ ...event, ResponseURL: "..." })); - let credentials; - if (call.assumedRoleArn) { - const timestamp = (/* @__PURE__ */ new Date()).getTime(); - const params = { - RoleArn: call.assumedRoleArn, - RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) - }; - const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); - credentials = fromTemporaryCredentials({ - params - }); - } - awsSdk = await awsSdk; - const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); - const client = new ServiceClient({ - apiVersion: call.apiVersion, - credentials, - region: call.region - }); - const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; - const Command = Object.entries(awsSdk).find( - ([name]) => name.toLowerCase() === commandName.toLowerCase() - )?.[1]; - let flatData = {}; - try { - const response = await client.send( - new Command( - (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} - ) - ); - flatData = { - apiVersion: client.config.apiVersion, - // For test purposes: check if apiVersion was correctly passed. - region: await client.config.region().catch(() => void 0), - // For test purposes: check if region was correctly passed. - ...flatten(response) - }; - let outputPaths; - if (call.outputPath) { - outputPaths = [call.outputPath]; - } else if (call.outputPaths) { - outputPaths = call.outputPaths; - } - if (outputPaths) { - data = filterKeys(flatData, startsWithOneOf(outputPaths)); - } else { - data = flatData; - } - } catch (e) { - const exceptionName = e.name ?? e.constructor.name; - if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { - throw e; - } - } - if (call.physicalResourceId?.responsePath) { - physicalResourceId = flatData[call.physicalResourceId.responsePath]; - } - } - await respond(event, "SUCCESS", "OK", physicalResourceId, data); - } catch (e) { - console.log(e); - await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - forceSdkInstallation, - handler -}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js deleted file mode 100644 index 6c53eaeef8cd1..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -exports.decodeSpecialValues = decodeSpecialValues; -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -exports.filterKeys = filterKeys; -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - // eslint-disable-next-line no-console - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': Buffer.byteLength(responseBody, 'utf8'), - }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -exports.respond = respond; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -exports.decodeCall = decodeCall; -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} -exports.startsWithOneOf = startsWithOneOf; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiw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pcmUoJ2h0dHBzJykucmVxdWVzdChyZXF1ZXN0T3B0aW9ucywgcmVzb2x2ZSk7XG4gICAgICByZXF1ZXN0Lm9uKCdlcnJvcicsIHJlamVjdCk7XG4gICAgICByZXF1ZXN0LndyaXRlKHJlc3BvbnNlQm9keSk7XG4gICAgICByZXF1ZXN0LmVuZCgpO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIHJlamVjdChlKTtcbiAgICB9XG4gIH0pO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZGVjb2RlQ2FsbChjYWxsOiBzdHJpbmcgfCB1bmRlZmluZWQpIHtcbiAgaWYgKCFjYWxsKSB7IHJldHVybiB1bmRlZmluZWQ7IH1cbiAgcmV0dXJuIEpTT04ucGFyc2UoY2FsbCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzdGFydHNXaXRoT25lT2Yoc2VhcmNoU3RyaW5nczogc3RyaW5nW10pOiAoc3RyaW5nOiBzdHJpbmcpID0+IGJvb2xlYW4ge1xuICByZXR1cm4gZnVuY3Rpb24oc3RyaW5nOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgICBmb3IgKGNvbnN0IHNlYXJjaFN0cmluZyBvZiBzZWFyY2hTdHJpbmdzKSB7XG4gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/aws-cdk-customresources-athena.assets.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/aws-cdk-customresources-athena.assets.json index cd8d0559c212f..7a918a90445c9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/aws-cdk-customresources-athena.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/aws-cdk-customresources-athena.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "8bd023db41a39938041d9ea6e2f4d6fb968dcce253cd7fede116fddf9fcc47a2": { + "7972e87a087b9f71e52b066a01f0c2ceb889b6a40ce2dd6e90ab2fa5144140dd": { "source": { "path": "aws-cdk-customresources-athena.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "8bd023db41a39938041d9ea6e2f4d6fb968dcce253cd7fede116fddf9fcc47a2.json", + "objectKey": "7972e87a087b9f71e52b066a01f0c2ceb889b6a40ce2dd6e90ab2fa5144140dd.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/aws-cdk-customresources-athena.template.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/aws-cdk-customresources-athena.template.json index d1f0ea6393318..1122a5cfd3538 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/aws-cdk-customresources-athena.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/aws-cdk-customresources-athena.template.json @@ -161,7 +161,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/manifest.json index a89ee53be1dc5..ec8f9c5612823 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8bd023db41a39938041d9ea6e2f4d6fb968dcce253cd7fede116fddf9fcc47a2.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/7972e87a087b9f71e52b066a01f0c2ceb889b6a40ce2dd6e90ab2fa5144140dd.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/tree.json index 7fa041fbd2b2a..b5d3364398973 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-athena.js.snapshot/tree.json @@ -273,7 +273,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js rename to packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js new file mode 100644 index 0000000000000..9f6e97928f257 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -0,0 +1,779 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts +var CLIENT_NAMES; +var init_client_names = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { + "use strict"; + CLIENT_NAMES = [ + "ACM", + "ACMPCA", + "APIGateway", + "ARCZonalShift", + "AccessAnalyzer", + "Account", + "AlexaForBusiness", + "Amp", + "Amplify", + "AmplifyBackend", + "AmplifyUIBuilder", + "ApiGatewayManagementApi", + "ApiGatewayV2", + "AppConfig", + "AppConfigData", + "AppIntegrations", + "AppMesh", + "AppRunner", + "AppStream", + "AppSync", + "Appflow", + "ApplicationAutoScaling", + "ApplicationCostProfiler", + "ApplicationInsights", + "Athena", + "AuditManager", + "AugmentedAIRuntime", + "AutoScaling", + "AutoScalingPlans", + "Backup", + "BackupGateway", + "BackupStorage", + "Batch", + "Billingconductor", + "Braket", + "Budgets", + "CUR", + "Chime", + "ChimeSDKIdentity", + "ChimeSDKMediaPipelines", + "ChimeSDKMeetings", + "ChimeSDKMessaging", + "ChimeSDKVoice", + "Cloud9", + "CloudControl", + "CloudDirectory", + "CloudFormation", + "CloudFront", + "CloudHSM", + "CloudHSMV2", + "CloudSearch", + "CloudSearchDomain", + "CloudTrail", + "CloudWatch", + "CloudWatchEvents", + "CloudWatchLogs", + "CodeArtifact", + "CodeBuild", + "CodeCatalyst", + "CodeCommit", + "CodeDeploy", + "CodeGuruProfiler", + "CodeGuruReviewer", + "CodePipeline", + "CodeStar", + "CodeStarNotifications", + "CodeStarconnections", + "CognitoIdentity", + "CognitoIdentityServiceProvider", + "CognitoSync", + "Comprehend", + "ComprehendMedical", + "ComputeOptimizer", + "ConfigService", + "Connect", + "ConnectCampaigns", + "ConnectCases", + "ConnectContactLens", + "ConnectParticipant", + "ControlTower", + "CostExplorer", + "CustomerProfiles", + "DAX", + "DLM", + "DMS", + "DataBrew", + "DataExchange", + "DataPipeline", + "DataSync", + "Detective", + "DevOpsGuru", + "DeviceFarm", + "DirectConnect", + "DirectoryService", + "Discovery", + "DocDB", + "DocDBElastic", + "Drs", + "DynamoDB", + "DynamoDBStreams", + "EBS", + "EC2", + "EC2InstanceConnect", + "ECR", + "ECRPUBLIC", + "ECS", + "EFS", + "EKS", + "ELB", + "ELBv2", + "EMR", + "EMRServerless", + "EMRcontainers", + "ES", + "ElastiCache", + "ElasticBeanstalk", + "ElasticInference", + "ElasticTranscoder", + "EventBridge", + "Evidently", + "FMS", + "FSx", + "Finspace", + "Finspacedata", + "Firehose", + "Fis", + "ForecastQueryService", + "ForecastService", + "FraudDetector", + "GameLift", + "GameSparks", + "Glacier", + "GlobalAccelerator", + "Glue", + "Grafana", + "Greengrass", + "GreengrassV2", + "GroundStation", + "GuardDuty", + "Health", + "HealthLake", + "Honeycode", + "IAM", + "IVS", + "IdentityStore", + "Imagebuilder", + "Inspector", + "Inspector2", + "IoT1ClickDevicesService", + "IoT1ClickProjects", + "IoTAnalytics", + "IoTEvents", + "IoTEventsData", + "IoTFleetHub", + "IoTFleetWise", + "IoTJobsDataPlane", + "IoTRoboRunner", + "IoTSecureTunneling", + "IoTSiteWise", + "IoTThingsGraph", + "IoTTwinMaker", + "IoTWireless", + "Iot", + "IotData", + "IotDeviceAdvisor", + "Ivschat", + "KMS", + "Kafka", + "KafkaConnect", + "Kendra", + "Keyspaces", + "Kinesis", + "KinesisAnalytics", + "KinesisAnalyticsV2", + "KinesisVideo", + "KinesisVideoArchivedMedia", + "KinesisVideoMedia", + "KinesisVideoSignalingChannels", + "KinesisVideoWebRTCStorage", + "LakeFormation", + "Lambda", + "LexModelBuildingService", + "LexModelsV2", + "LexRuntime", + "LexRuntimeV2", + "LicenseManager", + "LicenseManagerLinuxSubscriptions", + "LicenseManagerUserSubscriptions", + "Lightsail", + "Location", + "LookoutEquipment", + "LookoutMetrics", + "LookoutVision", + "M2", + "MQ", + "MTurk", + "MWAA", + "MachineLearning", + "Macie", + "Macie2", + "ManagedBlockchain", + "MarketplaceCatalog", + "MarketplaceCommerceAnalytics", + "MarketplaceEntitlementService", + "MarketplaceMetering", + "MediaConnect", + "MediaConvert", + "MediaLive", + "MediaPackage", + "MediaPackageVod", + "MediaStore", + "MediaStoreData", + "MediaTailor", + "MemoryDB", + "Mgn", + "MigrationHub", + "MigrationHubConfig", + "MigrationHubOrchestrator", + "MigrationHubRefactorSpaces", + "MigrationHubStrategy", + "Mobile", + "Neptune", + "NetworkFirewall", + "NetworkManager", + "Nimble", + "OAM", + "Omics", + "OpenSearch", + "OpenSearchServerless", + "OpsWorks", + "OpsWorksCM", + "Organizations", + "Outposts", + "PI", + "Panorama", + "Personalize", + "PersonalizeEvents", + "PersonalizeRuntime", + "Pinpoint", + "PinpointEmail", + "PinpointSMSVoice", + "PinpointSMSVoiceV2", + "Pipes", + "Polly", + "Pricing", + "PrivateNetworks", + "Proton", + "QLDB", + "QLDBSession", + "QuickSight", + "RAM", + "RDS", + "RDSDataService", + "RUM", + "Rbin", + "Redshift", + "RedshiftData", + "RedshiftServerless", + "Rekognition", + "Resiliencehub", + "ResourceExplorer2", + "ResourceGroups", + "ResourceGroupsTaggingAPI", + "RoboMaker", + "RolesAnywhere", + "Route53", + "Route53Domains", + "Route53RecoveryCluster", + "Route53RecoveryControlConfig", + "Route53RecoveryReadiness", + "Route53Resolver", + "S3", + "S3Control", + "S3Outposts", + "SES", + "SESV2", + "SMS", + "SNS", + "SQS", + "SSM", + "SSMContacts", + "SSMIncidents", + "SSO", + "SSOAdmin", + "SSOOIDC", + "STS", + "SWF", + "SageMaker", + "SageMakerFeatureStoreRuntime", + "SageMakerGeospatial", + "SageMakerMetrics", + "SageMakerRuntime", + "SagemakerEdge", + "SavingsPlans", + "Scheduler", + "Schemas", + "SecretsManager", + "SecurityHub", + "SecurityLake", + "ServerlessApplicationRepository", + "ServiceCatalog", + "ServiceCatalogAppRegistry", + "ServiceDiscovery", + "ServiceQuotas", + "Shield", + "Signer", + "SimSpaceWeaver", + "SnowDeviceManagement", + "Snowball", + "SsmSap", + "StepFunctions", + "StorageGateway", + "Support", + "SupportApp", + "Synthetics", + "Textract", + "TimestreamQuery", + "TimestreamWrite", + "TranscribeService", + "Transfer", + "Translate", + "VoiceID", + "WAF", + "WAFRegional", + "WAFV2", + "WellArchitected", + "Wisdom", + "WorkDocs", + "WorkLink", + "WorkMail", + "WorkMailMessageFlow", + "WorkSpaces", + "WorkSpacesWeb", + "XRay" + ]; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts +var CLIENT_PACKAGE_NAMES_MAP; +var init_client_package_names_map = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { + "use strict"; + init_client_names(); + CLIENT_PACKAGE_NAMES_MAP = { + ...CLIENT_NAMES.reduce( + (acc, name) => ({ + ...acc, + [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") + }), + {} + ), + AccessAnalyzer: "client-accessanalyzer", + ACMPCA: "client-acm-pca", + APIGateway: "client-api-gateway", + ApiGatewayManagementApi: "client-apigatewaymanagementapi", + ApiGatewayV2: "client-apigatewayv2", + AppConfig: "client-appconfig", + AppConfigData: "client-appconfigdata", + AppIntegrations: "client-appintegrations", + AppRunner: "client-apprunner", + AppStream: "client-appstream", + AppSync: "client-appsync", + ApplicationCostProfiler: "client-applicationcostprofiler", + ARCZonalShift: "client-arc-zonal-shift", + AugmentedAIRuntime: "client-sage-maker-a2iruntime", + AuditManager: "client-auditmanager", + BackupStorage: "client-backupstorage", + CUR: "client-cost-and-usage-report-service", + CloudHSMV2: "client-cloudhsm-v2", + CodeGuruProfiler: "client-codeguruprofiler", + CodeStarconnections: "client-codestar-connections", + CognitoIdentityServiceProvider: "client-cognito-identity-provider", + ComprehendMedical: "client-comprehendmedical", + ConnectContactLens: "client-connect-contact-lens", + ControlTower: "client-controltower", + DMS: "client-database-migration-service", + DataPipeline: "client-data-pipeline", + Discovery: "client-application-discovery-service", + DevOpsGuru: "client-devops-guru", + DynamoDB: "client-dynamodb", + DynamoDBStreams: "client-dynamodb-streams", + DocDB: "client-docdb", + DocDBElastic: "client-docdb-elastic", + EC2InstanceConnect: "client-ec2-instance-connect", + ECRPUBLIC: "client-ecr-public", + ELB: "client-elastic-load-balancing", + ELBv2: "client-elastic-load-balancing-v2", + ElastiCache: "client-elasticache", + EMRcontainers: "client-emr-containers", + EMRServerless: "client-emr-serverless", + ES: "client-elasticsearch-service", + EventBridge: "client-eventbridge", + Finspacedata: "client-finspace-data", + ForecastQueryService: "client-forecastquery", + ForecastService: "client-forecast", + FraudDetector: "client-frauddetector", + GameLift: "client-gamelift", + GameSparks: "client-gamesparks", + GreengrassV2: "client-greengrassv2", + GroundStation: "client-groundstation", + GuardDuty: "client-guardduty", + HealthLake: "client-healthlake", + IdentityStore: "client-identitystore", + IoTAnalytics: "client-iotanalytics", + IotData: "client-iot-data-plane", + IotDeviceAdvisor: "client-iotdeviceadvisor", + IoTSecureTunneling: "client-iotsecuretunneling", + IoTSiteWise: "client-iotsitewise", + IoTThingsGraph: "client-iotthingsgraph", + IoTTwinMaker: "client-iottwinmaker", + IoTRoboRunner: "client-iot-roborunner", + KafkaConnect: "client-kafkaconnect", + KinesisVideoSignalingChannels: "client-kinesis-video-signaling", + KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", + LakeFormation: "client-lakeformation", + LexRuntime: "client-lex-runtime-service", + ManagedBlockchain: "client-managedblockchain", + MigrationHubConfig: "client-migrationhub-config", + MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", + NetworkManager: "client-networkmanager", + OpenSearch: "client-opensearch", + OpenSearchServerless: "client-opensearchserverless", + OpsWorks: "client-opsworks", + OpsWorksCM: "client-opsworkscm", + PrivateNetworks: "client-privatenetworks", + QLDBSession: "client-qldb-session", + QuickSight: "client-quicksight", + ResourceExplorer2: "client-resource-explorer-2", + RDSDataService: "client-rds-data", + RoboMaker: "client-robomaker", + RolesAnywhere: "client-rolesanywhere", + Route53: "client-route-53", + Route53Domains: "client-route-53-domains", + Route53Resolver: "client-route53resolver", + S3Control: "client-s3-control", + SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", + SavingsPlans: "client-savingsplans", + SecurityHub: "client-securityhub", + ServerlessApplicationRepository: "client-serverlessapplicationrepository", + ServiceCatalogAppRegistry: "client-service-catalog-appregistry", + ServiceDiscovery: "client-servicediscovery", + SimSpaceWeaver: "client-simspaceweaver", + SSMContacts: "client-ssm-contacts", + SSMIncidents: "client-ssm-incidents", + SSOAdmin: "client-sso-admin", + SSOOIDC: "client-sso-oidc", + StepFunctions: "client-sfn", + TranscribeService: "client-transcribe", + WAFRegional: "client-waf-regional", + WellArchitected: "client-wellarchitected", + WorkMailMessageFlow: "client-workmailmessageflow" + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts +var get_v3_client_package_name_exports = {}; +__export(get_v3_client_package_name_exports, { + getV3ClientPackageName: () => getV3ClientPackageName +}); +var getV3ClientPackageName; +var init_get_v3_client_package_name = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { + "use strict"; + init_client_package_names_map(); + getV3ClientPackageName = (clientName) => { + if (clientName in CLIENT_PACKAGE_NAMES_MAP) { + return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; + } + throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts +var find_client_constructor_exports = {}; +__export(find_client_constructor_exports, { + findV3ClientConstructor: () => findV3ClientConstructor +}); +function findV3ClientConstructor(pkg) { + const [_clientName, ServiceClient] = Object.entries(pkg).find( + ([name]) => { + return name.endsWith("Client") && name !== "__Client"; + } + ); + return ServiceClient; +} +var init_find_client_constructor = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { + "use strict"; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js +var require_lib = __commonJS({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; + var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); + Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { + return get_v3_client_package_name_1.getV3ClientPackageName; + } }); + var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); + Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { + return find_client_constructor_1.findV3ClientConstructor; + } }); + } +}); + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var aws_sdk_v3_handler_exports = {}; +__export(aws_sdk_v3_handler_exports, { + forceSdkInstallation: () => forceSdkInstallation, + handler: () => handler +}); +module.exports = __toCommonJS(aws_sdk_v3_handler_exports); +var import_child_process = require("child_process"); +var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); + +// custom-resources/lib/aws-custom-resource/runtime/shared.ts +var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } + return Object.assign( + {}, + ..._flatten(object) + ); +} +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +function filterKeys(object, pred) { + return Object.entries(object).reduce( + (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, + {} + ); +} +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data + }); + console.log("Responding", responseBody); + const parsedUrl = require("url").parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { + "content-type": "", + "content-length": Buffer.byteLength(responseBody, "utf8") + } + }; + return new Promise((resolve, reject) => { + try { + const request = require("https").request(requestOptions, resolve); + request.on("error", reject); + request.write(responseBody); + request.end(); + } catch (e) { + reject(e); + } + }); +} +function decodeCall(call) { + if (!call) { + return void 0; + } + return JSON.parse(call); +} +function startsWithOneOf(searchStrings) { + return function(string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var installedSdk = {}; +function forceSdkInstallation() { + installedSdk = {}; +} +function installLatestSdk(packageName) { + console.log(`Installing latest AWS SDK v3: ${packageName}`); + (0, import_child_process.execSync)( + `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` + ); + installedSdk = { + ...installedSdk, + [packageName]: true + }; +} +async function loadAwsSdk(packageName, installLatestAwsSdk) { + let awsSdk; + try { + if (!installedSdk[packageName] && installLatestAwsSdk === "true") { + try { + installLatestSdk(packageName); + awsSdk = require(`/tmp/node_modules/${packageName}`); + } catch (e) { + console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); + return require(packageName); + } + } else if (installedSdk[packageName]) { + awsSdk = require(`/tmp/node_modules/${packageName}`); + } else { + awsSdk = require(packageName); + } + } catch (error) { + throw Error(`Package ${packageName} does not exist.`); + } + return awsSdk; +} +async function handler(event, context) { + try { + event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); + event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); + event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); + let data = {}; + let physicalResourceId; + switch (event.RequestType) { + case "Create": + physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; + break; + case "Update": + case "Delete": + physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; + break; + } + const call = event.ResourceProperties[event.RequestType]; + if (call) { + const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); + let awsSdk = loadAwsSdk( + packageName, + event.ResourceProperties.InstallLatestAwsSdk + ); + console.log(JSON.stringify({ ...event, ResponseURL: "..." })); + let credentials; + if (call.assumedRoleArn) { + const timestamp = (/* @__PURE__ */ new Date()).getTime(); + const params = { + RoleArn: call.assumedRoleArn, + RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) + }; + const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); + credentials = fromTemporaryCredentials({ + params + }); + } + awsSdk = await awsSdk; + const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); + const client = new ServiceClient({ + apiVersion: call.apiVersion, + credentials, + region: call.region + }); + const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; + const Command = Object.entries(awsSdk).find( + ([name]) => name.toLowerCase() === commandName.toLowerCase() + )?.[1]; + let flatData = {}; + try { + const response = await client.send( + new Command( + (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} + ) + ); + flatData = { + apiVersion: client.config.apiVersion, + // For test purposes: check if apiVersion was correctly passed. + region: await client.config.region().catch(() => void 0), + // For test purposes: check if region was correctly passed. + ...flatten(response) + }; + let outputPaths; + if (call.outputPath) { + outputPaths = [call.outputPath]; + } else if (call.outputPaths) { + outputPaths = call.outputPaths; + } + if (outputPaths) { + data = filterKeys(flatData, startsWithOneOf(outputPaths)); + } else { + data = flatData; + } + } catch (e) { + const exceptionName = e.name ?? e.constructor.name; + if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { + throw e; + } + } + if (call.physicalResourceId?.responsePath) { + physicalResourceId = flatData[call.physicalResourceId.responsePath]; + } + } + await respond(event, "SUCCESS", "OK", physicalResourceId, data); + } catch (e) { + console.log(e); + await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + forceSdkInstallation, + handler +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js rename to packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +exports.startsWithOneOf = startsWithOneOf; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7R0FFRztBQUNILE1BQU0sT0FBTyxHQUFHLElBQUksV0FBVyxFQUFFLENBQUM7QUFFbEM7O0dBRUc7QUFDSCxTQUFTLFVBQVUsQ0FBQyxLQUFVO0lBQzVCLElBQUksTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsRUFBRTtRQUMxQixPQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDL0I7U0FBTSxJQUFJLFdBQVcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLEVBQUU7UUFDcEMsT0FBTyxPQUFPLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQztLQUNyQztJQUVELE9BQU8sS0FBSyxDQUFDO0FBQ2YsQ0FBQztBQUNEOzs7OztHQUtHO0FBQ0gsU0FBZ0IsT0FBTyxDQUFDLE1BQWM7SUFDcE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gocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgdHJ5IHtcbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tcmVxdWlyZS1pbXBvcnRzXG4gICAgICBjb25zdCByZXF1ZXN0ID0gcmVxdWlyZSgnaHR0cHMnKS5yZXF1ZXN0KHJlcXVlc3RPcHRpb25zLCByZXNvbHZlKTtcbiAgICAgIHJlcXVlc3Qub24oJ2Vycm9yJywgcmVqZWN0KTtcbiAgICAgIHJlcXVlc3Qud3JpdGUocmVzcG9uc2VCb2R5KTtcbiAgICAgIHJlcXVlc3QuZW5kKCk7XG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgcmVqZWN0KGUpO1xuICAgIH1cbiAgfSk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBkZWNvZGVDYWxsKGNhbGw6IHN0cmluZyB8IHVuZGVmaW5lZCkge1xuICBpZiAoIWNhbGwpIHsgcmV0dXJuIHVuZGVmaW5lZDsgfVxuICByZXR1cm4gSlNPTi5wYXJzZShjYWxsKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHN0YXJ0c1dpdGhPbmVPZihzZWFyY2hTdHJpbmdzOiBzdHJpbmdbXSk6IChzdHJpbmc6IHN0cmluZykgPT4gYm9vbGVhbiB7XG4gIHJldHVybiBmdW5jdGlvbihzdHJpbmc6IHN0cmluZyk6IGJvb2xlYW4ge1xuICAgIGZvciAoY29uc3Qgc2VhcmNoU3RyaW5nIG9mIHNlYXJjaFN0cmluZ3MpIHtcbiAgICAgIGlmIChzdHJpbmcuc3RhcnRzV2l0aChzZWFyY2hTdHJpbmcpKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js deleted file mode 100644 index 1b662725f1b0b..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js +++ /dev/null @@ -1,769 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts -var CLIENT_NAMES; -var init_client_names = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { - "use strict"; - CLIENT_NAMES = [ - "ACM", - "ACMPCA", - "APIGateway", - "ARCZonalShift", - "AccessAnalyzer", - "Account", - "AlexaForBusiness", - "Amp", - "Amplify", - "AmplifyBackend", - "AmplifyUIBuilder", - "ApiGatewayManagementApi", - "ApiGatewayV2", - "AppConfig", - "AppConfigData", - "AppIntegrations", - "AppMesh", - "AppRunner", - "AppStream", - "AppSync", - "Appflow", - "ApplicationAutoScaling", - "ApplicationCostProfiler", - "ApplicationInsights", - "Athena", - "AuditManager", - "AugmentedAIRuntime", - "AutoScaling", - "AutoScalingPlans", - "Backup", - "BackupGateway", - "BackupStorage", - "Batch", - "Billingconductor", - "Braket", - "Budgets", - "CUR", - "Chime", - "ChimeSDKIdentity", - "ChimeSDKMediaPipelines", - "ChimeSDKMeetings", - "ChimeSDKMessaging", - "ChimeSDKVoice", - "Cloud9", - "CloudControl", - "CloudDirectory", - "CloudFormation", - "CloudFront", - "CloudHSM", - "CloudHSMV2", - "CloudSearch", - "CloudSearchDomain", - "CloudTrail", - "CloudWatch", - "CloudWatchEvents", - "CloudWatchLogs", - "CodeArtifact", - "CodeBuild", - "CodeCatalyst", - "CodeCommit", - "CodeDeploy", - "CodeGuruProfiler", - "CodeGuruReviewer", - "CodePipeline", - "CodeStar", - "CodeStarNotifications", - "CodeStarconnections", - "CognitoIdentity", - "CognitoIdentityServiceProvider", - "CognitoSync", - "Comprehend", - "ComprehendMedical", - "ComputeOptimizer", - "ConfigService", - "Connect", - "ConnectCampaigns", - "ConnectCases", - "ConnectContactLens", - "ConnectParticipant", - "ControlTower", - "CostExplorer", - "CustomerProfiles", - "DAX", - "DLM", - "DMS", - "DataBrew", - "DataExchange", - "DataPipeline", - "DataSync", - "Detective", - "DevOpsGuru", - "DeviceFarm", - "DirectConnect", - "DirectoryService", - "Discovery", - "DocDB", - "DocDBElastic", - "Drs", - "DynamoDB", - "DynamoDBStreams", - "EBS", - "EC2", - "EC2InstanceConnect", - "ECR", - "ECRPUBLIC", - "ECS", - "EFS", - "EKS", - "ELB", - "ELBv2", - "EMR", - "EMRServerless", - "EMRcontainers", - "ES", - "ElastiCache", - "ElasticBeanstalk", - "ElasticInference", - "ElasticTranscoder", - "EventBridge", - "Evidently", - "FMS", - "FSx", - "Finspace", - "Finspacedata", - "Firehose", - "Fis", - "ForecastQueryService", - "ForecastService", - "FraudDetector", - "GameLift", - "GameSparks", - "Glacier", - "GlobalAccelerator", - "Glue", - "Grafana", - "Greengrass", - "GreengrassV2", - "GroundStation", - "GuardDuty", - "Health", - "HealthLake", - "Honeycode", - "IAM", - "IVS", - "IdentityStore", - "Imagebuilder", - "Inspector", - "Inspector2", - "IoT1ClickDevicesService", - "IoT1ClickProjects", - "IoTAnalytics", - "IoTEvents", - "IoTEventsData", - "IoTFleetHub", - "IoTFleetWise", - "IoTJobsDataPlane", - "IoTRoboRunner", - "IoTSecureTunneling", - "IoTSiteWise", - "IoTThingsGraph", - "IoTTwinMaker", - "IoTWireless", - "Iot", - "IotData", - "IotDeviceAdvisor", - "Ivschat", - "KMS", - "Kafka", - "KafkaConnect", - "Kendra", - "Keyspaces", - "Kinesis", - "KinesisAnalytics", - "KinesisAnalyticsV2", - "KinesisVideo", - "KinesisVideoArchivedMedia", - "KinesisVideoMedia", - "KinesisVideoSignalingChannels", - "KinesisVideoWebRTCStorage", - "LakeFormation", - "Lambda", - "LexModelBuildingService", - "LexModelsV2", - "LexRuntime", - "LexRuntimeV2", - "LicenseManager", - "LicenseManagerLinuxSubscriptions", - "LicenseManagerUserSubscriptions", - "Lightsail", - "Location", - "LookoutEquipment", - "LookoutMetrics", - "LookoutVision", - "M2", - "MQ", - "MTurk", - "MWAA", - "MachineLearning", - "Macie", - "Macie2", - "ManagedBlockchain", - "MarketplaceCatalog", - "MarketplaceCommerceAnalytics", - "MarketplaceEntitlementService", - "MarketplaceMetering", - "MediaConnect", - "MediaConvert", - "MediaLive", - "MediaPackage", - "MediaPackageVod", - "MediaStore", - "MediaStoreData", - "MediaTailor", - "MemoryDB", - "Mgn", - "MigrationHub", - "MigrationHubConfig", - "MigrationHubOrchestrator", - "MigrationHubRefactorSpaces", - "MigrationHubStrategy", - "Mobile", - "Neptune", - "NetworkFirewall", - "NetworkManager", - "Nimble", - "OAM", - "Omics", - "OpenSearch", - "OpenSearchServerless", - "OpsWorks", - "OpsWorksCM", - "Organizations", - "Outposts", - "PI", - "Panorama", - "Personalize", - "PersonalizeEvents", - "PersonalizeRuntime", - "Pinpoint", - "PinpointEmail", - "PinpointSMSVoice", - "PinpointSMSVoiceV2", - "Pipes", - "Polly", - "Pricing", - "PrivateNetworks", - "Proton", - "QLDB", - "QLDBSession", - "QuickSight", - "RAM", - "RDS", - "RDSDataService", - "RUM", - "Rbin", - "Redshift", - "RedshiftData", - "RedshiftServerless", - "Rekognition", - "Resiliencehub", - "ResourceExplorer2", - "ResourceGroups", - "ResourceGroupsTaggingAPI", - "RoboMaker", - "RolesAnywhere", - "Route53", - "Route53Domains", - "Route53RecoveryCluster", - "Route53RecoveryControlConfig", - "Route53RecoveryReadiness", - "Route53Resolver", - "S3", - "S3Control", - "S3Outposts", - "SES", - "SESV2", - "SMS", - "SNS", - "SQS", - "SSM", - "SSMContacts", - "SSMIncidents", - "SSO", - "SSOAdmin", - "SSOOIDC", - "STS", - "SWF", - "SageMaker", - "SageMakerFeatureStoreRuntime", - "SageMakerGeospatial", - "SageMakerMetrics", - "SageMakerRuntime", - "SagemakerEdge", - "SavingsPlans", - "Scheduler", - "Schemas", - "SecretsManager", - "SecurityHub", - "SecurityLake", - "ServerlessApplicationRepository", - "ServiceCatalog", - "ServiceCatalogAppRegistry", - "ServiceDiscovery", - "ServiceQuotas", - "Shield", - "Signer", - "SimSpaceWeaver", - "SnowDeviceManagement", - "Snowball", - "SsmSap", - "StepFunctions", - "StorageGateway", - "Support", - "SupportApp", - "Synthetics", - "Textract", - "TimestreamQuery", - "TimestreamWrite", - "TranscribeService", - "Transfer", - "Translate", - "VoiceID", - "WAF", - "WAFRegional", - "WAFV2", - "WellArchitected", - "Wisdom", - "WorkDocs", - "WorkLink", - "WorkMail", - "WorkMailMessageFlow", - "WorkSpaces", - "WorkSpacesWeb", - "XRay" - ]; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts -var CLIENT_PACKAGE_NAMES_MAP; -var init_client_package_names_map = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { - "use strict"; - init_client_names(); - CLIENT_PACKAGE_NAMES_MAP = { - ...CLIENT_NAMES.reduce( - (acc, name) => ({ - ...acc, - [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") - }), - {} - ), - AccessAnalyzer: "client-accessanalyzer", - ACMPCA: "client-acm-pca", - APIGateway: "client-api-gateway", - ApiGatewayManagementApi: "client-apigatewaymanagementapi", - ApiGatewayV2: "client-apigatewayv2", - AppConfig: "client-appconfig", - AppConfigData: "client-appconfigdata", - AppIntegrations: "client-appintegrations", - AppRunner: "client-apprunner", - AppStream: "client-appstream", - AppSync: "client-appsync", - ApplicationCostProfiler: "client-applicationcostprofiler", - ARCZonalShift: "client-arc-zonal-shift", - AugmentedAIRuntime: "client-sage-maker-a2iruntime", - AuditManager: "client-auditmanager", - BackupStorage: "client-backupstorage", - CUR: "client-cost-and-usage-report-service", - CloudHSMV2: "client-cloudhsm-v2", - CodeGuruProfiler: "client-codeguruprofiler", - CodeStarconnections: "client-codestar-connections", - CognitoIdentityServiceProvider: "client-cognito-identity-provider", - ComprehendMedical: "client-comprehendmedical", - ConnectContactLens: "client-connect-contact-lens", - ControlTower: "client-controltower", - DMS: "client-database-migration-service", - DataPipeline: "client-data-pipeline", - Discovery: "client-application-discovery-service", - DevOpsGuru: "client-devops-guru", - DynamoDB: "client-dynamodb", - DynamoDBStreams: "client-dynamodb-streams", - DocDB: "client-docdb", - DocDBElastic: "client-docdb-elastic", - EC2InstanceConnect: "client-ec2-instance-connect", - ECRPUBLIC: "client-ecr-public", - ELB: "client-elastic-load-balancing", - ELBv2: "client-elastic-load-balancing-v2", - ElastiCache: "client-elasticache", - EMRcontainers: "client-emr-containers", - EMRServerless: "client-emr-serverless", - ES: "client-elasticsearch-service", - EventBridge: "client-eventbridge", - Finspacedata: "client-finspace-data", - ForecastQueryService: "client-forecastquery", - ForecastService: "client-forecast", - FraudDetector: "client-frauddetector", - GameLift: "client-gamelift", - GameSparks: "client-gamesparks", - GreengrassV2: "client-greengrassv2", - GroundStation: "client-groundstation", - GuardDuty: "client-guardduty", - HealthLake: "client-healthlake", - IdentityStore: "client-identitystore", - IoTAnalytics: "client-iotanalytics", - IotData: "client-iot-data-plane", - IotDeviceAdvisor: "client-iotdeviceadvisor", - IoTSecureTunneling: "client-iotsecuretunneling", - IoTSiteWise: "client-iotsitewise", - IoTThingsGraph: "client-iotthingsgraph", - IoTTwinMaker: "client-iottwinmaker", - IoTRoboRunner: "client-iot-roborunner", - KafkaConnect: "client-kafkaconnect", - KinesisVideoSignalingChannels: "client-kinesis-video-signaling", - KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", - LakeFormation: "client-lakeformation", - LexRuntime: "client-lex-runtime-service", - ManagedBlockchain: "client-managedblockchain", - MigrationHubConfig: "client-migrationhub-config", - MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", - NetworkManager: "client-networkmanager", - OpenSearch: "client-opensearch", - OpenSearchServerless: "client-opensearchserverless", - OpsWorks: "client-opsworks", - OpsWorksCM: "client-opsworkscm", - PrivateNetworks: "client-privatenetworks", - QLDBSession: "client-qldb-session", - QuickSight: "client-quicksight", - ResourceExplorer2: "client-resource-explorer-2", - RDSDataService: "client-rds-data", - RoboMaker: "client-robomaker", - RolesAnywhere: "client-rolesanywhere", - Route53: "client-route-53", - Route53Domains: "client-route-53-domains", - Route53Resolver: "client-route53resolver", - S3Control: "client-s3-control", - SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", - SavingsPlans: "client-savingsplans", - SecurityHub: "client-securityhub", - ServerlessApplicationRepository: "client-serverlessapplicationrepository", - ServiceCatalogAppRegistry: "client-service-catalog-appregistry", - ServiceDiscovery: "client-servicediscovery", - SimSpaceWeaver: "client-simspaceweaver", - SSMContacts: "client-ssm-contacts", - SSMIncidents: "client-ssm-incidents", - SSOAdmin: "client-sso-admin", - SSOOIDC: "client-sso-oidc", - StepFunctions: "client-sfn", - TranscribeService: "client-transcribe", - WAFRegional: "client-waf-regional", - WellArchitected: "client-wellarchitected", - WorkMailMessageFlow: "client-workmailmessageflow" - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts -var get_v3_client_package_name_exports = {}; -__export(get_v3_client_package_name_exports, { - getV3ClientPackageName: () => getV3ClientPackageName -}); -var getV3ClientPackageName; -var init_get_v3_client_package_name = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { - "use strict"; - init_client_package_names_map(); - getV3ClientPackageName = (clientName) => { - if (clientName in CLIENT_PACKAGE_NAMES_MAP) { - return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; - } - throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts -var find_client_constructor_exports = {}; -__export(find_client_constructor_exports, { - findV3ClientConstructor: () => findV3ClientConstructor -}); -function findV3ClientConstructor(pkg) { - const [_clientName, ServiceClient] = Object.entries(pkg).find( - ([name]) => { - return name.endsWith("Client") && name !== "__Client"; - } - ); - return ServiceClient; -} -var init_find_client_constructor = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { - "use strict"; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js -var require_lib = __commonJS({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; - var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); - Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { - return get_v3_client_package_name_1.getV3ClientPackageName; - } }); - var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); - Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { - return find_client_constructor_1.findV3ClientConstructor; - } }); - } -}); - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var aws_sdk_v3_handler_exports = {}; -__export(aws_sdk_v3_handler_exports, { - forceSdkInstallation: () => forceSdkInstallation, - handler: () => handler -}); -module.exports = __toCommonJS(aws_sdk_v3_handler_exports); -var import_child_process = require("child_process"); -var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); - -// custom-resources/lib/aws-custom-resource/runtime/shared.ts -var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; -function flatten(object) { - return Object.assign( - {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) - ); -} -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -function filterKeys(object, pred) { - return Object.entries(object).reduce( - (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, - {} - ); -} -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data - }); - console.log("Responding", responseBody); - const parsedUrl = require("url").parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { - "content-type": "", - "content-length": Buffer.byteLength(responseBody, "utf8") - } - }; - return new Promise((resolve, reject) => { - try { - const request = require("https").request(requestOptions, resolve); - request.on("error", reject); - request.write(responseBody); - request.end(); - } catch (e) { - reject(e); - } - }); -} -function decodeCall(call) { - if (!call) { - return void 0; - } - return JSON.parse(call); -} -function startsWithOneOf(searchStrings) { - return function(string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var installedSdk = {}; -function forceSdkInstallation() { - installedSdk = {}; -} -function installLatestSdk(packageName) { - console.log(`Installing latest AWS SDK v3: ${packageName}`); - (0, import_child_process.execSync)( - `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` - ); - installedSdk = { - ...installedSdk, - [packageName]: true - }; -} -async function loadAwsSdk(packageName, installLatestAwsSdk) { - let awsSdk; - try { - if (!installedSdk[packageName] && installLatestAwsSdk === "true") { - try { - installLatestSdk(packageName); - awsSdk = require(`/tmp/node_modules/${packageName}`); - } catch (e) { - console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); - return require(packageName); - } - } else if (installedSdk[packageName]) { - awsSdk = require(`/tmp/node_modules/${packageName}`); - } else { - awsSdk = require(packageName); - } - } catch (error) { - throw Error(`Package ${packageName} does not exist.`); - } - return awsSdk; -} -async function handler(event, context) { - try { - event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); - event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); - event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); - let data = {}; - let physicalResourceId; - switch (event.RequestType) { - case "Create": - physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; - break; - case "Update": - case "Delete": - physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; - break; - } - const call = event.ResourceProperties[event.RequestType]; - if (call) { - const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); - let awsSdk = loadAwsSdk( - packageName, - event.ResourceProperties.InstallLatestAwsSdk - ); - console.log(JSON.stringify({ ...event, ResponseURL: "..." })); - let credentials; - if (call.assumedRoleArn) { - const timestamp = (/* @__PURE__ */ new Date()).getTime(); - const params = { - RoleArn: call.assumedRoleArn, - RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) - }; - const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); - credentials = fromTemporaryCredentials({ - params - }); - } - awsSdk = await awsSdk; - const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); - const client = new ServiceClient({ - apiVersion: call.apiVersion, - credentials, - region: call.region - }); - const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; - const Command = Object.entries(awsSdk).find( - ([name]) => name.toLowerCase() === commandName.toLowerCase() - )?.[1]; - let flatData = {}; - try { - const response = await client.send( - new Command( - (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} - ) - ); - flatData = { - apiVersion: client.config.apiVersion, - // For test purposes: check if apiVersion was correctly passed. - region: await client.config.region().catch(() => void 0), - // For test purposes: check if region was correctly passed. - ...flatten(response) - }; - let outputPaths; - if (call.outputPath) { - outputPaths = [call.outputPath]; - } else if (call.outputPaths) { - outputPaths = call.outputPaths; - } - if (outputPaths) { - data = filterKeys(flatData, startsWithOneOf(outputPaths)); - } else { - data = flatData; - } - } catch (e) { - const exceptionName = e.name ?? e.constructor.name; - if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { - throw e; - } - } - if (call.physicalResourceId?.responsePath) { - physicalResourceId = flatData[call.physicalResourceId.responsePath]; - } - } - await respond(event, "SUCCESS", "OK", physicalResourceId, data); - } catch (e) { - console.log(e); - await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - forceSdkInstallation, - handler -}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js deleted file mode 100644 index 6c53eaeef8cd1..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -exports.decodeSpecialValues = decodeSpecialValues; -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -exports.filterKeys = filterKeys; -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - // eslint-disable-next-line no-console - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': Buffer.byteLength(responseBody, 'utf8'), - }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -exports.respond = respond; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -exports.decodeCall = decodeCall; -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} -exports.startsWithOneOf = startsWithOneOf; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7Ozs7R0FLRztBQUNILFNBQWdCLE9BQU8sQ0FBQyxNQUFjO0lBQ3BDLE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FDbEIsRUFBRSxFQUNGLEdBQUcsU0FBUyxRQUFRLENBQUMsS0FBVSxFQUFFLE9BQWlCLEVBQUU7UUFDbEQsT0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUM7YUFDbkMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxFQUFFO1lBQ1QsTUFBTSxRQUFRLEdBQUcsTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxD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HJpbmdzKSB7XG4gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/aws-cdk-customresources-vpc.assets.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/aws-cdk-customresources-vpc.assets.json index eee117fc9693c..0da9b1df7720b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/aws-cdk-customresources-vpc.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/aws-cdk-customresources-vpc.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "e156e994bd8b199ada07e704f8e41973d5a4754bb6850d96a2d271a56427aaac": { + "2fce543a9b15be3ef8efef63a88ed521bcf800d891ca815b68663dfd8a19cc9a": { "source": { "path": "aws-cdk-customresources-vpc.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "e156e994bd8b199ada07e704f8e41973d5a4754bb6850d96a2d271a56427aaac.json", + "objectKey": "2fce543a9b15be3ef8efef63a88ed521bcf800d891ca815b68663dfd8a19cc9a.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/aws-cdk-customresources-vpc.template.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/aws-cdk-customresources-vpc.template.json index b4d9d7e2d65b2..b38935b84fbe0 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/aws-cdk-customresources-vpc.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/aws-cdk-customresources-vpc.template.json @@ -432,7 +432,7 @@ ] ] }, - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "DescribeVpcAttributeCustomResourcePolicyAF7C66C1" @@ -539,7 +539,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/manifest.json index f8aeb4cb40b9c..4f5665b30f3ca 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e156e994bd8b199ada07e704f8e41973d5a4754bb6850d96a2d271a56427aaac.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2fce543a9b15be3ef8efef63a88ed521bcf800d891ca815b68663dfd8a19cc9a.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -171,6 +171,12 @@ "data": "VpcVPCGWBF912B6E" } ], + "/aws-cdk-customresources-vpc/DescribeVpcAttribute": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/aws-cdk-customresources-vpc/DescribeVpcAttribute/Resource/Default": [ { "type": "aws:cdk:logicalId", diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/tree.json index dd3985f355979..e45b9f46b61e9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.js.snapshot/tree.json @@ -869,7 +869,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v2-handler.js rename to packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js new file mode 100644 index 0000000000000..9f6e97928f257 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -0,0 +1,779 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts +var CLIENT_NAMES; +var init_client_names = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { + "use strict"; + CLIENT_NAMES = [ + "ACM", + "ACMPCA", + "APIGateway", + "ARCZonalShift", + "AccessAnalyzer", + "Account", + "AlexaForBusiness", + "Amp", + "Amplify", + "AmplifyBackend", + "AmplifyUIBuilder", + "ApiGatewayManagementApi", + "ApiGatewayV2", + "AppConfig", + "AppConfigData", + "AppIntegrations", + "AppMesh", + "AppRunner", + "AppStream", + "AppSync", + "Appflow", + "ApplicationAutoScaling", + "ApplicationCostProfiler", + "ApplicationInsights", + "Athena", + "AuditManager", + "AugmentedAIRuntime", + "AutoScaling", + "AutoScalingPlans", + "Backup", + "BackupGateway", + "BackupStorage", + "Batch", + "Billingconductor", + "Braket", + "Budgets", + "CUR", + "Chime", + "ChimeSDKIdentity", + "ChimeSDKMediaPipelines", + "ChimeSDKMeetings", + "ChimeSDKMessaging", + "ChimeSDKVoice", + "Cloud9", + "CloudControl", + "CloudDirectory", + "CloudFormation", + "CloudFront", + "CloudHSM", + "CloudHSMV2", + "CloudSearch", + "CloudSearchDomain", + "CloudTrail", + "CloudWatch", + "CloudWatchEvents", + "CloudWatchLogs", + "CodeArtifact", + "CodeBuild", + "CodeCatalyst", + "CodeCommit", + "CodeDeploy", + "CodeGuruProfiler", + "CodeGuruReviewer", + "CodePipeline", + "CodeStar", + "CodeStarNotifications", + "CodeStarconnections", + "CognitoIdentity", + "CognitoIdentityServiceProvider", + "CognitoSync", + "Comprehend", + "ComprehendMedical", + "ComputeOptimizer", + "ConfigService", + "Connect", + "ConnectCampaigns", + "ConnectCases", + "ConnectContactLens", + "ConnectParticipant", + "ControlTower", + "CostExplorer", + "CustomerProfiles", + "DAX", + "DLM", + "DMS", + "DataBrew", + "DataExchange", + "DataPipeline", + "DataSync", + "Detective", + "DevOpsGuru", + "DeviceFarm", + "DirectConnect", + "DirectoryService", + "Discovery", + "DocDB", + "DocDBElastic", + "Drs", + "DynamoDB", + "DynamoDBStreams", + "EBS", + "EC2", + "EC2InstanceConnect", + "ECR", + "ECRPUBLIC", + "ECS", + "EFS", + "EKS", + "ELB", + "ELBv2", + "EMR", + "EMRServerless", + "EMRcontainers", + "ES", + "ElastiCache", + "ElasticBeanstalk", + "ElasticInference", + "ElasticTranscoder", + "EventBridge", + "Evidently", + "FMS", + "FSx", + "Finspace", + "Finspacedata", + "Firehose", + "Fis", + "ForecastQueryService", + "ForecastService", + "FraudDetector", + "GameLift", + "GameSparks", + "Glacier", + "GlobalAccelerator", + "Glue", + "Grafana", + "Greengrass", + "GreengrassV2", + "GroundStation", + "GuardDuty", + "Health", + "HealthLake", + "Honeycode", + "IAM", + "IVS", + "IdentityStore", + "Imagebuilder", + "Inspector", + "Inspector2", + "IoT1ClickDevicesService", + "IoT1ClickProjects", + "IoTAnalytics", + "IoTEvents", + "IoTEventsData", + "IoTFleetHub", + "IoTFleetWise", + "IoTJobsDataPlane", + "IoTRoboRunner", + "IoTSecureTunneling", + "IoTSiteWise", + "IoTThingsGraph", + "IoTTwinMaker", + "IoTWireless", + "Iot", + "IotData", + "IotDeviceAdvisor", + "Ivschat", + "KMS", + "Kafka", + "KafkaConnect", + "Kendra", + "Keyspaces", + "Kinesis", + "KinesisAnalytics", + "KinesisAnalyticsV2", + "KinesisVideo", + "KinesisVideoArchivedMedia", + "KinesisVideoMedia", + "KinesisVideoSignalingChannels", + "KinesisVideoWebRTCStorage", + "LakeFormation", + "Lambda", + "LexModelBuildingService", + "LexModelsV2", + "LexRuntime", + "LexRuntimeV2", + "LicenseManager", + "LicenseManagerLinuxSubscriptions", + "LicenseManagerUserSubscriptions", + "Lightsail", + "Location", + "LookoutEquipment", + "LookoutMetrics", + "LookoutVision", + "M2", + "MQ", + "MTurk", + "MWAA", + "MachineLearning", + "Macie", + "Macie2", + "ManagedBlockchain", + "MarketplaceCatalog", + "MarketplaceCommerceAnalytics", + "MarketplaceEntitlementService", + "MarketplaceMetering", + "MediaConnect", + "MediaConvert", + "MediaLive", + "MediaPackage", + "MediaPackageVod", + "MediaStore", + "MediaStoreData", + "MediaTailor", + "MemoryDB", + "Mgn", + "MigrationHub", + "MigrationHubConfig", + "MigrationHubOrchestrator", + "MigrationHubRefactorSpaces", + "MigrationHubStrategy", + "Mobile", + "Neptune", + "NetworkFirewall", + "NetworkManager", + "Nimble", + "OAM", + "Omics", + "OpenSearch", + "OpenSearchServerless", + "OpsWorks", + "OpsWorksCM", + "Organizations", + "Outposts", + "PI", + "Panorama", + "Personalize", + "PersonalizeEvents", + "PersonalizeRuntime", + "Pinpoint", + "PinpointEmail", + "PinpointSMSVoice", + "PinpointSMSVoiceV2", + "Pipes", + "Polly", + "Pricing", + "PrivateNetworks", + "Proton", + "QLDB", + "QLDBSession", + "QuickSight", + "RAM", + "RDS", + "RDSDataService", + "RUM", + "Rbin", + "Redshift", + "RedshiftData", + "RedshiftServerless", + "Rekognition", + "Resiliencehub", + "ResourceExplorer2", + "ResourceGroups", + "ResourceGroupsTaggingAPI", + "RoboMaker", + "RolesAnywhere", + "Route53", + "Route53Domains", + "Route53RecoveryCluster", + "Route53RecoveryControlConfig", + "Route53RecoveryReadiness", + "Route53Resolver", + "S3", + "S3Control", + "S3Outposts", + "SES", + "SESV2", + "SMS", + "SNS", + "SQS", + "SSM", + "SSMContacts", + "SSMIncidents", + "SSO", + "SSOAdmin", + "SSOOIDC", + "STS", + "SWF", + "SageMaker", + "SageMakerFeatureStoreRuntime", + "SageMakerGeospatial", + "SageMakerMetrics", + "SageMakerRuntime", + "SagemakerEdge", + "SavingsPlans", + "Scheduler", + "Schemas", + "SecretsManager", + "SecurityHub", + "SecurityLake", + "ServerlessApplicationRepository", + "ServiceCatalog", + "ServiceCatalogAppRegistry", + "ServiceDiscovery", + "ServiceQuotas", + "Shield", + "Signer", + "SimSpaceWeaver", + "SnowDeviceManagement", + "Snowball", + "SsmSap", + "StepFunctions", + "StorageGateway", + "Support", + "SupportApp", + "Synthetics", + "Textract", + "TimestreamQuery", + "TimestreamWrite", + "TranscribeService", + "Transfer", + "Translate", + "VoiceID", + "WAF", + "WAFRegional", + "WAFV2", + "WellArchitected", + "Wisdom", + "WorkDocs", + "WorkLink", + "WorkMail", + "WorkMailMessageFlow", + "WorkSpaces", + "WorkSpacesWeb", + "XRay" + ]; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts +var CLIENT_PACKAGE_NAMES_MAP; +var init_client_package_names_map = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { + "use strict"; + init_client_names(); + CLIENT_PACKAGE_NAMES_MAP = { + ...CLIENT_NAMES.reduce( + (acc, name) => ({ + ...acc, + [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") + }), + {} + ), + AccessAnalyzer: "client-accessanalyzer", + ACMPCA: "client-acm-pca", + APIGateway: "client-api-gateway", + ApiGatewayManagementApi: "client-apigatewaymanagementapi", + ApiGatewayV2: "client-apigatewayv2", + AppConfig: "client-appconfig", + AppConfigData: "client-appconfigdata", + AppIntegrations: "client-appintegrations", + AppRunner: "client-apprunner", + AppStream: "client-appstream", + AppSync: "client-appsync", + ApplicationCostProfiler: "client-applicationcostprofiler", + ARCZonalShift: "client-arc-zonal-shift", + AugmentedAIRuntime: "client-sage-maker-a2iruntime", + AuditManager: "client-auditmanager", + BackupStorage: "client-backupstorage", + CUR: "client-cost-and-usage-report-service", + CloudHSMV2: "client-cloudhsm-v2", + CodeGuruProfiler: "client-codeguruprofiler", + CodeStarconnections: "client-codestar-connections", + CognitoIdentityServiceProvider: "client-cognito-identity-provider", + ComprehendMedical: "client-comprehendmedical", + ConnectContactLens: "client-connect-contact-lens", + ControlTower: "client-controltower", + DMS: "client-database-migration-service", + DataPipeline: "client-data-pipeline", + Discovery: "client-application-discovery-service", + DevOpsGuru: "client-devops-guru", + DynamoDB: "client-dynamodb", + DynamoDBStreams: "client-dynamodb-streams", + DocDB: "client-docdb", + DocDBElastic: "client-docdb-elastic", + EC2InstanceConnect: "client-ec2-instance-connect", + ECRPUBLIC: "client-ecr-public", + ELB: "client-elastic-load-balancing", + ELBv2: "client-elastic-load-balancing-v2", + ElastiCache: "client-elasticache", + EMRcontainers: "client-emr-containers", + EMRServerless: "client-emr-serverless", + ES: "client-elasticsearch-service", + EventBridge: "client-eventbridge", + Finspacedata: "client-finspace-data", + ForecastQueryService: "client-forecastquery", + ForecastService: "client-forecast", + FraudDetector: "client-frauddetector", + GameLift: "client-gamelift", + GameSparks: "client-gamesparks", + GreengrassV2: "client-greengrassv2", + GroundStation: "client-groundstation", + GuardDuty: "client-guardduty", + HealthLake: "client-healthlake", + IdentityStore: "client-identitystore", + IoTAnalytics: "client-iotanalytics", + IotData: "client-iot-data-plane", + IotDeviceAdvisor: "client-iotdeviceadvisor", + IoTSecureTunneling: "client-iotsecuretunneling", + IoTSiteWise: "client-iotsitewise", + IoTThingsGraph: "client-iotthingsgraph", + IoTTwinMaker: "client-iottwinmaker", + IoTRoboRunner: "client-iot-roborunner", + KafkaConnect: "client-kafkaconnect", + KinesisVideoSignalingChannels: "client-kinesis-video-signaling", + KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", + LakeFormation: "client-lakeformation", + LexRuntime: "client-lex-runtime-service", + ManagedBlockchain: "client-managedblockchain", + MigrationHubConfig: "client-migrationhub-config", + MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", + NetworkManager: "client-networkmanager", + OpenSearch: "client-opensearch", + OpenSearchServerless: "client-opensearchserverless", + OpsWorks: "client-opsworks", + OpsWorksCM: "client-opsworkscm", + PrivateNetworks: "client-privatenetworks", + QLDBSession: "client-qldb-session", + QuickSight: "client-quicksight", + ResourceExplorer2: "client-resource-explorer-2", + RDSDataService: "client-rds-data", + RoboMaker: "client-robomaker", + RolesAnywhere: "client-rolesanywhere", + Route53: "client-route-53", + Route53Domains: "client-route-53-domains", + Route53Resolver: "client-route53resolver", + S3Control: "client-s3-control", + SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", + SavingsPlans: "client-savingsplans", + SecurityHub: "client-securityhub", + ServerlessApplicationRepository: "client-serverlessapplicationrepository", + ServiceCatalogAppRegistry: "client-service-catalog-appregistry", + ServiceDiscovery: "client-servicediscovery", + SimSpaceWeaver: "client-simspaceweaver", + SSMContacts: "client-ssm-contacts", + SSMIncidents: "client-ssm-incidents", + SSOAdmin: "client-sso-admin", + SSOOIDC: "client-sso-oidc", + StepFunctions: "client-sfn", + TranscribeService: "client-transcribe", + WAFRegional: "client-waf-regional", + WellArchitected: "client-wellarchitected", + WorkMailMessageFlow: "client-workmailmessageflow" + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts +var get_v3_client_package_name_exports = {}; +__export(get_v3_client_package_name_exports, { + getV3ClientPackageName: () => getV3ClientPackageName +}); +var getV3ClientPackageName; +var init_get_v3_client_package_name = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { + "use strict"; + init_client_package_names_map(); + getV3ClientPackageName = (clientName) => { + if (clientName in CLIENT_PACKAGE_NAMES_MAP) { + return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; + } + throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts +var find_client_constructor_exports = {}; +__export(find_client_constructor_exports, { + findV3ClientConstructor: () => findV3ClientConstructor +}); +function findV3ClientConstructor(pkg) { + const [_clientName, ServiceClient] = Object.entries(pkg).find( + ([name]) => { + return name.endsWith("Client") && name !== "__Client"; + } + ); + return ServiceClient; +} +var init_find_client_constructor = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { + "use strict"; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js +var require_lib = __commonJS({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; + var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); + Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { + return get_v3_client_package_name_1.getV3ClientPackageName; + } }); + var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); + Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { + return find_client_constructor_1.findV3ClientConstructor; + } }); + } +}); + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var aws_sdk_v3_handler_exports = {}; +__export(aws_sdk_v3_handler_exports, { + forceSdkInstallation: () => forceSdkInstallation, + handler: () => handler +}); +module.exports = __toCommonJS(aws_sdk_v3_handler_exports); +var import_child_process = require("child_process"); +var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); + +// custom-resources/lib/aws-custom-resource/runtime/shared.ts +var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } + return Object.assign( + {}, + ..._flatten(object) + ); +} +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +function filterKeys(object, pred) { + return Object.entries(object).reduce( + (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, + {} + ); +} +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data + }); + console.log("Responding", responseBody); + const parsedUrl = require("url").parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { + "content-type": "", + "content-length": Buffer.byteLength(responseBody, "utf8") + } + }; + return new Promise((resolve, reject) => { + try { + const request = require("https").request(requestOptions, resolve); + request.on("error", reject); + request.write(responseBody); + request.end(); + } catch (e) { + reject(e); + } + }); +} +function decodeCall(call) { + if (!call) { + return void 0; + } + return JSON.parse(call); +} +function startsWithOneOf(searchStrings) { + return function(string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var installedSdk = {}; +function forceSdkInstallation() { + installedSdk = {}; +} +function installLatestSdk(packageName) { + console.log(`Installing latest AWS SDK v3: ${packageName}`); + (0, import_child_process.execSync)( + `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` + ); + installedSdk = { + ...installedSdk, + [packageName]: true + }; +} +async function loadAwsSdk(packageName, installLatestAwsSdk) { + let awsSdk; + try { + if (!installedSdk[packageName] && installLatestAwsSdk === "true") { + try { + installLatestSdk(packageName); + awsSdk = require(`/tmp/node_modules/${packageName}`); + } catch (e) { + console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); + return require(packageName); + } + } else if (installedSdk[packageName]) { + awsSdk = require(`/tmp/node_modules/${packageName}`); + } else { + awsSdk = require(packageName); + } + } catch (error) { + throw Error(`Package ${packageName} does not exist.`); + } + return awsSdk; +} +async function handler(event, context) { + try { + event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); + event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); + event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); + let data = {}; + let physicalResourceId; + switch (event.RequestType) { + case "Create": + physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; + break; + case "Update": + case "Delete": + physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; + break; + } + const call = event.ResourceProperties[event.RequestType]; + if (call) { + const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); + let awsSdk = loadAwsSdk( + packageName, + event.ResourceProperties.InstallLatestAwsSdk + ); + console.log(JSON.stringify({ ...event, ResponseURL: "..." })); + let credentials; + if (call.assumedRoleArn) { + const timestamp = (/* @__PURE__ */ new Date()).getTime(); + const params = { + RoleArn: call.assumedRoleArn, + RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) + }; + const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); + credentials = fromTemporaryCredentials({ + params + }); + } + awsSdk = await awsSdk; + const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); + const client = new ServiceClient({ + apiVersion: call.apiVersion, + credentials, + region: call.region + }); + const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; + const Command = Object.entries(awsSdk).find( + ([name]) => name.toLowerCase() === commandName.toLowerCase() + )?.[1]; + let flatData = {}; + try { + const response = await client.send( + new Command( + (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} + ) + ); + flatData = { + apiVersion: client.config.apiVersion, + // For test purposes: check if apiVersion was correctly passed. + region: await client.config.region().catch(() => void 0), + // For test purposes: check if region was correctly passed. + ...flatten(response) + }; + let outputPaths; + if (call.outputPath) { + outputPaths = [call.outputPath]; + } else if (call.outputPaths) { + outputPaths = call.outputPaths; + } + if (outputPaths) { + data = filterKeys(flatData, startsWithOneOf(outputPaths)); + } else { + data = flatData; + } + } catch (e) { + const exceptionName = e.name ?? e.constructor.name; + if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { + throw e; + } + } + if (call.physicalResourceId?.responsePath) { + physicalResourceId = flatData[call.physicalResourceId.responsePath]; + } + } + await respond(event, "SUCCESS", "OK", physicalResourceId, data); + } catch (e) { + console.log(e); + await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + forceSdkInstallation, + handler +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/index.js rename to packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; +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c2VCb2R5KTtcbiAgICAgIHJlcXVlc3QuZW5kKCk7XG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgcmVqZWN0KGUpO1xuICAgIH1cbiAgfSk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBkZWNvZGVDYWxsKGNhbGw6IHN0cmluZyB8IHVuZGVmaW5lZCkge1xuICBpZiAoIWNhbGwpIHsgcmV0dXJuIHVuZGVmaW5lZDsgfVxuICByZXR1cm4gSlNPTi5wYXJzZShjYWxsKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHN0YXJ0c1dpdGhPbmVPZihzZWFyY2hTdHJpbmdzOiBzdHJpbmdbXSk6IChzdHJpbmc6IHN0cmluZykgPT4gYm9vbGVhbiB7XG4gIHJldHVybiBmdW5jdGlvbihzdHJpbmc6IHN0cmluZyk6IGJvb2xlYW4ge1xuICAgIGZvciAoY29uc3Qgc2VhcmNoU3RyaW5nIG9mIHNlYXJjaFN0cmluZ3MpIHtcbiAgICAgIGlmIChzdHJpbmcuc3RhcnRzV2l0aChzZWFyY2hTdHJpbmcpKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js deleted file mode 100644 index 1b662725f1b0b..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/aws-sdk-v3-handler.bundled.js +++ /dev/null @@ -1,769 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts -var CLIENT_NAMES; -var init_client_names = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { - "use strict"; - CLIENT_NAMES = [ - "ACM", - "ACMPCA", - "APIGateway", - "ARCZonalShift", - "AccessAnalyzer", - "Account", - "AlexaForBusiness", - "Amp", - "Amplify", - "AmplifyBackend", - "AmplifyUIBuilder", - "ApiGatewayManagementApi", - "ApiGatewayV2", - "AppConfig", - "AppConfigData", - "AppIntegrations", - "AppMesh", - "AppRunner", - "AppStream", - "AppSync", - "Appflow", - "ApplicationAutoScaling", - "ApplicationCostProfiler", - "ApplicationInsights", - "Athena", - "AuditManager", - "AugmentedAIRuntime", - "AutoScaling", - "AutoScalingPlans", - "Backup", - "BackupGateway", - "BackupStorage", - "Batch", - "Billingconductor", - "Braket", - "Budgets", - "CUR", - "Chime", - "ChimeSDKIdentity", - "ChimeSDKMediaPipelines", - "ChimeSDKMeetings", - "ChimeSDKMessaging", - "ChimeSDKVoice", - "Cloud9", - "CloudControl", - "CloudDirectory", - "CloudFormation", - "CloudFront", - "CloudHSM", - "CloudHSMV2", - "CloudSearch", - "CloudSearchDomain", - "CloudTrail", - "CloudWatch", - "CloudWatchEvents", - "CloudWatchLogs", - "CodeArtifact", - "CodeBuild", - "CodeCatalyst", - "CodeCommit", - "CodeDeploy", - "CodeGuruProfiler", - "CodeGuruReviewer", - "CodePipeline", - "CodeStar", - "CodeStarNotifications", - "CodeStarconnections", - "CognitoIdentity", - "CognitoIdentityServiceProvider", - "CognitoSync", - "Comprehend", - "ComprehendMedical", - "ComputeOptimizer", - "ConfigService", - "Connect", - "ConnectCampaigns", - "ConnectCases", - "ConnectContactLens", - "ConnectParticipant", - "ControlTower", - "CostExplorer", - "CustomerProfiles", - "DAX", - "DLM", - "DMS", - "DataBrew", - "DataExchange", - "DataPipeline", - "DataSync", - "Detective", - "DevOpsGuru", - "DeviceFarm", - "DirectConnect", - "DirectoryService", - "Discovery", - "DocDB", - "DocDBElastic", - "Drs", - "DynamoDB", - "DynamoDBStreams", - "EBS", - "EC2", - "EC2InstanceConnect", - "ECR", - "ECRPUBLIC", - "ECS", - "EFS", - "EKS", - "ELB", - "ELBv2", - "EMR", - "EMRServerless", - "EMRcontainers", - "ES", - "ElastiCache", - "ElasticBeanstalk", - "ElasticInference", - "ElasticTranscoder", - "EventBridge", - "Evidently", - "FMS", - "FSx", - "Finspace", - "Finspacedata", - "Firehose", - "Fis", - "ForecastQueryService", - "ForecastService", - "FraudDetector", - "GameLift", - "GameSparks", - "Glacier", - "GlobalAccelerator", - "Glue", - "Grafana", - "Greengrass", - "GreengrassV2", - "GroundStation", - "GuardDuty", - "Health", - "HealthLake", - "Honeycode", - "IAM", - "IVS", - "IdentityStore", - "Imagebuilder", - "Inspector", - "Inspector2", - "IoT1ClickDevicesService", - "IoT1ClickProjects", - "IoTAnalytics", - "IoTEvents", - "IoTEventsData", - "IoTFleetHub", - "IoTFleetWise", - "IoTJobsDataPlane", - "IoTRoboRunner", - "IoTSecureTunneling", - "IoTSiteWise", - "IoTThingsGraph", - "IoTTwinMaker", - "IoTWireless", - "Iot", - "IotData", - "IotDeviceAdvisor", - "Ivschat", - "KMS", - "Kafka", - "KafkaConnect", - "Kendra", - "Keyspaces", - "Kinesis", - "KinesisAnalytics", - "KinesisAnalyticsV2", - "KinesisVideo", - "KinesisVideoArchivedMedia", - "KinesisVideoMedia", - "KinesisVideoSignalingChannels", - "KinesisVideoWebRTCStorage", - "LakeFormation", - "Lambda", - "LexModelBuildingService", - "LexModelsV2", - "LexRuntime", - "LexRuntimeV2", - "LicenseManager", - "LicenseManagerLinuxSubscriptions", - "LicenseManagerUserSubscriptions", - "Lightsail", - "Location", - "LookoutEquipment", - "LookoutMetrics", - "LookoutVision", - "M2", - "MQ", - "MTurk", - "MWAA", - "MachineLearning", - "Macie", - "Macie2", - "ManagedBlockchain", - "MarketplaceCatalog", - "MarketplaceCommerceAnalytics", - "MarketplaceEntitlementService", - "MarketplaceMetering", - "MediaConnect", - "MediaConvert", - "MediaLive", - "MediaPackage", - "MediaPackageVod", - "MediaStore", - "MediaStoreData", - "MediaTailor", - "MemoryDB", - "Mgn", - "MigrationHub", - "MigrationHubConfig", - "MigrationHubOrchestrator", - "MigrationHubRefactorSpaces", - "MigrationHubStrategy", - "Mobile", - "Neptune", - "NetworkFirewall", - "NetworkManager", - "Nimble", - "OAM", - "Omics", - "OpenSearch", - "OpenSearchServerless", - "OpsWorks", - "OpsWorksCM", - "Organizations", - "Outposts", - "PI", - "Panorama", - "Personalize", - "PersonalizeEvents", - "PersonalizeRuntime", - "Pinpoint", - "PinpointEmail", - "PinpointSMSVoice", - "PinpointSMSVoiceV2", - "Pipes", - "Polly", - "Pricing", - "PrivateNetworks", - "Proton", - "QLDB", - "QLDBSession", - "QuickSight", - "RAM", - "RDS", - "RDSDataService", - "RUM", - "Rbin", - "Redshift", - "RedshiftData", - "RedshiftServerless", - "Rekognition", - "Resiliencehub", - "ResourceExplorer2", - "ResourceGroups", - "ResourceGroupsTaggingAPI", - "RoboMaker", - "RolesAnywhere", - "Route53", - "Route53Domains", - "Route53RecoveryCluster", - "Route53RecoveryControlConfig", - "Route53RecoveryReadiness", - "Route53Resolver", - "S3", - "S3Control", - "S3Outposts", - "SES", - "SESV2", - "SMS", - "SNS", - "SQS", - "SSM", - "SSMContacts", - "SSMIncidents", - "SSO", - "SSOAdmin", - "SSOOIDC", - "STS", - "SWF", - "SageMaker", - "SageMakerFeatureStoreRuntime", - "SageMakerGeospatial", - "SageMakerMetrics", - "SageMakerRuntime", - "SagemakerEdge", - "SavingsPlans", - "Scheduler", - "Schemas", - "SecretsManager", - "SecurityHub", - "SecurityLake", - "ServerlessApplicationRepository", - "ServiceCatalog", - "ServiceCatalogAppRegistry", - "ServiceDiscovery", - "ServiceQuotas", - "Shield", - "Signer", - "SimSpaceWeaver", - "SnowDeviceManagement", - "Snowball", - "SsmSap", - "StepFunctions", - "StorageGateway", - "Support", - "SupportApp", - "Synthetics", - "Textract", - "TimestreamQuery", - "TimestreamWrite", - "TranscribeService", - "Transfer", - "Translate", - "VoiceID", - "WAF", - "WAFRegional", - "WAFV2", - "WellArchitected", - "Wisdom", - "WorkDocs", - "WorkLink", - "WorkMail", - "WorkMailMessageFlow", - "WorkSpaces", - "WorkSpacesWeb", - "XRay" - ]; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts -var CLIENT_PACKAGE_NAMES_MAP; -var init_client_package_names_map = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { - "use strict"; - init_client_names(); - CLIENT_PACKAGE_NAMES_MAP = { - ...CLIENT_NAMES.reduce( - (acc, name) => ({ - ...acc, - [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") - }), - {} - ), - AccessAnalyzer: "client-accessanalyzer", - ACMPCA: "client-acm-pca", - APIGateway: "client-api-gateway", - ApiGatewayManagementApi: "client-apigatewaymanagementapi", - ApiGatewayV2: "client-apigatewayv2", - AppConfig: "client-appconfig", - AppConfigData: "client-appconfigdata", - AppIntegrations: "client-appintegrations", - AppRunner: "client-apprunner", - AppStream: "client-appstream", - AppSync: "client-appsync", - ApplicationCostProfiler: "client-applicationcostprofiler", - ARCZonalShift: "client-arc-zonal-shift", - AugmentedAIRuntime: "client-sage-maker-a2iruntime", - AuditManager: "client-auditmanager", - BackupStorage: "client-backupstorage", - CUR: "client-cost-and-usage-report-service", - CloudHSMV2: "client-cloudhsm-v2", - CodeGuruProfiler: "client-codeguruprofiler", - CodeStarconnections: "client-codestar-connections", - CognitoIdentityServiceProvider: "client-cognito-identity-provider", - ComprehendMedical: "client-comprehendmedical", - ConnectContactLens: "client-connect-contact-lens", - ControlTower: "client-controltower", - DMS: "client-database-migration-service", - DataPipeline: "client-data-pipeline", - Discovery: "client-application-discovery-service", - DevOpsGuru: "client-devops-guru", - DynamoDB: "client-dynamodb", - DynamoDBStreams: "client-dynamodb-streams", - DocDB: "client-docdb", - DocDBElastic: "client-docdb-elastic", - EC2InstanceConnect: "client-ec2-instance-connect", - ECRPUBLIC: "client-ecr-public", - ELB: "client-elastic-load-balancing", - ELBv2: "client-elastic-load-balancing-v2", - ElastiCache: "client-elasticache", - EMRcontainers: "client-emr-containers", - EMRServerless: "client-emr-serverless", - ES: "client-elasticsearch-service", - EventBridge: "client-eventbridge", - Finspacedata: "client-finspace-data", - ForecastQueryService: "client-forecastquery", - ForecastService: "client-forecast", - FraudDetector: "client-frauddetector", - GameLift: "client-gamelift", - GameSparks: "client-gamesparks", - GreengrassV2: "client-greengrassv2", - GroundStation: "client-groundstation", - GuardDuty: "client-guardduty", - HealthLake: "client-healthlake", - IdentityStore: "client-identitystore", - IoTAnalytics: "client-iotanalytics", - IotData: "client-iot-data-plane", - IotDeviceAdvisor: "client-iotdeviceadvisor", - IoTSecureTunneling: "client-iotsecuretunneling", - IoTSiteWise: "client-iotsitewise", - IoTThingsGraph: "client-iotthingsgraph", - IoTTwinMaker: "client-iottwinmaker", - IoTRoboRunner: "client-iot-roborunner", - KafkaConnect: "client-kafkaconnect", - KinesisVideoSignalingChannels: "client-kinesis-video-signaling", - KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", - LakeFormation: "client-lakeformation", - LexRuntime: "client-lex-runtime-service", - ManagedBlockchain: "client-managedblockchain", - MigrationHubConfig: "client-migrationhub-config", - MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", - NetworkManager: "client-networkmanager", - OpenSearch: "client-opensearch", - OpenSearchServerless: "client-opensearchserverless", - OpsWorks: "client-opsworks", - OpsWorksCM: "client-opsworkscm", - PrivateNetworks: "client-privatenetworks", - QLDBSession: "client-qldb-session", - QuickSight: "client-quicksight", - ResourceExplorer2: "client-resource-explorer-2", - RDSDataService: "client-rds-data", - RoboMaker: "client-robomaker", - RolesAnywhere: "client-rolesanywhere", - Route53: "client-route-53", - Route53Domains: "client-route-53-domains", - Route53Resolver: "client-route53resolver", - S3Control: "client-s3-control", - SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", - SavingsPlans: "client-savingsplans", - SecurityHub: "client-securityhub", - ServerlessApplicationRepository: "client-serverlessapplicationrepository", - ServiceCatalogAppRegistry: "client-service-catalog-appregistry", - ServiceDiscovery: "client-servicediscovery", - SimSpaceWeaver: "client-simspaceweaver", - SSMContacts: "client-ssm-contacts", - SSMIncidents: "client-ssm-incidents", - SSOAdmin: "client-sso-admin", - SSOOIDC: "client-sso-oidc", - StepFunctions: "client-sfn", - TranscribeService: "client-transcribe", - WAFRegional: "client-waf-regional", - WellArchitected: "client-wellarchitected", - WorkMailMessageFlow: "client-workmailmessageflow" - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts -var get_v3_client_package_name_exports = {}; -__export(get_v3_client_package_name_exports, { - getV3ClientPackageName: () => getV3ClientPackageName -}); -var getV3ClientPackageName; -var init_get_v3_client_package_name = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { - "use strict"; - init_client_package_names_map(); - getV3ClientPackageName = (clientName) => { - if (clientName in CLIENT_PACKAGE_NAMES_MAP) { - return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; - } - throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); - }; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts -var find_client_constructor_exports = {}; -__export(find_client_constructor_exports, { - findV3ClientConstructor: () => findV3ClientConstructor -}); -function findV3ClientConstructor(pkg) { - const [_clientName, ServiceClient] = Object.entries(pkg).find( - ([name]) => { - return name.endsWith("Client") && name !== "__Client"; - } - ); - return ServiceClient; -} -var init_find_client_constructor = __esm({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { - "use strict"; - } -}); - -// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js -var require_lib = __commonJS({ - "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; - var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); - Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { - return get_v3_client_package_name_1.getV3ClientPackageName; - } }); - var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); - Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { - return find_client_constructor_1.findV3ClientConstructor; - } }); - } -}); - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var aws_sdk_v3_handler_exports = {}; -__export(aws_sdk_v3_handler_exports, { - forceSdkInstallation: () => forceSdkInstallation, - handler: () => handler -}); -module.exports = __toCommonJS(aws_sdk_v3_handler_exports); -var import_child_process = require("child_process"); -var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); - -// custom-resources/lib/aws-custom-resource/runtime/shared.ts -var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; -function flatten(object) { - return Object.assign( - {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) - ); -} -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -function filterKeys(object, pred) { - return Object.entries(object).reduce( - (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, - {} - ); -} -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data - }); - console.log("Responding", responseBody); - const parsedUrl = require("url").parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { - "content-type": "", - "content-length": Buffer.byteLength(responseBody, "utf8") - } - }; - return new Promise((resolve, reject) => { - try { - const request = require("https").request(requestOptions, resolve); - request.on("error", reject); - request.write(responseBody); - request.end(); - } catch (e) { - reject(e); - } - }); -} -function decodeCall(call) { - if (!call) { - return void 0; - } - return JSON.parse(call); -} -function startsWithOneOf(searchStrings) { - return function(string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} - -// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts -var installedSdk = {}; -function forceSdkInstallation() { - installedSdk = {}; -} -function installLatestSdk(packageName) { - console.log(`Installing latest AWS SDK v3: ${packageName}`); - (0, import_child_process.execSync)( - `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` - ); - installedSdk = { - ...installedSdk, - [packageName]: true - }; -} -async function loadAwsSdk(packageName, installLatestAwsSdk) { - let awsSdk; - try { - if (!installedSdk[packageName] && installLatestAwsSdk === "true") { - try { - installLatestSdk(packageName); - awsSdk = require(`/tmp/node_modules/${packageName}`); - } catch (e) { - console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); - return require(packageName); - } - } else if (installedSdk[packageName]) { - awsSdk = require(`/tmp/node_modules/${packageName}`); - } else { - awsSdk = require(packageName); - } - } catch (error) { - throw Error(`Package ${packageName} does not exist.`); - } - return awsSdk; -} -async function handler(event, context) { - try { - event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); - event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); - event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); - let data = {}; - let physicalResourceId; - switch (event.RequestType) { - case "Create": - physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; - break; - case "Update": - case "Delete": - physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; - break; - } - const call = event.ResourceProperties[event.RequestType]; - if (call) { - const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); - let awsSdk = loadAwsSdk( - packageName, - event.ResourceProperties.InstallLatestAwsSdk - ); - console.log(JSON.stringify({ ...event, ResponseURL: "..." })); - let credentials; - if (call.assumedRoleArn) { - const timestamp = (/* @__PURE__ */ new Date()).getTime(); - const params = { - RoleArn: call.assumedRoleArn, - RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) - }; - const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); - credentials = fromTemporaryCredentials({ - params - }); - } - awsSdk = await awsSdk; - const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); - const client = new ServiceClient({ - apiVersion: call.apiVersion, - credentials, - region: call.region - }); - const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; - const Command = Object.entries(awsSdk).find( - ([name]) => name.toLowerCase() === commandName.toLowerCase() - )?.[1]; - let flatData = {}; - try { - const response = await client.send( - new Command( - (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} - ) - ); - flatData = { - apiVersion: client.config.apiVersion, - // For test purposes: check if apiVersion was correctly passed. - region: await client.config.region().catch(() => void 0), - // For test purposes: check if region was correctly passed. - ...flatten(response) - }; - let outputPaths; - if (call.outputPath) { - outputPaths = [call.outputPath]; - } else if (call.outputPaths) { - outputPaths = call.outputPaths; - } - if (outputPaths) { - data = filterKeys(flatData, startsWithOneOf(outputPaths)); - } else { - data = flatData; - } - } catch (e) { - const exceptionName = e.name ?? e.constructor.name; - if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { - throw e; - } - } - if (call.physicalResourceId?.responsePath) { - physicalResourceId = flatData[call.physicalResourceId.responsePath]; - } - } - await respond(event, "SUCCESS", "OK", physicalResourceId, data); - } catch (e) { - console.log(e); - await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - forceSdkInstallation, - handler -}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js deleted file mode 100644 index 6c53eaeef8cd1..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83/shared.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; -/** - * Serialized form of the physical resource id for use in the operation parameters - */ -exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; -/** - * Flattens a nested object - * - * @param object the object to be flattened - * @returns a flat object with path as keys - */ -function flatten(object) { - return Object.assign({}, ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object)); -} -exports.flatten = flatten; -/** - * Decodes encoded special values (physicalResourceId) - */ -function decodeSpecialValues(object, physicalResourceId) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case exports.PHYSICAL_RESOURCE_ID_REFERENCE: - return physicalResourceId; - default: - return v; - } - }); -} -exports.decodeSpecialValues = decodeSpecialValues; -/** - * Filters the keys of an object. - */ -function filterKeys(object, pred) { - return Object.entries(object) - .reduce((acc, [k, v]) => pred(k) - ? { ...acc, [k]: v } - : acc, {}); -} -exports.filterKeys = filterKeys; -function respond(event, responseStatus, reason, physicalResourceId, data) { - const responseBody = JSON.stringify({ - Status: responseStatus, - Reason: reason, - PhysicalResourceId: physicalResourceId, - StackId: event.StackId, - RequestId: event.RequestId, - LogicalResourceId: event.LogicalResourceId, - NoEcho: false, - Data: data, - }); - // eslint-disable-next-line no-console - console.log('Responding', responseBody); - // eslint-disable-next-line @typescript-eslint/no-require-imports - const parsedUrl = require('url').parse(event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': Buffer.byteLength(responseBody, 'utf8'), - }, - }; - return new Promise((resolve, reject) => { - try { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const request = require('https').request(requestOptions, resolve); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -exports.respond = respond; -function decodeCall(call) { - if (!call) { - return undefined; - } - return JSON.parse(call); -} -exports.decodeCall = decodeCall; -function startsWithOneOf(searchStrings) { - return function (string) { - for (const searchString of searchStrings) { - if (string.startsWith(searchString)) { - return true; - } - } - return false; - }; -} -exports.startsWithOneOf = startsWithOneOf; -//# sourceM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vLXJlcXVpcmUtaW1wb3J0c1xuICAgICAgY29uc3QgcmVxdWVzdCA9IHJlcXVpcmUoJ2h0dHBzJykucmVxdWVzdChyZXF1ZXN0T3B0aW9ucywgcmVzb2x2ZSk7XG4gICAgICByZXF1ZXN0Lm9uKCdlcnJvcicsIHJlamVjdCk7XG4gICAgICByZXF1ZXN0LndyaXRlKHJlc3BvbnNlQm9keSk7XG4gICAgICByZXF1ZXN0LmVuZCgpO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIHJlamVjdChlKTtcbiAgICB9XG4gIH0pO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZGVjb2RlQ2FsbChjYWxsOiBzdHJpbmcgfCB1bmRlZmluZWQpIHtcbiAgaWYgKCFjYWxsKSB7IHJldHVybiB1bmRlZmluZWQ7IH1cbiAgcmV0dXJuIEpTT04ucGFyc2UoY2FsbCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzdGFydHNXaXRoT25lT2Yoc2VhcmNoU3RyaW5nczogc3RyaW5nW10pOiAoc3RyaW5nOiBzdHJpbmcpID0+IGJvb2xlYW4ge1xuICByZXR1cm4gZnVuY3Rpb24oc3RyaW5nOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgICBmb3IgKGNvbnN0IHNlYXJjaFN0cmluZyBvZiBzZWFyY2hTdHJpbmdzKSB7XG4gICAgICBpZiAoc3RyaW5nLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nKSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9O1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js-v3.assets.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js-v3.assets.json index 279df01301eb9..935cd59358df1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js-v3.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js-v3.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "f7014d6ee9fca77abf913cdb6de3cc5313693f863b4fc8fe4ec59b5765eec3cf": { + "80951151b958a24f50acb6314e49c2f7be8df66a6376a7db7b51d369f7170477": { "source": { "path": "aws-cdk-sdk-js-v3.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "f7014d6ee9fca77abf913cdb6de3cc5313693f863b4fc8fe4ec59b5765eec3cf.json", + "objectKey": "80951151b958a24f50acb6314e49c2f7be8df66a6376a7db7b51d369f7170477.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js-v3.template.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js-v3.template.json index c9fcc96a54cb8..0c8a8e19267af 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js-v3.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js-v3.template.json @@ -44,7 +44,7 @@ ] ] }, - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "PublishCustomResourcePolicyDF696FCA" @@ -111,7 +111,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { @@ -138,7 +138,7 @@ }, "Create": "{\"service\":\"SNS\",\"action\":\"listTopics\",\"physicalResourceId\":{\"responsePath\":\"Topics.0.TopicArn\"}}", "Update": "{\"service\":\"SNS\",\"action\":\"listTopics\",\"physicalResourceId\":{\"responsePath\":\"Topics.0.TopicArn\"}}", - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "ListTopicsCustomResourcePolicy31A8396A", @@ -211,7 +211,7 @@ ] ] }, - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "GetParameterCustomResourcePolicyD8E5D455" @@ -311,7 +311,7 @@ ] ] }, - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -327,7 +327,7 @@ }, "Create": "{\"service\":\"EKS\",\"action\":\"describeCluster\",\"parameters\":{\"name\":\"fake-cluster\"},\"physicalResourceId\":{\"id\":\"fake-cluster\"},\"ignoreErrorCodesMatching\":\"ResourceNotFoundException\"}", "Update": "{\"service\":\"EKS\",\"action\":\"describeCluster\",\"parameters\":{\"name\":\"fake-cluster\"},\"physicalResourceId\":{\"id\":\"fake-cluster\"},\"ignoreErrorCodesMatching\":\"ResourceNotFoundException\"}", - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "DescribeClusterCustomResourcePolicyD7730CF4" diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js.assets.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js.assets.json index 1a660f88d7732..84b8884186349 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js.assets.json @@ -1,20 +1,20 @@ { "version": "33.0.0", "files": { - "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { "source": { - "path": "asset.cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83", + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "f7014d6ee9fca77abf913cdb6de3cc5313693f863b4fc8fe4ec59b5765eec3cf": { + "80951151b958a24f50acb6314e49c2f7be8df66a6376a7db7b51d369f7170477": { "source": { "path": "aws-cdk-sdk-js.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "f7014d6ee9fca77abf913cdb6de3cc5313693f863b4fc8fe4ec59b5765eec3cf.json", + "objectKey": "80951151b958a24f50acb6314e49c2f7be8df66a6376a7db7b51d369f7170477.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js.template.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js.template.json index c9fcc96a54cb8..0c8a8e19267af 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js.template.json @@ -44,7 +44,7 @@ ] ] }, - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "PublishCustomResourcePolicyDF696FCA" @@ -111,7 +111,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "Handler": "index.handler", "Role": { @@ -138,7 +138,7 @@ }, "Create": "{\"service\":\"SNS\",\"action\":\"listTopics\",\"physicalResourceId\":{\"responsePath\":\"Topics.0.TopicArn\"}}", "Update": "{\"service\":\"SNS\",\"action\":\"listTopics\",\"physicalResourceId\":{\"responsePath\":\"Topics.0.TopicArn\"}}", - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "ListTopicsCustomResourcePolicy31A8396A", @@ -211,7 +211,7 @@ ] ] }, - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "GetParameterCustomResourcePolicyD8E5D455" @@ -311,7 +311,7 @@ ] ] }, - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -327,7 +327,7 @@ }, "Create": "{\"service\":\"EKS\",\"action\":\"describeCluster\",\"parameters\":{\"name\":\"fake-cluster\"},\"physicalResourceId\":{\"id\":\"fake-cluster\"},\"ignoreErrorCodesMatching\":\"ResourceNotFoundException\"}", "Update": "{\"service\":\"EKS\",\"action\":\"describeCluster\",\"parameters\":{\"name\":\"fake-cluster\"},\"physicalResourceId\":{\"id\":\"fake-cluster\"},\"ignoreErrorCodesMatching\":\"ResourceNotFoundException\"}", - "InstallLatestAwsSdk": false + "InstallLatestAwsSdk": "false" }, "DependsOn": [ "DescribeClusterCustomResourcePolicyD7730CF4" diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/manifest.json index 9192e2bb1b501..d7bbbc20684e7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/f7014d6ee9fca77abf913cdb6de3cc5313693f863b4fc8fe4ec59b5765eec3cf.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/80951151b958a24f50acb6314e49c2f7be8df66a6376a7db7b51d369f7170477.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -39,6 +39,12 @@ "data": "TopicBFC7AF6E" } ], + "/aws-cdk-sdk-js/Publish": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/aws-cdk-sdk-js/Publish/Resource/Default": [ { "type": "aws:cdk:logicalId", @@ -63,6 +69,12 @@ "data": "AWS679f53fac002430cb0da5b7982bd22872D164C4C" } ], + "/aws-cdk-sdk-js/ListTopics": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/aws-cdk-sdk-js/ListTopics/Resource/Default": [ { "type": "aws:cdk:logicalId", @@ -81,6 +93,12 @@ "data": "Utf8Parameter6C885A19" } ], + "/aws-cdk-sdk-js/GetParameter": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/aws-cdk-sdk-js/GetParameter/Resource/Default": [ { "type": "aws:cdk:logicalId", @@ -105,12 +123,24 @@ "data": "CustomRoleDefaultPolicyC5C189DF" } ], + "/aws-cdk-sdk-js/GetParameterNoPolicy": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/aws-cdk-sdk-js/GetParameterNoPolicy/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "GetParameterNoPolicyFCF7AA3B" } ], + "/aws-cdk-sdk-js/DescribeCluster": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/aws-cdk-sdk-js/DescribeCluster/Resource/Default": [ { "type": "aws:cdk:logicalId", @@ -178,7 +208,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/f7014d6ee9fca77abf913cdb6de3cc5313693f863b4fc8fe4ec59b5765eec3cf.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/80951151b958a24f50acb6314e49c2f7be8df66a6376a7db7b51d369f7170477.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -200,6 +230,12 @@ "data": "TopicBFC7AF6E" } ], + "/aws-cdk-sdk-js-v3/Publish": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/aws-cdk-sdk-js-v3/Publish/Resource/Default": [ { "type": "aws:cdk:logicalId", @@ -224,6 +260,12 @@ "data": "AWS679f53fac002430cb0da5b7982bd22872D164C4C" } ], + "/aws-cdk-sdk-js-v3/ListTopics": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/aws-cdk-sdk-js-v3/ListTopics/Resource/Default": [ { "type": "aws:cdk:logicalId", @@ -242,6 +284,12 @@ "data": "Utf8Parameter6C885A19" } ], + "/aws-cdk-sdk-js-v3/GetParameter": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/aws-cdk-sdk-js-v3/GetParameter/Resource/Default": [ { "type": "aws:cdk:logicalId", @@ -266,12 +314,24 @@ "data": "CustomRoleDefaultPolicyC5C189DF" } ], + "/aws-cdk-sdk-js-v3/GetParameterNoPolicy": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/aws-cdk-sdk-js-v3/GetParameterNoPolicy/Resource/Default": [ { "type": "aws:cdk:logicalId", "data": "GetParameterNoPolicyFCF7AA3B" } ], + "/aws-cdk-sdk-js-v3/DescribeCluster": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], "/aws-cdk-sdk-js-v3/DescribeCluster/Resource/Default": [ { "type": "aws:cdk:logicalId", diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/tree.json index 569de7b58df41..161f9d3d62dad 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/tree.json @@ -202,7 +202,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { @@ -846,7 +846,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "cb3fb24b24fb811fe6094748adf3e7571ee53cfadc9bf6753cbb223d266daf83.zip" + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" }, "handler": "index.handler", "role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337.assets.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337.assets.json new file mode 100644 index 0000000000000..2f0cfe8c4337c --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337.assets.json @@ -0,0 +1,19 @@ +{ + "version": "33.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337.template.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadStack.assets.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadStack.assets.json new file mode 100644 index 0000000000000..5664d86b6597a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadStack.assets.json @@ -0,0 +1,32 @@ +{ + "version": "33.0.0", + "files": { + "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6": { + "source": { + "path": "asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "5873734ee9738f2cc2e5299d2cdbd51b7cba842b46af87b9047f5d77044b81b3": { + "source": { + "path": "AwsCustomResourceInvokePayloadStack.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "5873734ee9738f2cc2e5299d2cdbd51b7cba842b46af87b9047f5d77044b81b3.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadStack.template.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadStack.template.json new file mode 100644 index 0000000000000..39cf4fdfd06bf --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/AwsCustomResourceInvokePayloadStack.template.json @@ -0,0 +1,271 @@ +{ + "Resources": { + "FunctionServiceRole675BB04A": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "Function76856677": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "exports.handler = async () => { return { statusCode: 200, body: 'Hello World' }; };" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "FunctionServiceRole675BB04A", + "Arn" + ] + }, + "Runtime": "nodejs18.x" + }, + "DependsOn": [ + "FunctionServiceRole675BB04A" + ] + }, + "ListLambdaFunctionsF9FB8E2B": { + "Type": "Custom::AWS", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AWS679f53fac002430cb0da5b7982bd22872D164C4C", + "Arn" + ] + }, + "Create": { + "Fn::Join": [ + "", + [ + "{\"service\":\"Lambda\",\"action\":\"invoke\",\"parameters\":{\"FunctionName\":\"", + { + "Ref": "Function76856677" + }, + "\"},\"physicalResourceId\":{\"id\":\"", + { + "Fn::GetAtt": [ + "Function76856677", + "Arn" + ] + }, + "\"}}" + ] + ] + }, + "Update": { + "Fn::Join": [ + "", + [ + "{\"service\":\"Lambda\",\"action\":\"invoke\",\"parameters\":{\"FunctionName\":\"", + { + "Ref": "Function76856677" + }, + "\"},\"physicalResourceId\":{\"id\":\"", + { + "Fn::GetAtt": [ + "Function76856677", + "Arn" + ] + }, + "\"}}" + ] + ] + }, + "InstallLatestAwsSdk": "false" + }, + "DependsOn": [ + "ListLambdaFunctionsCustomResourcePolicyCFFF021A" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ListLambdaFunctionsCustomResourcePolicyCFFF021A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "*", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ListLambdaFunctionsCustomResourcePolicyCFFF021A", + "Roles": [ + { + "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + } + ] + } + }, + "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleDefaultPolicyD28E1A5E": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "Function76856677", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "Function76856677", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleDefaultPolicyD28E1A5E", + "Roles": [ + { + "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + } + ] + } + }, + "AWS679f53fac002430cb0da5b7982bd22872D164C4C": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 120 + }, + "DependsOn": [ + "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleDefaultPolicyD28E1A5E", + "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + ] + } + }, + "Outputs": { + "FunctionPayload": { + "Value": { + "Fn::GetAtt": [ + "ListLambdaFunctionsF9FB8E2B", + "Payload" + ] + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js new file mode 100644 index 0000000000000..470bc12d6fd54 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v2-handler.js @@ -0,0 +1,161 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.handler = exports.forceSdkInstallation = void 0; +/* eslint-disable no-console */ +const child_process_1 = require("child_process"); +const fs = require("fs"); +const path_1 = require("path"); +const shared_1 = require("./shared"); +let latestSdkInstalled = false; +function forceSdkInstallation() { + latestSdkInstalled = false; +} +exports.forceSdkInstallation = forceSdkInstallation; +/** + * Installs latest AWS SDK v2 + */ +function installLatestSdk() { + console.log('Installing latest AWS SDK v2'); + // Both HOME and --prefix are needed here because /tmp is the only writable location + (0, child_process_1.execSync)('HOME=/tmp npm install aws-sdk@2 --production --no-package-lock --no-save --prefix /tmp'); + latestSdkInstalled = true; +} +// no currently patched services +const patchedServices = []; +/** + * Patches the AWS SDK by loading service models in the same manner as the actual SDK + */ +function patchSdk(awsSdk) { + const apiLoader = awsSdk.apiLoader; + patchedServices.forEach(({ serviceName, apiVersions }) => { + const lowerServiceName = serviceName.toLowerCase(); + if (!awsSdk.Service.hasService(lowerServiceName)) { + apiLoader.services[lowerServiceName] = {}; + awsSdk[serviceName] = awsSdk.Service.defineService(lowerServiceName, apiVersions); + } + else { + awsSdk.Service.addVersions(awsSdk[serviceName], apiVersions); + } + apiVersions.forEach(apiVersion => { + Object.defineProperty(apiLoader.services[lowerServiceName], apiVersion, { + get: function get() { + const modelFilePrefix = `aws-sdk-patch/${lowerServiceName}-${apiVersion}`; + const model = JSON.parse(fs.readFileSync((0, path_1.join)(__dirname, `${modelFilePrefix}.service.json`), 'utf-8')); + model.paginators = JSON.parse(fs.readFileSync((0, path_1.join)(__dirname, `${modelFilePrefix}.paginators.json`), 'utf-8')).pagination; + return model; + }, + enumerable: true, + configurable: true, + }); + }); + }); + return awsSdk; +} +/* eslint-disable @typescript-eslint/no-require-imports, import/no-extraneous-dependencies */ +async function handler(event, context) { + try { + let AWS; + if (!latestSdkInstalled && event.ResourceProperties.InstallLatestAwsSdk === 'true') { + try { + installLatestSdk(); + AWS = require('/tmp/node_modules/aws-sdk'); + } + catch (e) { + console.log(`Failed to install latest AWS SDK v2: ${e}`); + AWS = require('aws-sdk'); // Fallback to pre-installed version + } + } + else if (latestSdkInstalled) { + AWS = require('/tmp/node_modules/aws-sdk'); + } + else { + AWS = require('aws-sdk'); + } + try { + AWS = patchSdk(AWS); + } + catch (e) { + console.log(`Failed to patch AWS SDK: ${e}. Proceeding with the installed copy.`); + } + console.log(JSON.stringify({ ...event, ResponseURL: '...' })); + console.log('AWS SDK VERSION: ' + AWS.VERSION); + event.ResourceProperties.Create = (0, shared_1.decodeCall)(event.ResourceProperties.Create); + event.ResourceProperties.Update = (0, shared_1.decodeCall)(event.ResourceProperties.Update); + event.ResourceProperties.Delete = (0, shared_1.decodeCall)(event.ResourceProperties.Delete); + // Default physical resource id + let physicalResourceId; + switch (event.RequestType) { + case 'Create': + physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? + event.ResourceProperties.Update?.physicalResourceId?.id ?? + event.ResourceProperties.Delete?.physicalResourceId?.id ?? + event.LogicalResourceId; + break; + case 'Update': + case 'Delete': + physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; + break; + } + let flatData = {}; + let data = {}; + const call = event.ResourceProperties[event.RequestType]; + if (call) { + let credentials; + if (call.assumedRoleArn) { + const timestamp = (new Date()).getTime(); + const params = { + RoleArn: call.assumedRoleArn, + RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64), + }; + credentials = new AWS.ChainableTemporaryCredentials({ + params: params, + stsConfig: { stsRegionalEndpoints: 'regional' }, + }); + } + if (!Object.prototype.hasOwnProperty.call(AWS, call.service)) { + throw Error(`Service ${call.service} does not exist in AWS SDK version ${AWS.VERSION}.`); + } + const awsService = new AWS[call.service]({ + apiVersion: call.apiVersion, + credentials: credentials, + region: call.region, + }); + try { + const response = await awsService[call.action](call.parameters && (0, shared_1.decodeSpecialValues)(call.parameters, physicalResourceId)).promise(); + flatData = { + apiVersion: awsService.config.apiVersion, + region: awsService.config.region, + ...(0, shared_1.flatten)(response), + }; + let outputPaths; + if (call.outputPath) { + outputPaths = [call.outputPath]; + } + else if (call.outputPaths) { + outputPaths = call.outputPaths; + } + if (outputPaths) { + data = (0, shared_1.filterKeys)(flatData, (0, shared_1.startsWithOneOf)(outputPaths)); + } + else { + data = flatData; + } + } + catch (e) { + if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(e.code)) { + throw e; + } + } + if (call.physicalResourceId?.responsePath) { + physicalResourceId = flatData[call.physicalResourceId.responsePath]; + } + } + await (0, shared_1.respond)(event, 'SUCCESS', 'OK', physicalResourceId, data); + } + catch (e) { + console.log(e); + await (0, shared_1.respond)(event, 'FAILED', e.message || 'Internal Error', context.logStreamName, {}); + } +} +exports.handler = handler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXdzLXNkay12Mi1oYW5kbGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiYXdzLXNkay12Mi1oYW5kbGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLCtCQUErQjtBQUMvQixpREFBeUM7QUFDekMseUJBQXlCO0FBQ3pCLCtCQUE0QjtBQU81QixxQ0FBMEc7QUFHMUcsSUFBSSxrQkFBa0IsR0FBRyxLQUFLLENBQUM7QUFFL0IsU0FBZ0Isb0JBQW9CO0lBQ2xDLGtCQUFrQixHQUFHLEtBQUssQ0FBQztBQUM3QixDQUFDO0FBRkQsb0RBRUM7QUFFRDs7R0FFRztBQUNILFNBQVMsZ0JBQWdCO0lBQ3ZCLE9BQU8sQ0FBQyxHQUFHLENBQUMsOEJBQThCLENBQUMsQ0FBQztJQUM1QyxvRkFBb0Y7SUFDcEYsSUFBQSx3QkFBUSxFQUFDLHdGQUF3RixDQUFDLENBQUM7SUFDbkcsa0JBQWtCLEdBQUcsSUFBSSxDQUFDO0FBQzVCLENBQUM7QUFFRCxnQ0FBZ0M7QUFDaEMsTUFBTSxlQUFlLEdBQXFELEVBQUUsQ0FBQztBQUM3RTs7R0FFRztBQUNILFNBQVMsUUFBUSxDQUFDLE1BQVc7SUFDM0IsTUFBTSxTQUFTLEdBQU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4gICAgICB9XG4gICAgfVxuXG4gICAgYXdhaXQgcmVzcG9uZChldmVudCwgJ1NVQ0NFU1MnLCAnT0snLCBwaHlzaWNhbFJlc291cmNlSWQsIGRhdGEpO1xuICB9IGNhdGNoIChlOiBhbnkpIHtcbiAgICBjb25zb2xlLmxvZyhlKTtcbiAgICBhd2FpdCByZXNwb25kKGV2ZW50LCAnRkFJTEVEJywgZS5tZXNzYWdlIHx8ICdJbnRlcm5hbCBFcnJvcicsIGNvbnRleHQubG9nU3RyZWFtTmFtZSwge30pO1xuICB9XG59Il19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js new file mode 100644 index 0000000000000..9f6e97928f257 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/aws-sdk-v3-handler.bundled.js @@ -0,0 +1,779 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts +var CLIENT_NAMES; +var init_client_names = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-names.ts"() { + "use strict"; + CLIENT_NAMES = [ + "ACM", + "ACMPCA", + "APIGateway", + "ARCZonalShift", + "AccessAnalyzer", + "Account", + "AlexaForBusiness", + "Amp", + "Amplify", + "AmplifyBackend", + "AmplifyUIBuilder", + "ApiGatewayManagementApi", + "ApiGatewayV2", + "AppConfig", + "AppConfigData", + "AppIntegrations", + "AppMesh", + "AppRunner", + "AppStream", + "AppSync", + "Appflow", + "ApplicationAutoScaling", + "ApplicationCostProfiler", + "ApplicationInsights", + "Athena", + "AuditManager", + "AugmentedAIRuntime", + "AutoScaling", + "AutoScalingPlans", + "Backup", + "BackupGateway", + "BackupStorage", + "Batch", + "Billingconductor", + "Braket", + "Budgets", + "CUR", + "Chime", + "ChimeSDKIdentity", + "ChimeSDKMediaPipelines", + "ChimeSDKMeetings", + "ChimeSDKMessaging", + "ChimeSDKVoice", + "Cloud9", + "CloudControl", + "CloudDirectory", + "CloudFormation", + "CloudFront", + "CloudHSM", + "CloudHSMV2", + "CloudSearch", + "CloudSearchDomain", + "CloudTrail", + "CloudWatch", + "CloudWatchEvents", + "CloudWatchLogs", + "CodeArtifact", + "CodeBuild", + "CodeCatalyst", + "CodeCommit", + "CodeDeploy", + "CodeGuruProfiler", + "CodeGuruReviewer", + "CodePipeline", + "CodeStar", + "CodeStarNotifications", + "CodeStarconnections", + "CognitoIdentity", + "CognitoIdentityServiceProvider", + "CognitoSync", + "Comprehend", + "ComprehendMedical", + "ComputeOptimizer", + "ConfigService", + "Connect", + "ConnectCampaigns", + "ConnectCases", + "ConnectContactLens", + "ConnectParticipant", + "ControlTower", + "CostExplorer", + "CustomerProfiles", + "DAX", + "DLM", + "DMS", + "DataBrew", + "DataExchange", + "DataPipeline", + "DataSync", + "Detective", + "DevOpsGuru", + "DeviceFarm", + "DirectConnect", + "DirectoryService", + "Discovery", + "DocDB", + "DocDBElastic", + "Drs", + "DynamoDB", + "DynamoDBStreams", + "EBS", + "EC2", + "EC2InstanceConnect", + "ECR", + "ECRPUBLIC", + "ECS", + "EFS", + "EKS", + "ELB", + "ELBv2", + "EMR", + "EMRServerless", + "EMRcontainers", + "ES", + "ElastiCache", + "ElasticBeanstalk", + "ElasticInference", + "ElasticTranscoder", + "EventBridge", + "Evidently", + "FMS", + "FSx", + "Finspace", + "Finspacedata", + "Firehose", + "Fis", + "ForecastQueryService", + "ForecastService", + "FraudDetector", + "GameLift", + "GameSparks", + "Glacier", + "GlobalAccelerator", + "Glue", + "Grafana", + "Greengrass", + "GreengrassV2", + "GroundStation", + "GuardDuty", + "Health", + "HealthLake", + "Honeycode", + "IAM", + "IVS", + "IdentityStore", + "Imagebuilder", + "Inspector", + "Inspector2", + "IoT1ClickDevicesService", + "IoT1ClickProjects", + "IoTAnalytics", + "IoTEvents", + "IoTEventsData", + "IoTFleetHub", + "IoTFleetWise", + "IoTJobsDataPlane", + "IoTRoboRunner", + "IoTSecureTunneling", + "IoTSiteWise", + "IoTThingsGraph", + "IoTTwinMaker", + "IoTWireless", + "Iot", + "IotData", + "IotDeviceAdvisor", + "Ivschat", + "KMS", + "Kafka", + "KafkaConnect", + "Kendra", + "Keyspaces", + "Kinesis", + "KinesisAnalytics", + "KinesisAnalyticsV2", + "KinesisVideo", + "KinesisVideoArchivedMedia", + "KinesisVideoMedia", + "KinesisVideoSignalingChannels", + "KinesisVideoWebRTCStorage", + "LakeFormation", + "Lambda", + "LexModelBuildingService", + "LexModelsV2", + "LexRuntime", + "LexRuntimeV2", + "LicenseManager", + "LicenseManagerLinuxSubscriptions", + "LicenseManagerUserSubscriptions", + "Lightsail", + "Location", + "LookoutEquipment", + "LookoutMetrics", + "LookoutVision", + "M2", + "MQ", + "MTurk", + "MWAA", + "MachineLearning", + "Macie", + "Macie2", + "ManagedBlockchain", + "MarketplaceCatalog", + "MarketplaceCommerceAnalytics", + "MarketplaceEntitlementService", + "MarketplaceMetering", + "MediaConnect", + "MediaConvert", + "MediaLive", + "MediaPackage", + "MediaPackageVod", + "MediaStore", + "MediaStoreData", + "MediaTailor", + "MemoryDB", + "Mgn", + "MigrationHub", + "MigrationHubConfig", + "MigrationHubOrchestrator", + "MigrationHubRefactorSpaces", + "MigrationHubStrategy", + "Mobile", + "Neptune", + "NetworkFirewall", + "NetworkManager", + "Nimble", + "OAM", + "Omics", + "OpenSearch", + "OpenSearchServerless", + "OpsWorks", + "OpsWorksCM", + "Organizations", + "Outposts", + "PI", + "Panorama", + "Personalize", + "PersonalizeEvents", + "PersonalizeRuntime", + "Pinpoint", + "PinpointEmail", + "PinpointSMSVoice", + "PinpointSMSVoiceV2", + "Pipes", + "Polly", + "Pricing", + "PrivateNetworks", + "Proton", + "QLDB", + "QLDBSession", + "QuickSight", + "RAM", + "RDS", + "RDSDataService", + "RUM", + "Rbin", + "Redshift", + "RedshiftData", + "RedshiftServerless", + "Rekognition", + "Resiliencehub", + "ResourceExplorer2", + "ResourceGroups", + "ResourceGroupsTaggingAPI", + "RoboMaker", + "RolesAnywhere", + "Route53", + "Route53Domains", + "Route53RecoveryCluster", + "Route53RecoveryControlConfig", + "Route53RecoveryReadiness", + "Route53Resolver", + "S3", + "S3Control", + "S3Outposts", + "SES", + "SESV2", + "SMS", + "SNS", + "SQS", + "SSM", + "SSMContacts", + "SSMIncidents", + "SSO", + "SSOAdmin", + "SSOOIDC", + "STS", + "SWF", + "SageMaker", + "SageMakerFeatureStoreRuntime", + "SageMakerGeospatial", + "SageMakerMetrics", + "SageMakerRuntime", + "SagemakerEdge", + "SavingsPlans", + "Scheduler", + "Schemas", + "SecretsManager", + "SecurityHub", + "SecurityLake", + "ServerlessApplicationRepository", + "ServiceCatalog", + "ServiceCatalogAppRegistry", + "ServiceDiscovery", + "ServiceQuotas", + "Shield", + "Signer", + "SimSpaceWeaver", + "SnowDeviceManagement", + "Snowball", + "SsmSap", + "StepFunctions", + "StorageGateway", + "Support", + "SupportApp", + "Synthetics", + "Textract", + "TimestreamQuery", + "TimestreamWrite", + "TranscribeService", + "Transfer", + "Translate", + "VoiceID", + "WAF", + "WAFRegional", + "WAFV2", + "WellArchitected", + "Wisdom", + "WorkDocs", + "WorkLink", + "WorkMail", + "WorkMailMessageFlow", + "WorkSpaces", + "WorkSpacesWeb", + "XRay" + ]; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts +var CLIENT_PACKAGE_NAMES_MAP; +var init_client_package_names_map = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/client-package-names-map.ts"() { + "use strict"; + init_client_names(); + CLIENT_PACKAGE_NAMES_MAP = { + ...CLIENT_NAMES.reduce( + (acc, name) => ({ + ...acc, + [name]: `client-${name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`.replace("-chime-sdk", "-chime-sdk-").replace("client-amplify-", "client-amplify").replace("client-cloud-", "client-cloud").replace("client-code-", "client-code").replace("client-connect-", "client-connect").replace("client-data-", "client-data").replace("client-io-t", "client-iot-").replace("client-iot-fleet-", "client-iotfleet").replace("client-lookout-", "client-lookout").replace("client-media-", "client-media").replace("client-migration-hub-", "client-migrationhub").replace("client-pinpoint-sms", "client-pinpoint-sms-").replace("client-route53", "client-route53-").replace("client-sage-maker", "client-sagemaker").replace("client-security-", "client-security").replace("client-work-", "client-work") + }), + {} + ), + AccessAnalyzer: "client-accessanalyzer", + ACMPCA: "client-acm-pca", + APIGateway: "client-api-gateway", + ApiGatewayManagementApi: "client-apigatewaymanagementapi", + ApiGatewayV2: "client-apigatewayv2", + AppConfig: "client-appconfig", + AppConfigData: "client-appconfigdata", + AppIntegrations: "client-appintegrations", + AppRunner: "client-apprunner", + AppStream: "client-appstream", + AppSync: "client-appsync", + ApplicationCostProfiler: "client-applicationcostprofiler", + ARCZonalShift: "client-arc-zonal-shift", + AugmentedAIRuntime: "client-sage-maker-a2iruntime", + AuditManager: "client-auditmanager", + BackupStorage: "client-backupstorage", + CUR: "client-cost-and-usage-report-service", + CloudHSMV2: "client-cloudhsm-v2", + CodeGuruProfiler: "client-codeguruprofiler", + CodeStarconnections: "client-codestar-connections", + CognitoIdentityServiceProvider: "client-cognito-identity-provider", + ComprehendMedical: "client-comprehendmedical", + ConnectContactLens: "client-connect-contact-lens", + ControlTower: "client-controltower", + DMS: "client-database-migration-service", + DataPipeline: "client-data-pipeline", + Discovery: "client-application-discovery-service", + DevOpsGuru: "client-devops-guru", + DynamoDB: "client-dynamodb", + DynamoDBStreams: "client-dynamodb-streams", + DocDB: "client-docdb", + DocDBElastic: "client-docdb-elastic", + EC2InstanceConnect: "client-ec2-instance-connect", + ECRPUBLIC: "client-ecr-public", + ELB: "client-elastic-load-balancing", + ELBv2: "client-elastic-load-balancing-v2", + ElastiCache: "client-elasticache", + EMRcontainers: "client-emr-containers", + EMRServerless: "client-emr-serverless", + ES: "client-elasticsearch-service", + EventBridge: "client-eventbridge", + Finspacedata: "client-finspace-data", + ForecastQueryService: "client-forecastquery", + ForecastService: "client-forecast", + FraudDetector: "client-frauddetector", + GameLift: "client-gamelift", + GameSparks: "client-gamesparks", + GreengrassV2: "client-greengrassv2", + GroundStation: "client-groundstation", + GuardDuty: "client-guardduty", + HealthLake: "client-healthlake", + IdentityStore: "client-identitystore", + IoTAnalytics: "client-iotanalytics", + IotData: "client-iot-data-plane", + IotDeviceAdvisor: "client-iotdeviceadvisor", + IoTSecureTunneling: "client-iotsecuretunneling", + IoTSiteWise: "client-iotsitewise", + IoTThingsGraph: "client-iotthingsgraph", + IoTTwinMaker: "client-iottwinmaker", + IoTRoboRunner: "client-iot-roborunner", + KafkaConnect: "client-kafkaconnect", + KinesisVideoSignalingChannels: "client-kinesis-video-signaling", + KinesisVideoWebRTCStorage: "client-kinesis-video-webrtc-storage", + LakeFormation: "client-lakeformation", + LexRuntime: "client-lex-runtime-service", + ManagedBlockchain: "client-managedblockchain", + MigrationHubConfig: "client-migrationhub-config", + MigrationHubRefactorSpaces: "client-migration-hub-refactor-spaces", + NetworkManager: "client-networkmanager", + OpenSearch: "client-opensearch", + OpenSearchServerless: "client-opensearchserverless", + OpsWorks: "client-opsworks", + OpsWorksCM: "client-opsworkscm", + PrivateNetworks: "client-privatenetworks", + QLDBSession: "client-qldb-session", + QuickSight: "client-quicksight", + ResourceExplorer2: "client-resource-explorer-2", + RDSDataService: "client-rds-data", + RoboMaker: "client-robomaker", + RolesAnywhere: "client-rolesanywhere", + Route53: "client-route-53", + Route53Domains: "client-route-53-domains", + Route53Resolver: "client-route53resolver", + S3Control: "client-s3-control", + SageMakerFeatureStoreRuntime: "client-sagemaker-featurestore-runtime", + SavingsPlans: "client-savingsplans", + SecurityHub: "client-securityhub", + ServerlessApplicationRepository: "client-serverlessapplicationrepository", + ServiceCatalogAppRegistry: "client-service-catalog-appregistry", + ServiceDiscovery: "client-servicediscovery", + SimSpaceWeaver: "client-simspaceweaver", + SSMContacts: "client-ssm-contacts", + SSMIncidents: "client-ssm-incidents", + SSOAdmin: "client-sso-admin", + SSOOIDC: "client-sso-oidc", + StepFunctions: "client-sfn", + TranscribeService: "client-transcribe", + WAFRegional: "client-waf-regional", + WellArchitected: "client-wellarchitected", + WorkMailMessageFlow: "client-workmailmessageflow" + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts +var get_v3_client_package_name_exports = {}; +__export(get_v3_client_package_name_exports, { + getV3ClientPackageName: () => getV3ClientPackageName +}); +var getV3ClientPackageName; +var init_get_v3_client_package_name = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/get-v3-client-package-name.ts"() { + "use strict"; + init_client_package_names_map(); + getV3ClientPackageName = (clientName) => { + if (clientName in CLIENT_PACKAGE_NAMES_MAP) { + return `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[clientName]}`; + } + throw new Error(`Client '${clientName}' is either deprecated or newly added. Please consider using the v3 package format (@aws-sdk/client-xxx).`); + }; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts +var find_client_constructor_exports = {}; +__export(find_client_constructor_exports, { + findV3ClientConstructor: () => findV3ClientConstructor +}); +function findV3ClientConstructor(pkg) { + const [_clientName, ServiceClient] = Object.entries(pkg).find( + ([name]) => { + return name.endsWith("Client") && name !== "__Client"; + } + ); + return ServiceClient; +} +var init_find_client_constructor = __esm({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts"() { + "use strict"; + } +}); + +// ../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js +var require_lib = __commonJS({ + "../@aws-cdk/sdk-v2-to-v3-adapter/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.findV3ClientConstructor = exports.getV3ClientPackageName = void 0; + var get_v3_client_package_name_1 = (init_get_v3_client_package_name(), __toCommonJS(get_v3_client_package_name_exports)); + Object.defineProperty(exports, "getV3ClientPackageName", { enumerable: true, get: function() { + return get_v3_client_package_name_1.getV3ClientPackageName; + } }); + var find_client_constructor_1 = (init_find_client_constructor(), __toCommonJS(find_client_constructor_exports)); + Object.defineProperty(exports, "findV3ClientConstructor", { enumerable: true, get: function() { + return find_client_constructor_1.findV3ClientConstructor; + } }); + } +}); + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var aws_sdk_v3_handler_exports = {}; +__export(aws_sdk_v3_handler_exports, { + forceSdkInstallation: () => forceSdkInstallation, + handler: () => handler +}); +module.exports = __toCommonJS(aws_sdk_v3_handler_exports); +var import_child_process = require("child_process"); +var import_sdk_v2_to_v3_adapter = __toESM(require_lib()); + +// custom-resources/lib/aws-custom-resource/runtime/shared.ts +var PHYSICAL_RESOURCE_ID_REFERENCE = "PHYSICAL:RESOURCEID:"; +var decoder = new TextDecoder(); +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString("utf8"); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + const childKey = parseField(child[key]); + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + } + return Object.assign( + {}, + ..._flatten(object) + ); +} +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +function filterKeys(object, pred) { + return Object.entries(object).reduce( + (acc, [k, v]) => pred(k) ? { ...acc, [k]: v } : acc, + {} + ); +} +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data + }); + console.log("Responding", responseBody); + const parsedUrl = require("url").parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { + "content-type": "", + "content-length": Buffer.byteLength(responseBody, "utf8") + } + }; + return new Promise((resolve, reject) => { + try { + const request = require("https").request(requestOptions, resolve); + request.on("error", reject); + request.write(responseBody); + request.end(); + } catch (e) { + reject(e); + } + }); +} +function decodeCall(call) { + if (!call) { + return void 0; + } + return JSON.parse(call); +} +function startsWithOneOf(searchStrings) { + return function(string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} + +// custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts +var installedSdk = {}; +function forceSdkInstallation() { + installedSdk = {}; +} +function installLatestSdk(packageName) { + console.log(`Installing latest AWS SDK v3: ${packageName}`); + (0, import_child_process.execSync)( + `NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp` + ); + installedSdk = { + ...installedSdk, + [packageName]: true + }; +} +async function loadAwsSdk(packageName, installLatestAwsSdk) { + let awsSdk; + try { + if (!installedSdk[packageName] && installLatestAwsSdk === "true") { + try { + installLatestSdk(packageName); + awsSdk = require(`/tmp/node_modules/${packageName}`); + } catch (e) { + console.log(`Failed to install latest AWS SDK v3. Falling back to pre-installed version. Error: ${e}`); + return require(packageName); + } + } else if (installedSdk[packageName]) { + awsSdk = require(`/tmp/node_modules/${packageName}`); + } else { + awsSdk = require(packageName); + } + } catch (error) { + throw Error(`Package ${packageName} does not exist.`); + } + return awsSdk; +} +async function handler(event, context) { + try { + event.ResourceProperties.Create = decodeCall(event.ResourceProperties.Create); + event.ResourceProperties.Update = decodeCall(event.ResourceProperties.Update); + event.ResourceProperties.Delete = decodeCall(event.ResourceProperties.Delete); + let data = {}; + let physicalResourceId; + switch (event.RequestType) { + case "Create": + physicalResourceId = event.ResourceProperties.Create?.physicalResourceId?.id ?? event.ResourceProperties.Update?.physicalResourceId?.id ?? event.ResourceProperties.Delete?.physicalResourceId?.id ?? event.LogicalResourceId; + break; + case "Update": + case "Delete": + physicalResourceId = event.ResourceProperties[event.RequestType]?.physicalResourceId?.id ?? event.PhysicalResourceId; + break; + } + const call = event.ResourceProperties[event.RequestType]; + if (call) { + const packageName = call.service.startsWith("@aws-sdk/") ? call.service : (0, import_sdk_v2_to_v3_adapter.getV3ClientPackageName)(call.service); + let awsSdk = loadAwsSdk( + packageName, + event.ResourceProperties.InstallLatestAwsSdk + ); + console.log(JSON.stringify({ ...event, ResponseURL: "..." })); + let credentials; + if (call.assumedRoleArn) { + const timestamp = (/* @__PURE__ */ new Date()).getTime(); + const params = { + RoleArn: call.assumedRoleArn, + RoleSessionName: `${timestamp}-${physicalResourceId}`.substring(0, 64) + }; + const { fromTemporaryCredentials } = await import("@aws-sdk/credential-providers"); + credentials = fromTemporaryCredentials({ + params + }); + } + awsSdk = await awsSdk; + const ServiceClient = (0, import_sdk_v2_to_v3_adapter.findV3ClientConstructor)(awsSdk); + const client = new ServiceClient({ + apiVersion: call.apiVersion, + credentials, + region: call.region + }); + const commandName = call.action.endsWith("Command") ? call.action : `${call.action}Command`; + const Command = Object.entries(awsSdk).find( + ([name]) => name.toLowerCase() === commandName.toLowerCase() + )?.[1]; + let flatData = {}; + try { + const response = await client.send( + new Command( + (call.parameters && decodeSpecialValues(call.parameters, physicalResourceId)) ?? {} + ) + ); + flatData = { + apiVersion: client.config.apiVersion, + // For test purposes: check if apiVersion was correctly passed. + region: await client.config.region().catch(() => void 0), + // For test purposes: check if region was correctly passed. + ...flatten(response) + }; + let outputPaths; + if (call.outputPath) { + outputPaths = [call.outputPath]; + } else if (call.outputPaths) { + outputPaths = call.outputPaths; + } + if (outputPaths) { + data = filterKeys(flatData, startsWithOneOf(outputPaths)); + } else { + data = flatData; + } + } catch (e) { + const exceptionName = e.name ?? e.constructor.name; + if (!call.ignoreErrorCodesMatching || !new RegExp(call.ignoreErrorCodesMatching).test(exceptionName)) { + throw e; + } + } + if (call.physicalResourceId?.responsePath) { + physicalResourceId = flatData[call.physicalResourceId.responsePath]; + } + } + await respond(event, "SUCCESS", "OK", physicalResourceId, data); + } catch (e) { + console.log(e); + await respond(event, "FAILED", e.message || "Internal Error", context.logStreamName, {}); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + forceSdkInstallation, + handler +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js new file mode 100644 index 0000000000000..ceb54f8e2b70f --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/index.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.handler = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +var shared_1 = require("./shared"); +Object.defineProperty(exports, "PHYSICAL_RESOURCE_ID_REFERENCE", { enumerable: true, get: function () { return shared_1.PHYSICAL_RESOURCE_ID_REFERENCE; } }); +const env = process.env.AWS_EXECUTION_ENV; +// eslint-disable-next-line @typescript-eslint/no-require-imports +const runtime = env && env >= 'AWS_Lambda_nodejs18.x' ? require('./aws-sdk-v3-handler.bundled') : require('./aws-sdk-v2-handler'); +exports.handler = runtime.handler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxtQ0FBMEQ7QUFBakQsd0hBQUEsOEJBQThCLE9BQUE7QUFFdkMsTUFBTSxHQUFHLEdBQUcsT0FBTyxDQUFDLEdBQUcsQ0FBQyxpQkFBaUIsQ0FBQztBQUMxQyxpRUFBaUU7QUFDakUsTUFBTSxPQUFPLEdBQUcsR0FBRyxJQUFJLEdBQUcsSUFBSSx1QkFBdUIsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLDhCQUE4QixDQUFDLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxzQkFBc0IsQ0FBQyxDQUFDO0FBQ3JILFFBQUEsT0FBTyxHQUFHLE9BQU8sQ0FBQyxPQUFPLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBQSFlTSUNBTF9SRVNPVVJDRV9JRF9SRUZFUkVOQ0UgfSBmcm9tICcuL3NoYXJlZCc7XG5cbmNvbnN0IGVudiA9IHByb2Nlc3MuZW52LkFXU19FWEVDVVRJT05fRU5WO1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1yZXF1aXJlLWltcG9ydHNcbmNvbnN0IHJ1bnRpbWUgPSBlbnYgJiYgZW52ID49ICdBV1NfTGFtYmRhX25vZGVqczE4LngnID8gcmVxdWlyZSgnLi9hd3Mtc2RrLXYzLWhhbmRsZXIuYnVuZGxlZCcpIDogcmVxdWlyZSgnLi9hd3Mtc2RrLXYyLWhhbmRsZXInKTtcbmV4cG9ydCBjb25zdCBoYW5kbGVyID0gcnVudGltZS5oYW5kbGVyO1xuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js new file mode 100644 index 0000000000000..ee5f1a0267449 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/asset.66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6/shared.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startsWithOneOf = exports.decodeCall = exports.respond = exports.filterKeys = exports.decodeSpecialValues = exports.flatten = exports.PHYSICAL_RESOURCE_ID_REFERENCE = void 0; +/** + * Serialized form of the physical resource id for use in the operation parameters + */ +exports.PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value) { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } + else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + return value; +} +/** + * Flattens a nested object + * + * @param object the object to be flattened + * @returns a flat object with path as keys + */ +function flatten(object) { + function _flatten(child, path = []) { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } + return Object.assign({}, ..._flatten(object)); +} +exports.flatten = flatten; +/** + * Decodes encoded special values (physicalResourceId) + */ +function decodeSpecialValues(object, physicalResourceId) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case exports.PHYSICAL_RESOURCE_ID_REFERENCE: + return physicalResourceId; + default: + return v; + } + }); +} +exports.decodeSpecialValues = decodeSpecialValues; +/** + * Filters the keys of an object. + */ +function filterKeys(object, pred) { + return Object.entries(object) + .reduce((acc, [k, v]) => pred(k) + ? { ...acc, [k]: v } + : acc, {}); +} +exports.filterKeys = filterKeys; +function respond(event, responseStatus, reason, physicalResourceId, data) { + const responseBody = JSON.stringify({ + Status: responseStatus, + Reason: reason, + PhysicalResourceId: physicalResourceId, + StackId: event.StackId, + RequestId: event.RequestId, + LogicalResourceId: event.LogicalResourceId, + NoEcho: false, + Data: data, + }); + // eslint-disable-next-line no-console + console.log('Responding', responseBody); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const parsedUrl = require('url').parse(event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + return new Promise((resolve, reject) => { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const request = require('https').request(requestOptions, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +exports.respond = respond; +function decodeCall(call) { + if (!call) { + return undefined; + } + return JSON.parse(call); +} +exports.decodeCall = decodeCall; +function startsWithOneOf(searchStrings) { + return function (string) { + for (const searchString of searchStrings) { + if (string.startsWith(searchString)) { + return true; + } + } + return false; + }; +} +exports.startsWithOneOf = startsWithOneOf; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2hhcmVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBOztHQUVHO0FBQ1UsUUFBQSw4QkFBOEIsR0FBRyxzQkFBc0IsQ0FBQztBQUVyRTs7R0FFRztBQUNILE1BQU0sT0FBTyxHQUFHLElBQUksV0FBVyxFQUFFLENBQUM7QUFFbEM7O0dBRUc7QUFDSCxTQUFTLFVBQVUsQ0FBQyxLQUFVO0lBQzVCLElBQUksTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsRUFBRTtRQUMxQixPQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDL0I7U0FBTSxJQUFJLFdBQVcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLEVBQUU7UUFDcEMsT0FBTyxPQ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2hTdHJpbmcpKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/cdk.out new file mode 100644 index 0000000000000..560dae10d018f --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"33.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/integ.json new file mode 100644 index 0000000000000..a205345464bd5 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "33.0.0", + "testCases": { + "AwsCustomResourceInvokePayloadInteg/DefaultTest": { + "stacks": [ + "AwsCustomResourceInvokePayloadStack" + ], + "assertionStack": "AwsCustomResourceInvokePayloadInteg/DefaultTest/DeployAssert", + "assertionStackName": "AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/manifest.json new file mode 100644 index 0000000000000..3c4723af50fc5 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/manifest.json @@ -0,0 +1,159 @@ +{ + "version": "33.0.0", + "artifacts": { + "AwsCustomResourceInvokePayloadStack.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "AwsCustomResourceInvokePayloadStack.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "AwsCustomResourceInvokePayloadStack": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "AwsCustomResourceInvokePayloadStack.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5873734ee9738f2cc2e5299d2cdbd51b7cba842b46af87b9047f5d77044b81b3.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "AwsCustomResourceInvokePayloadStack.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "AwsCustomResourceInvokePayloadStack.assets" + ], + "metadata": { + "/AwsCustomResourceInvokePayloadStack/Function/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "FunctionServiceRole675BB04A" + } + ], + "/AwsCustomResourceInvokePayloadStack/Function/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Function76856677" + } + ], + "/AwsCustomResourceInvokePayloadStack/ListLambdaFunctions": [ + { + "type": "aws:cdk:warning", + "data": "installLatestAwsSdk was not specified, and defaults to true. You probably do not want this. Set the global context flag '@aws-cdk/customresources:installLatestAwsSdkDefault' to false to switch this behavior off project-wide, or set the property explicitly to true if you know you need to call APIs that are not in Lambda's built-in SDK version." + } + ], + "/AwsCustomResourceInvokePayloadStack/ListLambdaFunctions/Resource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "ListLambdaFunctionsF9FB8E2B" + } + ], + "/AwsCustomResourceInvokePayloadStack/ListLambdaFunctions/CustomResourcePolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ListLambdaFunctionsCustomResourcePolicyCFFF021A" + } + ], + "/AwsCustomResourceInvokePayloadStack/AWS679f53fac002430cb0da5b7982bd2287/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + } + ], + "/AwsCustomResourceInvokePayloadStack/AWS679f53fac002430cb0da5b7982bd2287/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleDefaultPolicyD28E1A5E" + } + ], + "/AwsCustomResourceInvokePayloadStack/AWS679f53fac002430cb0da5b7982bd2287/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "AWS679f53fac002430cb0da5b7982bd22872D164C4C" + } + ], + "/AwsCustomResourceInvokePayloadStack/FunctionPayload": [ + { + "type": "aws:cdk:logicalId", + "data": "FunctionPayload" + } + ], + "/AwsCustomResourceInvokePayloadStack/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/AwsCustomResourceInvokePayloadStack/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "AwsCustomResourceInvokePayloadStack" + }, + "AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "AwsCustomResourceInvokePayloadIntegDefaultTestDeployAssertB4B64337.assets" + ], + "metadata": { + "/AwsCustomResourceInvokePayloadInteg/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/AwsCustomResourceInvokePayloadInteg/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "AwsCustomResourceInvokePayloadInteg/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/tree.json new file mode 100644 index 0000000000000..0dd92b4e2f2ed --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.js.snapshot/tree.json @@ -0,0 +1,456 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "AwsCustomResourceInvokePayloadStack": { + "id": "AwsCustomResourceInvokePayloadStack", + "path": "AwsCustomResourceInvokePayloadStack", + "children": { + "Function": { + "id": "Function", + "path": "AwsCustomResourceInvokePayloadStack/Function", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "AwsCustomResourceInvokePayloadStack/Function/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "AwsCustomResourceInvokePayloadStack/Function/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "AwsCustomResourceInvokePayloadStack/Function/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "AwsCustomResourceInvokePayloadStack/Function/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "zipFile": "exports.handler = async () => { return { statusCode: 200, body: 'Hello World' }; };" + }, + "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "FunctionServiceRole675BB04A", + "Arn" + ] + }, + "runtime": "nodejs18.x" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "0.0.0" + } + }, + "ListLambdaFunctions": { + "id": "ListLambdaFunctions", + "path": "AwsCustomResourceInvokePayloadStack/ListLambdaFunctions", + "children": { + "Provider": { + "id": "Provider", + "path": "AwsCustomResourceInvokePayloadStack/ListLambdaFunctions/Provider", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.SingletonFunction", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "AwsCustomResourceInvokePayloadStack/ListLambdaFunctions/Resource", + "children": { + "Default": { + "id": "Default", + "path": "AwsCustomResourceInvokePayloadStack/ListLambdaFunctions/Resource/Default", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.CustomResource", + "version": "0.0.0" + } + }, + "CustomResourcePolicy": { + "id": "CustomResourcePolicy", + "path": "AwsCustomResourceInvokePayloadStack/ListLambdaFunctions/CustomResourcePolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "AwsCustomResourceInvokePayloadStack/ListLambdaFunctions/CustomResourcePolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "*", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "policyName": "ListLambdaFunctionsCustomResourcePolicyCFFF021A", + "roles": [ + { + "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.custom_resources.AwsCustomResource", + "version": "0.0.0" + } + }, + "AWS679f53fac002430cb0da5b7982bd2287": { + "id": "AWS679f53fac002430cb0da5b7982bd2287", + "path": "AwsCustomResourceInvokePayloadStack/AWS679f53fac002430cb0da5b7982bd2287", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "AwsCustomResourceInvokePayloadStack/AWS679f53fac002430cb0da5b7982bd2287/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "AwsCustomResourceInvokePayloadStack/AWS679f53fac002430cb0da5b7982bd2287/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "AwsCustomResourceInvokePayloadStack/AWS679f53fac002430cb0da5b7982bd2287/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "AwsCustomResourceInvokePayloadStack/AWS679f53fac002430cb0da5b7982bd2287/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "AwsCustomResourceInvokePayloadStack/AWS679f53fac002430cb0da5b7982bd2287/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "Function76856677", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "Function76856677", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "policyName": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleDefaultPolicyD28E1A5E", + "roles": [ + { + "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "AwsCustomResourceInvokePayloadStack/AWS679f53fac002430cb0da5b7982bd2287/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "AwsCustomResourceInvokePayloadStack/AWS679f53fac002430cb0da5b7982bd2287/Code/Stage", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "AwsCustomResourceInvokePayloadStack/AWS679f53fac002430cb0da5b7982bd2287/Code/AssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "AwsCustomResourceInvokePayloadStack/AWS679f53fac002430cb0da5b7982bd2287/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "66db480cb40e7e6208f01c9d9e882f4c416110a2c66dd0c6d12844e8ca9129b6.zip" + }, + "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2", + "Arn" + ] + }, + "runtime": "nodejs18.x", + "timeout": 120 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "0.0.0" + } + }, + "FunctionPayload": { + "id": "FunctionPayload", + "path": "AwsCustomResourceInvokePayloadStack/FunctionPayload", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "AwsCustomResourceInvokePayloadStack/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "AwsCustomResourceInvokePayloadStack/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "AwsCustomResourceInvokePayloadInteg": { + "id": "AwsCustomResourceInvokePayloadInteg", + "path": "AwsCustomResourceInvokePayloadInteg", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "AwsCustomResourceInvokePayloadInteg/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "AwsCustomResourceInvokePayloadInteg/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.69" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "AwsCustomResourceInvokePayloadInteg/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "AwsCustomResourceInvokePayloadInteg/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "AwsCustomResourceInvokePayloadInteg/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.69" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.ts b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.ts new file mode 100644 index 0000000000000..5c066e9939dff --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/aws-custom-resource/integ.invoke-function-payload.ts @@ -0,0 +1,44 @@ +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as cdk from 'aws-cdk-lib'; +import * as lambda from 'aws-cdk-lib/aws-lambda'; +import * as cr from 'aws-cdk-lib/custom-resources'; +import * as iam from 'aws-cdk-lib/aws-iam'; + +const app = new cdk.App(); + +const stack = new cdk.Stack(app, 'AwsCustomResourceInvokePayloadStack'); + +const fn = new lambda.Function(stack, 'Function', { + code: lambda.Code.fromInline("exports.handler = async () => { return { statusCode: 200, body: 'Hello World' }; };"), + handler: 'index.handler', + runtime: lambda.Runtime.NODEJS_18_X, +}); + +const testCr = new cr.AwsCustomResource(stack, 'ListLambdaFunctions', { + onUpdate: { + service: 'Lambda', + action: 'invoke', + parameters: { + FunctionName: fn.functionName, + }, + physicalResourceId: cr.PhysicalResourceId.of(fn.functionArn), + }, + policy: cr.AwsCustomResourcePolicy.fromStatements([ + new iam.PolicyStatement({ + actions: ['*'], + resources: ['*'], + effect: iam.Effect.ALLOW, + }), + ]), +}); + +fn.grantInvoke(testCr); +const payload = testCr.getResponseField('Payload'); + +new cdk.CfnOutput(stack, 'FunctionPayload', { + value: payload, +}); + +new IntegTest(app, 'AwsCustomResourceInvokePayloadInteg', { + testCases: [stack], +}); diff --git a/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/runtime/shared.ts b/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/runtime/shared.ts index c7989e10f1530..08af4c121178d 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/runtime/shared.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/runtime/shared.ts @@ -5,6 +5,23 @@ import * as AWSLambda from 'aws-lambda'; */ export const PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; +/** + * Text decoder used for Uint8Array response parsing + */ +const decoder = new TextDecoder(); + +/** + * Parse both buffers and ArrayBuffers which can be returned by sdkv3 + */ +function parseField(value: any): any { + if (Buffer.isBuffer(value)) { + return value.toString('utf8'); + } else if (ArrayBuffer.isView(value)) { + return decoder.decode(value.buffer); + } + + return value; +} /** * Flattens a nested object * @@ -12,17 +29,18 @@ export const PHYSICAL_RESOURCE_ID_REFERENCE = 'PHYSICAL:RESOURCEID:'; * @returns a flat object with path as keys */ export function flatten(object: object): { [key: string]: any } { + function _flatten(child: any, path: string[] = []): any { + return [].concat(...Object.keys(child) + .map(key => { + const childKey = parseField(child[key]); + return typeof childKey === 'object' && childKey !== null + ? _flatten(childKey, path.concat([key])) + : ({ [path.concat([key]).join('.')]: childKey }); + })); + } return Object.assign( {}, - ...function _flatten(child: any, path: string[] = []): any { - return [].concat(...Object.keys(child) - .map(key => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString('utf8') : child[key]; - return typeof childKey === 'object' && childKey !== null - ? _flatten(childKey, path.concat([key])) - : ({ [path.concat([key]).join('.')]: childKey }); - })); - }(object), + ..._flatten(object), ); } @@ -109,4 +127,4 @@ export function startsWithOneOf(searchStrings: string[]): (string: string) => bo } return false; }; -} \ No newline at end of file +} diff --git a/packages/aws-cdk-lib/custom-resources/test/aws-custom-resource/runtime/shared.test.ts b/packages/aws-cdk-lib/custom-resources/test/aws-custom-resource/runtime/shared.test.ts index 62496f03e7270..c69f758cfcb23 100644 --- a/packages/aws-cdk-lib/custom-resources/test/aws-custom-resource/runtime/shared.test.ts +++ b/packages/aws-cdk-lib/custom-resources/test/aws-custom-resource/runtime/shared.test.ts @@ -33,4 +33,23 @@ test('flatten correctly flattens an object with buffers', () => { 'nested.array.0': 'array.0', 'nested.array.1': 'array.1', }); -}); \ No newline at end of file +}); + +test('flatten correctly flattens an object with Uint8Array', () => { + const encoder = new TextEncoder(); + expect(flatten({ + body: encoder.encode('body'), + nested: { + buffer: encoder.encode('buffer'), + array: [ + encoder.encode('array.0'), + encoder.encode('array.1'), + ], + }, + })).toEqual({ + 'body': 'body', + 'nested.buffer': 'buffer', + 'nested.array.0': 'array.0', + 'nested.array.1': 'array.1', + }); +}); From a93af2fec36d05d9d0e3afcbbc39eb7a25e6f422 Mon Sep 17 00:00:00 2001 From: Luca Pizzini Date: Fri, 18 Aug 2023 19:10:18 +0200 Subject: [PATCH 09/19] feat(route53): add support for grantDelegation on imported PublicHostedZone (#26333) Imported `PublicHostedZone` with `fromPublicHostedZoneId` and `fromPublicHostedZoneAttributes` don't have support for the `grantDelegation` method since they return an instance of type `IPublicHostedZone`. This change adds support for `grantDelegation` to those instances as well. Closes #26240. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- ...dk-route53-cross-account-integ.assets.json | 4 +- ...-route53-cross-account-integ.template.json | 80 +++++++++++ .../manifest.json | 14 +- .../tree.json | 132 ++++++++++++++++++ .../integ.cross-account-zone-delegation.ts | 8 ++ packages/aws-cdk-lib/aws-ec2/README.md | 4 +- packages/aws-cdk-lib/aws-route53/README.md | 14 ++ .../aws-route53/lib/hosted-zone.ts | 39 ++---- packages/aws-cdk-lib/aws-route53/lib/util.ts | 22 +++ .../aws-route53/test/hosted-zone.test.ts | 51 +++++++ 10 files changed, 339 insertions(+), 29 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/aws-cdk-route53-cross-account-integ.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/aws-cdk-route53-cross-account-integ.assets.json index 03a8cf2340c2f..53d04417642e3 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/aws-cdk-route53-cross-account-integ.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/aws-cdk-route53-cross-account-integ.assets.json @@ -14,7 +14,7 @@ } } }, - "3222f491727b0389ac87f972f2443b490ff3cee14d24c28f1527c3f085cab460": { + "52da24cb67101152630cedcc08830f183f595580f8a7f6fcef1e0aac216c7198": { "source": { "path": "aws-cdk-route53-cross-account-integ.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "3222f491727b0389ac87f972f2443b490ff3cee14d24c28f1527c3f085cab460.json", + "objectKey": "52da24cb67101152630cedcc08830f183f595580f8a7f6fcef1e0aac216c7198.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/aws-cdk-route53-cross-account-integ.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/aws-cdk-route53-cross-account-integ.template.json index 0dc079b05fef5..1d8521c793e6e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/aws-cdk-route53-cross-account-integ.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/aws-cdk-route53-cross-account-integ.template.json @@ -302,6 +302,86 @@ ], "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" + }, + "Role1ABCC5F0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + } + } + ], + "Version": "2012-10-17" + } + } + }, + "RoleDefaultPolicy5FFB7DAB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "route53:ChangeResourceRecordSets", + "Condition": { + "ForAllValues:StringEquals": { + "route53:ChangeResourceRecordSetsRecordTypes": [ + "NS" + ], + "route53:ChangeResourceRecordSetsActions": [ + "UPSERT", + "DELETE" + ] + } + }, + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":route53:::hostedzone/imported-public-zone-id" + ] + ] + } + }, + { + "Action": "route53:ListHostedZonesByName", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "RoleDefaultPolicy5FFB7DAB", + "Roles": [ + { + "Ref": "Role1ABCC5F0" + } + ] + } } }, "Parameters": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/manifest.json index 646cd1f7d8514..4ccccaed927c8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/manifest.json @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3222f491727b0389ac87f972f2443b490ff3cee14d24c28f1527c3f085cab460.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/52da24cb67101152630cedcc08830f183f595580f8a7f6fcef1e0aac216c7198.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -93,6 +93,18 @@ "data": "DelegationWithZoneNameCrossAccountZoneDelegationCustomResourceA1A1C94A" } ], + "/aws-cdk-route53-cross-account-integ/Role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Role1ABCC5F0" + } + ], + "/aws-cdk-route53-cross-account-integ/Role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "RoleDefaultPolicy5FFB7DAB" + } + ], "/aws-cdk-route53-cross-account-integ/BootstrapVersion": [ { "type": "aws:cdk:logicalId", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/tree.json index d74a2a27509b1..583d08a41ccc4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.js.snapshot/tree.json @@ -427,6 +427,138 @@ "version": "0.0.0" } }, + "Role": { + "id": "Role", + "path": "aws-cdk-route53-cross-account-integ/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "aws-cdk-route53-cross-account-integ/Role/ImportRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-route53-cross-account-integ/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-cdk-route53-cross-account-integ/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-route53-cross-account-integ/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "route53:ChangeResourceRecordSets", + "Condition": { + "ForAllValues:StringEquals": { + "route53:ChangeResourceRecordSetsRecordTypes": [ + "NS" + ], + "route53:ChangeResourceRecordSetsActions": [ + "UPSERT", + "DELETE" + ] + } + }, + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":route53:::hostedzone/imported-public-zone-id" + ] + ] + } + }, + { + "Action": "route53:ListHostedZonesByName", + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "policyName": "RoleDefaultPolicy5FFB7DAB", + "roles": [ + { + "Ref": "Role1ABCC5F0" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "ImportedPublicZone": { + "id": "ImportedPublicZone", + "path": "aws-cdk-route53-cross-account-integ/ImportedPublicZone", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, "BootstrapVersion": { "id": "BootstrapVersion", "path": "aws-cdk-route53-cross-account-integ/BootstrapVersion", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.ts index 0e72c2df287d5..e8e5d3d154b1b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.cross-account-zone-delegation.ts @@ -32,8 +32,16 @@ new CrossAccountZoneDelegationRecord(stack, 'DelegationWithZoneName', { delegationRole: parentZone.crossAccountZoneDelegationRole!, }); +const role = new iam.Role(stack, 'Role', { + assumedBy: new iam.AccountRootPrincipal(), +}); + +const importedPublicZone = PublicHostedZone.fromPublicHostedZoneId(stack, 'ImportedPublicZone', 'imported-public-zone-id'); +importedPublicZone.grantDelegation(role); + new IntegTest(app, 'Route53CrossAccountInteg', { testCases: [stack], diffAssets: true, }); + app.synth(); diff --git a/packages/aws-cdk-lib/aws-ec2/README.md b/packages/aws-cdk-lib/aws-ec2/README.md index 709e363140811..9f909c613d08c 100644 --- a/packages/aws-cdk-lib/aws-ec2/README.md +++ b/packages/aws-cdk-lib/aws-ec2/README.md @@ -980,8 +980,8 @@ Endpoint services support private DNS, which makes it easier for clients to conn You can enable private DNS on an endpoint service like so: ```ts -import { HostedZone, VpcEndpointServiceDomainName } from 'aws-cdk-lib/aws-route53'; -declare const zone: HostedZone; +import { PublicHostedZone, VpcEndpointServiceDomainName } from 'aws-cdk-lib/aws-route53'; +declare const zone: PublicHostedZone; declare const vpces: ec2.VpcEndpointService; new VpcEndpointServiceDomainName(this, 'EndpointDomain', { diff --git a/packages/aws-cdk-lib/aws-route53/README.md b/packages/aws-cdk-lib/aws-route53/README.md index 3b5ee894c9494..af2036ca097fd 100644 --- a/packages/aws-cdk-lib/aws-route53/README.md +++ b/packages/aws-cdk-lib/aws-route53/README.md @@ -289,6 +289,20 @@ const zoneFromAttributes = route53.PublicHostedZone.fromPublicHostedZoneAttribut const zoneFromId = route53.PublicHostedZone.fromPublicHostedZoneId(this, 'MyZone', 'ZOJJZC49E0EPZ'); ``` +You can use `CrossAccountZoneDelegationRecord` on imported Public Hosted Zones with the `grantDelegation` method: + +```ts +const crossAccountRole = new iam.Role(this, 'CrossAccountRole', { + // The role name must be predictable + roleName: 'MyDelegationRole', + // The other account + assumedBy: new iam.AccountPrincipal('12345678901'), +}); + +const zoneFromId = route53.PublicHostedZone.fromPublicHostedZoneId(this, 'MyZone', 'ZOJJZC49E0EPZ'); +zoneFromId.grantDelegation(crossAccountRole); +``` + ## VPC Endpoint Service Private DNS When you create a VPC endpoint service, AWS generates endpoint-specific DNS hostnames that consumers use to communicate with the service. diff --git a/packages/aws-cdk-lib/aws-route53/lib/hosted-zone.ts b/packages/aws-cdk-lib/aws-route53/lib/hosted-zone.ts index efe94731622ae..cbb8ad6faf524 100644 --- a/packages/aws-cdk-lib/aws-route53/lib/hosted-zone.ts +++ b/packages/aws-cdk-lib/aws-route53/lib/hosted-zone.ts @@ -3,7 +3,7 @@ import { HostedZoneProviderProps } from './hosted-zone-provider'; import { HostedZoneAttributes, IHostedZone, PublicHostedZoneAttributes } from './hosted-zone-ref'; import { CaaAmazonRecord, ZoneDelegationRecord } from './record-set'; import { CfnHostedZone } from './route53.generated'; -import { makeHostedZoneArn, validateZoneName } from './util'; +import { makeGrantDelegation, makeHostedZoneArn, validateZoneName } from './util'; import * as ec2 from '../../aws-ec2'; import * as iam from '../../aws-iam'; import * as cxschema from '../../cloud-assembly-schema'; @@ -238,7 +238,12 @@ export interface PublicHostedZoneProps extends CommonHostedZoneProps { /** * Represents a Route 53 public hosted zone */ -export interface IPublicHostedZone extends IHostedZone { } +export interface IPublicHostedZone extends IHostedZone { + /** + * Grant permissions to add delegation records to this zone + */ + grantDelegation(grantee: iam.IGrantable): iam.Grant; +} /** * Create a Route53 public hosted zone. @@ -264,6 +269,9 @@ export class PublicHostedZone extends HostedZone implements IPublicHostedZone { public get hostedZoneArn(): string { return makeHostedZoneArn(this, this.hostedZoneId); } + public grantDelegation(grantee: iam.IGrantable): iam.Grant { + return makeGrantDelegation(grantee, this.hostedZoneArn); + }; } return new Import(scope, id); } @@ -284,6 +292,9 @@ export class PublicHostedZone extends HostedZone implements IPublicHostedZone { public get hostedZoneArn(): string { return makeHostedZoneArn(this, this.hostedZoneId); } + public grantDelegation(grantee: iam.IGrantable): iam.Grant { + return makeGrantDelegation(grantee, this.hostedZoneArn); + }; } return new Import(scope, id); } @@ -354,28 +365,8 @@ export class PublicHostedZone extends HostedZone implements IPublicHostedZone { }); } - /** - * Grant permissions to add delegation records to this zone - */ - public grantDelegation(grantee: iam.IGrantable) { - const g1 = iam.Grant.addToPrincipal({ - grantee, - actions: ['route53:ChangeResourceRecordSets'], - resourceArns: [this.hostedZoneArn], - conditions: { - 'ForAllValues:StringEquals': { - 'route53:ChangeResourceRecordSetsRecordTypes': ['NS'], - 'route53:ChangeResourceRecordSetsActions': ['UPSERT', 'DELETE'], - }, - }, - }); - const g2 = iam.Grant.addToPrincipal({ - grantee, - actions: ['route53:ListHostedZonesByName'], - resourceArns: ['*'], - }); - - return g1.combine(g2); + public grantDelegation(grantee: iam.IGrantable): iam.Grant { + return makeGrantDelegation(grantee, this.hostedZoneArn); } } diff --git a/packages/aws-cdk-lib/aws-route53/lib/util.ts b/packages/aws-cdk-lib/aws-route53/lib/util.ts index b6416e49a366f..6f8f832289a98 100644 --- a/packages/aws-cdk-lib/aws-route53/lib/util.ts +++ b/packages/aws-cdk-lib/aws-route53/lib/util.ts @@ -1,5 +1,6 @@ import { Construct } from 'constructs'; import { IHostedZone } from './hosted-zone-ref'; +import * as iam from '../../aws-iam'; import { Stack } from '../../core'; /** @@ -69,3 +70,24 @@ export function makeHostedZoneArn(construct: Construct, hostedZoneId: string): s resourceName: hostedZoneId, }); } + +export function makeGrantDelegation(grantee: iam.IGrantable, hostedZoneArn: string): iam.Grant { + const g1 = iam.Grant.addToPrincipal({ + grantee, + actions: ['route53:ChangeResourceRecordSets'], + resourceArns: [hostedZoneArn], + conditions: { + 'ForAllValues:StringEquals': { + 'route53:ChangeResourceRecordSetsRecordTypes': ['NS'], + 'route53:ChangeResourceRecordSetsActions': ['UPSERT', 'DELETE'], + }, + }, + }); + const g2 = iam.Grant.addToPrincipal({ + grantee, + actions: ['route53:ListHostedZonesByName'], + resourceArns: ['*'], + }); + + return g1.combine(g2); +} \ No newline at end of file diff --git a/packages/aws-cdk-lib/aws-route53/test/hosted-zone.test.ts b/packages/aws-cdk-lib/aws-route53/test/hosted-zone.test.ts index 4f37b586ee041..a5b2722a8adf5 100644 --- a/packages/aws-cdk-lib/aws-route53/test/hosted-zone.test.ts +++ b/packages/aws-cdk-lib/aws-route53/test/hosted-zone.test.ts @@ -288,6 +288,57 @@ test('grantDelegation', () => { }); }); +test('grantDelegation on imported public zones', () => { + // GIVEN + const stack = new cdk.Stack(undefined, 'TestStack', { + env: { account: '123456789012', region: 'us-east-1' }, + }); + + const role = new iam.Role(stack, 'Role', { + assumedBy: new iam.AccountPrincipal('22222222222222'), + }); + + const zone = PublicHostedZone.fromPublicHostedZoneId(stack, 'Zone', 'hosted-id'); + + // WHEN + zone.grantDelegation(role); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', { + PolicyDocument: { + Statement: [ + { + Action: 'route53:ChangeResourceRecordSets', + Effect: 'Allow', + Resource: { + 'Fn::Join': [ + '', + [ + 'arn:', + { + Ref: 'AWS::Partition', + }, + ':route53:::hostedzone/hosted-id', + ], + ], + }, + Condition: { + 'ForAllValues:StringEquals': { + 'route53:ChangeResourceRecordSetsRecordTypes': ['NS'], + 'route53:ChangeResourceRecordSetsActions': ['UPSERT', 'DELETE'], + }, + }, + }, + { + Action: 'route53:ListHostedZonesByName', + Effect: 'Allow', + Resource: '*', + }, + ], + }, + }); +}); + describe('Hosted Zone with dot', () => { test('Hosted Zone constructs without trailing dot by default', () => { // GIVEN From 3305d4f8cf2a15f36c90065c21c7d8525ac1ccbc Mon Sep 17 00:00:00 2001 From: Tatsuya Mori Date: Sat, 19 Aug 2023 02:37:19 +0900 Subject: [PATCH 10/19] docs(events-targets): add link for Run an ECS task section (#26805) README for aws-cdk-lib.aws_events_targets is missing the link for `Run an ECS task` section. This PR introduces the link. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk-lib/aws-events-targets/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-events-targets/README.md b/packages/aws-cdk-lib/aws-events-targets/README.md index 693a93ab2dbd1..1ca040a96e49d 100644 --- a/packages/aws-cdk-lib/aws-events-targets/README.md +++ b/packages/aws-cdk-lib/aws-events-targets/README.md @@ -9,7 +9,7 @@ Currently supported are: * [Start a CodeBuild build](#start-a-codebuild-build) * [Start a CodePipeline pipeline](#start-a-codepipeline-pipeline) -* Run an ECS task +* [Run an ECS task](#run-an-ecs-task) * [Invoke a Lambda function](#invoke-a-lambda-function) * [Invoke a API Gateway REST API](#invoke-an-api-gateway-rest-api) * Publish a message to an SNS topic @@ -416,7 +416,7 @@ rule.addTarget( ); ``` -### enable Amazon ECS Exec for ECS Task +### Enable Amazon ECS Exec for ECS Task If you use Amazon ECS Exec, you can run commands in or get a shell to a container running on an Amazon EC2 instance or on AWS Fargate. From 94e48c6f5adf4aa5ebfe1491990ef8c4cf4ddaad Mon Sep 17 00:00:00 2001 From: Luca Pizzini Date: Fri, 18 Aug 2023 20:05:04 +0200 Subject: [PATCH 11/19] fix(secretsmanager): rotation resource creation can fail due to race condition (#26512) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Setting up a `RotationSchedule` with `rotationLambda` could cause failures due to the lambda invoking permission and the`RotationSchedule` being created concurrently. This fix adds a dependency to ensure the policy is created first and to prevent race conditions. Closes #26481. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- ...integ-secret-lambda-rotation.template.json | 5 ++++- .../test/integ.lambda-rotation.ts | 9 +++++++- .../lib/rotation-schedule.ts | 3 ++- .../test/rotation-schedule.test.ts | 22 +++++++++++++++++++ 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.lambda-rotation.js.snapshot/cdk-integ-secret-lambda-rotation.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.lambda-rotation.js.snapshot/cdk-integ-secret-lambda-rotation.template.json index f21330a12b17c..f8b5c879ce48a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.lambda-rotation.js.snapshot/cdk-integ-secret-lambda-rotation.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.lambda-rotation.js.snapshot/cdk-integ-secret-lambda-rotation.template.json @@ -144,7 +144,10 @@ "RotationRules": { "AutomaticallyAfterDays": 30 } - } + }, + "DependsOn": [ + "LambdaInvokeN0a2GKfZP0JmDqDEVhhu6A0TUv3NyNbk4YMFKNc69846677" + ] }, "SecretPolicy06C9821C": { "Type": "AWS::SecretsManager::ResourcePolicy", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.lambda-rotation.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.lambda-rotation.ts index eedd5f6654472..18cdb2597de5f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.lambda-rotation.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.lambda-rotation.ts @@ -2,6 +2,7 @@ import * as kms from 'aws-cdk-lib/aws-kms'; import * as lambda from 'aws-cdk-lib/aws-lambda'; import * as cdk from 'aws-cdk-lib'; import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager'; +import * as integ from '@aws-cdk/integ-tests-alpha'; class TestStack extends cdk.Stack { constructor(scope: cdk.App, id: string) { @@ -24,5 +25,11 @@ class TestStack extends cdk.Stack { } const app = new cdk.App(); -new TestStack(app, 'cdk-integ-secret-lambda-rotation'); + +const stack = new TestStack(app, 'cdk-integ-secret-lambda-rotation'); + +new integ.IntegTest(app, 'cdk-integ-secret-lambda-rotation-test', { + testCases: [stack], +}); + app.synth(); diff --git a/packages/aws-cdk-lib/aws-secretsmanager/lib/rotation-schedule.ts b/packages/aws-cdk-lib/aws-secretsmanager/lib/rotation-schedule.ts index 411199c3f3aa6..b2460667599f1 100644 --- a/packages/aws-cdk-lib/aws-secretsmanager/lib/rotation-schedule.ts +++ b/packages/aws-cdk-lib/aws-secretsmanager/lib/rotation-schedule.ts @@ -100,7 +100,8 @@ export class RotationSchedule extends Resource { ); } - props.rotationLambda.grantInvoke(new iam.ServicePrincipal('secretsmanager.amazonaws.com')); + const grant = props.rotationLambda.grantInvoke(new iam.ServicePrincipal('secretsmanager.amazonaws.com')); + grant.applyBefore(this); props.rotationLambda.addToRolePolicy( new iam.PolicyStatement({ diff --git a/packages/aws-cdk-lib/aws-secretsmanager/test/rotation-schedule.test.ts b/packages/aws-cdk-lib/aws-secretsmanager/test/rotation-schedule.test.ts index 2452c751c7830..8e2052f02ca1d 100644 --- a/packages/aws-cdk-lib/aws-secretsmanager/test/rotation-schedule.test.ts +++ b/packages/aws-cdk-lib/aws-secretsmanager/test/rotation-schedule.test.ts @@ -629,3 +629,25 @@ describe('manual rotations', () => { checkRotationNotSet(Duration.millis(0)); }); }); + +test('rotation schedule should have a dependency on lambda permissions', () => { + // GIVEN + const secret = new secretsmanager.Secret(stack, 'Secret'); + const rotationLambda = new lambda.Function(stack, 'Lambda', { + runtime: lambda.Runtime.NODEJS_14_X, + code: lambda.Code.fromInline('export.handler = event => event;'), + handler: 'index.handler', + }); + + // WHEN + secret.addRotationSchedule('RotationSchedule', { + rotationLambda, + }); + + // THEN + Template.fromStack(stack).hasResource('AWS::SecretsManager::RotationSchedule', { + DependsOn: [ + 'LambdaInvokeN0a2GKfZP0JmDqDEVhhu6A0TUv3NyNbk4YMFKNc69846677', + ], + }); +}); From 00a7f033f6ad19160a7350784243ecf9c71c388b Mon Sep 17 00:00:00 2001 From: Tatsuya Mori Date: Sat, 19 Aug 2023 03:32:10 +0900 Subject: [PATCH 12/19] fix(backup): validation for vault name fails when parameters are referred in the name (#25943) Validation for Backup vault name fails when parameters are referred in the name now. Current implementation simply validates vault name with regular expression described in [CFn reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-backup-backupvault.html#cfn-backup-backupvault-backupvaultname), so it does not consider the special characters for parameters. This PR solves the issue by checking props.backupVaultName is resolved. Closes #21735 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../cdk-backup.assets.json | 4 +- .../cdk-backup.template.json | 34 ++++- .../test/integ.backup.js.snapshot/integ.json | 2 +- .../integ.backup.js.snapshot/manifest.json | 16 ++- .../test/integ.backup.js.snapshot/tree.json | 131 ++++++++++++------ .../test/aws-backup/test/integ.backup.ts | 13 +- packages/aws-cdk-lib/aws-backup/lib/vault.ts | 4 +- .../aws-cdk-lib/aws-backup/test/vault.test.ts | 17 ++- 8 files changed, 165 insertions(+), 56 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.assets.json index ebc526f444743..19ddf51ac30c3 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.assets.json @@ -1,7 +1,7 @@ { "version": "32.0.0", "files": { - "cf2d89a4eac2c90005b9a1e142f1cac80cf9cd29d1b8f98f002b9f3a1849454c": { + "0c52c355c71ac95690274d7987110017ff9cd1a1bc79fa4206fda2f55d6b62d5": { "source": { "path": "cdk-backup.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cf2d89a4eac2c90005b9a1e142f1cac80cf9cd29d1b8f98f002b9f3a1849454c.json", + "objectKey": "0c52c355c71ac95690274d7987110017ff9cd1a1bc79fa4206fda2f55d6b62d5.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.template.json index 577d8efd46f37..2722b98da789d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/cdk-backup.template.json @@ -3,16 +3,16 @@ "TableCD117FA1": { "Type": "AWS::DynamoDB::Table", "Properties": { - "KeySchema": [ + "AttributeDefinitions": [ { "AttributeName": "id", - "KeyType": "HASH" + "AttributeType": "S" } ], - "AttributeDefinitions": [ + "KeySchema": [ { "AttributeName": "id", - "AttributeType": "S" + "KeyType": "HASH" } ], "ProvisionedThroughput": { @@ -50,6 +50,27 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, + "ThirdVault3441C01E": { + "Type": "AWS::Backup::BackupVault", + "Properties": { + "BackupVaultName": { + "Fn::Join": [ + "", + [ + "backupVault-", + { + "Ref": "Env" + } + ] + ] + }, + "LockConfiguration": { + "MinRetentionDays": 5 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, "PlanDAF4E53A": { "Type": "AWS::Backup::BackupPlan", "Properties": { @@ -234,6 +255,11 @@ } }, "Parameters": { + "Env": { + "Type": "String", + "Default": "test", + "Description": "Env" + }, "BootstrapVersion": { "Type": "AWS::SSM::Parameter::Value", "Default": "/cdk-bootstrap/hnb659fds/version", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/integ.json index 0a26289ba381b..266124ac58c12 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "33.0.0", "testCases": { "integ.backup": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/manifest.json index 210b015870fa2..aa4d73d1faac8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "33.0.0", "artifacts": { "cdk-backup.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/cf2d89a4eac2c90005b9a1e142f1cac80cf9cd29d1b8f98f002b9f3a1849454c.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0c52c355c71ac95690274d7987110017ff9cd1a1bc79fa4206fda2f55d6b62d5.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -57,6 +57,18 @@ "data": "SecondaryVault67665B5E" } ], + "/cdk-backup/Env": [ + { + "type": "aws:cdk:logicalId", + "data": "Env" + } + ], + "/cdk-backup/ThirdVault/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ThirdVault3441C01E" + } + ], "/cdk-backup/Plan/Resource": [ { "type": "aws:cdk:logicalId", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/tree.json index e367a29532898..3728b496ca8cf 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.js.snapshot/tree.json @@ -18,16 +18,16 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::DynamoDB::Table", "aws:cdk:cloudformation:props": { - "keySchema": [ + "attributeDefinitions": [ { "attributeName": "id", - "keyType": "HASH" + "attributeType": "S" } ], - "attributeDefinitions": [ + "keySchema": [ { "attributeName": "id", - "attributeType": "S" + "keyType": "HASH" } ], "provisionedThroughput": { @@ -37,22 +37,22 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_dynamodb.CfnTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "ScalingRole": { "id": "ScalingRole", "path": "cdk-backup/Table/ScalingRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_dynamodb.Table", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "FileSystem": { @@ -63,8 +63,8 @@ "aws:cdk:cloudformation:props": {} }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_efs.CfnFileSystem", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "Vault": { @@ -84,14 +84,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.CfnBackupVault", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.BackupVault", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "SecondaryVault": { @@ -111,14 +111,59 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.CfnBackupVault", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.BackupVault", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" + } + }, + "Env": { + "id": "Env", + "path": "cdk-backup/Env", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.69" + } + }, + "ThirdVault": { + "id": "ThirdVault", + "path": "cdk-backup/ThirdVault", + "children": { + "Resource": { + "id": "Resource", + "path": "cdk-backup/ThirdVault/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Backup::BackupVault", + "aws:cdk:cloudformation:props": { + "backupVaultName": { + "Fn::Join": [ + "", + [ + "backupVault-", + { + "Ref": "Env" + } + ] + ] + }, + "lockConfiguration": { + "minRetentionDays": 5 + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.69" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "Plan": { @@ -205,8 +250,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.CfnBackupPlan", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "Selection": { @@ -221,8 +266,8 @@ "id": "ImportRole", "path": "cdk-backup/Plan/Selection/Role/ImportRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "Resource": { @@ -260,14 +305,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "Resource": { @@ -349,42 +394,42 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.CfnBackupSelection", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.BackupSelection", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_backup.BackupPlan", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "BootstrapVersion": { "id": "BootstrapVersion", "path": "cdk-backup/BootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", "path": "cdk-backup/CheckBootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } }, "Tree": { @@ -392,13 +437,13 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.26" + "version": "10.2.69" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.69" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.ts index 32ff7b52f454b..d5138ced8bc41 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-backup/test/integ.backup.ts @@ -1,6 +1,6 @@ import * as dynamodb from 'aws-cdk-lib/aws-dynamodb'; import * as efs from 'aws-cdk-lib/aws-efs'; -import { App, Duration, RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib'; +import { App, Duration, RemovalPolicy, Stack, StackProps, CfnParameter } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import * as backup from 'aws-cdk-lib/aws-backup'; @@ -31,6 +31,17 @@ class TestStack extends Stack { minRetention: Duration.days(5), }, }); + + const env = new CfnParameter(this, 'Env', { type: 'String', description: 'Env', default: 'test' }); + + new backup.BackupVault(this, 'ThirdVault', { + removalPolicy: RemovalPolicy.DESTROY, + backupVaultName: `backupVault-${env.valueAsString}`, + lockConfiguration: { + minRetention: Duration.days(5), + }, + }); + const plan = backup.BackupPlan.dailyWeeklyMonthly5YearRetention(this, 'Plan', vault); plan.addSelection('Selection', { diff --git a/packages/aws-cdk-lib/aws-backup/lib/vault.ts b/packages/aws-cdk-lib/aws-backup/lib/vault.ts index ac530bafab2f1..8208cf6c37aba 100644 --- a/packages/aws-cdk-lib/aws-backup/lib/vault.ts +++ b/packages/aws-cdk-lib/aws-backup/lib/vault.ts @@ -3,7 +3,7 @@ import { CfnBackupVault } from './backup.generated'; import * as iam from '../../aws-iam'; import * as kms from '../../aws-kms'; import * as sns from '../../aws-sns'; -import { ArnFormat, Duration, IResource, Lazy, Names, RemovalPolicy, Resource, Stack } from '../../core'; +import { ArnFormat, Duration, IResource, Lazy, Names, RemovalPolicy, Resource, Stack, Token } from '../../core'; /** * A backup vault @@ -270,7 +270,7 @@ export class BackupVault extends BackupVaultBase { constructor(scope: Construct, id: string, props: BackupVaultProps = {}) { super(scope, id); - if (props.backupVaultName && !/^[a-zA-Z0-9\-_]{2,50}$/.test(props.backupVaultName)) { + if (props.backupVaultName && !Token.isUnresolved(props.backupVaultName) && !/^[a-zA-Z0-9\-_]{2,50}$/.test(props.backupVaultName)) { throw new Error('Expected vault name to match pattern `^[a-zA-Z0-9\-_]{2,50}$`'); } diff --git a/packages/aws-cdk-lib/aws-backup/test/vault.test.ts b/packages/aws-cdk-lib/aws-backup/test/vault.test.ts index dc2f5c50bd2c4..46cb2b4a18be2 100644 --- a/packages/aws-cdk-lib/aws-backup/test/vault.test.ts +++ b/packages/aws-cdk-lib/aws-backup/test/vault.test.ts @@ -2,7 +2,7 @@ import { Template } from '../../assertions'; import * as iam from '../../aws-iam'; import * as kms from '../../aws-kms'; import * as sns from '../../aws-sns'; -import { ArnFormat, Duration, Stack } from '../../core'; +import { ArnFormat, Duration, Stack, Fn } from '../../core'; import { BackupVault, BackupVaultEvents } from '../lib'; let stack: Stack; @@ -303,6 +303,21 @@ test('import from name', () => { })); }); +test('specify imported value as vault name', () => { + // WHEN + const vaultName = Fn.importValue('VaultName'); + new BackupVault(stack, 'Vault', { + backupVaultName: vaultName, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Backup::BackupVault', { + BackupVaultName: { + 'Fn::ImportValue': 'VaultName', + }, + }); +}); + test('grant action', () => { // GIVEN const vaultName = 'myVaultName'; From 95f8cef0505dd2deb8ee5e45ab98c6ab1b764b02 Mon Sep 17 00:00:00 2001 From: Rico Hermans Date: Mon, 21 Aug 2023 17:05:49 +0200 Subject: [PATCH 13/19] fix(lambda-python): poetry bundling is broken after Aug 20 (#26823) The Dockerfile that builds an executable container to run `poetry` in installs the latest version of `poetry` on a Python 3.7 Docker image. Unfortunately `poetry 1.6.0`, released August 20, drops support for Python 3.7 which means that all poetry bundling jobs started failing on that date. `1.6.0` also does not work on Python 3.8, which I don't see mentioned in the change log, but our integration tests that use Python 3.8 are also broken. Lock the poetry version back to `1.5.1` by using a version specifier so the command is not dependent on the date it is run. This is the last version that supported both Python 3.7 and 3.8. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-lambda-python-alpha/lib/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/lib/Dockerfile b/packages/@aws-cdk/aws-lambda-python-alpha/lib/Dockerfile index e61f15fcb0fa8..334b2a80ac4d9 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/lib/Dockerfile +++ b/packages/@aws-cdk/aws-lambda-python-alpha/lib/Dockerfile @@ -6,6 +6,7 @@ FROM $IMAGE ARG PIP_INDEX_URL ARG PIP_EXTRA_INDEX_URL ARG HTTPS_PROXY +ARG POETRY_VERSION=1.5.1 # Add virtualenv path ENV PATH="/usr/app/venv/bin:$PATH" @@ -17,7 +18,7 @@ ENV PIP_CACHE_DIR=/tmp/pip-cache ENV POETRY_CACHE_DIR=/tmp/poetry-cache RUN \ -# create a new virtualenv for python to use +# create a new virtualenv for python to use # so that it isn't using root python -m venv /usr/app/venv && \ # Create a new location for the pip cache @@ -31,7 +32,7 @@ RUN \ # Ensure all users can write to poetry cache chmod -R 777 /tmp/poetry-cache && \ # pipenv 2022.4.8 is the last version with Python 3.6 support - pip install pipenv==2022.4.8 poetry && \ + pip install pipenv==2022.4.8 poetry==$POETRY_VERSION && \ # Ensure no temporary files remain in the caches rm -rf /tmp/pip-cache/* /tmp/poetry-cache/* From 26dcc1e11a07d93681145049aa06d80a7d2114b9 Mon Sep 17 00:00:00 2001 From: Calvin Combs <66279577+comcalvi@users.noreply.github.com> Date: Mon, 21 Aug 2023 10:38:36 -0700 Subject: [PATCH 14/19] fix(CLI): diff reports wrong count of changed stacks (#26796) The current logic counts the number of changes in any parent stacks. It doesn't count nested stacks correctly, and doesn't count parent stacks correctly. With this change: Screenshot 2023-08-18 at 9 43 49 AM Without this change: Screenshot 2023-08-18 at 9 51 55 AM Closes #26818. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk/lib/api/deployments.ts | 10 +- .../aws-cdk/lib/api/nested-stack-helpers.ts | 28 +++++ packages/aws-cdk/lib/cdk-toolkit.ts | 16 ++- .../api/cloudformation-deployments.test.ts | 16 ++- packages/aws-cdk/test/diff.test.ts | 103 +++++++++++++----- 5 files changed, 135 insertions(+), 38 deletions(-) diff --git a/packages/aws-cdk/lib/api/deployments.ts b/packages/aws-cdk/lib/api/deployments.ts index a375bf25c4f65..cab9eb922a66d 100644 --- a/packages/aws-cdk/lib/api/deployments.ts +++ b/packages/aws-cdk/lib/api/deployments.ts @@ -6,7 +6,7 @@ import { ISDK } from './aws-auth/sdk'; import { CredentialsOptions, SdkForEnvironment, SdkProvider } from './aws-auth/sdk-provider'; import { deployStack, DeployStackResult, destroyStack, makeBodyParameterAndUpload, DeploymentMethod } from './deploy-stack'; import { HotswapMode } from './hotswap/common'; -import { loadCurrentTemplateWithNestedStacks, loadCurrentTemplate } from './nested-stack-helpers'; +import { loadCurrentTemplateWithNestedStacks, loadCurrentTemplate, flattenNestedStackNames, TemplateWithNestedStackCount } from './nested-stack-helpers'; import { ToolkitInfo } from './toolkit-info'; import { CloudFormationStack, Template, ResourcesToImport, ResourceIdentifierSummaries } from './util/cloudformation'; import { StackActivityProgress } from './util/cloudformation/stack-activity-monitor'; @@ -300,9 +300,13 @@ export class Deployments { public async readCurrentTemplateWithNestedStacks( rootStackArtifact: cxapi.CloudFormationStackArtifact, retrieveProcessedTemplate: boolean = false, - ): Promise