Question 26

Matt wants to import a manually created EC2 instance into terraform so that he can manage the EC2 instance
through terraform going forward. He has written the configuration file of the EC2 instance before importing it
to Terraform. Following is the code:
resource "aws_instance" "matt_ec2" { ami = "ami-bg2640de" instance_type = "t2.micro"
vpc_security_group_ids = ["sg-6ae7d613", "sg-53370035"] key_name = "mysecret" subnet_id =
"subnet-9e3cfbc5" }
The instance id of that EC2 instance is i-0260835eb7e9bd40 How he can import data of EC2 to state file?
  • Question 27

    Changing the Terraform backend from the default "local" backend to a different one after doing your first
    terraform apply is:
  • Question 28

    Every region in AWS has a different AMI ID for Linux and these are keep on changing. What is the best
    approach to create the EC2 instances that can deal with different AMI IDs based on regions?
  • Question 29

    The Security Operations team of ABC Enterprise wants to mandate that all the Terraform configuration that
    creates an S3 bucket must have encryption feature enabled. What is the best way to achieve it?
  • Question 30

    Which of the following is not an action performed by terraform init?