// Stores an instance ID and the information required to validate further login/renewal attempts from
// the same instance ID.
762059
func setWhitelistIdentityEntry(ctx context.Context, s logical.Storage, instanceID string, identity *whitelistIdentity) error {
	entry, err := logical.StorageEntryJSON("whitelist/identity/"+instanceID, identity)
	if err != nil {
		return err
	}

	if err := s.Put(ctx, entry); err != nil {
		return err
	}
	return nil
}
555482
func (s *ElasticIp) SetInstanceId(v string) *ElasticIp {
	s.InstanceId = &v
	return s
}
842107
func (s *DeleteInstanceInput) SetInstanceId(v string) *DeleteInstanceInput {
	s.InstanceId = &v
	return s
}
982098
func InstanceID(ctx types.Context) (*types.InstanceID, error) {
	req, err := http.NewRequest(http.MethodGet, iidURL, nil)
	if err != nil {
		return nil, err
	}

	res, err := doRequest(ctx, req)
	if err != nil {
		return nil, err
	}
	defer res.Body.Close()

	iid := instanceIdentityDoc{}
	dec := json.NewDecoder(res.Body)
	if err := dec.Decode(&iid); err != nil {
		return nil, err
	}

	mac, err := getMAC(ctx)
	if err != nil {
		return nil, err
	}

	subnetID, err := ResolveSubnetWithMAC(ctx, mac)
	if err != nil {
		return nil, err
	}

	secGroups, err := getSecurityGroups(ctx, mac)
	if err != nil {
		return nil, err
	}

	iidFields := map[string]string{
		efs.InstanceIDFieldRegion:           iid.Region,
		efs.InstanceIDFieldAvailabilityZone: iid.AvailabilityZone,
	}

	if len(secGroups) > 0 {
		iidFields[efs.InstanceIDFieldSecurityGroups] = strings.Join(
			secGroups, ";")
	}

	return &types.InstanceID{
		ID:     subnetID,
		Driver: efs.Name,
		Fields: iidFields,
	}, nil
}
734575
func (s *CreateAssociationBatchRequestEntry) SetInstanceId(v string) *CreateAssociationBatchRequestEntry {
	s.InstanceId = &v
	return s
}
321703
func (s *CreateLaunchConfigurationInput) SetInstanceId(v string) *CreateLaunchConfigurationInput {
	s.InstanceId = &v
	return s
}
1278593
func (s *SetTimeBasedAutoScalingInput) SetInstanceId(v string) *SetTimeBasedAutoScalingInput {
	s.InstanceId = &v
	return s
}
912471
func (s *DescribeUserInput) SetInstanceId(v string) *DescribeUserInput {
	s.InstanceId = &v
	return s
}
776245
func MustInstanceID(ctx context.Context) *types.InstanceID {
	return ctx.Value(InstanceIDKey).(*types.InstanceID)
}
752405
func (s *AssociateElasticIpInput) SetInstanceId(v string) *AssociateElasticIpInput {
	s.InstanceId = &v
	return s
}
407276
func (s *Instance) SetInstanceId(v string) *Instance {
	s.InstanceId = &v
	return s
}
430459
func (s *TimeBasedAutoScalingConfiguration) SetInstanceId(v string) *TimeBasedAutoScalingConfiguration {
	s.InstanceId = &v
	return s
}
1137505
func (s *UpdateManagedInstanceRoleInput) SetInstanceId(v string) *UpdateManagedInstanceRoleInput {
	s.InstanceId = &v
	return s
}
889532
func (s *UpdateAssociationStatusInput) SetInstanceId(v string) *UpdateAssociationStatusInput {
	s.InstanceId = &v
	return s
}
801464
func (s *DescribeInstanceAssociationsStatusInput) SetInstanceId(v string) *DescribeInstanceAssociationsStatusInput {
	s.InstanceId = &v
	return s
}
1239301
func (i *Instances) InstanceID(ctx context.Context, name types.NodeName) (string, error) {
	srv, err := getServerByName(i.compute, name)
	if err != nil {
		if err == ErrNotFound {
			return "", cloudprovider.InstanceNotFound
		}
		return "", err
	}
	// In the future it is possible to also return an endpoint as:
	// <endpoint>/<instanceid>
	return "/" + srv.ID, nil
}
884249
func (s *DescribeUserHierarchyStructureInput) SetInstanceId(v string) *DescribeUserHierarchyStructureInput {
	s.InstanceId = &v
	return s
}