1
votes

Here is said that it is a possible scenario to set up a waitcondition and corresponding handle to wait for the configuration of an RDS instance:

You can also use the DependsOn attribute on other resources. For example, you may want an RDS DB instance to be created and a database configured on that DB instance first before creating the EC2 instances that use that database. In this case, you create a wait condition that has a DependsOn attribute that specifies the DB instance, and you create EC2 instance resources that have DependsOn attributes that specify the wait condition. This would ensure that the EC2 instances would only be created directly after the DB instance and the wait condition were completed.

On an EC2 instance i could pass the handle into the userdata and have a script call the URL to resolve the waitcondition, or resolve it directly via cfn-signal. But how to do that from a RDS instance that has no userdata or "AWS::CloudFormation::Init"? I understand the DependsOn-part, but I do not see how / from where send the signal to the waitcondition.

Edit: Meanwhile I got the impression, that any resource / script that should configure the database also has to resolve the waitcondition, it just is not mentioned anywhere in the text. Resolving (i.e. sending the signal to or calling the presigned URL of the condition) is not possible from an RDS.

1

1 Answers

2
votes

The DependsOn attribute is used in the CloudFormation template, so the wait condition is indirectly created when you add the DependsOn attribute to a CloudFormation resource.

Please look at the first example in this page for a solution that uses RDS and EC2, just like you need to do as well ;)