Run awscli with different profile
aws –profile foo s3 ls
aws –profile foo s3 ls
Datadog $ terraform import module.timeboard_system.datadog_timeboard.system 111xxx SQS $ terraform import module.resource-name.aws_sqs_queue.main https://sqs.ap-southeast-1.amazonaws.com/123xxx/xxxx Notes: If you cannot find the resource address, try: $ terraform plan
$ ssh -f -N -v -t -L 5433:target_host:5432 user@jump_server target_host is the host/database_server/RDS that you want to access that only can be accessed from jump _server or bastion if you’re using AWS jump_server is the host that accessible from you and the only host that can access target_host 5432 is local port (postgresql default) 5433 is the … Read more
This is a quick guide will show you how to open ssh tunnel to ssh into your target server that can only be accessed from jump server. So this is how to do it: ssh -v -t -L 10443:localhost:20443 <jump_server> ssh -t -L 20443:localhost:443 user@<target_server> jump_server is the host that accessible from you and the … Read more
provider “aws” { access_key = “” secret_key = “” region = “ap-southeast-1” } resource “aws_instance” “web-1” { vpc_security_group_ids = [“sg-xxxxxxxx”] subnet_id = “subnet-xxxxxxxx” ami = “ami-xxxxxxxx” availability_zone = “ap-southeast-1a” instance_type = “t2.micro” tags { Name = “test-terraform-1” } }
$ packer build main.json $ vim ~/.aws/credentials [default] aws_access_key_id = aws_secret_access_key = Add the environment variables at the end of file ~/.bashrc $ vim ~/.bashrc export AWS_ACCESS_KEY_ID= export AWS_SECRET_ACCESS_KEY=
To describe specific AMI $ aws ec2 describe-images –image-ids ami-5731123e To describe instance $ aws ec2 describe-instances –instance-ids i-1234567890abcdef0 To describe VPCs $ aws ec2 describe-vpcs To describe route tables $ aws ec2 describe-route-tables