Before destroying the resources you need to delete all objects from the Bucket, and the Pre-authenticated requests:
a) For deleting the objects, run the command:
oci os object bulk-delete -bn mdsbucket
Possible output:
root@mysqlshellinstance:/home# oci os object bulk-delete -bn mdsbucket
WARNING: This command will delete 13 objects. Are you sure you wish to continue? [y/N]: y
Deleted mdsobject/@.done.json [####################################] 100%
Deleted mdsobject/@.sql [####################################] 100%
Deleted mdsobject/testexample@exampletable.json [####################################] 100%
Deleted mdsobject/testexample@exampletable.sql [####################################] 100%
Deleted mdsobject/testexample@exampletable.tsv.zst [####################################] 100%
Deleted mdsobject/testexample@exampletable.tsv.zst.idx [####################################] 100%
Deleted mdsobject/testexample.sql [####################################] 100%
Deleted mdsobject/@.post.sql [####################################] 100%
Deleted mdsobject/@.json [####################################] 100%
Deleted mdsobject/load-progress.e8a2b443-a04b-11eb-924d-02001702b29c.json [####################################] 100%
Deleted mdsobject/testexample.json [####################################] 100%
Deleted mdsobject/@.users.sql [####################################] 100%
b) For deleting the pre-authenticated requests, run following command:
for idz in `oci os preauth-request list -bn mdsbucket |\
grep id | awk '{print $2}' | sed 's/",//g' | sed 's/"//g'`; \
do echo y | \
oci os preauth-request delete -bn mdsbucket --par-id $idz ; \
done
Do not interract with the terminal. The command will already pass the "y" option.
Possible output:
root@mysqlshellinstance:/home# for idz in `oci os preauth-request list -bn mdsbucket |\
> grep id | awk '{print $2}' | sed 's/",//g' | sed 's/"//g'`; \
> do echo y | \
> oci os preauth-request delete -bn mdsbucket --par-id $idz ; \
> done
Are you sure you want to delete this resource? [y/N]: Are you sure you want to delete this resource? [y/N]: Are you sure you want to delete this resource? [y/N]: Are you sure you want to delete this resource? [y/N]: Are you sure you want to delete this resource? [y/N]:
Are you sure you want to delete this resource? [y/N]: Are you sure you want to delete this resource? [y/N]: Are you sure you want to delete this resource? [y/N]: Are you sure you want to delete this resource? [y/N]: Are you sure you want to delete this resource? [y/N]:
Are you sure you want to delete this resource? [y/N]: Are you sure you want to delete this resource? [y/N]:
From Cloud-Shell, MdsReplication folder, perform command "terraform destroy"