http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html https://www.youtube.com/watch?v=_wiGpBQGCjU
This is a guide for how to get dbeaver connected to your rds cluster.
Dependencies:
brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk11
brew cask install dbeaver-community
- create bastion host to sit inside your vpc, and add ssh keys for your user
Dependencies:
brew install stoken
-
Click on the RSA link in your email and copy the 'ctfData' string value from the address bar and use it with the command below:
stoken import --token='com.rsa.securid://ctf?ctfData=YOUR-CTF-DATA-HERE'
-
Enter your PIN as your password
-
Get your Device ID or 'Binding ID' from your RSA ID app on your mobile device under the info tab, long pressing over the id also will allow you to share it to yourself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// anything older than 20 days ago | |
SET cutoff = current_date() - 20; | |
SELECT h.query_text, | |
h.database_name, | |
h.user_name, | |
h.role_name, | |
t.table_name, | |
u.login_name | |
FROM snowflake.account_usage.query_history h |
View output of large plan
tf plan -no-color | subl &
Migrate everything from state A → state B
Temporarily switch to a local states by commenting out any remote backends you have,
and running ‘terraform init’, ‘yes’ to copy the remote to local state files
run:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew cask install snowflake-snowsql | |
snowsql -a <snowflake_instance>.<region> -u <user.name>@COMPANY.com --authenticator=externalbrowser | |
# login with your federated login in your default browser | |
# MACOS | |
> PUT file:///Users/<your_username>/Desktop/test.csv @test_internal_stage; | |
> use database <YOUR_DB>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# useful script if you happen to have any rds instances on private subnets | |
# with a bastion host to tunnel into And IAM authentication | |
# Mostly inspired from this article on the AWS blog: | |
# https://aws.amazon.com/blogs/database/using-iam-authentication-to-connect-with-pgadmin-amazon-aurora-postgresql-or-amazon-rds-for-postgresql/ | |
# Thanks to @mjreed-turner for teaching me all things Linux, as usual | |
export AWS_DEFAULT_REGION=us-east-1 | |
export AWS_PROFILE=your-aws-creds-profile | |
export BASTION_EC2_INSTANCE=i-12345678 |