0
0
Terraformcloud~10 mins

Provider caching and mirrors in Terraform - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the Terraform provider source.

Terraform
terraform {
  required_providers {
    aws = {
      source = "[1]"
      version = "~> 4.0"
    }
  }
}
Drag options to blanks, or click blank then click option'
Aaws/hashicorp
Bprovider/aws
Cterraform/aws
Dhashicorp/aws
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect source format like 'aws/hashicorp' or 'terraform/aws'.
Forgetting to specify the source at all.
2fill in blank
medium

Complete the code to configure a provider mirror for Terraform.

Terraform
provider_installation {
  filesystem_mirror {
    path    = "[1]"
    include = ["hashicorp/*"]
  }
  direct {
    exclude = ["hashicorp/*"]
  }
}
Drag options to blanks, or click blank then click option'
A/usr/local/providers
B/mnt/terraform-providers
C/etc/terraform/mirrors
D/var/lib/providers
Attempts:
3 left
💡 Hint
Common Mistakes
Using relative paths instead of absolute paths.
Choosing a path that does not exist or is not accessible.
3fill in blank
hard

Fix the error in the provider installation block to correctly enable the mirror.

Terraform
provider_installation {
  [1] {
    path    = "/mnt/terraform-providers"
    include = ["hashicorp/*"]
  }
  direct {
    exclude = ["hashicorp/*"]
  }
}
Drag options to blanks, or click blank then click option'
Afilesystem_mirror
Bfile_mirror
Cmirror_filesystem
Dmirror
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect block names like 'file_mirror' or 'mirror_filesystem'.
Misspelling the block name.
4fill in blank
hard

Fill both blanks to configure Terraform to use a mirror and fallback to direct installation.

Terraform
provider_installation {
  [1] {
    path    = "/opt/terraform/providers"
    include = ["[2]"]
  }
  direct {}
}
Drag options to blanks, or click blank then click option'
Afilesystem_mirror
Bhashicorp/*
Clocal_mirror
Dterraform/*
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect block names like 'local_mirror'.
Using wrong provider patterns like 'terraform/*'.
5fill in blank
hard

Fill all three blanks to configure Terraform with a mirror path, include pattern, and exclude pattern.

Terraform
provider_installation {
  [1] {
    path    = "/data/terraform/providers"
    include = ["[2]"]
  }
  direct {
    exclude = ["[3]"]
  }
}
Drag options to blanks, or click blank then click option'
Afilesystem_mirror
Bhashicorp/*
Dcustom/*
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same pattern for include and exclude incorrectly.
Using wrong block names or patterns.