Difference between revisions of "Multiple providers"
Jump to navigation
Jump to search
↑ https://www.terraform.io/language/providers/configuration
(Created page with "You can optionally define multiple configurations for the same provider, and select which one to use on a per-resource or per-module basis. <ref>https://www.terraform.io/langu...") |
|||
Line 1: | Line 1: | ||
− | You can optionally define multiple configurations for the same provider, and select which one to use on a per-resource or per-module basis. <ref>https://www.terraform.io/language/providers/configuration</ref> | + | You can optionally define multiple configurations for the same [[provider]], and select which one to use on a per-resource or per-module basis. <ref>https://www.terraform.io/language/providers/configuration</ref> |
+ | |||
+ | === Example === | ||
+ | |||
+ | <pre> | ||
+ | # The default provider configuration; resources that begin with `aws_` will use | ||
+ | # it as the default, and it can be referenced as `aws`. | ||
+ | provider "aws" { | ||
+ | region = "us-east-1" | ||
+ | } | ||
+ | |||
+ | # Additional provider configuration for west coast region; resources can | ||
+ | # reference this as `aws.west`. | ||
+ | provider "aws" { | ||
+ | alias = "west" | ||
+ | region = "us-west-2" | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | <pre> | ||
+ | terraform { | ||
+ | required_providers { | ||
+ | mycloud = { | ||
+ | source = "mycorp/mycloud" | ||
+ | version = "~> 1.0" | ||
+ | configuration_aliases = [ mycloud.alternate ] | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </pre> | ||
== Questions examples == | == Questions examples == |
Revision as of 05:11, 21 February 2022
You can optionally define multiple configurations for the same provider, and select which one to use on a per-resource or per-module basis. [1]
Contents
Example
# The default provider configuration; resources that begin with `aws_` will use # it as the default, and it can be referenced as `aws`. provider "aws" { region = "us-east-1" } # Additional provider configuration for west coast region; resources can # reference this as `aws.west`. provider "aws" { alias = "west" region = "us-west-2" }
terraform { required_providers { mycloud = { source = "mycorp/mycloud" version = "~> 1.0" configuration_aliases = [ mycloud.alternate ] } } }
Questions examples
- https://learn.hashicorp.com/tutorials/terraform/associate-questions?in=terraform/certification
- https://www.whizlabs.com/blog/terraform-certification-exam-questions/
- 250 questions and answers: https://medium.com/bb-tutorials-and-thoughts/250-practice-questions-for-terraform-associate-certification-7a3ccebe6a1a
Related
See also
- Terraform, OpenTofu, Terrakube.org, Installation, Terraform AWS, Terraform GCP, Terraform commands, Terraform Cloud, Terraform Enterprise (TFE), HCL, HIL, meta-arguments, providers, modules, resource, provisioners, data sources, backends: remote backends, examples, configuration files, state files, variables, types, Terraform Registry, conditionals:
depends_on
, functions, Blocks, dynamic blocks, errors, Terragrunt, Terraformer, Terratest, Terraform certifications, Terraform map type, Terraform Associate, Terraform: list type,TF_VAR_, TF_LOG
, Terraform provider versioning, Terraform Style Conventions, Required version, Terraform plugin, Terraform Named Values, tags, Changelog,tfsec, tflint
, Operators, Expressions:for, splat
, Debugging, Namespaces, Terraform Landing Zones, CDKTF, Atmos - Certifications: Security certifications, Enterprise architecture, Coursera, AWS certifications, CertiProf, Pearson VUE, Terraform Associate, Freecram, ExamLabs
Advertising: