We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This function will fail if the response property contains the null value.
aws-cdk/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/runtime/index.ts
Lines 11 to 23 in e95b52e
const clusterInfo = new cr.AwsCustomResource(stack, 'clusterInfo', { onUpdate: { service: 'EKS', action: 'describeCluster', region, parameters: { name: cluster.clusterName, }, physicalResourceId: cluster.clusterName, }, })
Will get response like this
{ name: 'cluster-a5bc1663-3159-4112-9c28-e8c84e730606', arn: 'arn:aws:eks:ap-northeast-1:903779448426:cluster/cluster-a5bc1663-3159-4112-9c28-e8c84e730606', createdAt: 2019-11-15T01:28:24.825Z, version: '1.14', endpoint: '...', roleArn: '...', resourcesVpcConfig: { subnetIds: [Array], securityGroupIds: [Array], vpcId: 'vpc-497a492d', endpointPublicAccess: true, endpointPrivateAccess: false }, logging: { clusterLogging: [Array] }, status: 'ACTIVE', certificateAuthority: { data: '...' }, clientRequestToken: null, platformVersion: 'eks.2' } }
And the clientRequestToken would be null, which breaks the flatten() function.
clientRequestToken
A simple additional check like this can fix this issue but I'm not sure if it's a good way to fix it.
function flatten(object) { return Object.assign({}, ...function _flatten(child, path = []) { return [].concat(...Object.keys(child) .map(key => typeof child[key] === 'object' && child[key] != null ? _flatten(child[key], path.concat([key])) : ({ [path.concat([key]).join('.')]: child[key] }))); }(object)); }
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered:
fix(custom-resource): flatten objects with null values in AwsCustomRe…
f68d1d0
…source Fixes aws#5061
fix(custom-resources): flatten objects with null values in AwsCustomR…
3978e56
…esource Fixes aws#5061
f4ea264
…esource (#5073) Fixes #5061
Successfully merging a pull request may close this issue.
This function will fail if the response property contains the null value.
aws-cdk/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/runtime/index.ts
Lines 11 to 23 in e95b52e
Reproduction Steps
Will get response like this
And the
clientRequestToken
would be null, which breaks the flatten() function.A simple additional check like this can fix this issue but I'm not sure if it's a good way to fix it.
Error Log
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: