我在驗證以下YAML代碼時遇到問題,因爲我無法解析Fn::Base64
和Fn::Join
。我該如何解決這個問題?驗證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如果你編輯一篇文章,請不要只在你打開它進行編輯時進行代碼格式化,清理整篇文章。 – Anthon
你用什麼來驗證這個YAML。你可以在將文件交給目前進行驗證的進程之前預處理該文件嗎? – Anthon