Question 1 · choose 1
A team finds a module named "vpc" for the aws provider, published by the "terraform-aws-modules" namespace in the public Terraform Registry. Which source argument installs it?
- Asource = "aws/vpc/terraform-aws-modules"
- Bsource = "terraform-aws-modules/vpc/aws"
- Csource = "registry::terraform-aws-modules/vpc"
- Dsource = "https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws"
Show the answer and why
Asource = "aws/vpc/terraform-aws-modules"
Incorrect
The order is namespace, name, provider.
Bsource = "terraform-aws-modules/vpc/aws"
Correct
Public registry modules use the <NAMESPACE>/<NAME>/<PROVIDER> source format.
Csource = "registry::terraform-aws-modules/vpc"
Incorrect
There is no registry:: prefix, and the provider part is missing.
Dsource = "https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws"
Incorrect
Registry modules are addressed by namespace, name and provider, not by their web page URL.
Public registry addresses have three parts: namespace, module name and provider.
HashiCorp documentation