https://pulumi.com logo
p

prehistoric-window-17785

08/07/2023, 3:28 PM
Hello community! How can I add an existing gcp firewall policy to a vm whilst creating one in pulumi ? Couldn't find any relevant doc/example. Thanks
b

better-umbrella-26052

08/07/2023, 3:53 PM
Firewalls are attached to networks and VMs are created in a network. So they get the firewall of the network into which they are created. https://www.pulumi.com/registry/packages/gcp/api-docs/compute/firewall/
p

prehistoric-window-17785

08/07/2023, 4:13 PM
Can I not create and put firewall policies at vm level ?
b

better-umbrella-26052

08/07/2023, 4:20 PM
Nope. Not how GCP works. https://cloud.google.com/compute/docs/reference/rest/v1/instances . Firewalls come with the network.
p

prehistoric-window-17785

08/07/2023, 5:26 PM
ok thanks for the references !