Solved: How to configure Terraform backend on AWS S3

Terraform is a very useful tool for IaaS. As you would have already known that it create a .tfstate file to save the status of infra. If you are doing testing you can save the .tfstate locally on your laptop. But, if you are working in prod environment with team then it's best that you save the .tfstate remotely so that it's secure and can be used by other team members.
Here we will show you two ways of configuring AWS S3 as backend to save the .tfstate file.
  1. First way of configuring .tfstate is that you define it in the main.tf file. You will just have to add a snippet like below in your main.tf file.
terraform {

      backend "s3" {

          bucket="cloudvedas-test123"

          key="cloudvedas-test-s3.tfstate"

          region="us-east-1"

      }

}

Here we have defined following things.
bucket = The S3 bucket in which the .tfstate should be saved
key = The name of the .tfstate file
region = The region in which S3 backend bucket exists.
2 Another way of specifying the S3 backend is that you define it when you initialize the terraform using the init command. This can be useful when you want to invoke the terraform from a jenkins file.
  • Here is an example that you can  execute in windows command prompt. This will do the same thing as we did in first example.
terraform init -no-color -reconfigure -force-copy -backend-config="region="us-east-1"" \
-backend-config="bucket="cloudvedas-test123"" -backend-config="key="cloudvedas-test1-win-s3.tfstate""
  • If you want to execute from a linux shell use below syntax.
 terraform init -no-color -reconfigure -force-copy \
-backend-config="region=us-east-1" \
-backend-config="bucket=cloudvedas-test123" \
-backend-config="key=cloudvedas-test-s3.tfstate"
Give it a try and let us know in comments section if you have any query or suggestion.

Solved RDS : Access denied; you need the SUPER privilege for thisoperation

Access denied; you need the SUPER privilege for this operation

You may get this error while trying to set values for RDS AURORA MySQL from the command line. It can be setting for long running queries or slow queries or many others.

If, you are sure you are trying to execute these changes using the master user then you can’t set these from command line.

For RDS Aurora you will have to make these changes through Parameter groups of DB and Cluster.

  •  To make the change, login to your AWS RDS console.
  • On the left side panel click on Parameter Groups and select the group associated with your RDS Cluster and node.
  • Make changes in the parameter groups.
  • Once you have saved the changes in parameter group it will start applying to your RDS cluster.

Some parameter changes will require reboot of your cluster while others can be done without reboot.  You will see pending-reboot in your cluster if it needs reboot to change the parameter.  For more details about parameter groups refer this AWS doc.

Solved : How to redirect non-www blogger custom domain to www with SSL

If you have added a custom domain to your blogger blog you may have noticed that when you access your domain like www.example.com it works fine but if you try to access the naked domain like example.com(notice no www) it fails or gives SSL error. In this post we will show you how to fix this.

Review of 70-532 Developing Microsoft Azure Solutions Certification preparation course by Scott Duffy

In our earlier post we have described steps about how you can prepare for Architecting Microsoft Azure Solutions Certification. But, if you have just started your journey in Azure than it will be a good idea to start with the Azure developer certification which is 70-532 Developing Microsoft Azure Solutions .
If you are an absolute beginner you can start with free Azure account.  It will help give a good understanding of Azure. But, be careful while using the resources because as we get free hand access to resources, we tend to spin up lot of instances and forget them running. This may end up with a huge bill. Best practice is that you setup a billing alert to avoid any shocks at month end.
To further hone your skills you can either go for Azure classroom training or go for online courses. The classroom training will cost you from USD 800 to USD 2000. While the online courses can cost you from USD 10 to USD 300, depending on which course you choose.
As mentioned in the last post since my experience with online courses was good as it give you good foundation, so I prefer to go the online way.
When I started my search for a suitable course I zeroed in on 70-532 or renamed AZ-203 Developing Microsoft Azure Solutions Certification  course by Scott Duffy on Udemy.
Scott himself is a certified architect and got a rich industry experience. Going through the course content I found that it covered almost all exam topics. Also Scott keeps on updating the content as the syllabus changes. And if you buy from Udemy you get free life time access to the course so I went with this one.
As of Dec-18 the course contents 10 hours of video and a practice test. Also, you get lifetime free access to the course on Udemy.
It’s a good idea to follow all the labs with the instructor and once you get confidence redo the labs independently. Don’t forget to complete the practice quizzes to check your knowledge.
You can also supplement your preparation with practice Tests for 70-532 Developing MS Azure Solutions  .

Solved : How to simply install python pip on windows?

The latest version of python is shipped with pip. But, if you are using older version of python 2(<2.7.9) or python 3(<3.4) and still need pip on windows please follow the instruction below.
If pip is not installed or the path is not set correctly you will get an error like below while invoking it in windows command prompt.
pip install sklearn'pip' is not recognized as an internal or external command,operable program or batch file.
Here are the steps to get pip in your windows box.
  • Download get-pip.py . Copy and paste the contents of the link in a notepad and save it as get-pip.py, remember not in .txt format but .py format.
  • Next install it.
python get-pip.py
  • Find the recently installed pip.exe in your machine. It’s generally in C:\Python27\Scripts or similar folder depending on the python version you installed. You can set the path variable in windows using these instructions.
– Search for “Advanced System Settings” in your windows machine.
– Click on the tab “Advanced”. In it click on Environment Variables.
– In the new window click on System Variables.  Select “Path” and click on “Edit”.
– Click on new and enter C:\Python27\Scripts\ in the space.
– Finally click ok to all windows and re-open command prompt.
  • If you have followed the instructions correctly you will now be able to install packages using pip.
pip install sklearn
That’s all you need to install pip in windows.
Tip:- Some people make mistake of executing pip from Python interpreter and get the below error.

>>> pip install sklearn
File "<stdin>", line 1
pip install sklearn^SyntaxError: invalid syntax
>>>

But, from the above tutorial you now know that pip is installed and executed from command prompt and not from the interpreter.
Hope you find this simple tutorial useful. Let us know in comment section if you face any issue.