forked from iam-veeramalla/terraform-zero-to-hero
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
32 lines (26 loc) · 598 Bytes
/
main.tf
File metadata and controls
32 lines (26 loc) · 598 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
provider "aws" {
region = "us-east-1"
}
provider "vault" {
address = "<>:8200"
skip_child_token = true
auth_login {
path = "auth/approle/login"
parameters = {
role_id = "<>"
secret_id = "<>"
}
}
}
data "vault_kv_secret_v2" "example" {
mount = "secret" // change it according to your mount
name = "test-secret" // change it according to your secret
}
resource "aws_instance" "my_instance" {
ami = "ami-053b0d53c279acc90"
instance_type = "t2.micro"
tags = {
Name = "test"
Secret = data.vault_kv_secret_v2.example.data["foo"]
}
}