Given a subnet id or name, describe its properties.

    Returns a dictionary of interesting properties.

    .. versionadded:: 2015.8.0

    CLI Examples:

    .. code-block:: bash

        salt myminion boto_vpc.describe_subnet subnet_id=subnet-123456
        salt myminion boto_vpc.describe_subnet subnet_name=mysubnet

def describe_subnet(subnet_id=None, subnet_name=None, region=None,
                    key=None, keyid=None, profile=None):
    '''
    Given a subnet id or name, describe its properties.

    Returns a dictionary of interesting properties.

    .. versionadded:: 2015.8.0

    CLI Examples:

    .. code-block:: bash

        salt myminion boto_vpc.describe_subnet subnet_id=subnet-123456
        salt myminion boto_vpc.describe_subnet subnet_name=mysubnet

    '''
    try:
        subnet = _get_resource('subnet', name=subnet_name, resource_id=subnet_id,
                               region=region, key=key, keyid=keyid, profile=profile)
    except BotoServerError as e:
        return {'error': __utils__['boto.get_error'](e)}

    if not subnet:
        return {'subnet': None}
    log.debug('Found subnet: %s', subnet.id)

    keys = ('id', 'cidr_block', 'availability_zone', 'tags', 'vpc_id')
    ret = {'subnet': dict((k, getattr(subnet, k)) for k in keys)}
    explicit_route_table_assoc = _get_subnet_explicit_route_table(ret['subnet']['id'],
                                                                  ret['subnet']['vpc_id'],
                                                                  conn=None, region=region,
                                                                  key=key, keyid=keyid, profile=profile)
    if explicit_route_table_assoc:
        ret['subnet']['explicit_route_table_association_id'] = explicit_route_table_assoc
    return ret