16 lines
344 B
Terraform
16 lines
344 B
Terraform
|
locals {
|
||
|
assume_role_arn = "arn:aws:iam::${var.account_id}:role/${var.role_name}"
|
||
|
}
|
||
|
|
||
|
data "external" "awscli" {
|
||
|
program = [format("%s/assumeRole.sh", path.module)]
|
||
|
query = {
|
||
|
assume_role_arn = local.assume_role_arn
|
||
|
role_session_name = var.role_session_name
|
||
|
}
|
||
|
}
|
||
|
|
||
|
output temp_credential {
|
||
|
value = data.external.awscli.result
|
||
|
}
|