Solved: Conflicting conditional operation error while creating S3 bucket

A conflicting conditional operation is currently in progress against this resource. Please try again.
You can get above error when you are creating an S3 bucket.
This error generally comes if you have deleted an S3 bucket in one region and immediately trying to create a bucket in other region with same bucket name.
Problem is that the S3 syncing is not instant across regions. It may take anything between 2 minutes to 30 minutes for the information to update in all S3 region that you have already deleted the bucket with that name.
You may get the same error even when you try creating same name bucket in different AWS account. Reason being same of syncing.
So if you want the bucket name to be same try creating it again after a coffee break.

AWS Crash Course - Elastic Beanstalk

Welcome back to AWS Crash Course.
In the last section we discussed about EBS.
In this section we will discuss about AWS Elastic Beanstalk.
AWS Elastic Beanstalk makes it even easier for developers to quickly deploy and manage applications in the AWS cloud. Developers simply upload their application, and Elastic Beanstalk automatically handles the deployment details of capacity provisioning, load balancing, auto-scaling, and application health monitoring.
  • You can push updates from GIT and only the modified files are transmitted to AWS elastic beanstalk.
  • Elastic beanstalk supports IAM, EC2, VPC and RDS instances.
  • You have full access to the resources under elastic beanstalk
  • Code is stored in S3
  • Multiple environments are allowed to support version control. You can roll back changes.
  • Amazon Linux AMI and Windows 2008 R2 supported.
    What are the supported Languages and Development Stacks?
  • Apache Tomcat for Java applications
  • Apache HTTP Server for PHP applications
  • Apache HTTP Server for Python applications
  • Nginx or Apache HTTP Server for Node.js applications
  • Passenger or Puma for Ruby applications
  • Microsoft IIS 7.5, 8.0, and 8.5 for .NET applications
  • Java SE
  • Docker
  • Go
How can you update Elastic Beanstalk?
  • You can upload the code for updating on AWS elastic beanstalk
  • It support multiple running environments like test, pre-prod and prod etc
  • Each environment is independently configured and runs on its own separate AWS resources
  • Elastic beanstalk also stores and tracks application versions over time so an existing environment can easily rolled back to a prior version.
  • New environment can be launched using an older version to try and reproduce a customer problem.
Fault Tolerance
  • Always design, implement, and deploy for automated recovery from failure
  • Use multiple Availability Zones for your Amazon EC2 instances and for Amazon RDS
  • Use ELB for balancing the load.
  • Configure your Auto Scaling settings to maintain your fleet of Amazon EC2 instances.
  • If you are using Amazon RDS, then set the retention period for backups, so that Amazon RDS can perform automated backups.
  What about Security?
  • Security on AWS is a shared responsibility
  • You are responsible for the security of data coming in and out of your Elastic Beanstalk environment.
  • Configure SSL to protect information from your clients.
  • Configure security groups and NACL with least privilege.
This short course was to give you an understanding of elastic beanstalk. If you want to try some hands on follow this AWS tutorial.

Solved: Share AMI with other AWS accounts

At times you may have to safely share an AMI(Amazon machine Image) with another AWS account. You can do it without making the AMI Public.
Here we will show you how you can do it easily.
  1. Login to your EC2 console by this link . EC2 Console
  2. In the left navigation panel choose AMIs in Image section.
  3. Select the AMI you want to share.
  4. Click on Actions > Modify Image Permissions
  5. In the Modify Image Permissions box do the following :-

    a) This image is currently “Private”
    b) Enter the AWS account number with which you want to share the AMI. Click Add Permissions.
    c) Check the box with Add “create volume” permissions to the following associated snapshots when creating permissions.
  6. Finally click on Save .
Once above steps are done in the source account you have to go in the destination account AMIs section in EC2 Console and in the filter select Private images. You should now be able to see the image you shared earlier.

If you want to do the same with AWS CLI, Use these two commands:-

Here we are granting launch permission to a specific AMI(ami-a2n4b68kl) for a specific AWS account number (123456789) .
aws ec2 modify-image-attribute --image-id ami-a2n4b68kl --launch-permission "{\"Add\":[{\"UserId\":\"123456789\"}]}"
Below command will grant create volume permission for snapshot(snap-try657hvndh909) as we did in Step 5(c)
aws ec2 modify-snapshot-attribute --snapshot-id snap-try657hvndh909 \
--attribute createVolumePermission --operation-type add --user-ids 123456789
After doing this the AMI should be visible in AMIs of the new account.

