简体   繁体   English

我是否需要为此 cloudformation yaml 文件创建一个单独的网络堆栈才能工作?

[英]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.

相关问题 无法创建 AWS CloudFormation 堆栈 - Unable to create AWS CloudFormation stack 如何删除正在使用导出的 CloudFormation 堆栈? - How do I delete a CloudFormation Stack that has Exports in use? 如何在 Cloudformation 中为 DocumentDB 创建 CloudWatch 警报 - How do I create CloudWatch Alarms for DocumentDB in Cloudformation CloudFormation 堆栈卡在“正在创建”中 - CloudFormation stack stuck in 'Create-In'Progress' AWS CloudFormation create-stack 命令导致未创建堆栈 - AWS CloudFormation create-stack command results in no stack created 如何通过 CloudFormation 将堆栈导出的现有 S3 存储桶导入另一个堆栈 YAML - How to import an existing S3 bucket exported by a stack, into another stack via CloudFormation YAML Cloudformation YAML 自定义变量 - Cloudformation YAML custom variable 如何在现有 su.net 或我创建的 su.net 模板中指定 su.netID? - How do I specify subnetID in cloudformation template, either from existing subnet or one that I create? AWS CloudFormation 无法使用 CodeDeploy 蓝/绿部署创建堆栈 - AWS CloudFormation cannot create Stack using CodeDeploy blue/green deployments 如何使用 lambda 删除和重新创建 CDK 堆栈 (Cloudformation)? - How can I delete and recreate a CDK Stack (Cloudformation) using a lambda?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM