Skip to content

Commit 0864d27

Browse files
committed
OCPBUGS-23458: force destroy bootstrap ign
If S3 versioning is enabled, destroy may fail with: BucketNotEmpty: The bucket you tried to delete is not empty. You must delete all versions in the bucket. Adding the force_destroy attribute should destroy the bucket, even with versioning enabled.
1 parent 5744fea commit 0864d27

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

data/data/aws/bootstrap/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ data "aws_partition" "current" {}
4545
data "aws_ebs_default_kms_key" "current" {}
4646

4747
resource "aws_s3_bucket" "ignition" {
48-
count = var.aws_preserve_bootstrap_ignition ? 0 : 1
49-
bucket = var.aws_ignition_bucket
48+
count = var.aws_preserve_bootstrap_ignition ? 0 : 1
49+
bucket = var.aws_ignition_bucket
50+
force_destroy = true
5051

5152
tags = merge(
5253
{

0 commit comments

Comments
 (0)