상세 컨텐츠

본문 제목

[Terraform] Terraform Certified Associate Exam MockTest

데이터 과학

by Taeyoon.Kim.DS 2024. 2. 10. 00:58

본문

Q1. Calling a child module. Specifies the moudel version. During a terraform init, what happen if the version parameter is removed?

- Terraform would use the existing module already downloaded.

 

Q2. Alias

provider "aws" {
  region = "us-east-1"
}
 
provider "aws" {
  alias  = "west"
  region = "us-west-2"
}
 
provider "aws" {
  alias  = "eu"
  region = "eu-west-2"
}

Using the same provider with diffeent configs for difference resources.

 

Q3. A deployed a new EC2 through the console. B imports the new EC2 instance. 

$ terraform import aws_instance.web_app_42 i-b54a26b28b8acv7233
Has been coded. It brings Error: resource address "aws_instance.web_app_42" does not exist in the configuration.

To solve this...
Create a configuration for the new resource in the Terraform configuration file.

Q4. Which of the following commands can be used to detect configuration drift?

terraform apply -refresh-only

(Correct)
 
Q5. Terraform Cloud 
1. VCS connection
2. Remote runs
3. Private module registry
 
Q6. Count counts number of subnet names private

resource "aws_subnet" "private_subnet" {
  count             = length(var.private_subnet_names)

 

Q7. 

resource "aws_instance" "database" {
  # ...
  for_each = {
    "vault": "secrets",
    "terraform": "infrastructure",
    "consul": "networking",
    "nomad": "scheduler"
  }
}

aws_instance.database["vault"]
aws_instance.database["terraform"]

aws_instance.database["consul"]

aws_instance.database["nomad"]

 

Q8. Main.tf is always required ?

No. any file with a .tf or .tf.json will be okay.

 

Q9. 

관련글 더보기