[英]Do I need to create a seperate network stack for this cloudformation yaml file to work?
so I am tring to create Fargate instances into su.nets using cloudformation.所以我尝试使用 cloudformation 将 Fargate 实例创建到 su.nets 中。 I would like the user to be able to choose which vpc id, su.net ids to launch their Fargate instances into which I use as a parameter like this:
我希望用户能够选择哪个 vpc id、su.net id 来启动他们的 Fargate 实例,我将其用作参数,如下所示:
Parameters:
VPCSubnets:
Type: List<AWS::EC2::Subnet::Id>
Description: Provide the subnets you wish to deploy into.
VPCInformation:
Type: AWS::EC2::VPC::Id
Description: Provide the VPC ID that resources will be deployed into.
this information is used for the.network settings for ECS and task definitions.此信息用于 ECS 和任务定义的网络设置。 If I create.network resouces just below parameters like this:
如果我 create.network resouces 就在参数下面,如下所示:
for example:例如:
MyVpc:
Type: AWS::EC2::VPC
Description: VPC for the cluster and fargate instances
Properties:
CidrBlock: 10.0.0.0/26
EnableDnsSupport: true
EnableDnsHostnames: true
Tags:
- Key: interviewchallenge-vpc
Value: !Join ['', [!Ref "AWS::Region", "conversion-challenge-VPC" ]]
PublicSubnet1:
Type: AWS::EC2::Subnet
Properties:
VpcId:
Ref: myVPC
CidrBlock: 10.0.0.0/28
AvailabilityZone: "us-east-1a"
Tags:
- Key: interviewchallenge-vpc-subnet1
Value: !Join ['', [!Ref "AWS::Region", "conversion-challenge-az1" ]]
At this point in the template, these.network resouces havent been created right?此时在模板中,这些.network 资源还没有创建,对吗? Can this be done in a single stack??
这可以在一个堆栈中完成吗?
Can this be done in a single stack??
这可以在一个堆栈中完成吗?
No. You need two templates and the corresponding stacks.不,您需要两个模板和相应的堆栈。 The first template creates VPC, su.nets and the remaining.network resources.
第一个模板创建 VPC、su.nets 和 remaining.network 资源。 Then in the second stack, you use them in for ECS deployment.
然后在第二个堆栈中,您将它们用于 ECS 部署。
Only this way your user will be able to choose the VPC and su.nets when creating the ECS stack.只有这样,您的用户才能在创建 ECS 堆栈时选择 VPC 和 su.net。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.