31 lines
727 B
HCL
31 lines
727 B
HCL
module "main" {
|
|
source = "../"
|
|
|
|
name = "tftest-user"
|
|
}
|
|
|
|
data "aws_caller_identity" "current" {}
|
|
|
|
# tflint-ignore: terraform_unused_declarations
|
|
data "external" "main" {
|
|
program = ["${path.module}/test.sh"]
|
|
|
|
depends_on = [local_file.aws_config]
|
|
}
|
|
|
|
locals {
|
|
# tflint-ignore: terraform_unused_declarations
|
|
expected_arn = format(
|
|
"arn:aws:iam::%s:user/tftest-user",
|
|
data.aws_caller_identity.current.account_id,
|
|
)
|
|
}
|
|
|
|
resource "local_file" "aws_config" {
|
|
filename = "${path.module}/aws_config"
|
|
file_permission = "0600"
|
|
content = templatefile("${path.module}/aws_config.tftpl", {
|
|
aws_access_key_id = module.main.access_key_id
|
|
aws_access_key_secret = module.main.access_key_secret
|
|
})
|
|
}
|