大家好,我正在使用CloudFormation构建基础架构。我的代码块如下所示。
...
..
.
SubnetId:
Type: String
Description: SubnetId of an existing subnet in your Virtual Private
Cloud (VPC)
...
..
.
Resources:
MyInstance:
Type: AWS::EC2::Instance
Properties:
ImageId:
Fn::FindInMap:
- AWSRegionArch2AMI
- Ref: AWS::Region
- Fn::FindInMap:
- AWSInstanceType2Arch
- Ref: InstanceType
- Arch
InstanceType:
Ref: InstanceType
SubnetId:
Ref: SubnetId
SecurityGroupIds:
- Ref: MyInstanceSecGroup
KeyName:
Ref: KeyName
我已经执行了命令
aws cloudformation create-stack --template-body file://ec2.yaml --parameters ParameterKey=SubnetId,ParameterValue=subnet-abcde --stack-name my_instance
因此我在CloudFormation控制台出现如下所示的错误。
The parameter groupName cannot be used with the parameter subnet
如何动态地将subnetId设置为参数。
感谢帮助