func ValidateDestroyFlags()

in helpers/foundation-deployer/stages/validate.go [96:120]


func ValidateDestroyFlags(t testing.TB, g GlobalTFVars) {
	flags := []string{}

	if g.BucketForceDestroy == nil || !*g.BucketForceDestroy {
		flags = append(flags, "bucket_force_destroy")
	}
	if g.AuditLogsTableDeleteContentsOnDestroy == nil || !*g.AuditLogsTableDeleteContentsOnDestroy {
		flags = append(flags, "audit_logs_table_delete_contents_on_destroy")
	}
	if g.LogExportStorageForceDestroy == nil || !*g.LogExportStorageForceDestroy {
		flags = append(flags, "log_export_storage_force_destroy")
	}
	if g.CaiMonitoringKmsForceDestroy == nil || !*g.CaiMonitoringKmsForceDestroy {
		flags = append(flags, "cai_monitoring_kms_force_destroy")
	}
	if g.BucketTfstateKmsForceDestroy == nil || !*g.BucketTfstateKmsForceDestroy {
		flags = append(flags, "bucket_tfstate_kms_force_destroy")
	}

	if len(flags) > 0 {
		fmt.Println("# To use the feature to destroy the deployment created by this helper,")
		fmt.Println("# please set the following flags to 'true' in the tfvars file:")
		fmt.Printf("# %s\n", strings.Join(flags, ", "))
	}
}