Skip to content

Commit

Permalink
fix(integ-tests): Uint8Arrays are not decoded properly (#27009)
Browse files Browse the repository at this point in the history
AWS SDK v3 has changed some data types to Uint8Array. If a value of this type was provided by the user, it would not be decoded properly back to a Uint8Array before making the call.

Recognize when there is an encoded Uint8Array and decode it back properly.

Closes #26798.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
otaviomacedo authored Sep 6, 2023
1 parent e260d30 commit 47ab5c8
Show file tree
Hide file tree
Showing 13 changed files with 32,800 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "34.0.0",
"files": {
"e4cbaa0fcf23495e4d555f44c97cf3fdd0bbd04ce558a02ba6a79f7ae1944f60": {
"source": {
"path": "IntegBinaryPayload.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "e4cbaa0fcf23495e4d555f44c97cf3fdd0bbd04ce558a02ba6a79f7ae1944f60.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"Resources": {
"fnServiceRole5D180AFD": {
"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"
]
]
}
]
}
},
"fn5FF616E3": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"ZipFile": "\n exports.handler = async (event) => {\n return event;\n };\n "
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"fnServiceRole5D180AFD",
"Arn"
]
},
"Runtime": "nodejs18.x"
},
"DependsOn": [
"fnServiceRole5D180AFD"
]
}
},
"Outputs": {
"ExportsOutputReffn5FF616E3BE1A8BD6": {
"Value": {
"Ref": "fn5FF616E3"
},
"Export": {
"Name": "IntegBinaryPayload:ExportsOutputReffn5FF616E3BE1A8BD6"
}
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"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."
}
]
}
}
}
Loading

0 comments on commit 47ab5c8

Please sign in to comment.