heat_template_version: {{ openshift_openstack_heat_template_version }}

description: Template to create subports

parameters:
  network:
    type: string
    label: Subport Network
  subnet:
    type: string
    label: Subport Subnet
  pod_access_sg:
    type: comma_delimited_list
    label: Pod access sg

resources:
  subports:
    type: OS::Neutron::Port
    properties:
      network: { get_param: network }
      security_groups: { get_param: pod_access_sg }
      fixed_ips:
        - subnet: { get_param: subnet }
      device_owner: {{ openshift_kuryr_device_owner|default('compute:kuryr') }}
{% if openshift_use_kuryr|default(false)|bool %}
      tags: [{{ openshift_openstack_clusterid }}]
{% endif %}

outputs:
  subport_id:
    value: { get_resource: subports }
