2 個答案
- 最新
- 最多得票
- 最多評論
1
You can try this way, but I think there is more elegant solution:
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::LanguageExtensions
Parameters:
InstanceList:
Type: CommaDelimitedList
Resources:
Fn::ForEach::Instances:
- InstanceLogicalId
- !Ref InstanceList
- ${InstanceLogicalId}:
Type: AWS::EC2::Instance
Properties:
ImageId: ami-0ed752ea0f62749af
InstanceType: t2.micro
Then in a console just type the name of logical id, like:
instance1 - will create one instance
instance1, instance2, instance3 - will create three instances
0
You can also do this with Count -macro. There were some issues using parameters with Count attribute but based on comments those shound have been fixed.
相關內容
- 已提問 1 年前
- 已提問 7 個月前
- AWS 官方已更新 1 年前