I've a CF stack and I've defined different resources. One of these is an S3 Bucket. I need to run the stack in the eu-west-1 region while create the bucket in the ap-southeast-1 region. How can I do something like this?
Unfortunately this is impossible using the standard AWS::S3::Bucket in CloudFormation, since resources managed by a CloudFormation stack can only reside in the same region as the stack itself. However, you could work your way around this by using a Lambda function
Your Lambda function would have to set the LocationConstraint to ap-southeast-1 when creating the bucket. Also, you Lambda function will be responsible for updating and deleting your bucket, which can involve a bit more code.
You can wire your Lambda function to CloudFormation using Lambda-backed Custom Resources.
A single CloudFormation stack can only have resources in the single region that the stack resides.
However, using CloudFormation Stack Sets, you can create resources across multiple CloudFormation stacks in multiple regions and AWS accounts.
More information about using Stack Sets can be found in the Stack Set documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With