AWS CDK - Lightsail LoadBalance #26264
-
Hi everyone, I'm currently working on an infrastructure using CDK and Amazon Lightsail as my main services. I was wondering if any of you have been in a similar situation before and if you have any ideas or suggestions on how I could fix this. I'm also open to any workarounds or workarounds that might work. Thanks in advance for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Natively, it appears you're only able to fetch the ref and ARN unfortunately https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-loadbalancer.html#aws-resource-lightsail-loadbalancer-return-values To work around this while still using lightsail, you will probably need to implement a custom resource that allows for API calls during deployment. We have a construct It may be a bit tricky getting this setup properly if you've never used custom resources before, just let me know |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Natively, it appears you're only able to fetch the ref and ARN unfortunately https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-loadbalancer.html#aws-resource-lightsail-loadbalancer-return-values
To work around this while still using lightsail, you will probably need to implement a custom resource that allows for API calls during deployment. We have a construct
AwsCustomResource
that makes it easy to make an arbitrary API call. You could useAwsCustomResource
to make agetLoadBalancer
call, and then reference the returneddnsName
in your CloudFront resource.It may be a bit tricky getting this setup properly if you've never used custom resources before, …