sparse-intern-71089
03/02/2023, 12:43 AMlittle-cartoon-10569
03/02/2023, 12:52 AMgifted-room-26715
03/02/2023, 12:55 AMlittle-cartoon-10569
03/02/2023, 12:55 AMgifted-room-26715
03/02/2023, 1:11 AMTrue
,
private_ipv6_google_access="DISABLE_GOOGLE_ACCESS",
project=GCP_project_ID,
purpose="PRIVATE",
region=varregion,
stack_type="IPV4_ONLY",
opts=ResourceOptions(
import_=default_subnet.id,
protect=True,
),
# opts=pulumi.ResourceOptions(protect=True)
)
=============================
This is the modification I want to make i.e private_ip_google_access=False
,
# Create a new subnet resource using the imported resource as a base
new_subnet = gcp.compute.Subnetwork(
"new-subnet",
region=existing_subnet.region,
network=existing_subnet.network,
ip_cidr_range="10.0.1.0/24",
private_ip_google_access=False
,
)
But instead of modify the existing resource, it is creating another subnetlittle-cartoon-10569
03/02/2023, 1:13 AMpulumi import
, you can use the --stack
option to specify which stack you need, and you don't need a Pulumi.stack.yaml file. I think you need a Pulumi.yaml file, but you don't need to commit it to source control, you can delete it as soon as you've imported. You do need to add the generated code to your project.
If you're using the import
opt, then you don' t need to do anything. Just run your program once with the import opts, and then remove them.gifted-room-26715
03/02/2023, 1:28 AMlittle-cartoon-10569
03/02/2023, 1:54 AMpulumi import
doesn't require 2 passes.