| page_title | dbtcloud_athena_credential Resource - dbtcloud |
|---|---|
| subcategory | |
| description | Athena credential resource |
Athena credential resource
// Using the classic sensitive attributes (stored in state)
resource "dbtcloud_athena_credential" "example" {
project_id = dbtcloud_project.example.id
aws_access_key_id = "your-access-key-id"
aws_secret_access_key = "your-secret-access-key"
schema = "your_schema"
}
// Using write-only attributes (not stored in state, requires Terraform >= 1.11)
//
// The aws_access_key_id_wo and aws_secret_access_key_wo values are never persisted in the Terraform state file.
// Use aws_access_key_id_wo_version / aws_secret_access_key_wo_version to trigger an update when the secret changes.
variable "athena_aws_access_key_id" {
type = string
ephemeral = true
}
variable "athena_aws_secret_access_key" {
type = string
ephemeral = true
}
resource "dbtcloud_athena_credential" "example_wo" {
project_id = dbtcloud_project.example.id
aws_access_key_id_wo = var.athena_aws_access_key_id
aws_access_key_id_wo_version = 1
aws_secret_access_key_wo = var.athena_aws_secret_access_key
aws_secret_access_key_wo_version = 1
schema = "your_schema"
}project_id(Number) Project ID to create the Athena credential inschema(String) The schema where to create models
aws_access_key_id(String, Sensitive) AWS access key ID for Athena user. Consider usingaws_access_key_id_woinstead, which is not stored in state.aws_access_key_id_wo(String) Write-only alternative toaws_access_key_id. The value is not stored in state. Requiresaws_access_key_id_wo_versionto trigger updates.aws_access_key_id_wo_version(Number) Version number foraws_access_key_id_wo. Increment this value to trigger an update of the AWS access key ID when usingaws_access_key_id_wo.aws_secret_access_key(String, Sensitive) AWS secret access key for Athena user. Consider usingaws_secret_access_key_woinstead, which is not stored in state.aws_secret_access_key_wo(String) Write-only alternative toaws_secret_access_key. The value is not stored in state. Requiresaws_secret_access_key_wo_versionto trigger updates.aws_secret_access_key_wo_version(Number) Version number foraws_secret_access_key_wo. Increment this value to trigger an update of the AWS secret access key when usingaws_secret_access_key_wo.resource_metadata(Dynamic) Metadata for tracking resource identity during account migrations. Stored in Terraform state only and not sent to the API.
credential_id(Number) The internal credential IDid(String) The ID of this resource. Contains the project ID and the credential ID.
Import is supported using the following syntax:
# using import blocks (requires Terraform >= 1.5)
import {
to = dbtcloud_athena_credential.my_athena_credential
id = "project_id:credential_id"
}
import {
to = dbtcloud_athena_credential.my_athena_credential
id = "12345:6789"
}
# using the older import command
terraform import dbtcloud_athena_credential.my_athena_credential "project_id:credential_id"
terraform import dbtcloud_athena_credential.my_athena_credential 12345:6789