Skip to content

Commit 3166305

Browse files
m-strzelczykdandhlee
authored andcommitted
docs(samples): Adding the missing compute_create_windows_instance_external_ip region (#300)
1 parent b93d67a commit 3166305

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

compute/compute/ingredients/instances/create_start_instance/create_windows_instance.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,15 @@ def create_windows_instance(project_id: str, zone: str, instance_name: str,
6767
# that contain Windows instances with only internal IP addresses.
6868
# More information about Private Google Access: https://cloud.google.com/vpc/docs/configure-private-google-access#enabling
6969

70-
instance = create_instance(project_id, zone, instance_name, disks,
71-
machine_type=machine_type, network_link=network_link,
72-
subnetwork_link=subnetwork_link, external_access=True,
73-
)
70+
instance = create_instance(
71+
project_id,
72+
zone,
73+
instance_name,
74+
disks,
75+
machine_type=machine_type,
76+
network_link=network_link,
77+
subnetwork_link=subnetwork_link,
78+
external_access=True, # Set this to False to disable external IP for your instance
79+
)
7480
return instance
7581
# </INGREDIENT>

compute/compute/recipes/instances/create_start_instance/create_windows_instance.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414
# flake8: noqa
1515

16+
# <REGION compute_create_windows_instance_external_ip>
1617
# <REGION compute_create_windows_instance_internal_ip>
1718
# <IMPORTS/>
1819

@@ -29,3 +30,4 @@
2930

3031
# <INGREDIENT create_windows_instance />
3132
# </REGION compute_create_windows_instance_internal_ip>
33+
# </REGION compute_create_windows_instance_external_ip>

compute/compute/snippets/instances/create_start_instance/create_windows_instance.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# directory and apply your changes there.
2020

2121

22+
# [START compute_create_windows_instance_external_ip]
2223
# [START compute_create_windows_instance_internal_ip]
2324
import re
2425
import sys
@@ -305,9 +306,10 @@ def create_windows_instance(
305306
machine_type=machine_type,
306307
network_link=network_link,
307308
subnetwork_link=subnetwork_link,
308-
external_access=True,
309+
external_access=True, # Set this to False to disable external IP for your instance
309310
)
310311
return instance
311312

312313

313314
# [END compute_create_windows_instance_internal_ip]
315+
# [END compute_create_windows_instance_external_ip]

0 commit comments

Comments
 (0)