Created
January 29, 2018 20:40
-
-
Save dfrankel33/fd1642297db97573fa0a884ddbc73d32 to your computer and use it in GitHub Desktop.
RCL definition to create a VPC Route where a NAT Gateway is the next hop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define create_nat_route($route_table_id, $nat_gateway_id, $region) return $response do | |
$response = http_request( | |
host: "ec2."+$region+".amazonaws.com/?Action=CreateRoute&DestinationCidrBlock=0.0.0.0/0&RouteTableId="+$route_table_id+"&NatGatewayId="+$nat_gateway_id+"&Version=2016-11-15", | |
https: true, | |
verb: "post", | |
signature: {"type": "aws"} | |
) | |
end | |
# Example: | |
# provision(@route_table) #rs_cm.route_table | |
# provision(@nat_gateway) #rs_aws_vpc.nat_gateway | |
# call create_nat_route(@route_table.resource_uid, @nat_gateway.natGatewayId, "us-west-1") retrieve $nat_route_response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment