- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在部署 AWS CloudFormation 模板。在我的模板中,我引用一个安全组中的另一个安全组。但部署失败。
这是我的模板。
AWSTemplateFormatVersion: '2010-09-09'
Description: "Simple 3 tier web application template"
Parameters:
KeyName:
Default: 'MyanEat'
Type: String
VpcCidr:
Default: '10.1.0.0/16'
Type: String
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
InstanceType:
Default: 't2.micro'
Type: String
SSHLocation:
Description: The IP address range that can be used to SSH to the EC2 instances
Type: String
MinLength: '9'
MaxLength: '18'
Default: 0.0.0.0/0
AllowedPattern: "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})"
ConstraintDescription: Must be a valid IP CIDR range of the form x.x.x.x/x
Mappings:
AWSInstanceType2Arch:
t1.micro:
Arch: HVM64
t2.nano:
Arch: HVM64
t2.micro:
Arch: HVM64
t2.small:
Arch: HVM64
t2.medium:
Arch: HVM64
t2.large:
Arch: HVM64
m1.small:
Arch: HVM64
m1.medium:
Arch: HVM64
m1.large:
Arch: HVM64
m1.xlarge:
Arch: HVM64
m2.xlarge:
Arch: HVM64
m2.2xlarge:
Arch: HVM64
m2.4xlarge:
Arch: HVM64
m3.medium:
Arch: HVM64
m3.large:
Arch: HVM64
m3.xlarge:
Arch: HVM64
m3.2xlarge:
Arch: HVM64
m4.large:
Arch: HVM64
m4.xlarge:
Arch: HVM64
m4.2xlarge:
Arch: HVM64
m4.4xlarge:
Arch: HVM64
m4.10xlarge:
Arch: HVM64
c1.medium:
Arch: HVM64
c1.xlarge:
Arch: HVM64
c3.large:
Arch: HVM64
c3.xlarge:
Arch: HVM64
c3.2xlarge:
Arch: HVM64
c3.4xlarge:
Arch: HVM64
c3.8xlarge:
Arch: HVM64
c4.large:
Arch: HVM64
c4.xlarge:
Arch: HVM64
c4.2xlarge:
Arch: HVM64
c4.4xlarge:
Arch: HVM64
c4.8xlarge:
Arch: HVM64
g2.2xlarge:
Arch: HVMG2
g2.8xlarge:
Arch: HVMG2
r3.large:
Arch: HVM64
r3.xlarge:
Arch: HVM64
r3.2xlarge:
Arch: HVM64
r3.4xlarge:
Arch: HVM64
r3.8xlarge:
Arch: HVM64
i2.xlarge:
Arch: HVM64
i2.2xlarge:
Arch: HVM64
i2.4xlarge:
Arch: HVM64
i2.8xlarge:
Arch: HVM64
d2.xlarge:
Arch: HVM64
d2.2xlarge:
Arch: HVM64
d2.4xlarge:
Arch: HVM64
d2.8xlarge:
Arch: HVM64
hi1.4xlarge:
Arch: HVM64
hs1.8xlarge:
Arch: HVM64
cr1.8xlarge:
Arch: HVM64
cc2.8xlarge:
Arch: HVM64
AWSRegionArch2AMI:
us-east-1:
HVM64: ami-0ff8a91507f77f867
HVMG2: ami-0a584ac55a7631c0c
us-west-2:
HVM64: ami-a0cfeed8
HVMG2: ami-0e09505bc235aa82d
us-west-1:
HVM64: ami-0bdb828fd58c52235
HVMG2: ami-066ee5fd4a9ef77f1
eu-west-1:
HVM64: ami-047bb4163c506cd98
HVMG2: ami-0a7c483d527806435
eu-west-2:
HVM64: ami-f976839e
HVMG2: NOT_SUPPORTED
eu-west-3:
HVM64: ami-0ebc281c20e89ba4b
HVMG2: NOT_SUPPORTED
eu-central-1:
HVM64: ami-0233214e13e500f77
HVMG2: ami-06223d46a6d0661c7
ap-northeast-1:
HVM64: ami-06cd52961ce9f0d85
HVMG2: ami-053cdd503598e4a9d
ap-northeast-2:
HVM64: ami-0a10b2721688ce9d2
HVMG2: NOT_SUPPORTED
ap-northeast-3:
HVM64: ami-0d98120a9fb693f07
HVMG2: NOT_SUPPORTED
ap-southeast-1:
HVM64: ami-08569b978cc4dfa10
HVMG2: ami-0be9df32ae9f92309
ap-southeast-2:
HVM64: ami-09b42976632b27e9b
HVMG2: ami-0a9ce9fecc3d1daf8
ap-south-1:
HVM64: ami-0912f71e06545ad88
HVMG2: ami-097b15e89dbdcfcf4
us-east-2:
HVM64: ami-0b59bfac6be064b78
HVMG2: NOT_SUPPORTED
ca-central-1:
HVM64: ami-0b18956f
HVMG2: NOT_SUPPORTED
sa-east-1:
HVM64: ami-07b14488da8ea02a0
HVMG2: NOT_SUPPORTED
cn-north-1:
HVM64: ami-0a4eaf6c4454eda75
HVMG2: NOT_SUPPORTED
cn-northwest-1:
HVM64: ami-6b6a7d09
HVMG2: NOT_SUPPORTED
Resources:
Vpc:
Type: AWS::EC2::VPC
Properties:
CidrBlock: !Ref VpcCidr
EnableDnsHostnames: True
EnableDnsSupport: True
PublicSubnet1:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref Vpc
CidrBlock: !Select [ 0, !Cidr [ !Ref VpcCidr, 12, 8 ] ]
MapPublicIpOnLaunch: True
AvailabilityZone: !Select
- 0
- Fn::GetAZs: !Ref "AWS::Region"
DatabaseSubnet1:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref Vpc
CidrBlock: !Select [ 2, !Cidr [ !Ref VpcCidr, 12, 8 ] ]
AvailabilityZone: !Select
- 0
- Fn::GetAZs: !Ref "AWS::Region"
WebServerInstance:
Type: AWS::EC2::Instance
Properties:
InstanceType: !Ref InstanceType
KeyName: !Ref KeyName
SubnetId: !Ref PublicSubnet1
ImageId:
Fn::FindInMap:
- AWSRegionArch2AMI
- Ref: AWS::Region
- Fn::FindInMap:
- AWSInstanceType2Arch
- Ref: InstanceType
- Arch
AvailabilityZone: !Select
- 0
- Fn::GetAZs: !Ref "AWS::Region"
WebServerSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Enable HTTP access via port 80
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: '80'
ToPort: '80'
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: '22'
ToPort: '22'
CidrIp:
Ref: SSHLocation
DBSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Enable TCP connection on port 3306 for database connection
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: '0'
ToPort: '3306'
SourceSecurityGroupId:
Ref: WebServerSecurityGroup
当我部署模板时,它失败了。当我打印事件日志时。据说创建 DBSecurityGroup 失败。我的模板有什么问题以及如何修复它?
最佳答案
模板中的最后一行应该是
SourceSecurityGroupId:!GetAtt WebServerSecurityGroup.GroupId
.
我还注意到在 AWS::EC2::Subnet
中,CidrBlock
属性应该是
CidrBlock: !Select [ 0, !Cidr [ !GetAtt Vpc.CidrBlock, 12, 8 ] ]
和
CidrBlock: !Select [ 2, !Cidr [ !GetAtt Vpc.CidrBlock, 12, 8 ] ]
关于amazon-web-services - AWS 云形成 : Creating Security Group fails while it is referencing another security,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63095275/
我不确定这个语法是否是 Informix 特有的,但是我在创建触发器时遇到了麻烦,直到我找到了一些包含这些行之一或两者的语法: CREATE TRIGGER accuplacer_trig
我是 Android Studio 和 gradle 的新手。我有一个 Android 项目,部分在 Eclipse 中工作。原始代码在Android中使用derby数据库。旧代码通过 JDBC 直接
我对以下示例中的行为感到困惑。我在一个项目中偶然发现了这个问题,我花了几个小时将问题缩小到一个简单的例子。所以这是我的简单测试类: 'John']]; public function inf
我在 pgAdmin 4 中创建了一些表,但由于某种原因我一直收到标题错误,你能找出原因吗?我没有看到任何问题,并且我已经查看了与我的代码示例相似的其他代码示例,这些示例编译得很好。它在 IDEone
我正在创建一个表,但出现此错误: number of referencing and referenced columns for foreign key disagree. 不知道怎么解决。我认为声
假设我有一个名为“C”的库 (.NETStandard 2.0),它定义了一个名为“CRecord”(记录)的类型。 假设我从名为“B”的 .NET 4.7.2 库中使用这个库。有一个使用“CReco
我已经尝试解决这个错误几分钟了,但我不知道表定义中缺少什么。 表格的代码如下: 表Autocare: CREATE TABLE [dbo].[Autocare] ( [IDAutocar]
DROP DATABASE IF EXISTS ProviderPatients; CREATE DATABASE ProviderPatients; USE ProviderPatients; CR
假设我有这个表stuff_property: | stuff_id (fk) | property_id | | ------------- | ----------- | 现在我想要进行查询,该查询
我是 MySQL 的新手。我完全有能力进行查询和创建表,但之前从未尝试过触发器。 CREATE TRIGGER TrigMora AFTER INSERT ON cliente REFEREN
我可以创建一个具有四个这样的属性的对象 $pocketKnife = New-Object PSObject -property @{ Color = 'Black' Weight =
我有一个名为 App 的对象,它包含主干应用程序的所有相关部分。 问题:当我从应用程序中的其他对象调用应用程序中的对象时,它们是未定义的。 我认为发生这种情况是因为在定义其自身的 App 对象之前,它
我有一个ArrayClass并且mergeSortArray扩展了它。并且 mergeSortArray 包含一个 mergeSort() 方法。但是,由于我使用 super 从父类(super cl
public class foo{ private String label; foo(String whereto){ label = whereto; } publi
我正在尝试以编程方式将库添加到引用的库中。这是我的代码: String filename = "myfile.jar"; InputStream is; try { is = new Buffe
我使用@Reference来获取我需要的所有信息: 吗菲亚: Query query = INSTANCE.createQuery(User.class); return query.asLi
我在 eclipse 中有一个 Java 项目,我想在其中添加 3 个 jar 文件到构建路径: 但是,当我选择它们并将它们添加到构建路径(右键单击/构建路径/添加到构建路径)时,它们将与成为类的“j
希望获得 Java 遵循的一些幕后内存引用和规则。 这是一段代码。基本上,此类用于实例化一些其他对象 (MyOtherObject),然后将此对象的 doClose() 方法的引用发送到 Vector
我打开了this关于转发引用的帖子,这是一个(希望如此)MCVE 代码: #include #include using namespace std; struct MultiMemoizator
MySQL 表: categoryID categoryName categoryParent 每个类别都有一个父类别,尽管它可以是 NULL,我将其视为根类别。 我想从表中获取所有类别,将其存储
我是一名优秀的程序员,十分优秀!