Replies: 1 comment 1 reply
-
Hello, self.internet_gateway = ec2.CfnInternetGateway(self, "InternetGateway")
ec2.CfnRoute(
self,
"InternetRoute",
route_table_id=self.route_table.attr_route_table_id,
destination_cidr_block="0.0.0.0/0",
gateway_id=self.internet_gateway.ref,
) or self.internet_gateway = ec2.CfnInternetGateway(self, "InternetGateway")
ec2.CfnRoute(
self,
"InternetRoute",
route_table_id=self.route_table.attr_route_table_id,
destination_cidr_block="0.0.0.0/0",
gateway_id=self.internet_gateway.attr_internet_gateway_id,
) In CDK, there are construct levels. You are using Level 1, so you need to use it similarly to raw CloudFormation. To pass attributes like resource IDs that you've created, you need to use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I'm trying to deploy a side project cheaply and found this post by Aidan Steele on his blog called Cheap serverless containers using API Gateway in which he outlines how to deploy an ECS service/task without using an ALB, which are pricy. He provides 2 complete Cloudformation templates which I'm trying to convert into CDK. Here is what I have so far
But i get unsure of myself when we get into the
ec2.CfnRouteTable
andCfn*
in general as this is sort of stuff I usually rely on CDK for (and permissions). This is failing because theCfnRoute
wants agateway_id
not an actualCfnInternetGateway
... but I get the feeling I should be using something fromaws_apigatewayv2
here?Anyway, if anyone has some tips as to how to make this more high level, its be much appreciated,
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions