Skip to content
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

Feature: choose first subnet in selection for single instance broker deployments #55

Open
jayalfredprufrock opened this issue Jan 10, 2025 · 1 comment · May be fixed by #60
Open

Feature: choose first subnet in selection for single instance broker deployments #55

jayalfredprufrock opened this issue Jan 10, 2025 · 1 comment · May be fixed by #60
Assignees

Comments

@jayalfredprufrock
Copy link

Thanks for the super useful construct! Saved me lots of time :)

While playing with it, I came across the error: Specify a single subnet in [SINGLE_INSTANCE] deployment mode..

It's probably not that uncommon to have multiple isolated subnets across availability zones, but still deploy only a single instance broker (perhaps to manage cost in development environments). Having to manually construct a subnet selection to contain exactly one subnet is a little awkward. Other official constructs seem to allow a larger subnet selection and (presumably) just choose the first one - at least I've never hit an error like this before. Anyways, would be great if this construct could handle this case more gracefully somehow.

Here is what I need to do now:

const isolatedSubnets = this.vpc.selectSubnets({
      subnetType: SubnetType.PRIVATE_ISOLATED,
});

const rmqBroker = new RabbitMqBrokerInstance(this, 'rmq-broker', {
       vpc: this.vpc,
       vpcSubnets: { subnets: [isolatedSubnets.subnets[0]] },
       ...
}

It's actually a little more complicated in my case, since I have to switch between the single and cluster constructs depending on some configuration. Not a huge deal but wanted to mention in case somebody else would find this useful. Thanks again!

@swimming-potato swimming-potato self-assigned this Jan 10, 2025
@swimming-potato
Copy link

Hi, @jayalfredprufrock thanks for your feedback. We are happy to hear that our work is helping others :) We will discuss the possible options and get back to you next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants