Skill 2.3.1

Using several provider types in one configuration

Key Concepts

Each provider is declared in required_providers and, if it needs settings, configured with its own provider block. Resources from different providers then reference each other freely. For example, a random_pet resource from the random provider can generate a name that an aws_s3_bucket uses, and a cloudflare_dns_record can point at an AWS load balancer's DNS name.

Terraform builds one dependency graph across all providers, so it creates the random name before the bucket and the load balancer before the DNS record. The state file records which provider configuration manages each resource.