-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The module uses a null_resource with triggers to create the Athena table with the AWS CLI.
It turns out using the provisioner destroy time provider to destroy the table isn't possible because running the destroy command requires inputs that aren't available during a destroy (see error below).
│ Error: Invalid reference from destroy provisioner
│
│ on .terraform/modules/elblogging_bucket/athena.tf line 37, in resource "null_resource" "create_table":
│ 37: command = templatefile("${path.module}/templates/delete_table.sh.tpl", {
│ 38: results_config = "OutputLocation=s3://${aws_s3_bucket.this.bucket}/elblogging-athena-results"
│ 39: execution_context = "Database=${aws_athena_database.this[0].id}"
│ 40: })
│
│ Destroy-time provisioners and their connection configurations may only reference attributes of the related resource, via
│ 'self', 'count.index', or 'each.key'.
│
│ References to other resources during the destroy phase can cause dependency cycles and interact poorly with
│ create_before_destroy.
Right now the work-around is to provide the aws cli command to delete the table as an output to the module.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request