Open obriensystems opened 1 year ago
the following lien removals allow the LZ delete to finish (or disable the projects before)
gcloud config set project audit-prj-id-oldv1
AUDIT_LIEN=$(gcloud alpha resource-manager liens list)
gcloud alpha resource-manager liens delete $AUDIT_LIEN
gcloud config set project net-host-prj-prod-oldv1
gcloud config set project net-host-prj-nonprod-oldv1
results
folder.resourcemanager.cnrm.cloud.google.com/infrastructure.networking reconcile successful
delete result: 10 attempted, 10 successful, 0 skipped, 0 failed
reconcile result: 10 attempted, 10 successful, 0 skipped, 0 failed, 0 timed out
michael@cloudshell:~/dev/pdt-oldev/obriensystems (net-host-prj-nonprod-oldv1)$
exact commands in deployment.sh
gcloud config set project audit-prj-id-oldv2
# there is only one lien for now
export AUDIT_LIEN=$(gcloud alpha resource-manager liens list --format json | jq .[0].name | sed 's/"//g' | sed 's/liens\///g')
echo "Deleting lien: ${AUDIT_LIEN}"
gcloud alpha resource-manager liens delete $AUDIT_LIEN
#NAME: p450465108368-l10d7c241-a1b3-4c52-8986-112209c5966a
#ORIGIN: xpn.googleapis.com
#REASON: This lien is added to prevent the deletion of this shared VPC host project. The host project should be disabled before it is deleted.
Updated property [core/project].
Deleting lien: p596436110046-l3fd7494f-64ad-44c6-aba3-6cabaed36777
Deleted [liens/p596436110046-l3fd7494f-64ad-44c6-aba3-6cabaed36777].
michael@cloudshell:~/wse_github/GoogleCloudPlatform (landing-zone-controller-e4g7d)$ gcloud config set project audit-prj-id-gz1
Updated property [core/project].
michael@cloudshell:~/wse_github/GoogleCloudPlatform (audit-prj-id-gz1)$ export AUDIT_LIEN=$(gcloud alpha resource-manager liens list --format json | jq .[0].name | sed 's/"//g' | sed 's/liens\///g')
michael@cloudshell:~/wse_github/GoogleCloudPlatform (audit-prj-id-gz1)$ echo $AUDIT_LIEN
p402270513653-lec39ae31-1d37-48f0-bbe7-59b0d41541a1
michael@cloudshell:~/wse_github/GoogleCloudPlatform (audit-prj-id-gz1)$ gcloud alpha resource-manager liens delete $AUDIT_LIEN
Deleted [liens/p402270513653-lec39ae31-1d37-48f0-bbe7-59b0d41541a1].
michael@cloudshell:~/wse_github/GoogleCloudPlatform (audit-prj-id-gz1)$ gcloud config set project net-host-prj-prod-gz1
Updated property [core/project].
michael@cloudshell:~/wse_github/GoogleCloudPlatform (net-host-prj-prod-gz1)$ export AUDIT_LIEN=$(gcloud alpha resource-manager liens list --format json | jq .[0].name | sed 's/"//g' | sed 's/liens\///g')
michael@cloudshell:~/wse_github/GoogleCloudPlatform (net-host-prj-prod-gz1)$ echo $AUDIT_LIEN
p698859936700-l9cf73dda-4423-454a-b137-c838b6357574
michael@cloudshell:~/wse_github/GoogleCloudPlatform (net-host-prj-prod-gz1)$ gcloud alpha resource-manager liens delete $AUDIT_LIEN
Deleted [liens/p698859936700-l9cf73dda-4423-454a-b137-c838b6357574].
sh changes in prep of adding delete to Arete shortly
For example - before the kpt live destroy - lifecyle can reconcile - we need to pre-disable the project or delete the lien