Example #1
0
def subnet_special(
    stem,
    name,
    virtual_network_name,
    address_prefix,
    route_table_id,
    depends_on=None,
):
    sn = network.Subnet(
        f'{stem}{s}sn',
        name=name,
        resource_group_name=resource_group_name,
        virtual_network_name=virtual_network_name,
        address_prefixes=[address_prefix],
        opts=ResourceOptions(
            parent=self,
            delete_before_replace=True,
            depends_on=depends_on,
        ),
    )
    rta = network.SubnetRouteTableAssociation(
        f'{stem}{s}sn{s}rta',
        route_table_id=route_table_id,
        subnet_id=sn.id,
        opts=ResourceOptions(parent=self, depends_on=depends_on),
    )
    return sn
Example #2
0
def subnet_route_table(stem, route_table_id, subnet_id):
    rta = network.SubnetRouteTableAssociation(
        f'{stem}-sn-rta',
        route_table_id=route_table_id,
        subnet_id=subnet_id,
        opts=ResourceOptions(parent=self),
    )
    return rta
Example #3
0
def subnet(
    stem,
    virtual_network_name,
    address_prefix,
    route_table_id,
    depends_on=None,
):
    sn = network.Subnet(
        f'{stem}-sn-',
        resource_group_name=resource_group_name,
        virtual_network_name=virtual_network_name,
        address_prefixes=[address_prefix],
        opts=ResourceOptions(parent=self, depends_on=depends_on),
    )
    rta = network.SubnetRouteTableAssociation(
        f'{stem}-sn-rta',
        route_table_id=route_table_id,
        subnet_id=sn.id,
        opts=ResourceOptions(parent=self, depends_on=depends_on),
    )
    return sn