2 Respuestas
- Más nuevo
- Más votos
- Más comentarios
0
Hello.
When I tried it in my environment, I was able to confirm that it works if you do the following.
It worked when I changed the line break with "Fn::GetAtt".
"MyDBInstanceCNAME": {
"Type": "AWS::Route53::RecordSet",
"Properties": {
"HostedZoneId": {
"Ref": "MyPrivateHostedZone"
},
"Name": "db.vpc.app.my.com",
"Type": "CNAME",
"TTL": "300",
"ResourceRecords": [
{
"Fn::GetAtt": [
"MyAppDBInstance",
"Endpoint.Address"
]
}
]
}
}
0
Below is the entire template as I tried it.
The template was too long to fit into comments, so I split it into parts.
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Test RDS instance",
"Parameters": {
"DBName": {
"Default": "mydb",
"Description": "RDS Name",
"Type": "String",
"MinLength": "1",
"MaxLength": "64",
"AllowedPattern": "[a-zA-Z][a-zA-Z0-9]*"
},
"DBUser": {
"NoEcho": "true",
"Description": "Username",
"Type": "String",
"MinLength": "1",
"MaxLength": "16",
"AllowedPattern": "[a-zA-Z][a-zA-Z0-9]*"
},
"DBPassword": {
"NoEcho": "true",
"Description": "Password",
"Type": "String",
"MinLength": "8",
"MaxLength": "41"
},
"DBAllocatedStorage": {
"Default": "20",
"Description": "Storage Size",
"Type": "Number",
"MinValue": "5",
"MaxValue": "1024"
},
"DBInstanceClass": {
"Description": "Instance Type",
"Type": "String",
"Default": "db.t3.micro",
"AllowedValues": [
"db.t3.micro",
"db.t3.small",
"db.t3.medium",
"db.t3.large"
]
},
"MyPrivateHostedZone": {
"Description": "HostedZone ID",
"Type": "String"
}
},
"Resources": {
"MyAppDBInstance": {
"Type": "AWS::RDS::DBInstance",
"Properties": {
"DBName": {
"Ref": "DBName"
},
"Engine": "MySQL",
"MasterUsername": {
"Ref": "DBUser"
},
"MasterUserPassword": {
"Ref": "DBPassword"
},
"DBInstanceClass": {
"Ref": "DBInstanceClass"
},
"AllocatedStorage": {
"Ref": "DBAllocatedStorage"
}
}
},
"MyDBInstanceCNAME": {
"Type": "AWS::Route53::RecordSet",
"Properties": {
"HostedZoneId": {
"Ref": "MyPrivateHostedZone"
},
"Name": "db.vpc.app.my.com",
"Type": "CNAME",
"TTL": "300",
"ResourceRecords": [
{
"Fn::GetAtt": [
"MyAppDBInstance",
"Endpoint.Address"
]
}
]
}
}
},
"Outputs": {
"EndPoint": {
"Description": "MySQL instance endpoint",
"Value": {
"Fn::GetAtt": [
"MyAppDBInstance",
"Endpoint.Address"
]
}
}
}
}
Contenido relevante
- OFICIAL DE AWSActualizada hace 3 años
- OFICIAL DE AWSActualizada hace un año
Thank you. It does work. I suspect this is a problem with a CF parser in my IDE.