Create Snapshot Using Terraform Kodekloud Engineer Task Success

Ticker

6/recent/ticker-posts

Create Snapshot Using Terraform Kodekloud Engineer Task Success

 Question :  he Nautilus DevOps team has some volumes in different regions in their AWS account. They are going to setup some automated backups so that all important data can be backed up on regular basis. For now they shared some requirements to take a snapshot of one of the volumes they have.

Create a snapshot of an existing volume named devops-vol in us-east-1 region using terraform.

1) The name of the snapshot must be devops-vol-ss.

2) The description must be Devops Snapshot.

3) Make sure the snapshot status is completed before submitting the task.

The Terraform working directory is /home/bob/terraform. Update the main.tf file (do not create a separate .tf file) to accomplish this task.

Note: Right-click under the EXPLORER section in VS Code and select Open in Integrated Terminal to launch the terminal.



Please Note:-  Perform the below commands based on your question server,  user name & other details that might differ as per the task.

Solution:  

1. In VS Code Editor create a new file  main.tf 

      (Refer Video below for better understanding )


Code you will get on Git Lab repository 

https://gitlab.com/nb-tech-support/devops/-/blob/master/Terraform

resource "aws_ebs_snapshot" "devops-vol-ss" {
  description = "Devops Snapshot"
  volume_id = aws_ebs_volume.k8s_volume.id

  tags = {
    Name = "devops-vol-ss"
  }
}

output "snapshot_id" {
  value       = aws_ebs_snapshot.devops-vol-ss.id
  description = "The ID of snapshot."
}

2  Execute given below command one another.

terraform init

terraform plan

terraform apply



3. Click on Finish & Confirm to complete the task successful

Happy Learning!!!!


Apart from this if you need more clarity,  I have made a  tutorial video on this , 

please go through and share your comments. Like and share the knowledge



















Post a Comment

0 Comments

Latest Posts

Create Snapshot Using Terraform  Kodekloud Engineer Task Success