Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(integ-tests): use transformToString on API call response #27122

Merged
merged 14 commits into from
Sep 13, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -32686,9 +32686,11 @@ var AwsApiCallHandler = class extends CustomResourceHandler {
const parameters = (request2.parameters && decodeParameters(request2.parameters)) ?? {};
const commandInput = (0, import_sdk_v2_to_v3_adapter.coerceApiParametersToUint8Array)(request2.service, request2.api, parameters);
console.log(`SDK request to ${sdkPkg.service}.${request2.api} with parameters ${JSON.stringify(commandInput)}`);
const response = await client.send(new Command(commandInput));
let response = await client.send(new Command(commandInput));
if (response.Payload) {
response.Payload = parseJsonPayload(response.Payload);
} else if (response.Body) {
response = await response.Body.transformToString("utf-8");
}
console.log(`SDK response received ${JSON.stringify(response)}`);
delete response.$metadata;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"version": "34.0.0",
"files": {
"77997674c0a10fbb65169124ad6c0d7a664b6162ad44f9abfa22fd006b33f754": {
"f7d0a853e93cf45bf3a2294247e3a83df76fb1d4c5b0219ab7f4ee18b539db17": {
"source": {
"path": "asset.77997674c0a10fbb65169124ad6c0d7a664b6162ad44f9abfa22fd006b33f754.bundle",
"path": "asset.f7d0a853e93cf45bf3a2294247e3a83df76fb1d4c5b0219ab7f4ee18b539db17.bundle",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "77997674c0a10fbb65169124ad6c0d7a664b6162ad44f9abfa22fd006b33f754.zip",
"objectKey": "f7d0a853e93cf45bf3a2294247e3a83df76fb1d4c5b0219ab7f4ee18b539db17.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"e70bd778aadedf7f4065f219cf272b5b8a2bf42a03c1a0ccb4e7ec4859df0790": {
"f0a67747b9b2ab2986d0044984e263a1f7a12086e17b73a79b9fdd4ed69c8170": {
"source": {
"path": "deploytimesubstitutionintegtestDefaultTestDeployAssertCBBB427B.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "e70bd778aadedf7f4065f219cf272b5b8a2bf42a03c1a0ccb4e7ec4859df0790.json",
"objectKey": "f0a67747b9b2ab2986d0044984e263a1f7a12086e17b73a79b9fdd4ed69c8170.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
]
]
},
"actualPath": "Body",
"parameters": {
"Bucket": {
"Fn::Join": [
Expand All @@ -39,11 +38,8 @@
},
"Key": "\"56450500138e1b4809dbb5aa9bc51ccd1e0bc0044c6a453b40df7e5a17244740\""
},
"flattenResponse": "true",
"outputPaths": [
"Body"
],
"salt": "1694452807292"
"flattenResponse": "false",
"salt": "1694581889882"
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
Expand Down Expand Up @@ -107,7 +103,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "77997674c0a10fbb65169124ad6c0d7a664b6162ad44f9abfa22fd006b33f754.zip"
"S3Key": "f7d0a853e93cf45bf3a2294247e3a83df76fb1d4c5b0219ab7f4ee18b539db17.zip"
},
"Timeout": 120,
"Handler": "index.handler",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,101 +1,6 @@
{
"version": "34.0.0",
"artifacts": {
"my-stack.assets": {
"type": "cdk:asset-manifest",
"properties": {
"file": "my-stack.assets.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
}
},
"my-stack": {
"type": "aws:cloudformation:stack",
"environment": "aws://unknown-account/unknown-region",
"properties": {
"templateFile": "my-stack.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}/5f7bf484ce84a5fb9af1c00b0e00bcb7584993fa5f836a703478a7753525a6ea.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
"my-stack.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": [
"my-stack.assets"
],
"metadata": {
"/my-stack/Hello/ServiceRole/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "HelloServiceRole1E55EA16"
}
],
"/my-stack/Hello/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "Hello4A628BD4"
}
],
"/my-stack/substitution-bucket/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "substitutionbucket13A1BF4A"
}
],
"/my-stack/Deployment/AwsCliLayer/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "DeploymentAwsCliLayerB82B26A3"
}
],
"/my-stack/Deployment/CustomResource/Default": [
{
"type": "aws:cdk:logicalId",
"data": "DeploymentCustomResource47E8B2E6"
}
],
"/my-stack/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265"
}
],
"/my-stack/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/DefaultPolicy/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF"
}
],
"/my-stack/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536"
}
],
"/my-stack/BootstrapVersion": [
{
"type": "aws:cdk:logicalId",
"data": "BootstrapVersion"
}
],
"/my-stack/CheckBootstrapVersion": [
{
"type": "aws:cdk:logicalId",
"data": "CheckBootstrapVersion"
}
]
},
"displayName": "my-stack"
},
"test-s3-deploy-substitution.assets": {
"type": "cdk:asset-manifest",
"properties": {
Expand Down Expand Up @@ -219,7 +124,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}/e70bd778aadedf7f4065f219cf272b5b8a2bf42a03c1a0ccb4e7ec4859df0790.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/f0a67747b9b2ab2986d0044984e263a1f7a12086e17b73a79b9fdd4ed69c8170.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down

This file was deleted.

Loading