- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试学习 Aws cloud Formation ,我正在尝试创建 VPC,如图所示。它包含三个公共(public)子网、私有(private)子网、natgateway 和 Internetgateway,以及公共(public)和私有(private)路由表。我试图通过云形成来实现它,但获得弹性 IP 的异常(exception)。 我已经创建了模板,但是当我尝试在云形成上创建堆栈时,我收到错误
"The elastic-ip ID 'xx.xxx.xx.xxx' is malformed (Service: AmazonEC2; Status Code: 400; Error Code: InvalidElasticIpID.Malformed; Request ID: 2e3a9f8c-5a7e-482e-869c-8a0e46a08f27; Proxy: null)"
。我正在尝试将弹性 IP 连接到 NatGateway 并出现上述错误。请指导我该怎么做。
{
{
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"ExampleEc2Instance": {
"Type": "AWS::EC2::Instance",
"Properties": {
"InstanceType": "t2.micro",
"ImageId" : "ami-047a51fa27710816e",
"AvailabilityZone" : "us-east-1a",
"SecurityGroupIds" : [{
"Ref":"ExampleSecurityGroup"
}],
"SubnetId" : {
"Ref":"public2A"
}
}
},"ExampleEc2InstancePrivate": {
"Type": "AWS::EC2::Instance",
"Properties": {
"InstanceType": "t2.micro",
"ImageId" : "ami-047a51fa27710816e",
"AvailabilityZone" : "us-east-1a",
"SecurityGroupIds" : [{
"Ref":"ExampleSecurityGroup"
}],
"SubnetId" : {
"Ref":"private2A"
}
}
},
"public2A":{
"Type" : "AWS::EC2::Subnet",
"Properties":{
"AvailabilityZone" : "us-east-1a",
"CidrBlock" : "10.0.2.0/24",
"Tags" : [{"Key" : "public2A", "Value" : "public2A"}],
"VpcId" : {
"Ref":"ExampleVpcId"
}
}
},"public2B":{
"Type" : "AWS::EC2::Subnet",
"Properties":{
"AvailabilityZone" : "us-east-1a",
"CidrBlock" : "10.0.3.0/24",
"Tags" : [{"Key" : "public2B", "Value" : "public2B"}],
"VpcId" : {
"Ref":"ExampleVpcId"
}
}
},
"public2C":{
"Type" : "AWS::EC2::Subnet",
"Properties":{
"AvailabilityZone" : "us-east-1a",
"CidrBlock" : "10.0.1.0/24",
"Tags" : [{"Key" : "public2C", "Value" : "public2C"}],
"VpcId" : {
"Ref":"ExampleVpcId"
}
}
},"private2A":{
"Type" : "AWS::EC2::Subnet",
"Properties":{
"AvailabilityZone" : "us-east-1a",
"CidrBlock" : "10.0.5.0/24",
"Tags" : [{"Key" : "private2A", "Value" : "private2A"}],
"VpcId" : {
"Ref":"ExampleVpcId"
}
}
},"private2B":{
"Type" : "AWS::EC2::Subnet",
"Properties":{
"AvailabilityZone" : "us-east-1a",
"CidrBlock" : "10.0.6.0/24",
"Tags" : [{"Key" : "private2B", "Value" : "private2B"}],
"VpcId" : {
"Ref":"ExampleVpcId"
}
}
},
"private2C":{
"Type" : "AWS::EC2::Subnet",
"Properties":{
"AvailabilityZone" : "us-east-1a",
"CidrBlock" : "10.0.7.0/24",
"Tags" : [{"Key" : "private2C", "Value" : "private2C"}],
"VpcId" : {
"Ref":"ExampleVpcId"
}
}
},
"privateRT":{
"Type" : "AWS::EC2::RouteTable",
"Properties" : {
"Tags" : [{"Key" : "privateRT", "Value" : "privateRT"}],
"VpcId" : {
"Ref":"ExampleVpcId"
}
}
},
"publicRT":{
"Type" : "AWS::EC2::RouteTable",
"Properties" : {
"Tags" : [{"Key" : "publicRT", "Value" : "publicRT"}],
"VpcId" : {
"Ref":"ExampleVpcId"
}
}
},
"public2ARouteTableAssociation" : {
"Type" : "AWS::EC2::SubnetRouteTableAssociation",
"Properties" : {
"SubnetId" : { "Ref" : "public2A" },
"RouteTableId" : { "Ref" : "publicRT" }
}
},
"public2BRouteTableAssociation" : {
"Type" : "AWS::EC2::SubnetRouteTableAssociation",
"Properties" : {
"SubnetId" : { "Ref" : "public2B" },
"RouteTableId" : { "Ref" : "publicRT" }
}
},
"public2CRouteTableAssociation" : {
"Type" : "AWS::EC2::SubnetRouteTableAssociation",
"Properties" : {
"SubnetId" : { "Ref" : "public2C" },
"RouteTableId" : { "Ref" : "publicRT" }
}
},
"private2ARouteTableAssociation" : {
"Type" : "AWS::EC2::SubnetRouteTableAssociation",
"Properties" : {
"SubnetId" : { "Ref" : "private2A" },
"RouteTableId" : { "Ref" : "privateRT" }
}
},
"private2BRouteTableAssociation" : {
"Type" : "AWS::EC2::SubnetRouteTableAssociation",
"Properties" : {
"SubnetId" : { "Ref" : "private2B" },
"RouteTableId" : { "Ref" : "privateRT" }
}
},
"private2CRouteTableAssociation" : {
"Type" : "AWS::EC2::SubnetRouteTableAssociation",
"Properties" : {
"SubnetId" : { "Ref" : "private2C" },
"RouteTableId" : { "Ref" : "privateRT" }
}
},
"myVpcInternetGateWay":{
"Type" : "AWS::EC2::InternetGateway",
"Properties" : {
"Tags" : [{"Key" : "myVpcInternetGateWay", "Value" : "myVpcInternetGateWay"}]
}
},
"myVpcInternetGateWayRoute":{
"Type" : "AWS::EC2::Route",
"Properties" : {
"DestinationCidrBlock" : "0.0.0.0/0",
"GatewayId" : {"Ref":"myVpcInternetGateWay"},
"RouteTableId" : {"Ref":"publicRT"}
}
},
"myVpcInternetGateWayAttachement":{
"Type" : "AWS::EC2::VPCGatewayAttachment",
"Properties" : {
"InternetGatewayId" : {"Ref":"myVpcInternetGateWay"},
"VpcId" : {"Ref":"ExampleVpcId"}
}
},
"myNatGateWay":{
"Type" : "AWS::EC2::NatGateway",
"Properties" : {
"AllocationId" : {"Ref":"myElasticIP"},
"SubnetId" :{"Ref":"public2A"},
"Tags" : [{"Key" : "myNatGateWay", "Value" : "myNatGateWay"}]
}
},"myVpcNatGatWayRoute":{
"Type" : "AWS::EC2::Route",
"Properties" : {
"DestinationCidrBlock" : "0.0.0.0/0",
"GatewayId" : {"Ref":"myNatGateWay"},
"RouteTableId" : {"Ref":"privateRT"}
}
},
"myElasticIP":{
"Type" : "AWS::EC2::EIP",
"Properties" : {
"Domain" : "VPC",
"Tags" : [{"Key" : "myElasticIP", "Value" : "myElasticIP"}]
}
},
"ExampleSecurityGroup":{
"Type":"AWS::EC2::SecurityGroup",
"Properties" : {
"GroupDescription" : "Allow http to client host",
"GroupName" : "templateSecuritygrp",
"Tags" : [ {"Key" : "securityGroup", "Value" : "cloudformationSecurityGroup"} ],
"VpcId" : {
"Ref":"ExampleVpcId"
}
}
},
"ExampleSecurityGroupEgress" : {
"Type":"AWS::EC2::SecurityGroupEgress",
"Properties":{
"IpProtocol":"-1",
"FromPort":"-1",
"ToPort":"-1",
"DestinationSecurityGroupId":{
"Ref":"ExampleSecurityGroup"
},
"GroupId":{
"Ref":"ExampleSecurityGroup"
}
}
},
"ExampleSecurityGroupIngress" :{
"Type":"AWS::EC2::SecurityGroupIngress",
"Properties":{
"IpProtocol":"-1",
"FromPort":"-1",
"ToPort":"-1",
"SourceSecurityGroupId":{
"Ref":"ExampleSecurityGroup"
},
"GroupId":{
"Ref":"ExampleSecurityGroup"
}
}
},
"ExampleVpcId":{
"Type":"AWS::EC2::VPC",
"Properties" : {
"CidrBlock" : "10.0.0.0/16",
"EnableDnsSupport" : "false",
"EnableDnsHostnames" : "false",
"InstanceTenancy" : "default",
"Tags" : [ {"Key" : "tmpltVPC", "Value" : "firstVpc"}]
}
}
}
}
}
最佳答案
在您的myNatGateWay
中,您应该使用GetAtt
来获取AllocationId
:
"myNatGateWay":{
"Type" : "AWS::EC2::NatGateway",
"Properties" : {
"AllocationId" : { "Fn::GetAtt" : ["myElasticIP", "AllocationId"]},
"SubnetId" :{"Ref":"public2A"},
"Tags" : [{"Key" : "myNatGateWay", "Value" : "myNatGateWay"}]
}
}
您还需要DependsOn在EIP中:
"myElasticIP":{
"Type" : "AWS::EC2::EIP",
"DependsOn":["myVpcInternetGateWayAttachement"] ,
"Properties" : {
"Domain" : "VPC",
"Tags" : [{"Key" : "myElasticIP", "Value" : "myElasticIP"}]
}
}
最后myVpcNatGatWayRoute
应该是:
"myVpcNatGatWayRoute":{
"Type" : "AWS::EC2::Route",
"Properties" : {
"DestinationCidrBlock" : "0.0.0.0/0",
"NatGatewayId" : {"Ref":"myNatGateWay"},
"RouteTableId" : {"Ref":"privateRT"}
}
}
关于amazon-web-services - 如何通过 Cloudformation 将弹性 IP 连接到 Nat 网关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66131377/
我考虑创建一个基于 NATS 的新解决方案,目前只剩下两个悬而未决的问题。在我的场景中,我需要客户端向服务器进行身份验证,以及可能的机制 user+pass、token 和 JWT 我想使用 toke
我需要在我的程序中以编程方式确定路由器 NAT 类型。我确实查看了一些与 STUN 相关的答案和关于 SO 的 UPnP 相关信息。但没有得到任何确定的答案。 我查看了 STUN RFC (rfc 5
以下两个命题很容易证明。 Theorem nat_eq_nat : nat = nat. Proof. trivial. Qed. Theorem True_neq_False : ~(True
如果我要求 gethostbyaddr() 查找 NAT 生成的 IP 地址,例如 192.168.0.4,我应该期望它起作用吗? 背景:我正在家里对一些用于网络环境的控制代码进行测试。有时,此代码会
我正在尝试使多层 NAT 后面的(apache)服务器可以从 Internet 访问。 限制: 避免中继。有一个公共(public)服务器(我们称他为 OldMan)用于登录/眩晕,但它的带宽太差,无
在 OCaml 中使用类型级算法,很容易定义一个函数,该函数的 nat 值高于特定值: let f : 'a succ nat -> string = function _ -> "hej" f Ze
我正在寻找一种方法来显示操作期间 NATS 流服务器上当前存在的所有主题。已经彻底查看了文档,但到目前为止还没有找到提及。 有没有办法找到可以在服务器上订阅的所有可用主题的列表? 最佳答案 我刚刚合并
我发现:“唯一需要 TURN 的情况是当其中一个对等点位于对称 NAT 后面,而另一个对等点位于对称 NAT 或端口限制 NAT 后面时。”那么,对称 NAT 后面的对等点如何连接后面的另一个点(例如
我的数据框是 time NTCS001G002 NTCS001W005 0 2013-05-30 23:00:00 NaN NaN 1 2013-06-30
我的问题是我需要增加 NATS 收到的 max_payload 值,但我不知道我可以在哪里做。 该项目正在使用 Moleculer,NATS 被创建为带有 docker 的容器。 当我尝试发出大于 1
我正在尝试调试一个问题,我了解 VirtualBox 中的 NAT 网络适配器与 VMWare Fusion 中的 NAT 网络适配器之间的区别。到目前为止,我可以配置 VMWare 并实现我想要的结
是否可以向 nat 后面的主机发送回显请求 后。所有的 echo-request 都不包含目标主机的端口,因此如果有多个主机使用相同的外部 ip 地址,nat 将如何将 echo-reques
是否有任何工具可用于监控通过 NATS 队列发布的实际消息?对于演示文稿,我需要显示通过微服务架构显示的消息,最好通过现有解决方案来实现,而不是自己编写一个。 我现在有 Natsboard ( htt
根据维基百科文章 Micro Transport Protocol支持使用UDP打洞的NAT穿越。但是看着libutp's project page我在头文件中找不到任何这样的引用。我错过了一些明显的
我在网上查了一下,我发现的所有内容都显示了如何创建一个单独的服务器来连接到位于 nat 或防火墙后面的主服务器。 但在我的例子中,客户端位于 NAT 后面,服务器位于本地网络上。 所以它的设置有点像下
我已经在我的 Windows 机器上启动并运行了带 docker 的 NATS 服务器。 我也想在我的 Windows 机器上安装 nats CLI 工具。 文档中只提到了 Mac 和 Linux。
我已经安装了 Asterisk 11 并出现了这个错误。我更改了 sip.conf 并且仍然在 Asterisk Debug模式下看到错误日志。 Asterisk 日志 [Apr 16 20:43:0
我有以下 Cloud Formation 配置,其中包括子网、路由表/路由、nat 网关和弹性 IP: lambdaPointToIgwStaging: Type: 'AWS::EC2::
我在私有(private)子网中的 aws 上使用 Kops 创建了一个 kubernetes 集群。 当使用 NAT 网关作为集群中的导出点时,一切正常。但是,当我尝试将 NAT 实例部署为集群中的
配置LVS-NAT模式 由于我们要进行LVS-NAT模式集群搭建。首先在VMware中添加两个虚拟网段 VMnet2:做内网的网段 VMnet4:做外网的网段 然后
我是一名优秀的程序员,十分优秀!