This is an automated email from the ASF dual-hosted git repository.

pankaj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 434f571915 Add subnet_ids param in AzureContainerInstancesOperator 
(#34850)
434f571915 is described below

commit 434f5719153a9202c3de7555c96e185a17415d80
Author: Pankaj Singh <98807258+pankajas...@users.noreply.github.com>
AuthorDate: Tue Oct 10 22:58:14 2023 +0530

    Add subnet_ids param in AzureContainerInstancesOperator (#34850)
---
 airflow/providers/microsoft/azure/operators/container_instances.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/airflow/providers/microsoft/azure/operators/container_instances.py 
b/airflow/providers/microsoft/azure/operators/container_instances.py
index 1cee34076e..8abcb48c13 100644
--- a/airflow/providers/microsoft/azure/operators/container_instances.py
+++ b/airflow/providers/microsoft/azure/operators/container_instances.py
@@ -25,6 +25,7 @@ from typing import TYPE_CHECKING, Any, Sequence
 from azure.mgmt.containerinstance.models import (
     Container,
     ContainerGroup,
+    ContainerGroupSubnetId,
     ContainerPort,
     EnvironmentVariable,
     IpAddress,
@@ -88,6 +89,7 @@ class AzureContainerInstancesOperator(BaseOperator):
     :param restart_policy: Restart policy for all containers within the 
container group.
         Possible values include: 'Always', 'OnFailure', 'Never'
     :param ip_address: The IP address type of the container group.
+    :param subnet_ids: The subnet resource IDs for a container group
 
     **Example**::
 
@@ -142,6 +144,7 @@ class AzureContainerInstancesOperator(BaseOperator):
         restart_policy: str = "Never",
         ip_address: IpAddress | None = None,
         ports: list[ContainerPort] | None = None,
+        subnet_ids: list[ContainerGroupSubnetId] | None = None,
         **kwargs,
     ) -> None:
         super().__init__(**kwargs)
@@ -179,6 +182,7 @@ class AzureContainerInstancesOperator(BaseOperator):
             )
         self.ip_address = ip_address
         self.ports = ports
+        self.subnet_ids = subnet_ids
 
     def execute(self, context: Context) -> int:
         # Check name again in case it was templated.
@@ -251,6 +255,7 @@ class AzureContainerInstancesOperator(BaseOperator):
                 os_type=self.os_type,
                 tags=self.tags,
                 ip_address=self.ip_address,
+                subnet_ids=self.subnet_ids,
             )
 
             self._ci_hook.create_or_update(self.resource_group, self.name, 
container_group)

Reply via email to