Idempotency Support for Route Table and Network ACL Creation in Amazon VPC!
Amazon VPN now supports idempotency for route table and network ACL creation.
clientToken
parameter (--client-token
) to achieve idempotency.1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
abhijit@AwsJunkie:~$ uuidgen
abf653c2-09a2-426d-bd2d-acaac0c98a28
abhijit@AwsJunkie:~$ aws ec2 create-route-table --vpc-id vpc-00c84bd9dcad1d728 --client-token abf653c2-09a2-426d-bd2d-acaac0c98a28
{
"RouteTable": {
"Associations": [],
"PropagatingVgws": [],
"RouteTableId": "rtb-0899b6226d3a3ef9a",
"Routes": [
{
"DestinationCidrBlock": "172.31.0.0/16",
"GatewayId": "local",
"Origin": "CreateRouteTable",
"State": "active"
}
],
"Tags": [],
"VpcId": "vpc-00c84bd9dcad1d728",
"OwnerId": "141035231386"
},
"ClientToken": "abf653c2-09a2-426d-bd2d-acaac0c98a28"
}
--client-token
, it will return the same route table instead of creating a new one.1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
abhijit@AwsJunkie:~$ aws ec2 create-route-table --vpc-id vpc-00c84bd9dcad1d728 --client-token abf653c2-09a2-426d-bd2d-acaac0c98a28
{
"RouteTable": {
"Associations": [],
"PropagatingVgws": [],
"RouteTableId": "rtb-0899b6226d3a3ef9a",
"Routes": [
{
"DestinationCidrBlock": "172.31.0.0/16",
"GatewayId": "local",
"Origin": "CreateRouteTable",
"State": "active"
}
],
"Tags": [],
"VpcId": "vpc-00c84bd9dcad1d728",
"OwnerId": "141035231386"
},
"ClientToken": "abf653c2-09a2-426d-bd2d-acaac0c98a28"
}
IdempotentParameterMismatch
error.1
2
3
abhijit@AwsJunkie:~$ aws ec2 create-route-table --vpc-id vpc-03683f950edba6643 --client-token abf653c2-09a2-426d-bd2d-acaac0c98a28
An error occurred (IdempotentParameterMismatch) when calling the CreateRouteTable operation: Wrong arguments for request with token abf653c2-09a2-426d-bd2d-acaac0c98a28