J'ai un script CloudFormation qui crée une instance RDS et demande un groupe de sous-réseaux. Mais au lieu de demander à l'utilisateur de spécifier les sous-réseaux un par un et de créer un nouveau groupe, je souhaite sélectionner un groupe existant.Demander un groupe de sous-réseaux existant dans le script AWS CloudFormation
En ce moment j'ai cela pour le groupe de sous-réseau:
"DatabaseSubnets": {
"Description": "The subnets to place database instances in.",
"Type": "List<AWS::EC2::Subnet::Id>"
},
....
"DatabaseSubnetGroup": {
"Type": "AWS::RDS::DBSubnetGroup",
"Properties": {
"DBSubnetGroupDescription": "CloudFormation managed DB subnet group.",
"SubnetIds": {
"Ref": "DatabaseSubnets"
}
}
},
Comment puis-je modifier pour sélectionner un groupe existant? Dois-je remplacer le groupe "Properties"
par un Ref
?
Je pensais plutôt à transmettre un ID de groupe de sous-réseau en tant que paramètre. – sashoalm
DBSubnetGroup n'accepte que les identifiants de sous-réseau. Voir ici: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbsubnet-group.html Si vous voulez réutiliser un existant pour votre RDS, vous pouvez transmettez-le via le paramètre DBSubnetGroupName: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html#cfn-rds-dbcluster-dbsubnetgroupname et http: // docs. aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsubnetgroupname – n00b