Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(oracle): only allow public subnets to be selected from target VCN #318

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1!5.3.0
1!5.4.0
4 changes: 4 additions & 0 deletions pycloudlib/oci/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ def get_subnet_id(
subnets = network_client.list_subnets(compartment_id, vcn_id=vcn_id).data
subnet_id = None
for subnet in subnets:
if subnet.prohibit_internet_ingress: # skip subnet if it's private
print("Ignoring private subnet: " + subnet.id)
continue
print("Using public subnet: " + subnet.id)
if subnet.availability_domain == availability_domain:
subnet_id = subnet.id
break
Expand Down