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

Add support for parsing config file for basti init #123

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Sharu95
Copy link

@Sharu95 Sharu95 commented Feb 20, 2025

Proposed Changes

This PR adds support for parsing the config file for the basti init command.

Related Issues/PRs

Checklist

  • I cleaned up my code.
  • All the tests and checks passed (npm run test).
  • I have added necessary documentation and/or updated existing documentation.
  • I have added or modified tests to cover the changes.

@BohdanPetryshyn
Copy link
Collaborator

Hi @Sharu95, thank you for your interest in contributing to Basti!

I'll try to look at the changes this weekend. Meanwhile, could you please explain the motivation for the changes and the example of the new config?

@Sharu95
Copy link
Author

Sharu95 commented Feb 21, 2025

Hi @BohdanPetryshyn, happy to contribute!

Still just a draft PR but I wanted to put it out there so its easier to iterate on it with feedback. Currently not perfectly parsing from config, but the setup works. Tags are passed from CLI options as well.

My main motivation was to be able to run basti init --target=<some-target> similar to how it is possible to run basti connect --connection. It makes initialization way easier and the config can just be set once in the config file. I think it is a nice abstraction on top of the CLI command ( and the interactive setup)! 👍🏾 An example config file for reference;

connections:
  basti-production:
    target: my-target
    localPort: 8080

targets:
  my-target:
    rdsCluster: basti-production
    awsProfile: AdministratorAccess
    awsRegion: us-east-1
    bastionSubnet: subnet

If the target is part of the connection setup, it should still be parsed as a connection target, but this setup is more or less to adhere to the init command as well, with the config file 🙌🏾

Another motivation I've had is that we manage some of our RDS resources in terraform. The security group used by basti/bastion instance is often deleted during terraform deployments/applies, because its not tracked in terraform, so we end up running basti init more often than ideal if we use terraform a lot

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

Successfully merging this pull request may close these issues.

2 participants