Comments (7)
Hi @con5cience. Thanks for reporting this issue. I'll take a deeper look later today, but in the mean time you could try importing the resource with the Pulumi CLI:
$ pulumi import gcp:compute/subnetwork:Subnetwork ${subnetName} ${id}
That might work around the problem.
from pulumi-gcp.
Thanks for your response!
The manual import command worked, but on subsequent Pulumi runs it's threatening to delete-replace the subnet:
++gcp:compute/subnetwork:Subnetwork: (create-replacement) 🔓
[id=projects/<redacted>/regions/europe-central2/subnetworks/<redacted>]
[urn=urn:pulumi:gke::gcp-development::gcp:compute/subnetwork:Subnetwork::<redacted>]
[provider: urn:pulumi:gke::gcp-development::pulumi:providers:gcp::default_7_26_0::fb5e55fc-0e70-435a-818c-98843ebfd136 => urn:pulumi:gke::gcp-development::pulumi:providers:gcp::gcp::e9ecc2c6-6177-4dc9-be65-c10d7272c0a7]
~ logConfig : {
+ filterExpr : "true"
}
~ network : "https://www.googleapis.com/compute/v1/projects/<redacted>/global/networks/<redacted>" => "projects/<redacted>/global/networks/<redacted>"
- privateIpv6GoogleAccess: "DISABLE_GOOGLE_ACCESS"
- purpose : "PRIVATE"
- stackType : "IPV4_ONLY"
+-gcp:compute/subnetwork:Subnetwork: (replace) 🔓
[id=projects/<redacted>/regions/<redacted>/subnetworks/<redacted>]
[urn=urn:pulumi:gke::gcp-development::gcp:compute/subnetwork:Subnetwork::<redacted>]
[provider: urn:pulumi:gke::gcp-development::pulumi:providers:gcp::default_7_26_0::fb5e55fc-0e70-435a-818c-98843ebfd136 => urn:pulumi:gke::gcp-development::pulumi:providers:gcp::gcp::e9ecc2c6-6177-4dc9-be65-c10d7272c0a7]
- allowSubnetCidrRoutesOverlap: false
- creationTimestamp : "2022-05-05T07:57:29.093-07:00"
- description : ""
- externalIpv6Prefix : ""
- gatewayAddress : "10.108.0.1"
- id : "projects/<redacted>/regions/<redacted>/subnetworks/<redacted>"
- internalIpv6Prefix : ""
- ipv6AccessType : ""
- ipv6CidrRange : ""
~ logConfig : {
+ filterExpr : "true"
}
~ network : "https://www.googleapis.com/compute/v1/projects/<redacted>/global/networks/<redacted>" => "projects/<redacted>/global/networks/<redacted>"
- privateIpGoogleAccess : false
- privateIpv6GoogleAccess : "DISABLE_GOOGLE_ACCESS"
- purpose : "PRIVATE"
- role : ""
- secondaryIpRanges : []
- selfLink : "https://www.googleapis.com/compute/v1/projects/<redacted>/regions/<redacted>/subnetworks/<redacted>"
- stackType : "IPV4_ONLY"
--gcp:compute/subnetwork:Subnetwork: (delete-replaced) 🔒
[id=projects/<redacted>/regions/<redacted>/subnetworks/<redacted>]
[urn=urn:pulumi:gke::gcp-development::gcp:compute/subnetwork:Subnetwork::<redacted>]
[provider=urn:pulumi:gke::gcp-development::pulumi:providers:gcp::default_7_26_0::fb5e55fc-0e70-435a-818c-98843ebfd136]
😓
from pulumi-gcp.
Hi @con5cience, this is quite unfortunate, does the replace go away if you edit the network
property of the Subnetwork
in your code to prefix https://www.googleapis.com/compute/v1/
?
You can try it with network = vpc.id.apply(x => "https://www.googleapis.com/compute/v1/" + x)
from pulumi-gcp.
I've been unable to repro either of the reported problems. It seems to depend on the state of the resource in the cloud when importing and I tried with a few variations on that and have not had any luck so far.
@con5cience I'd appreciate it if you could give us the code generated from the pulumi import ...
command - that would help us reproduce the problem ourselves so we can diagnose where the issue occurs and find a fix.
from pulumi-gcp.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const subnet = new gcp.compute.Subnetwork("subnet", {
ipCidrRange: "10.108.0.0/24",
logConfig: {
aggregationInterval: "INTERVAL_15_MIN",
filterExpr: "",
flowSampling: 0.05,
metadata: "EXCLUDE_ALL_METADATA",
},
name: "<redacted>",
network: "https://www.googleapis.com/compute/v1/projects/<redacted>/global/networks/<redacted>",
privateIpv6GoogleAccess: "DISABLE_GOOGLE_ACCESS",
project: "<redacted>",
purpose: "PRIVATE",
region: "<redacted>",
stackType: "IPV4_ONLY",
}, {
protect: true,
});
The delete-replace is still planned even if I mutate the network
attribute per your suggestion above.
from pulumi-gcp.
Thanks for the code sample @con5cience - this is an odd thing to happen as the filterExpr
there is not a valid value.
Could you please provide us with the output of gcloud compute networks subnets describe test-subnetwork
- that should give the authoritative filterExpr
used for your subnetwork I hope.
from pulumi-gcp.
Thanks for your help -- I'm closing this ticket as I'm no longer working this particular project.
from pulumi-gcp.
Related Issues (20)
- Failed to detect changes to certain options when creating a resource. HOT 2
- Compute Subnetwork secondary ip ranges drops note from upstream docs
- Upgrade terraform-provider-google-beta to v5.39.0 HOT 1
- Workflow failure: release HOT 1
- Workflow failure: release HOT 1
- Upgrade terraform-provider-google-beta to v5.39.1 HOT 1
- Workflow failure: master
- PRC test failures in GCP HOT 1
- Upgrade terraform-provider-google-beta to v5.40.0
- Edit retest window on gcp.monitoring.AlertPolicy HOT 1
- [Epic] GCP 8.0
- Create alpha release
- GCP v8 Prerelease: Find testers and request feedback
- GCP v8: Audit Patches
- GCP v8: Update documents
- GCP v8: Prepare blog post
- GCP v8: Create Migration Guide
- CloudSQL instances with auto disk resizing fail to update on the first try but succeed on retrying HOT 3
- Upgrade terraform-provider-google-beta to v5.41.0
- Workflow failure: release
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pulumi-gcp.