func (m *Metadata) AvailabilityZones(ctx context.Context) ([]string, error) {
	m.mutex.Lock()
	defer m.mutex.Unlock()

	if len(m.availabilityZones) == 0 {
		session, err := m.unlockedSession(ctx)
		if err != nil {
			return nil, err
		}

		m.availabilityZones, err = availabilityZones(ctx, session, m.region)
		if err != nil {
			return nil, errors.Wrap(err, "creating AWS session")
		}
	}

	return m.availabilityZones, nil
}
// AvailabilityZones retrieves a list of availability zones for the configured region.
AvailabilityZones retrieves a list of availability zones for the configured region.
// AvailabilityZones retrieves a list of availability zones for the configured region .
func (m *Metadata) AvailabilityZones(ctx context.Context) ([]string, error) {
	m.mutex.Lock()
	defer m.mutex.Unlock()
	if len(m.availabilityZones) == 0 {
		session, err := m.unlockedSession(ctx)
		if err != nil {
			return nil, err
		}
		m.availabilityZones, err = availabilityZones(ctx, session, m.region)
		if err != nil {
			return nil, errors.Wrap(err, "creating AWS session")
		}
	}
	return m.availabilityZones, nil
}
func ( m * Metadata ) AvailabilityZones ( ctx context . Context ) ( [ ] string , error ) { m . mutex . Lock ( ) defer m . mutex . Unlock ( ) if len ( m . availabilityZones ) == 0 { session , err := m . unlockedSession ( ctx ) if err != nil { return nil , err } m . availabilityZones , err = availabilityZones ( ctx , session , m . region ) if err != nil { return nil , errors . Wrap ( err , " " ) } } return m . availabilityZones , nil }
AvailabilityZones retrieves a list of availability zones for the configured region.
AvailabilityZones retrieves a list of availability zones for the configured region .