Creating InstanceConfig Attributes for NSG Refactor (#1331)

* Updating instance_config

* Updating attribute names.

* Updating list factory.

* Updating config attributes.

Co-authored-by: nharper285 <nharper285@gmail.com>
This commit is contained in:
Noah McGregor Harper
2021-10-07 15:35:14 -07:00
committed by Stas
parent 773ae3a5cf
commit 9f4db320b4
2 changed files with 57 additions and 0 deletions

View File

@ -649,6 +649,9 @@ Each event will be submitted via HTTP POST to the user provided URL.
"address_space": "10.0.0.0/8", "address_space": "10.0.0.0/8",
"subnet": "10.0.0.0/16" "subnet": "10.0.0.0/16"
}, },
"proxy_nsg_config": {
"allowed_ips": []
},
"proxy_vm_sku": "Standard_B2s" "proxy_vm_sku": "Standard_B2s"
} }
} }
@ -759,6 +762,9 @@ Each event will be submitted via HTTP POST to the user provided URL.
"network_config": { "network_config": {
"$ref": "#/definitions/NetworkConfig" "$ref": "#/definitions/NetworkConfig"
}, },
"proxy_nsg_config": {
"$ref": "#/definitions/NetworkSecurityGroupConfig"
},
"proxy_vm_sku": { "proxy_vm_sku": {
"default": "Standard_B2s", "default": "Standard_B2s",
"title": "Proxy Vm Sku", "title": "Proxy Vm Sku",
@ -814,6 +820,26 @@ Each event will be submitted via HTTP POST to the user provided URL.
}, },
"title": "NetworkConfig", "title": "NetworkConfig",
"type": "object" "type": "object"
},
"NetworkSecurityGroupConfig": {
"properties": {
"allowed_ips": {
"items": {
"type": "string"
},
"title": "Allowed Ips",
"type": "array"
},
"allowed_service_tags": {
"items": {
"type": "string"
},
"title": "Allowed Service Tags",
"type": "array"
}
},
"title": "NetworkSecurityGroupConfig",
"type": "object"
} }
}, },
"properties": { "properties": {
@ -5835,6 +5861,9 @@ Each event will be submitted via HTTP POST to the user provided URL.
"network_config": { "network_config": {
"$ref": "#/definitions/NetworkConfig" "$ref": "#/definitions/NetworkConfig"
}, },
"proxy_nsg_config": {
"$ref": "#/definitions/NetworkSecurityGroupConfig"
},
"proxy_vm_sku": { "proxy_vm_sku": {
"default": "Standard_B2s", "default": "Standard_B2s",
"title": "Proxy Vm Sku", "title": "Proxy Vm Sku",
@ -5942,6 +5971,26 @@ Each event will be submitted via HTTP POST to the user provided URL.
"title": "NetworkConfig", "title": "NetworkConfig",
"type": "object" "type": "object"
}, },
"NetworkSecurityGroupConfig": {
"properties": {
"allowed_ips": {
"items": {
"type": "string"
},
"title": "Allowed Ips",
"type": "array"
},
"allowed_service_tags": {
"items": {
"type": "string"
},
"title": "Allowed Service Tags",
"type": "array"
}
},
"title": "NetworkSecurityGroupConfig",
"type": "object"
},
"NoReproReport": { "NoReproReport": {
"properties": { "properties": {
"error": { "error": {

View File

@ -799,6 +799,11 @@ class NetworkConfig(BaseModel):
subnet: str = Field(default="10.0.0.0/16") subnet: str = Field(default="10.0.0.0/16")
class NetworkSecurityGroupConfig(BaseModel):
allowed_service_tags: Optional[List[str]]
allowed_ips: List[str] = Field(default_factory=list)
class KeyvaultExtensionConfig(BaseModel): class KeyvaultExtensionConfig(BaseModel):
keyvault_name: str keyvault_name: str
cert_name: str cert_name: str
@ -847,6 +852,9 @@ class InstanceConfig(BaseModel):
allowed_aad_tenants: List[UUID] allowed_aad_tenants: List[UUID]
network_config: NetworkConfig = Field(default_factory=NetworkConfig) network_config: NetworkConfig = Field(default_factory=NetworkConfig)
proxy_nsg_config: NetworkSecurityGroupConfig = Field(
default_factory=NetworkSecurityGroupConfig
)
extensions: Optional[AzureVmExtensionConfig] extensions: Optional[AzureVmExtensionConfig]
proxy_vm_sku: str = Field(default="Standard_B2s") proxy_vm_sku: str = Field(default="Standard_B2s")