Terraform & IaC
Multi account providers
Multi-account Terraform works when each provider configuration assumes a role in its own account, because an assumed session carries that role's permissions and then expires, so confirm the target before every apply.
What you will be able to do
- Explain how assumed roles and trust policies give a provider access to another account.
- Decide how to confirm the target account at the start of every job.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in Terraform & IaC
- Secret handlingAdvanced · 5 min
Secrets in Terraform reach state and plan files even when they are marked sensitive, so a handling plan must cover where values are stored, who can read them and how…
- Provider aliasesAdvanced · 4 min
Provider aliases give one provider several configurations, and resources and modules must pick one explicitly because the default is used without warning when they do…
- Workspaces limitationsAdvanced · 4 min
Workspaces hold separate states inside one backend and one configuration, which makes them a weak barrier between environments that need separate credentials, so use…
- Policy as codeAdvanced · 4 min
Policy as code checks Terraform plan data against written rules before changes are applied, and it protects a team only when the rules are tested and fail on a known…
- OPA and SentinelAdvanced · 4 min
OPA and Sentinel are policy frameworks that evaluate rules against plan data, and the right choice depends on whether the checks run inside HCP Terraform or in your own…
- Terraform testingAdvanced · 4 min
Explain how Terraform's built-in test files check a module's behaviour. Plan-mode runs read planned values cheaply, while apply-mode runs create real infrastructure and…