I'm creating an opsworks
stack using a cloudformation
template, and I have few applications in my stack that require a database
RDS instance :
"WordpressApp": {
"Type": "AWS::OpsWorks::App",
"Properties": {
"AppSource" : {
"Type" : "git",
"Url" : "git://github.com:myproject/wordpress.git",
"Revision" : "master"
},
"DataSources":[{
"Arn" : { "Ref" : "RDSInstanceARN" },
"DatabaseName" : "application",
"Type" : "RdsDbInstance"
}],
"Description": "website application",
"Name" : "app",
"Shortname" : "app",
"StackId" : {"Ref": "MyStack"},
"Type" : "php"
}
},
Here is the RDSInstancARN
parameter :
"RDSInstanceARN" : {
"Description" : "Arn of the RDS instance",
"Type" : "String",
"Default" : "arn:aws:rds:eu-west-1:454524154879:db:instanceappdb"
}
The ARN is well written. When I test the template I get this error :
unable to find rds instance with ARN
What is the cause of this error ? I don't understand, the arn is written properly and it exists in the aws account and running. Any idea please ? Thank you.
Have you registered your RDS instance with your OpsWorks stack first?
According to Amazon RDS Service Layer documentation section, the procedure for using an RDS instance with an OpsWorks stack is as follows:
I believe setting the
DataSources
property on anAWS::OpsWorks::App
corresponds to #3 above, but #2 will need to be done first.Unfortunately it looks like step #2 isn't officially supported by CloudFormation - see my answer to your other question, Create an RDS Opsworks Layer by a Cloudformation template for more details/discussion on that step.