diff options
Diffstat (limited to 'fdio.infra.terraform/1n_nmd')
-rw-r--r-- | fdio.infra.terraform/1n_nmd/aws/main.tf | 37 | ||||
-rw-r--r-- | fdio.infra.terraform/1n_nmd/aws/providers.tf | 14 | ||||
-rw-r--r-- | fdio.infra.terraform/1n_nmd/aws/variables.tf | 9 |
3 files changed, 60 insertions, 0 deletions
diff --git a/fdio.infra.terraform/1n_nmd/aws/main.tf b/fdio.infra.terraform/1n_nmd/aws/main.tf new file mode 100644 index 0000000000..6768203441 --- /dev/null +++ b/fdio.infra.terraform/1n_nmd/aws/main.tf @@ -0,0 +1,37 @@ +resource "vault_aws_secret_backend" "aws" { + access_key = var.aws_access_key + secret_key = var.aws_secret_key + path = "${var.name}-path" + + default_lease_ttl_seconds = "120" + max_lease_ttl_seconds = "240" +} + +resource "vault_aws_secret_backend_role" "admin" { + backend = vault_aws_secret_backend.aws.path + name = "${var.name}-role" + credential_type = "iam_user" + + policy_document = <<EOF +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "iam:*", "ec2:*" + ], + "Resource": "*" + } + ] +} +EOF +} + +output "backend" { + value = vault_aws_secret_backend.aws.path +} + +output "role" { + value = vault_aws_secret_backend_role.admin.name +}
\ No newline at end of file diff --git a/fdio.infra.terraform/1n_nmd/aws/providers.tf b/fdio.infra.terraform/1n_nmd/aws/providers.tf new file mode 100644 index 0000000000..49922fd78f --- /dev/null +++ b/fdio.infra.terraform/1n_nmd/aws/providers.tf @@ -0,0 +1,14 @@ +terraform { + required_providers { + vault = { + version = ">=2.22.1" + } + } + required_version = ">= 1.0.3" +} + +provider "vault" { + address = "http://10.30.51.28:8200" + skip_tls_verify = true + token = "s.4z5PsufFwV3sHbCzK9Y2Cojd" +}
\ No newline at end of file diff --git a/fdio.infra.terraform/1n_nmd/aws/variables.tf b/fdio.infra.terraform/1n_nmd/aws/variables.tf new file mode 100644 index 0000000000..11c3535266 --- /dev/null +++ b/fdio.infra.terraform/1n_nmd/aws/variables.tf @@ -0,0 +1,9 @@ +variable "aws_access_key" { +} + +variable "aws_secret_key" { +} + +variable "name" { + default = "dynamic-aws-creds-vault-admin" +}
\ No newline at end of file |