Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam Terraform Associate topic 1 question 108 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 108
Topic #: 1
[All Terraform Associate Questions]

FILL BLANK -
In the below configuration, how would you reference the module output vpc_id?

Type your answer in the field provided. The text field is not case sensitive and all variations of the correct answer are accepted.

Show Suggested Answer Hide Answer
Suggested Answer: output "outvpc_id"

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Hizumi
Highly Voted 1 year, 8 months ago
module.vpc.vpc_id Reference: https://cloudcasts.io/course/terraform/community-vpc-module
upvoted 67 times
...
shopkitty
Highly Voted 1 year, 8 months ago
it should be module.vpc.vpc_id
upvoted 17 times
...
temor
Most Recent 1 month, 2 weeks ago
module.vpc.vpc_id
upvoted 1 times
...
5719d28
2 months, 2 weeks ago
module.vpc.vpc_id
upvoted 1 times
...
NashP
3 months, 2 weeks ago
To reference the module output `vpc_id` in the given configuration, you would use the following syntax: ```hcl module.vpc.vpc_id ``` This assumes that the output variable `vpc_id` is declared in the "example" module. Replace `vpc` with the actual name you gave to your module. So, if your module is named "vpc," the reference would be: ```hcl module.vpc.vpc_id ``` This syntax allows you to access the output value `vpc_id` from the specified module in your Terraform configuration.
upvoted 1 times
...
KingFvsher
8 months ago
You can reference the vpc_id output of a module in Terraform using the module.<MODULE_NAME>.<OUTPUT_NAME> syntax. In this case, if the name of the module block is vpc, you would reference the vpc_id output as module.vpc.vpc_id.
upvoted 4 times
...
debabrata6983
8 months, 3 weeks ago
module.vpc.vpc_id
upvoted 2 times
...
arunrkaushik
9 months, 1 week ago
resource "aws_vpc" "my_vpc" { cidr_block = "10.0.0.0/16" ... } output "vpc_id" { value = aws_vpc.my_vpc.id }
upvoted 1 times
...
joyboy23
10 months, 2 weeks ago
module.vpc.vpc_id
upvoted 1 times
...
abhi6199
11 months ago
its module.vpc.vpc_id
upvoted 1 times
...
IK912
11 months ago
module.vpc.vpc_id
upvoted 1 times
...
Ni33
1 year ago
module.vpc.vpc_id
upvoted 1 times
...
Nunyabiznes
1 year, 1 month ago
To reference the vpc_id output of the vpc module in the above configuration, you would use the following syntax: module.vpc.vpc_id This would allow you to reference the vpc_id output from other parts of your Terraform configuration, such as when creating resources that depend on the VPC. For example: resource "aws_subnet" "subnet_1" { vpc_id = module.vpc.vpc_id cidr_block = "10.0.1.0/24" } In this example, the aws_subnet resource is referencing the vpc_id output of the vpc module to ensure that the subnet is created in the correct VPC.
upvoted 5 times
...
alexsandroe
1 year, 2 months ago
module.vpc.id
upvoted 1 times
...
TechHero
1 year, 3 months ago
To reference the output vpc_id from the above module configuration, you would use the following syntax: module.vpc.vpc_id Here, module is the prefix used to reference outputs from a module, vpc is the name of the module, and vpc_id is the name of the output being referenced.
upvoted 5 times
alec123
1 year, 3 months ago
correct
upvoted 1 times
...
...
RVivek
1 year, 7 months ago
It should be module.vpc.vpc_id
upvoted 2 times
...
keiffo2
1 year, 8 months ago
module.vpc.id
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...