S3 Bucket – EC2 Directory Sync using AWS Lambda

Allow only AWS CLI commands for the login user: $visudo ubuntu ALL=(ALL:ALL) /usr/local/bin/aws   Write the lambda function Prepare the deployment package $mkdir /python-packages $virtualenv -p /usr/bin/python /python-packages $source /python-packages/bin/activate $pip install pycrypto $pip install paramiko Deactivate Virtualenv $mkdir /deployment-package $copy the GITHUB URL file here $cp -r /python-packages/lib/python2.7/site-packages/* deployment-package/ $cp -rf /python-packages/lib/python2.7/site-packages/.libs_cffi_backend deployment-package/ $chmod […]

Full Access to a specific S3 Bucket except DeleteObject

{ “Statement”: [ { “Effect”: “Allow”, “Action”: [ “s3:GetBucketLocation”, “s3:ListAllMyBuckets” ], “Resource”: “arn:aws:s3:::*” }, { “Effect”: “Allow”, “Action”: [ “s3:ListBucket” ], “Resource”: [ “arn:aws:s3:::testbucket-unni” ] }, { “Effect”: “Allow”, “Action”: [ “s3:PutObject”, “s3:GetObject” ], “Resource”: [ “arn:aws:s3:::testbucket-unni/*” ] } ] } Details: Get and List actions given to “arn:aws:s3:::*” to enable console view List action […]

ARN – AWS Documentation Excerpts

Here are some example ARNs: <!– AWS Elastic Beanstalk application version –> arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/MyEnvironment <!– IAM user name –> arn:aws:iam::123456789012:David <!– Amazon RDS tag –> arn:aws:rds:eu-west-1:001234567890:db:mysql-db <!– Amazon S3 bucket (and all objects in it)–> arn:aws:s3:::my_corporate_bucket/* The following are the general formats for ARNs; the specific components and values used depend on the AWS service. […]

AWS EC2 Internal Security Structure

Reference An insight into internal structure of EC2. The Hypervisor Amazon EC2 currently utilizes a highly customized version of the Xen hypervisor, taking advantage of paravirtualization (in the case of Linux guests). Because paravirtualized guests rely on the hypervisor to provide support for operations that normally require privileged access, the guest OS has no elevated […]

s3cmd Elaborated…

Use –rr option (reduced redundancy) for every put and sync commands !!!.  Use –bucket-location option to mention nearest geographical location to avoid latency. To view contents inside a bucket #s3cmd ls s3://bucketname To copy/sync a directory into a bucket #s3cmd sync Desktop/check s3://bucket_name To view all contents of all buckets one level down (only non […]

Netflix on AWS

DC Analogy Cloud Analogy Transition : DC to CLOUD Application Restructuring DATABASE Test Cloud Efficiency   There are Chaos Monkey (which simulates instance failures) and Chaos Gorilla (which simulate AWS Region Failures). Extensive Backup Strategy As shown on the left side, the whole infra setup is redundant across multiple AZ. On the right side the […]