Skip to content

Commit

Permalink
get rid of decodeBooleans
Browse files Browse the repository at this point in the history
  • Loading branch information
Elad Ben-Israel authored Jun 10, 2020
1 parent 2e63152 commit e7ef1cf
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions packages/@aws-cdk/aws-eks/lib/cluster-resource-handler/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,6 @@ export interface EksUpdateId {

export type ResourceEvent = AWSLambda.CloudFormationCustomResourceEvent & EksUpdateId;

/**
* Decodes encoded true/false values
*/
function decodeBooleans(object: object) {
return JSON.parse(JSON.stringify(object), (_k, v) => {
switch (v) {
case 'TRUE:BOOLEAN':
return true;
case 'FALSE:BOOLEAN':
return false;
default:
return v;
}
});
}

export abstract class ResourceHandler {
protected readonly requestId: string;
protected readonly logicalResourceId: string;
Expand All @@ -49,10 +33,6 @@ export abstract class ResourceHandler {
throw new Error('AssumeRoleArn must be provided');
}

if (event.ResourceProperties.Config) {
this.event.ResourceProperties.Config = decodeBooleans(event.ResourceProperties.Config);
}

eks.configureAssumeRole({
RoleArn: roleToAssume,
RoleSessionName: `AWSCDK.EKSCluster.${this.requestType}.${this.requestId}`,
Expand Down

0 comments on commit e7ef1cf

Please sign in to comment.