I am using cross-account authorisation to create AWS resources with Terraform. That is to say:
- I have an account "A" where I have a user.
- I also have an account "B" where I have a role that is authorised to deploy resources within account "B".
- My user account in "A" is authorised to assume the role in account "B".
- When I run Terraform (with the "aws" provider), I have the credentials for user "A" in the aws credentials file.
- My Terraform configuration has the provider block like this:
provider "aws" {
assume_role {
role_arn = "<ARN of roleB>"
}
}
The documentation for the aws_caller_identity data source says that it exposes details about "the calling entity", but it is unclear to me which "entity" this should be in my case: is it userA or roleB?