今日会把架构上的剩下服务讲完。
NACL这边使用预设的,就不用在YAML特别撰写。
Route table的设定以下会用到
routeTableName:
Type: AWS::EC2::RouteTable
Properties:
VpcId: !Ref myVPC
Tags:
- Key: itdemo-rt-cf
Value: v1
routeName:
Type: AWS::EC2::Route
Properties:
RouteTableId: !Ref routeTableName
DestinationCidrBlock: 0.0.0.0/0
GatewayId: !Ref igwName
routeTableAssocName:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
SubnetId: !Ref subnetName
RouteTableId: !Ref routeTableName
DestinationCidrBlock: 0.0.0.0/0,外网为最终目的地。
Internet gateway的设定以下会用到
igwName:
Type: AWS::EC2::InternetGateway
Properties:
Tags:
- Key: itdemo-igw-cf
Value: v1
AttachGateway:
Type: AWS::EC2::VPCGatewayAttachment
Properties:
VpcId: !Ref myVPC
InternetGatewayId: !Ref igwName
整个YAML档如下:
Resources:
myVPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
EnableDnsSupport: true
EnableDnsHostnames: true
Tags:
- Key: itdemo-vpc-cf
Value: v1
subnetName:
Type: AWS::EC2::Subnet
Properties:
AvailabilityZone: us-east-2a
VpcId: !Ref myVPC
CidrBlock: 10.0.0.0/24
MapPublicIpOnLaunch: true
Tags:
- Key: itdemo-subnet-cf
Value: v1
igwName:
Type: AWS::EC2::InternetGateway
Properties:
Tags:
- Key: itdemo-igw-cf
Value: v1
AttachGateway:
Type: AWS::EC2::VPCGatewayAttachment
Properties:
VpcId: !Ref myVPC
InternetGatewayId: !Ref igwName
routeTableName:
Type: AWS::EC2::RouteTable
Properties:
VpcId: !Ref myVPC
Tags:
- Key: itdemo-rt-cf
Value: v1
routeName:
Type: AWS::EC2::Route
Properties:
RouteTableId: !Ref routeTableName
DestinationCidrBlock: 0.0.0.0/0
GatewayId: !Ref igwName
routeTableAssocName:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
SubnetId: !Ref subnetName
RouteTableId: !Ref routeTableName
secGroupName:
Type: AWS::EC2::SecurityGroup
Properties:
GroupName: itdemo-sg
GroupDescription: it 30 days demo
VpcId: !Ref myVPC
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 80
ToPort: 80
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: 22
ToPort: 22
CidrIp: 0.0.0.0/0
Tags:
- Key: itdemo-sg-cf
Value: v1
myEC2Instance:
Type: AWS::EC2::Instance
Properties:
BlockDeviceMappings:
- DeviceName: "/dev/xvda"
Ebs:
VolumeSize: 30
VolumeType: gp3
KeyName: "itdemo"
SubnetId: !Ref subnetName
DisableApiTermination: false
ImageId: ami-0443305dabd4be2bc
InstanceType: "t3.micro"
SecurityGroupIds:
- !Ref secGroupName
UserData: !Base64 |
#!/bin/bash -ex
# put your script here
Tags:
- Key: itdemo-ec2-cf
Value: v1
CloudFormation建置环境步骤:
<<: 【Day 13】Array - Practice 1
>>: [Day 12 - Bootstrap] Bootstrap一下,快速建立响应式网站
首先先更新登入的部分,之後会需要登入凭证,这边的一些变数可以再利用 然後是网格交易策略那边,一些参数...
因应各国个资保护法如雨後春笋般出现,在2C市场上不单单只有眼前的利益营收,更要有一套完善的隐私保护的...
hi!今天要介绍mapping!其实mapping很像一个hash table,有很多时候都会有一...
前言 注意力机制让预测目标单词之前比较其与所有来源单词(在翻译任务中精确地来说是词向量)之间的语意关...
记忆大考验 教学原文参考:记忆大考验 这篇文章会使用「阵列」积木,建立两组灯号数据,搭配「函式」、「...