- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 AWS 上启动堆栈并收到错误时遇到错误:
The subnet ID '10.0.4.0/24' is malformed (Service: AmazonEC2; Status Code: 400)
这是我的堆栈:
Parameters:
KeyName:
Description: Nom de la paire de cle pour l'acces aux instances EC2 via SSH
Type: 'AWS::EC2::KeyPair::KeyName'
Default: 'CLEAWS'
LanIPPub:
Description: Adresse IP publique de l'entreprise
Type: String
Default: '82.64.110.122'
LanNetwork:
Description: Adresse du reseau local de l'entreprise a joindre via le VPN (CIDR Block)
Type: String
Default: '192.168.0.0/24'
VPCAddress:
Description: Adresse du VPC a creer (CIDR Block)
Type: String
Default: '10.0.0.0/16'
PrivateNetwork:
Description: Adresse du sous-reseau prive a creer (CIDR Block)
Type: String
Default: '10.0.1.0/24'
PublicNetwork:
Description: Adresse du sous-reseau public a creer (CIDR Block)
Type: String
Default: '10.0.4.0/24'
AMIID:
Description: ID de l'instance EC2 (AMI) a creer pour l'intranet
Type: String
Default: 'ami-0c6ebbd55ab05f070'
IPIntranet:
Description: IP a definir pour l'instance intranet situee dans le subnet prive
Type: String
Default: '172.32.1.80'
Resources:
VPC:
Type: 'AWS::EC2::VPC'
Properties:
CidrBlock: !Ref VPCAddress
EnableDnsHostnames: true
EnableDnsSupport: true
Tags:
- Key: Name
Value: 'vpc-infra'
PrivateSubnet:
Type: 'AWS::EC2::Subnet'
Properties:
VpcId:
Ref: VPC
AvailabilityZone: eu-west-3c
CidrBlock: !Ref PrivateNetwork
Tags:
- Key: Name
Value: 'sub-priv-infra'
InternetGateway:
Type: AWS::EC2::InternetGateway
Properties:
Tags:
- Key: Name
Value: 'infra-igw'
AttachInternetGateway:
Type: 'AWS::EC2::VPCGatewayAttachment'
Properties:
VpcId: !Ref VPC
InternetGatewayId: !Ref InternetGateway
NatEip:
Type: AWS::EC2::EIP
Properties:
Domain: vpc
NatGateway:
DependsOn: AttachInternetGateway
Type: AWS::EC2::NatGateway
Properties:
AllocationId: !GetAtt NatEip.AllocationId
SubnetId: !Ref PublicNetwork
Tags:
- Key: Name
Value: 'infra-gwnat'
RouteTablePrivateSubnet:
Type: 'AWS::EC2::RouteTable'
Properties:
VpcId: !Ref VPC
Tags:
- Key: Name
Value: 'infra-route-pv-sub'
RoutePrivateSubnetVPNAccess:
Type: AWS::EC2::Route
Properties:
RouteTableId: !Ref RouteTablePrivateSubnet
DestinationCidrBlock: !Ref LanNetwork
GatewayId: !Ref VPNGateway
DependsOn: AttachVpnGateway
RoutePrivateSubnetWanAccess:
Type: AWS::EC2::Route
Properties:
RouteTableId: !Ref RouteTablePrivateSubnet
DestinationCidrBlock: 0.0.0.0/0
NatGatewayId: !Ref NatGateway
DependsOn: NatEip
PrivateSubnetRouteTableAssociation:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
SubnetId: !Ref PrivateSubnet
RouteTableId: !Ref RouteTablePrivateSubnet
DependsOn:
- PrivateSubnet
- RouteTablePrivateSubnet
SecGrpPriv:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: HTTP and SSH
SecurityGroupIngress:
- IpProtocol: icmp
FromPort: -1
ToPort: -1
CidrIp: !Ref LanNetwork
- IpProtocol: tcp
FromPort: 22
ToPort: 22
CidrIp: !Ref LanNetwork
- IpProtocol: tcp
FromPort: 80
ToPort: 80
CidrIp: !Ref LanNetwork
VpcId: !Ref VPC
Tags:
- Key: Name
Value: infra-grp-sec-priv
CustomerGateway:
Type: AWS::EC2::CustomerGateway
Properties:
Type: ipsec.1
BgpAsn: 65000
IpAddress: !Ref LanIPPub
Tags:
- Key: Name
Value: lan-gw
VPNGateway:
Type: AWS::EC2::VPNGateway
Properties:
Type: ipsec.1
Tags:
- Key: Name
Value: vpn-gw
AttachVpnGateway:
Type: AWS::EC2::VPCGatewayAttachment
Properties:
VpcId: !Ref VPC
VpnGatewayId: !Ref VPNGateway
VPNConnection:
Type: AWS::EC2::VPNConnection
Properties:
Type: ipsec.1
StaticRoutesOnly: true
CustomerGatewayId: !Ref CustomerGateway
VpnGatewayId: !Ref VPNGateway
Tags:
- Key: Name
Value: vpn-aws-to-lan
ConnectionRoute:
Type: AWS::EC2::VPNConnectionRoute
Properties:
DestinationCidrBlock: !Ref LanNetwork
VpnConnectionId: !Ref VPNConnection
IntranetEC2:
Type: AWS::EC2::Instance
DependsOn: ConnectionRoute
Properties:
ImageId: !Ref AMIID
InstanceType: t2.micro
PrivateIpAddress: !Ref IPIntranet
KeyName: !Ref KeyName
SubnetId: !Ref PrivateSubnet
SecurityGroupIds:
- !Ref SecGrpPriv
UserData:
Fn::Base64:
!Sub |
#!/bin/bash
sudo su apt-get update && apt-get upgrade -y
<!-- end snippet -->
AMIID:
Description: ID de l'instance EC2 (AMI) a creer pour l'intranet
Type: String
Default: 'ami-0c6ebbd55ab05f070'
IPIntranet:
Description: IP a definir pour l'instance intranet situee dans le subnet prive
Type: String
Default: '172.32.1.80'
Resources:
VPC:
Type: 'AWS::EC2::VPC'
Properties:
CidrBlock: !Ref VPCAddress
EnableDnsHostnames: true
EnableDnsSupport: true
Tags:
- Key: Name
Value: 'vpc-infra'
PrivateSubnet:
Type: 'AWS::EC2::Subnet'
Properties:
VpcId:
Ref: VPC
AvailabilityZone: eu-west-3c
CidrBlock: !Ref PrivateNetwork
Tags:
- Key: Name
Value: 'sub-priv-infra'
InternetGateway:
Type: AWS::EC2::InternetGateway
Properties:
Tags:
- Key: Name
Value: 'infra-igw'
AttachInternetGateway:
Type: 'AWS::EC2::VPCGatewayAttachment'
Properties:
VpcId: !Ref VPC
InternetGatewayId: !Ref InternetGateway
NatEip:
Type: AWS::EC2::EIP
Properties:
Domain: vpc
NatGateway:
DependsOn: AttachInternetGateway
Type: AWS::EC2::NatGateway
Properties:
AllocationId: !GetAtt NatEip.AllocationId
SubnetId: !Ref PublicNetwork
Tags:
- Key: Name
Value: 'infra-gwnat'
RouteTablePrivateSubnet:
Type: 'AWS::EC2::RouteTable'
Properties:
VpcId: !Ref VPC
Tags:
- Key: Name
Value: 'infra-route-pv-sub'
RoutePrivateSubnetVPNAccess:
Type: AWS::EC2::Route
Properties:
RouteTableId: !Ref RouteTablePrivateSubnet
DestinationCidrBlock: !Ref LanNetwork
GatewayId: !Ref VPNGateway
DependsOn: AttachVpnGateway
RoutePrivateSubnetWanAccess:
Type: AWS::EC2::Route
Properties:
RouteTableId: !Ref RouteTablePrivateSubnet
DestinationCidrBlock: 0.0.0.0/0
NatGatewayId: !Ref NatGateway
DependsOn: NatEip
PrivateSubnetRouteTableAssociation:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
SubnetId: !Ref PrivateSubnet
RouteTableId: !Ref RouteTablePrivateSubnet
DependsOn:
- PrivateSubnet
- RouteTablePrivateSubnet
SecGrpPriv:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: HTTP and SSH
SecurityGroupIngress:
- IpProtocol: icmp
FromPort: -1
ToPort: -1
CidrIp: !Ref LanNetwork
- IpProtocol: tcp
FromPort: 22
ToPort: 22
CidrIp: !Ref LanNetwork
- IpProtocol: tcp
FromPort: 80
ToPort: 80
CidrIp: !Ref LanNetwork
VpcId: !Ref VPC
Tags:
- Key: Name
Value: infra-grp-sec-priv
CustomerGateway:
Type: AWS::EC2::CustomerGateway
Properties:
Type: ipsec.1
BgpAsn: 65000
IpAddress: !Ref LanIPPub
Tags:
- Key: Name
Value: lan-gw
VPNGateway:
Type: AWS::EC2::VPNGateway
Properties:
Type: ipsec.1
Tags:
- Key: Name
Value: vpn-gw
AttachVpnGateway:
Type: AWS::EC2::VPCGatewayAttachment
Properties:
VpcId: !Ref VPC
VpnGatewayId: !Ref VPNGateway
VPNConnection:
Type: AWS::EC2::VPNConnection
Properties:
Type: ipsec.1
StaticRoutesOnly: true
CustomerGatewayId: !Ref CustomerGateway
VpnGatewayId: !Ref VPNGateway
Tags:
- Key: Name
Value: vpn-aws-to-lan
ConnectionRoute:
Type: AWS::EC2::VPNConnectionRoute
Properties:
DestinationCidrBlock: !Ref LanNetwork
VpnConnectionId: !Ref VPNConnection
IntranetEC2:
Type: AWS::EC2::Instance
DependsOn: ConnectionRoute
Properties:
ImageId: !Ref AMIID
InstanceType: t2.micro
PrivateIpAddress: !Ref IPIntranet
KeyName: !Ref KeyName
SubnetId: !Ref PrivateSubnet
SecurityGroupIds:
- !Ref SecGrpPriv
UserData:
Fn::Base64:
!Sub |
#!/bin/bash
sudo su apt-get update && apt-get upgrade -y
你能帮我一下吗?谢谢
最佳答案
这不是子网 ID,而是子网的 CIDR block 。您应该使用对 PublicSubnet
的引用,而不是 PublicNetwork
。
关于amazon-web-services - 子网 ID '10.0.4.0/24' 格式错误(服务 : AmazonEC2; Status Code: 400),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71227352/
因此,AWS 中私有(private)子网的目的是使其实例无法从外部世界直接访问。然而,在某些情况下(成功地抵制了“实例”双关语),实例访问互联网很有用。例如,一种这样的用例可能是下载软件更新。 实现
我已经退出虚拟机,我需要更改该虚拟机的虚拟网络/子网。我没有找到任何可以更改的选项,请帮助我。谢谢..! 最佳答案 据我所知,当在 VNet 中创建 NIC 时,它就无法再移动到另一个 VNet。因此
我想导出一些内容,例如 VNET 中存在的子网 View (如门户中显示的那样)。不幸的是,没有选项可以将其导出为 CSV。我在网上找到了可以导出子网路由表和关联子网的 powershell 脚本。我
我的虚拟网络具有以下子网 10.0.0.0/24,我想添加另一个子网,但每次尝试时都会得到:“您的子网不包含在该虚拟网络的同一地址空间内” 如何添加另一个子网? 最佳答案 您可以在虚拟网络中添加子网,
我有 ip 地址列表作为字符串,但该列表中也有一些子网。例如: ...127.0.0.1(这是ip)127.0.0.1/24(这是子网)... 我想检查哪个是ip,哪个是子网。到目前为止我可以过滤 i
我正在尝试使用 ARM 模板部署 Azure 防火墙。该模板在首次部署期间工作正常,并在现有虚拟网络中创建一个子网(根据需要命名为 AzureFirewallSubnet)以及具有公共(public)
我正在尝试使用 ARM 模板部署 Azure 防火墙。该模板在首次部署期间工作正常,并在现有虚拟网络中创建一个子网(根据需要命名为 AzureFirewallSubnet)以及具有公共(public)
我正在尝试编写一个脚本,将大于(不大于/16)大于/24 的子网分解为/24 子网。例如:10.10.10.0/23 应该给我 10.10.10.0/24 和 10.10.11.0/24 我的逻辑是首
我在 Azure VNet 中有两台虚拟机(IP 地址 10.1.0.4 和 10.1.0.5),以及一台通过 VPN 网关连接到 VNet 的计算机(IP 10.3.0.2)。是否可以在内部负载均衡
错误消息 执行terraform apply时收到以下错误消息: 错误:创建/更新虚拟网络“CTI-NETWORK”(资源组“CTI-RESOURCES”)时出错:network.VirtualNet
我无法从不再使用的 VNet 中删除“默认”子网。错误是:“子网默认值由/subscriptions/{guid}/resourceGroups/mpi-prod-westeurope-rg/prov
我在使用 docker-compose 时遇到问题。目前,我的容器堆栈是在它们自己定制的、基于桥接的隔离网络中创建的。 例如当运行 docker-compose -p client1 up -d 时,
我无法从不再使用的 VNet 中删除“默认”子网。错误是:“子网默认值由/subscriptions/{guid}/resourceGroups/mpi-prod-westeurope-rg/prov
如果文件的一个版本在特定子网中具有接口(interface),我想将其复制到服务器,或者如果在该子网中没有接口(interface),则将文件的一个版本复制到服务器。下面是一个工作,但我认为不是最佳解
我是 terraform 新手,想要更改网络上的子网,但遇到了一个奇怪的错误。谷歌什么也没得到。这是我要输入的内容(更改 main.tf 和运行计划后) terraform apply -replac
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a software
我们有 dbs, basion ..等,总共 10 个东西需要分开。 如果我们将它们中的每一个都放入一个单独的子网中,我们总共有 10 个子网,再加上 1 个用于第二个区域以实现高可用性。因此,我们总
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a software
我们有 dbs, basion ..等,总共 10 个东西需要分开。 如果我们将它们中的每一个都放入一个单独的子网中,我们总共有 10 个子网,再加上 1 个用于第二个区域以实现高可用性。因此,我们总
在 IP 为 145.74.217.109 的机器 A 上运行 ServerSocket 时然后尝试使用 IP 为 145.74.219.103 的机器 B 连接到机器 A,但无法连接。但是当使用 I
我是一名优秀的程序员,十分优秀!