Skip to content

Latest commit

 

History

History
90 lines (70 loc) · 3.43 KB

File metadata and controls

90 lines (70 loc) · 3.43 KB
page_title dbtcloud_athena_credential Resource - dbtcloud
subcategory
description Athena credential resource

dbtcloud_athena_credential (Resource)

Athena credential resource

Example Usage

// 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"
}

Schema

Required

  • project_id (Number) Project ID to create the Athena credential in
  • schema (String) The schema where to create models

Optional

  • aws_access_key_id (String, Sensitive) AWS access key ID for Athena user. Consider using aws_access_key_id_wo instead, which is not stored in state.
  • aws_access_key_id_wo (String) Write-only alternative to aws_access_key_id. The value is not stored in state. Requires aws_access_key_id_wo_version to trigger updates.
  • aws_access_key_id_wo_version (Number) Version number for aws_access_key_id_wo. Increment this value to trigger an update of the AWS access key ID when using aws_access_key_id_wo.
  • aws_secret_access_key (String, Sensitive) AWS secret access key for Athena user. Consider using aws_secret_access_key_wo instead, which is not stored in state.
  • aws_secret_access_key_wo (String) Write-only alternative to aws_secret_access_key. The value is not stored in state. Requires aws_secret_access_key_wo_version to trigger updates.
  • aws_secret_access_key_wo_version (Number) Version number for aws_secret_access_key_wo. Increment this value to trigger an update of the AWS secret access key when using aws_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.

Read-Only

  • credential_id (Number) The internal credential ID
  • id (String) The ID of this resource. Contains the project ID and the credential ID.

Import

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