【发布时间】:2016-09-05 09:11:11
【问题描述】:
我在验证以下 YAML 代码时遇到问题,因为我无法解析 Fn::Base64 和 Fn::Join。我该如何解决这个问题?
AWSTemplateFormatVersion: "2010-09-09"
Description: "test e2 ebs in vpc"
Parameters:
KeyPairName:
Description: "Public/private key pairs allow you to securely connect to your instance after it launches"
Type: "AWS::EC2::KeyPair::KeyName"
VPC:
Description: "ID of the VPC (e.g., vpc-0343606e)"
Type: AWS::EC2::VPC::Id"
myWSFCNode1InstanceType:
ConstraintDescription: "Only EBS Optimized instance types r3.xlarge, r3.2xlarge, r3.4xlarge allowed"
Default: t2.small
Description: "Amazon EC2 instance type for the 1st WSFC Node"
Type: String
Resources:
myWSFCNode1:
CreationPolicy:
ResourceSignal:
Count: "1"
Timeout: PT15M
Properties:
BlockDeviceMappings:
- DeviceName: /dev/sda1
Ebs:
VolumeSize: "100"
VolumeType: gp2
ImageId: ami-fd9cecc7
InstanceType:
Ref: myWSFCNode1InstanceType
KeyName:
Ref: KeyPairName
SecurityGroupIds:
-
Ref: myWSFCSecurityGroup
UserData:
? "Fn::Base64"
:
? "Fn::Join"
:
- ""
-
Type: "AWS::EC2::Instance"
myWSFCNode1Volume1:
Properties:
Size: 50
Type: "AWS::EC2::Volume"
myWSFCSecurityGroup:
Properties:
GroupDescription: "Enable the WSFC and SQL AlwaysOn Availability Group communications"
SecurityGroupIngress:
-
CidrIp: 0.0.0.0/0
FromPort: "22"
IpProtocol: tcp
ToPort: "22"
VpcId: Ref: VPC
Type: "AWS::EC2::SecurityGroup"
mySystemGroup: "ec2SG"
【问题讨论】:
-
@LukaKerr 如果您编辑帖子,请不要在打开编辑后只进行代码格式化,清理整个帖子。
-
你用什么来验证这个 YAML。您可以在将文件交给当前进行验证的进程之前对其进行预处理吗?
标签: parsing amazon-web-services yaml