Skip to content

Commit

Permalink
docs(samples): Adding the missing compute_create_windows_instance_ext…
Browse files Browse the repository at this point in the history
…ernal_ip region (#300)
  • Loading branch information
m-strzelczyk authored and dandhlee committed Nov 16, 2022
1 parent b93d67a commit 3166305
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,15 @@ def create_windows_instance(project_id: str, zone: str, instance_name: str,
# that contain Windows instances with only internal IP addresses.
# More information about Private Google Access: https://cloud.google.com/vpc/docs/configure-private-google-access#enabling

instance = create_instance(project_id, zone, instance_name, disks,
machine_type=machine_type, network_link=network_link,
subnetwork_link=subnetwork_link, external_access=True,
)
instance = create_instance(
project_id,
zone,
instance_name,
disks,
machine_type=machine_type,
network_link=network_link,
subnetwork_link=subnetwork_link,
external_access=True, # Set this to False to disable external IP for your instance
)
return instance
# </INGREDIENT>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
# flake8: noqa

# <REGION compute_create_windows_instance_external_ip>
# <REGION compute_create_windows_instance_internal_ip>
# <IMPORTS/>

Expand All @@ -29,3 +30,4 @@

# <INGREDIENT create_windows_instance />
# </REGION compute_create_windows_instance_internal_ip>
# </REGION compute_create_windows_instance_external_ip>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# directory and apply your changes there.


# [START compute_create_windows_instance_external_ip]
# [START compute_create_windows_instance_internal_ip]
import re
import sys
Expand Down Expand Up @@ -305,9 +306,10 @@ def create_windows_instance(
machine_type=machine_type,
network_link=network_link,
subnetwork_link=subnetwork_link,
external_access=True,
external_access=True, # Set this to False to disable external IP for your instance
)
return instance


# [END compute_create_windows_instance_internal_ip]
# [END compute_create_windows_instance_external_ip]

0 comments on commit 3166305

Please sign in to comment.