nma*_*akb 2 aws-cloudformation
当我运行 create-stack 时,创建 elasticsearch 域失败并出现此错误 - “属性 SubnetIds 的值必须是字符串列表类型” 这是 CF 模板的片段...
Parameters:
SubnetIds:
Type: 'List<AWS::EC2::Subnet::Id>'
Description: Select a VPC subnet to place the instance. Select Multiple Subnets for multi-AZ deployments
Resources:
ElasticsearchDomain:
Type: 'AWS::Elasticsearch::Domain'
Properties:
AccessPolicies:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
AWS: '*'
Action:
- 'es:ESHttp*'
Resource: !Sub 'arn:aws:es:${AWS::Region}:${AWS::AccountId}:domain/${DomainName}/*'
DomainName: !Ref 'DomainName'
EBSOptions:
EBSEnabled: !Ref EBSEnabled
VolumeSize: !Ref EBSVolumeSize
VolumeType: gp2
ElasticsearchClusterConfig:
DedicatedMasterCount: !If [HasDedicatedMasterNodes, !Ref DedicatedMasterCount, !Ref 'AWS::NoValue']
DedicatedMasterEnabled: !If [HasDedicatedMasterNodes, true, false]
DedicatedMasterType: !If [HasDedicatedMasterNodes, !Ref DedicatedMasterType, !Ref 'AWS::NoValue']
InstanceCount: !Ref ClusterInstanceCount
InstanceType: !Ref ClusterInstanceType
ZoneAwarenessEnabled: !If [HasSingleClusterInstance, false, true]
ElasticsearchVersion: !Ref ElasticsearchVersion
EncryptionAtRestOptions: !If [HasKmsKey, {Enabled: true, KmsKeyId: !Ref KMSEncryptionKey}, !Ref 'AWS::NoValue']
SnapshotOptions:
AutomatedSnapshotStartHour: 0
VPCOptions:
SecurityGroupIds:
- !Ref SecurityGroup
SubnetIds:
- !Ref SubnetIds
Run Code Online (Sandbox Code Playgroud)
也尝试过这样的方法,但不起作用 -
SubnetIds:
- [!Ref SubnetIds]
Run Code Online (Sandbox Code Playgroud)
尝试使用以下代码片段:
VPCOptions:
SubnetIds: !Ref ESSubnetsID
SecurityGroupIds: !Ref ESSecurityGroup
Run Code Online (Sandbox Code Playgroud)
并使用以下内容更新参数部分:
ESSubnetsID:
Description: Choose which subnets the Elasticsearch cluster should use
Type: 'List<AWS::EC2::Subnet::Id>'
Default: 'subnet-1,subnet-2'
ESSecurityGroup:
Description: Select the SecurityGroup to use for the Elasticsearch cluster
Type: 'List<AWS::EC2::SecurityGroup::Id>'
Default: 'sg-1,sg-2'
Run Code Online (Sandbox Code Playgroud)
确保您传递了子网 ID列表。
| 归档时间: |
|
| 查看次数: |
15543 次 |
| 最近记录: |