AWS Crash Course - EBS

In the last section we discussed about VPC. In this section we will discuss about EBS.
What is EBS?
  • EBS is Elastic Block Storage.
  • EBS volume is a durable, block-level storage. It’s similar to the hard disk that you have in your laptop or desktop.
  • EBS volumes can be used as primary storage for data that requires frequent updates.
  • EBS volume in an Availability Zone is automatically replicated within that zone to prevent data loss due to failure.
  • You can create encrypted EBS volumes with the Amazon EBS encryption feature or use 3rd party software for encryption.
  • To improve performance use RAID Groups e.g. RAID 0, RAID 1, RAID 10
What are the different types of EBS volumes?
  • General Purpose SSD (gp2) – It provides you upto 10,000 IOPS(Input/output operations per second)  and it can be of size from 1GB to 16TB . This is used for for normal loads. And should be enough for your you Dev or UAT setups.
  • Provisioned IOPS SSD (io1) – It provides you upto 20000 IOPS  and it can be of size from 4GB to 16TB . These are generally used for Large SQL/NoSQL Databases.
  • Throughput Optimized HDD (st1) – These provide you upto 500 IOPS  and can range in size from 500GB to 16TB. These are mostly useful for Big Data/ Data warehouses.
  • Cold HDD (sc1) – These are the cheapest kind of disks.  They provide upto 250 IOPS -and can range in size from 500GB to 16TB. These are commonly used fro data archiving as they provide low IOPS but are cheap for storing data which is not used frequently.
You can take snapshots of EBS volumes.
So what is a snapshot?
  • You can back up the data on your EBS volumes to Amazon S3 by taking point-in-time snapshots
  • Snapshots are incremental backups – Saves time and storage costs
  • Snapshots support encryption
  • Snapshots exclude data that has been cached by any applications or the OS
  • You can share your unencrypted snapshots with others
  • You can use a copy of a snapshot for Migrations, DR, Data retention etc.
You can try handson with EBS by using this exercise .

Azure Crash Course - Web Apps

Azure is quickly adding services in it’s portfolio.
Three of the Azure services “Web Apps”, “Cloud Services” and “API Apps” provide services which are equivalent to AWS Elastic Benastalk.
In this article we will be discussing about Web Apps.
  • Web Apps is a PaaS offering of Azure.
  • Web Apps allows developers to quickly build, deploy and manage websites easily.
  • It provides you shared or dedicated virtual machines.
  • These are managed VMs so you don’t have to worry about hardware or patching.
  • Languages supported are ASP.NET, Node.js, Java, PHP, or Python. These are basically the languages which are supported by Azure App Service.
  • It supports Scaling up or Scaling out both.
  • It supports High Availability.
  • You can select application templates from Azure marketplace and deploy using Web Apps.  Some examples of supported templates are WordPress, Joomla and Drupal.
Web Apps can be deployed in three ways:-
  1. Azure CLI
  2. Azure ARM Portal
  3. Visual Studio
For DevOps you can easily integrate Web Apps with GitHub, Bitbucket, or Visual Studio Team Services.
Web Apps has a great feature of Deployment Slots. So what is Deployment slots?
It allows you to validate the change first in Dev or UAT before pushing it in Production. By deploying a web app to a slot first and swapping it into production ensures that all instances of the slot are warmed up before being swapped into production. This eliminates cold start for your application.
It gives you flexibility to roll back.
You can also configure auto swap. When a deployment slot is configured for Auto Swap into production, every time you push your code update to that slot, App Service will automatically swap the app into production after it has already warmed up in the slot.
Pricing Plans:-
Web Apps supports different pricing plans.
  1. Free
  2. Shared
  3. Basic
  4. Standard
  5. Premium
Free and Shared Plans don’t have SLAs associated with them.  While the remaining three provide 99.95% SLA.
You can also buy custom domains and SSL certificate through Web Apps.
This article was written to give you quick snapshot of Web Apps.  You can follow this Azure Doc to check how to quickly deploy apps with Web Apps.
This series is created to give you quick snapshot of Azure services. You can check other services in this series over here .