Command to stop an EC2 Instance: aws ec2 stop-instances –instance-ids INSTANCEID Command to start an EC2 Instance: aws ec2 start-instances
Continue readingCategory: How-To Guides
How to create an AMI of an EC2 Instance from AWS CLI
Use the below command to create AMI of an EC2 Instance. Replace instanceid and name values accordingly. aws ec2 create-image
Continue readingHow to change EC2 Instance to an ENA supported Instance type
Step1: Verify if the ENA driver is installed on the EC2 Instance by running the modinfo command as below: modinfo
Continue readingHow to add column to a table in Redshift
Below is the syntax to add a new column to an existing table in Redshift database. ALTER TABLE table_name ADD
Continue readingHow to create a group and add users to group in Redshift
create group group_name; GRANT USAGE ON SCHEMA schema_name TO GROUP group_name; alter group group_name add user user_name; commit;
Continue readingHow to change column data type in Redshift
BEGIN TRANSACTION; ALTER TABLE schemaname.tablename RENAME TO tablename_old; CREATE TABLE schemaname.tablename (); –New definition INSERT INTO schemaname.tablename SELECT * FROM
Continue readingHow to change the table owner of a Redshift table
Check the current owner of the table using the below query where table_name is the name of your table and
Continue readingHow to list all S3 buckets and contents of a bucket
Below is the command to list all S3 buckets owned by you: aws s3 ls To list all the contents
Continue readingHow to rename folders and files in S3
To Rename a folder aws s3 –recursive mv s3://bucketname/prefix_old/ s3://bucketname/prefix_new/ To Rename a file aws s3 mv s3://bucketname/prefix/filename_old s3://bucketname/prefix/filename_new
Continue readingHow to copy files from one S3 bucket to another using wildcard
aws s3 cp s3://bucketname1/prefix1/prefix2/ s3://bucketname2/prefix/ –recursive –exclude “” –include “searchterm*”
Continue reading