stratospheric-dev / stratospheric

All you need to know to get your Spring Boot application into production with AWS 🍃
https://stratospheric.dev
Apache License 2.0
260 stars 187 forks source link

Clarification on deploying multiple apps using same account #268

Closed ryanmcfall closed 6 months ago

ryanmcfall commented 6 months ago

What can we improve?

I have tried deploying multiple Spring Boot applications using the framework in the book, and ran into one difficulty when running npm service:deploy -- -c dockerImageTag=#. In particular, it arose because this line of code in Service.java in the cdk-construct library:

CfnListenerRule httpListenerRule = CfnListenerRule.Builder.create(this, "httpListenerRule")
  .actions(singletonList(actionProperty))
  .conditions(singletonList(condition))
  .listenerArn(networkOutputParameters.getHttpListenerArn())
  .priority(2)
  .build();

This would give an error indicating that a resource already exists with an identifier of something like 'Priority '2' (sorry, I don't have the exact error message handy)

I'm not currently using HTTPS, so I suspect that's the reason I got this error but didn't get one for the similar rule being created for HTTPS. Experimentally I changed the priority parameter to 3 in a local version of the cdk-constructs library and was able to deploy the code without any difficulty.

I also noticed there is only one load balancer listed in my account, even though I've deployed two applications. This makes me think that perhaps the code is designed with an assumption that only one Spring Boot app will be deployed for that AWS account. But much of the rest of the book attempts to avoid name clashes using a naming scheme of prod and staging for the environment name.

So I'm seeking some clarification on the intent of the book's deployment framework.

Version

latest

Suggested Changes

No response

BjoernKW commented 6 months ago

Thanks for bringing this up. We'll consider this for a future release.