File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ def __init__(
7171 "destination_role" , ""
7272 )
7373 self .subnet_id : str = self .config .active_config .get ("subnet_id" , "" )
74+ self .private_ip_action : str = self .config .active_config .get (
75+ "private_ip_action" , ""
76+ )
77+ if self .subnet_id and not self .private_ip_action :
78+ self .private_ip_action = "CREATE_NEW"
7479 self .security_group_id : str = self .config .active_config .get (
7580 "security_group_id" , ""
7681 )
@@ -491,9 +496,13 @@ def update_blueprint(self) -> bool:
491496 )
492497 blueprint ["disks" ] = new_disks
493498
494- # Update launch subnets and SG IDs
495- blueprint ["subnetIDs" ] = [self .subnet_id ]
496- blueprint ["securityGroupIDs" ] = [self .security_group_id ]
499+ if self .subnet_id :
500+ # Update launch subnets and SG IDs
501+ blueprint ["subnetIDs" ] = [self .subnet_id ]
502+ if self .private_ip_action :
503+ blueprint ["privateIPAction" ] = self .private_ip_action
504+ if self .security_group_id :
505+ blueprint ["securityGroupIDs" ] = [self .security_group_id ]
497506
498507 # Update machine tags
499508 blueprint ["tags" ] = [
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ class CloudEndureConfig:
3737 "destination_role" : "" ,
3838 "subnet_id" : "" ,
3939 "security_group_id" : "" ,
40+ "private_ip_action" : "" ,
4041 "disk_type" : "SSD" ,
4142 "public_ip" : "DONT_ALLOCATE" ,
4243 }
You can’t perform that action at this time.
0 commit comments