I am trying to do the following:
- Get the CIDR block set by the user in the Parameters
- Split the CIDR by "." to get the individual numbers
- Join CIDR[0], CIDR[1], "4.0/24"
I have come up with the following funciton:
"CidrBlock": {
"Join": [
".",
[
{
"Select": [
"0",
{
"Split": [
".",
{
"Ref": "2CIDR"
}
]
}
]
},
{
"Select": [
"1",
{
"Split": [
".",
{
"Ref": "2CIDR"
}
]
}
]
},
"16.0/24"
]
]
},
But this fails with the following error:
Value of property CidrBlock must be of type String
I cannot find any examples of what I am trying to do on the internet.
Anyone has any idea what's wrong with the above function? Or can anyone suggest an alternative way to build the CIDR of each subnet using the CIDR of the VPC?