FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit c50f3845 authored by Dmitrii Unterov's avatar Dmitrii Unterov
Browse files

chore: add known-issues.md file

parent 19326492
No related branches found
No related tags found
No related merge requests found
Pipeline #604106 waiting for manual action
# Known issues
## Manual Deletion Required for Static IP Address
This module has `prevent_deletion` attribute enabled for `google_compute_address.static_ip`
resource. This attribute is used to prevent accidental deletion of important resources.
It was done on purpose, as it is not expected that static IPs to be regularly removed
and recreated, as it's likely that they will be used within firewall, DNS records and so on.
Terraform will display error trying to destroy the resource:
```sh
│ Error: Instance cannot be destroyed
│ on .terraform/modules/webapp/static_egress_ip.tf line 40:
│ 40: resource "google_compute_address" "static_ip" {
│ Resource module.webapp.google_compute_address.static_ip[0] has lifecycle.prevent_destroy set, but the plan calls for this resource to be destroyed. To avoid
│ this error and continue with the plan, either disable lifecycle.prevent_destroy or reduce the scope of the plan using the -target flag.
```
However, sometimes it needs to be deleted. If a resource is created with `prevent_deletion`,
Terraform will block any attempt to delete this resource through Terraform commands.
As a result, if you need to remove such a resource from your Terraform configuration,
you must manually delete the resource outside of Terraform before running `terraform apply` again.
The steps below shows how it can be achieved.
## Steps to Resolve
First, delete the resources that use the IP address. In common case it is Cloud Router with the
default name `webapp-ip-router`. If not sure, check the list of routers using `gcloud` command:
```sh
gcloud compute routers list --project $PROJECT_ID
NAME REGION NETWORK
webapp-ip-router europe-west2 default
```
Delete the Cloud Router:
```sh
gcloud compute routers delete webapp-ip-router --project $PROJECT_ID --region $REGION
```
Now the IP adress can be deleted:
```sh
gcloud compute addresses delete webapp-static-ip --region $REGION --project $PROJECT_ID
```
That's it. Now Terraform commands will work without errors.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment