You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/integrations/platforms/hashicorp-terraform.mdx
+206-9Lines changed: 206 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ export const description = 'Use Phase with Terraform to manage your secrets'
7
7
8
8
# Terraform Provider
9
9
10
-
The Phase Terraform Provider allows you to securely retrieve secrets directly from your Terraform configurations. This integration enables you to incorporate secret management into your infrastructure-as-code workflows.
10
+
The Phase Terraform Provider allows you to securely manage and retrieve secrets directly from your Terraform configurations. This integration enables you to incorporate secure secret management into your infrastructure-as-code workflows.
11
11
12
12
## Prerequisites
13
13
@@ -21,7 +21,7 @@ The Phase Terraform Provider allows you to securely retrieve secrets directly fr
21
21
22
22
2. Fetch your Phase **Application ID** (AppID) by going to your application settings in the Phase Console, hovering over UUID under the App section and clicking the `Copy` button:
The provider automatically tracks secret versions and metadata:
330
+
331
+
```hcl
332
+
resource "phase_secret" "database_url" {
333
+
env = "production"
334
+
app_id = "your-app-id"
335
+
key = "DATABASE_URL"
336
+
value = "postgres://user:password@localhost:5432/db"
337
+
tags = ["database", "credentials"] # Tags must already exist in Phase Console
338
+
}
339
+
340
+
output "secret_version" {
341
+
value = phase_secret.database_url.version
342
+
}
343
+
344
+
output "secret_created_at" {
345
+
value = phase_secret.database_url.created_at
346
+
}
347
+
```
348
+
153
349
## Personal Secret Overrides
154
350
155
351
Personal Secret Overrides allow individual users to temporarily override a secret's value for their own use, without affecting the value for other users or systems. Important points to note:
@@ -167,3 +363,4 @@ Personal Secret Overrides allow individual users to temporarily override a secre
167
363
1. Use variables or environment variables for the Phase token to keep it out of your Terraform configurations.
168
364
2. Utilize Terraform's `sensitive` argument when outputting or using secret values to prevent accidental exposure.
169
365
3. Be cautious when using `terraform output` commands, as these may display sensitive information.
366
+
4. Create all necessary tags in the Phase Console before referencing them in Terraform configurations. In the near future, we will add an API to automatically create tags in Terraform.
0 commit comments