feat: Allow access to Postgres from the office (and VPN) #216
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change?
Add an ingress rule to the Postgres security group, allowing connection from the Engineering subnet.
The CloudFormation diff is quite big, however that's largely due to one change - we're now explicitly creating a security group for the database, rather than letting AWS CDK create one. This change has a cascading effect across most other resources in the stack.
As noted, a bastion host might be a better option here as it means we're not reliant on the network to limit access. Thoughts on whether this is blocking welcomed. See also guardian/cdk#1786.
Why?
This means we can connect to the database from the office network, as it is sometimes easier to run queries outside of Grafana.
We had previously added this ingress rule manually (i.e. introduced drift); this change encodes it.
How one connects is down to preference. Personally, I'd be recommending using the AWS Toolkit for JetBrains as it allows one to authenticate via IAM credentials, i.e. credentials issued by Janus.
How has it been verified?
I have performed the following steps:
main