Skip to main content

Posts

Showing posts from April, 2020

AWS Cli examples

// The following command lists any of your instances that have the tag Name=MyInstance. $ aws ec2 describe-instances --filters "Name=tag:Name,Values=MyInstance" // The following command lists your instances that were launched using any of the following AMIs: ami-x0123456, ami-y0123456, and ami-z0123456. $ aws ec2 describe-instances --filters "Name=image-id,Values=ami-x0123456,ami-y0123456,ami-z0123456" $ aws ec2 describe-vpcs // Create a Bucket $ aws s3 mb s3://bucket-name // List Your Buckets $ aws s3 ls // The following command lists all objects and folders (referred to in S3 as 'prefixes') in a bucket. $ aws s3 ls s3://bucket-name // Delete a Bucket $ aws s3 rb s3://bucket-name // The following example copies an object into a bucket. It grants read permissions on the object to everyone and full permissions (read, readacl, and writeacl) to the account associated with user@example.com. $ aws s3 cp file.txt s3://my-bucket/ --grants rea...

Install Docker on an Amazon Workspace

Connect to your workspace. Update the installed packages and package cache on your workspace. $ sudo yum update -y Install the most recent Docker Community Edition package. $ sudo amazon-linux-extras install docker Start the Docker service. $ sudo service docker start Add the current user to the docker group so you can execute Docker commands without using sudo. $ sudo usermod -a -G docker ec2-user or $ ll /var/run-/docker.sock srw-rw----. 1 root root 0 Mar 22 16:40 /var/run/docker.sock $ sudo chgrp docker /var/run/docker.sock $ sudo usermod -aG docker ${USER} $ sudo ll /var/run/docker.sock srw-rw----. 1 root docker 0 Mar 22 16:40 /var/run/docker.sock $ su - ${USER} Verify that the ec2-user can run Docker commands without sudo. $ docker info

Install java on EC2

# sudo yum install wget # sudo yum install zip unzip -y # mkdir -p /u01/software # cd /u01/software # wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u251-b08/3d5a2bb8f8d4428bbe94aed7ec7ae784/jdk-8u251-linux-x64.rpm # yum install -y jdk-8u251-linux-x64.rpm

AWS S3

Amazon S3 is a highly durable and distributed data store. Using a web services interface, you can store and retrieve large amounts of data as objects in buckets (containers). The stored objects are also accessible from the web via HTTP. Amazon S3 has three pricing components: storage (per GB per month), data transfer in or out (per GB per month), and requests (per n thousand requests per month) Usage samples : 1. One very common use for Amazon S3 is storage and distribution of static web content and media. This content can be delivered directly from Amazon S3, since each object in Amazon S3 has a unique HTTP URL address, or Amazon S3 can serve as an origin store for a content delivery network (CDN), such as Amazon Cloud Front. 2. Amazon S3 is also frequently used to host entire static websites. Amazon S3 provides a highly available and highly scalable solution for websites with only static content, including HTML files, images, videos, and client-side scripts such as ...

Implement asynchronous processing on AWS

AWS SNS service for notifying components when a message's request processing has been completed. For asynchronous pipelines for data flows within your application using AWS Kinesis data streams and AWS SQS queues, where you can route your data to different queues to be processed differently.

Boto3 AWS Python interface

Boto3  makes it easy to integrate your  Python  application, library, or script with AWS services including Amazon S3, Amazon EC2, Amazon DynamoDB, and more. https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html