Saturday, 14 July 2018

Fetch the output of resource

If you want to fetch the output of s3 bucket domain name. you can use below output section.It more are less same of other service only differ attribute and service name.

Syntax of Attribute:                                                                 

(Provider_property.userdefined_property.Attributes)         aws_s3_bucket.my_bucket.bucket_domain_name




provider "aws" {
  region     = "us-east-1"  
  access_key = "CCCCCCCCCCCCCCCCCCCCCC"  
  secret_key = "CCCCCCCCCCCCCCCCCCCCCC"}

resource "aws_s3_bucket" "my_bucket" {
  bucket = "my-bucket-testing-frist"}

output "bucket" {
  value = "${aws_s3_bucket.my_bucket.bucket_domain_name}"}

Friday, 13 July 2018

Install Terraform – Windows & Linux

  1. Download terraform for windows 
    • Note: Terraform is packaged as a zip archive, so after downloading Terraform, unzip the package. 
  2. Copy files from the zip to “c:\terraform” for example. That’s our terraform PATH.

Windows 10 and Windows 8

  1. In Search, search for and then select: System (Control Panel)
  2. Click the System and Security link.
  3. Click the System link.
  4. Click the Advanced system settings link.
  5. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
  6. In the Edit System Variable (or New System Variable) window, append at the end of the PATH environment variable the value of terraform path ex.”c:\terraform;” . Click OK. Close all remaining windows by clicking OK.
  7. Reopen Command prompt window, and run terraform.

Windows 7

  1. From the desktop, right click the Computer icon.
  2. Choose Properties from the context menu.
  3. Click the Advanced system settings link.
  4. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
  5. In the Edit System Variable (or New System Variable) window, append at the end of the PATH environment variable the value of terraform path ex.”c:\terraform;” . Click OK. Close all remaining windows by clicking OK.
  6. Reopen Command prompt window, and run terraform.

Install Terraform – Linux

  1. Download terraform for linux.
$ wget https://releases.hashicorp.com/terraform/0.xx.x/terraform_0.xx.x_linux_amd64.zip

  • Note: Terraform is packaged as a zip archive, so after downloading Terraform, unzip the package. Terraform runs as a single binary named terraform. Any other files in the package can be safely removed and Terraform will still function
          2.Install unzip

                sudo apt-get install unzip
     

         3.Unzip and set path.


            $ unzip terraform_0.11.1_linux_amd64.zip 
            $ sudo mv terraform /usr/local/bin/

Verify Install

When you’re done, you should be able to run the terraform command and get the usage information:

Configure EKS Persistent Static Storage With Elastic File System Using Terraform

  checkout :https://youtu.be/QuUIgQWBBZM