--- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "infisical_secret Ephemeral Resource - terraform-provider-infisical" subcategory: "Secrets" description: |- Read ephemeral secrets from Infisical --- # infisical_secret (Ephemeral Resource) Read ephemeral secrets from Infisical ## Example Usage ```terraform terraform { required_providers { infisical = { # version = source = "infisical/infisical" } postgresql = { source = "cyrilgdn/postgresql" version = "1.25.0" } } } provider "infisical" { host = "https://app.infisical.com" # Only required if using self hosted instance of Infisical, default is https://app.infisical.com auth = { universal = { client_id = "" client_secret = "" } } } ephemeral "infisical_secret" "postgres_username" { name = "POSTGRES_USERNAME" env_slug = "dev" workspace_id = "PROJECT_ID" folder_path = "/" } ephemeral "infisical_secret" "postgres_password" { name = "POSTGRES_PASSWORD" env_slug = "dev" workspace_id = "PROJECT_ID" folder_path = "/" } locals { credentials = { username = ephemeral.infisical_secret.postgres_username.value password = ephemeral.infisical_secret.postgres_password.value } } provider "postgresql" { host = data.aws_db_instance.example.address port = data.aws_db_instance.example.port username = local.credentials["username"] password = local.credentials["password"] } ``` ## Schema ### Required - `env_slug` (String) The environment slug of the secret to fetch - `folder_path` (String) The path to the folder where the given secret resides - `name` (String) The name of the secret - `workspace_id` (String) The Infisical project ID ### Read-Only - `metadata` (Map of String) Metadata associated with the secret as key-value pairs. - `value` (String, Sensitive) The value of the secret - `version` (Number) The version number of the secret