-
-
Save RoyLDD/156d384bd33982e77630b27ff9568f63 to your computer and use it in GitHub Desktop.
terraform AWS assume role provider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-- External provider ------------------------------------------------------- | |
provider "aws" { | |
version = "~> 2.0" | |
region = "<AWS_REGION>" | |
assume_role { | |
role_arn = "${var.provider_env_roles[terraform.workspace]}" | |
} | |
} | |
#-- var.tf ------------------------------------------------------------------- | |
variable "provider_env_roles" { | |
type = "map" | |
default = { | |
"<ENV_1>" = "" | |
"<ENV_2>" = "arn:aws:iam::<AWS_ACCOUNT_2>:role/<ROLE_NAME>" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment