FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GCP Cloud Run app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab has been upgraded. See what's new in the
Changelog
.
Show more breadcrumbs
Information Services
DevOps
Infrastructure
Terraform Modules
GCP Cloud Run app
Commits
29630df9
Commit
29630df9
authored
6 months ago
by
Dmitrii Unterov
Browse files
Options
Downloads
Patches
Plain Diff
chore: add known-issues.md file
parent
3099b008
No related branches found
No related tags found
No related merge requests found
Pipeline
#604772
waiting for manual action
Stage: test
Stage: review
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/known-issues.md
+25
-13
25 additions, 13 deletions
docs/known-issues.md
with
25 additions
and
13 deletions
docs/known-issues.md
+
25
−
13
View file @
29630df9
...
...
@@ -2,11 +2,14 @@
## 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:
`prevent_deletion`
attribute is enabled for the
`google_compute_address.static_ip`
resource.
This attribute is used to prevent accidental deletion of important resources.
It is generally not expected for static IP addresses to be deleted or recreated frequently,
as these are often referenced in other external configurations such as firewall rules and DNS
records.
with
`prevent_deletion`
applied, Terraform will display error trying to destroy the resource:
```
sh
│ Error: Instance cannot be destroyed
...
...
@@ -20,15 +23,16 @@ Terraform will display error trying to destroy the resource:
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.
In some situations, it is necessary to delete static IP Address entries. In order to do this with
`prevent_deletion`
enabled, you must first manually delete the resource via the console or
`gcloud`
cli tool before running
`terraform apply`
.
The steps below show
s how
it can be achieved
.
A full example of this i
s
s
how
n below
.
## 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:
## Manually deleting a static IP address with `prevent_deletion` attribute
1.
Confirm the name of the Cloud Router using the
`gcloud`
command:
```
sh
gcloud compute routers list
--project
$PROJECT_ID
...
...
@@ -37,16 +41,24 @@ NAME REGION NETWORK
webapp-ip-router europe-west2 default
```
Delete the Cloud Router:
Default name for the resource created within this module is
`webapp-ip-router`
.
2.
Delete the Cloud Router:
```
sh
gcloud compute routers delete webapp-ip-router
--project
$PROJECT_ID
--region
$REGION
```
Now
the IP address
can be deleted
:
3.
Delete
the IP address:
```
sh
gcloud compute addresses delete webapp-static-ip
--region
$REGION
--project
$PROJECT_ID
```
4.
Verify that the IP address is deleted:
```
sh
gcloud compute addresses list
--project
$PROJECT_ID
```
That's it. Now Terraform commands will work without errors.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment