Amazon web services 自动气象站云层

Amazon web services 自动气象站云层,amazon-web-services,amazon-vpc,amazon-cloudformation,infrastructure,Amazon Web Services,Amazon Vpc,Amazon Cloudformation,Infrastructure,嗯,我正试图在AWS中找到一个cloudformation模板 我需要在哪里创建三个VPC,其中包含一个子网和实例。其中您有internetgateway,有两个从vpc到gateway的单向连接和一个双向连接,如下所示: 您可以利用的快速入门,使用样板VPC架构。此AWS支持的模板在每个指定的可用性区域(您提供2-4个可用性区域作为参数)内创建一个包含公用(双向)和专用(单向,仅出站Internet)子网的VPC。我建议从快速入门开始,然后在必要时进行定制,以更好地满足您的特定需求 对于您的用

嗯,我正试图在AWS中找到一个cloudformation模板

我需要在哪里创建三个VPC,其中包含一个子网和实例。其中您有internetgateway,有两个从vpc到gateway的单向连接和一个双向连接,如下所示:

您可以利用的快速入门,使用样板VPC架构。此AWS支持的模板在每个指定的可用性区域(您提供2-4个可用性区域作为参数)内创建一个包含公用(双向)和专用(单向,仅出站Internet)子网的VPC。我建议从快速入门开始,然后在必要时进行定制,以更好地满足您的特定需求

对于您的用例,您可以指定2个可用性区域,然后将每个AZ中的专用子网用于SubnetA和SubnetB,将其中一个AZ中的公用子网用于Subnetetc

注意:我建议反对为一个应用程序创建3个独立的VPC。不同的子网提供了足够的网络隔离,创建3个独立的VPC会复制许多不必要的额外资源,如Internet通道,并且存在一个安全漏洞。)

下面是一个完整的工作示例,它直接将快速入门模板用作:

Description:创建一个包含2个专用子网和1个公用子网的VPC,每个子网中有一个EC2实例。
映射:
区域地图:
us-east-1:
#amzn-ami-hvm-2016.09.1.20161221-x86_64-gp2
“蛋白石”:“ami-9be6f38c”
“rstudio”:“ami-9be6f38c”
参数:
实例类型:
Description:EC2实例类型
类型:字符串
默认值:t2.5
允许值:[t2.nano,t2.micro,t2.small,t2.medium,t2.large,t2.xlarge,t2.2xlarge,
m4.4XL、m4.xlarge、m4.2xlarge、m4.4XL、m4.10xlarge、m4.16xlarge、,
c4.L、c4.xlarge、c4.2XL、c4.4XL、c4.8XL、,
r4.large、r4.xlarge、r4.2xlarge、r4.4xlarge、r4.8xlarge、r4.16xlarge]
ConstraintDescription:请选择有效的实例类型。
可用区域:
描述:VPC中用于子网的2个可用区域列表。
类型:“列表”
KeyPairName:
描述:提供对EC2实例的SSH访问的公钥/私钥对。
类型:“AWS::EC2::KeyPair::KeyName”
资源:
VPCStack:
类型:AWS::CloudFormation::Stack
特性:
TemplateURL:'https://s3.amazonaws.com/quickstart-reference/aws/vpc/latest/templates/aws-vpc.template'
参数:
可用区域:!联接[',',!Ref AvailabilityZones]
键盘名称:!参考键配对名称
人数:2
证券集团:
类型:AWS::EC2::SecurityGroup
特性:
组描述:VPC安全组
VpcId:!GetAtt VPCStack.Outputs.VPCID
OpalServer1:
类型:AWS::EC2::实例
特性:
图像ID:!FindInMap[RegionMap,!Ref“AWS::Region”,蛋白石]
实例类型:!Ref实例类型
SecurityGroupId:[!Ref SecurityGroup]
子网:!GetAtt VPCStack.Outputs.PrivateSubnet1AID
关键字:!参考键配对名称
OpalServer2:
类型:AWS::EC2::实例
特性:
图像ID:!FindInMap[RegionMap,!Ref“AWS::Region”,蛋白石]
实例类型:!Ref实例类型
SecurityGroupId:[!Ref SecurityGroup]
子网:!GetAtt VPCStack.Outputs.PrivateSubnet2AID
关键字:!参考键配对名称
RStudioClient:
类型:AWS::EC2::实例
特性:
图像ID:!FindInMap[RegionMap,!Ref“AWS::Region”,rstudio]
实例类型:!Ref实例类型
SecurityGroupId:[!Ref SecurityGroup]
子网:!GetAtt VPCStack.Outputs.PublicSubnet1ID
关键字:!参考键配对名称
您可以利用的快速启动样板VPC架构。此AWS支持的模板在每个指定的可用性区域(您提供2-4个可用性区域作为参数)内创建一个包含公用(双向)和专用(单向,仅出站Internet)子网的VPC。我建议从快速入门开始,然后在必要时进行定制,以更好地满足您的特定需求

对于您的用例,您可以指定2个可用性区域,然后将每个AZ中的专用子网用于SubnetA和SubnetB,将其中一个AZ中的公用子网用于Subnetetc

注意:我建议反对为一个应用程序创建3个独立的VPC。不同的子网提供了足够的网络隔离,创建3个独立的VPC会复制许多不必要的额外资源,如Internet通道,并且存在一个安全漏洞。)

下面是一个完整的工作示例,它直接将快速入门模板用作:

Description:创建一个包含2个专用子网和1个公用子网的VPC,每个子网中有一个EC2实例。
映射:
区域地图:
us-east-1:
#amzn-ami-hvm-2016.09.1.20161221-x86_64-gp2
“蛋白石”:“ami-9be6f38c”
“rstudio”:“ami-9be6f38c”
参数:
实例类型:
Description:EC2实例类型
类型:字符串
默认值:t2.5
允许值:[t2.nano,t2.micro,t2.small,t2.medium,t2.large,t2.xlarge,t2.2xlarge,
m4.4XL、m4.xlarge、m4.2xlarge、m4.4XL、m4.10xlarge、m4.16xlarge、,
c4.L、c4.xlarge、c4.2XL、c4.4XL、c4.8XL、,
r4.large、r4.xlarge、r4.2xlarge、r4.4xlarge、r4.8xlarge、r4.16xlarge]
ConstraintDescription:请选择有效的实例类型。
可用区域:
描述:VPC中用于子网的2个可用区域列表。
类型:“列表”
KeyPairName:
描述:提供对EC2实例的SSH访问的公钥/私钥对。
类型:“AWS::EC2::KeyPair::KeyName”
资源:
VPCStack:
类型:AWS::CloudFormation::Stack
特性:
TemplateURL:'https://s3.amazonaws.com/quickstart-reference/aws/vpc/latest/templates/aws-vpc.template'
参数:
可用区域:!联接[',',!Ref AvailabilityZones]
键盘名称:!参考键配对名称
人数:2
证券集团
Description: Create a VPC with 2 private and 1 public subnets, with an EC2 instance in each.
Mappings:
  RegionMap:
    us-east-1:
      # amzn-ami-hvm-2016.09.1.20161221-x86_64-gp2
      "opal": "ami-9be6f38c"
      "rstudio": "ami-9be6f38c"
Parameters:
  InstanceType:
    Description: EC2 instance type
    Type: String
    Default: t2.medium
    AllowedValues: [t2.nano, t2.micro, t2.small, t2.medium, t2.large, t2.xlarge, t2.2xlarge,
      m4.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m4.10xlarge, m4.16xlarge,
      c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge,
      r4.large, r4.xlarge, r4.2xlarge, r4.4xlarge, r4.8xlarge, r4.16xlarge]
    ConstraintDescription: Please choose a valid instance type.
  AvailabilityZones:
    Description: List of 2 Availability Zones to use for the subnets in the VPC.
    Type: "List<AWS::EC2::AvailabilityZone::Name>"
  KeyPairName:
    Description: Public/private key pair to provide SSH access to the EC2 instances.
    Type: "AWS::EC2::KeyPair::KeyName"
Resources:
  VPCStack:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: 'https://s3.amazonaws.com/quickstart-reference/aws/vpc/latest/templates/aws-vpc.template'
      Parameters:
        AvailabilityZones: !Join [',', !Ref AvailabilityZones]
        KeyPairName: !Ref KeyPairName
        NumberOfAZs: 2
  SecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: VPC Security Group
      VpcId: !GetAtt VPCStack.Outputs.VPCID
  OpalServer1:
    Type: AWS::EC2::Instance
    Properties:
      ImageId: !FindInMap [ RegionMap, !Ref "AWS::Region", opal]
      InstanceType: !Ref InstanceType
      SecurityGroupIds: [!Ref SecurityGroup]
      SubnetId: !GetAtt VPCStack.Outputs.PrivateSubnet1AID
      KeyName: !Ref KeyPairName
  OpalServer2:
    Type: AWS::EC2::Instance
    Properties:
      ImageId: !FindInMap [ RegionMap, !Ref "AWS::Region", opal]
      InstanceType: !Ref InstanceType
      SecurityGroupIds: [!Ref SecurityGroup]
      SubnetId: !GetAtt VPCStack.Outputs.PrivateSubnet2AID
      KeyName: !Ref KeyPairName
  RStudioClient:
    Type: AWS::EC2::Instance
    Properties:
      ImageId: !FindInMap [ RegionMap, !Ref "AWS::Region", rstudio]
      InstanceType: !Ref InstanceType
      SecurityGroupIds: [!Ref SecurityGroup]
      SubnetId: !GetAtt VPCStack.Outputs.PublicSubnet1ID
      KeyName: !Ref KeyPairName