Skip to content

Commit

Permalink
fix(cdk): Fn.cidr should return a list and not a string (#2678)
Browse files Browse the repository at this point in the history
CloudFormation's Fn::CIDR returns a list of CIDR blocks and not a string.
So we need to use a listified token instead of a string.

Fixes #2671
  • Loading branch information
Elad Ben-Israel authored May 29, 2019
1 parent 88c4199 commit 9d2ea2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@aws-cdk/cdk/lib/fn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ export class Fn {
* @param sizeMask The digit covered in the subnet.
* @returns a token represented as a string
*/
public static cidr(ipBlock: string, count: number, sizeMask?: string): string {
return new FnCidr(ipBlock, count, sizeMask).toString();
public static cidr(ipBlock: string, count: number, sizeMask?: string): string[] {
return new FnCidr(ipBlock, count, sizeMask).toList();
}

/**
Expand Down

0 comments on commit 9d2ea2a

Please sign in to comment.