Terraform level 1 challenge 29 Delete Backup from S3 Using Terraform problem

What did I do wrong here :

@rwobben

Your code only removes the bucket when running terraform destroy. When you apply it, it runs the aws s3 cp command. Please refer to the code below and try again.

resource "null_resource" "run_aws_cli" {
  provisioner "local-exec" {
    command = "aws s3 cp s3://datacenter-bck-29878 /opt/s3-backup/ --recursive && aws s3 rb s3://datacenter-bck-29878 --force"
  }
}

1 Like

Thanks, I can continue with the level 1