Skip to content

pruneops_terraform_config (Resource)

Where PruneOps finds Terraform state files (.tfstate in S3) to map resources to their Terraform address and detect drift.

Example Usage

resource "pruneops_terraform_config" "prod_states" {
  name       = "Production states"
  s3_bucket  = "acme-terraform-states"
  s3_prefix  = "prod/"
  account_id = pruneops_cloud_account.aws_prod.id
}

Schema

Required

  • account_id (String) The pruneops_cloud_account whose credentials read the bucket.
  • name (String) Display name.
  • s3_bucket (String) S3 bucket holding the state files.

Optional

  • priority (Number) Evaluation order, lower first.
  • s3_pattern (String) File name pattern of the state files.
  • s3_prefix (String) Key prefix within the bucket. Empty: the whole bucket.

Read-Only

  • id (String) Config id, generated by PruneOps.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

terraform import pruneops_terraform_config.prod_states 4ac7a4a9