-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Cross-region resource sharing #8232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey @IndikaUdagedara , thanks for opening the issue. In general, we only support cross account/region references when using conventional physical names. Unfortunately, if a resource does not allow you to set a physical name, things get difficult. In this case, I wonder whether you couldn't use Route53 to give a well-known name to the LoadBalancer DNS, and kind of "simulate" a physical name that way? |
Thanks @skinny85. That's good idea, I'll try that. What about in other cases e.g. sharing a certificate ARN? What is the recommended approach? |
I don't know of a good way to do that unfortunately :/. Yes, you can write a custom resource that will read the output of the other stack in a cross region/account fashion, but then you're effectively hard-coding the name of the output, which is not great :/. I wish I had better news in this case, but this is a problem that I've yet to see a great solution for. |
Thanks @skinny85 - I got it working with your suggestion. Hope CDK will provide this natively soon! |
I found this error when |
❓ General Issue
The Question
Within the same
app
how can you share resources from different regions?My specific use case is: A Cloudfront distribution requiring a ACM certificate from us-east-1, which has a origin load-balancer in another region. i.e.
I could move Cloudfront to StackB but then I still have to pass certificate ARN from A to B. In both cases passed values don't have predictable names (DNS name/cert ARN) so can't think of a workaround (other than creating one stack first and copying the values by hand... )
When I try the above, I get the error:
Environment
Other information
There are couple of issues already posted (#7484, #7339) regarding cross-region/cross-account resource sharing within an
app
but couldn't find a solution to my problem. This could be a missing feature or unclear documentation.The solution could be bit complicated if it's cross-account (due to having to create cross-account roles for example) but I feel there could be a simpler solution if the resources are in the same account. I was thinking about something like
Would that work or is there another option? Appreciate guidance.
The text was updated successfully, but these errors were encountered: