Free Terraform Associate Exam Braindumps (page: 40)

Page 39 of 113

Refer to the below code where developer is outputting the value of the database password but has used sensitive parameter to hide the output value in the CLI.
output "db_password" { value = aws_db_instance.db.password description = "The password for logging in to the database." sensitive = true}
Since sensitive is set to true, the value associated with db password will not be present in state file as plain-text?

  1. False
  2. True

Answer(s): A

Explanation:

Sensitive output values are still recorded in the state, and so will be visible to anyone who is able to access the state data.



While using generic git repository as a module source, which of the below options allows terraform to select a specific version or tag instead of selecting the HEAD.

  1. Append ref argument as
    module "vpc" { source = "git::https://example.com/vpc.git?ref=v1.2.0"}
  2. Append version argument as
    module "vpc" { source = "git::https://example.com/vpc.git?version=v1.2.0"}
  3. Append ref argument as
    module "vpc" { source = "git::https://example.com/vpc.git#ref=v1.2.0"}
  4. By default, Terraform will clone and use the default branch (referenced by HEAD) in the selected repository and you can not override this.

Answer(s): A

Explanation:

By default, Terraform will clone and use the default branch (referenced by HEAD) in the selected repository. You can override this using the ref argument:
module "vpc" {
source = "git::https://example.com/vpc.git?ref=v1.2.0"
}
The value of the ref argument can be any reference that would be accepted by the git checkout command, including branch and tag names. https://www.terraform.io/docs/modules/sources.html



In regards to deploying resources in multi-cloud environments, what are some of the benefits of using Terraform rather than a provider's native tooling? (select three)

  1. Terraform can help businesses deploy applications on multiple clouds and on-premises infrastructure.
  2. Terraform is not cloud-agnostic and can be used to deploy resources across a single public cloud.
  3. Terraform simplifies management and orchestration, helping operators build large-scale, multi- cloud infrastructure.
  4. Terraform can manage cross-cloud dependencies.

Answer(s): A,C,D

Explanation:

Terraform is cloud-agnostic and allows a single configuration to be used to manage multiple providers, and to even handle cross-cloud dependencies. This simplifies management and orchestration, helping operators build large-scale multi-cloud infrastructures. https://www.terraform.io/intro/use-cases.html



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?

  1. terraform import aws_instance.id = i-0260835eb7e9bd40
  2. terraform import i-0260835eb7e9bd40
  3. terraform import aws_instance.i-0260835eb7e9bd40
  4. terraform import aws_instance.matt_ec2 i-0260835eb7e9bd40

Answer(s): D


Reference:

https://www.terraform.io/docs/import/usage.html






Post your Comments and Discuss HashiCorp Terraform Associate exam with other Community members:

Terraform Associate Exam Discussions & Posts