amazonka-ec2-2.0: Amazon Elastic Compute Cloud SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.EC2.ModifyInstancePlacement

Description

Modifies the placement attributes for a specified instance. You can do the following:

  • Modify the affinity between an instance and a Dedicated Host. When affinity is set to host and the instance is not associated with a specific Dedicated Host, the next time the instance is launched, it is automatically associated with the host on which it lands. If the instance is restarted or rebooted, this relationship persists.
  • Change the Dedicated Host with which an instance is associated.
  • Change the instance tenancy of an instance.
  • Move an instance to or from a placement group.

At least one attribute for affinity, host ID, tenancy, or placement group name must be specified in the request. Affinity and tenancy can be modified in the same request.

To modify the host ID, tenancy, placement group, or partition for an instance, the instance must be in the stopped state.

Synopsis

Creating a Request

data ModifyInstancePlacement Source #

See: newModifyInstancePlacement smart constructor.

Constructors

ModifyInstancePlacement' 

Fields

  • affinity :: Maybe Affinity

    The affinity setting for the instance.

  • groupId :: Maybe Text

    The Group Id of a placement group. You must specify the Placement Group Group Id to launch an instance in a shared placement group.

  • groupName :: Maybe Text

    The name of the placement group in which to place the instance. For spread placement groups, the instance must have a tenancy of default. For cluster and partition placement groups, the instance must have a tenancy of default or dedicated.

    To remove an instance from a placement group, specify an empty string ("").

  • hostId :: Maybe Text

    The ID of the Dedicated Host with which to associate the instance.

  • hostResourceGroupArn :: Maybe Text

    The ARN of the host resource group in which to place the instance.

  • partitionNumber :: Maybe Int

    The number of the partition in which to place the instance. Valid only if the placement group strategy is set to partition.

  • tenancy :: Maybe HostTenancy

    The tenancy for the instance.

    For T3 instances, you can't change the tenancy from dedicated to host, or from host to dedicated. Attempting to make one of these unsupported tenancy changes results in the InvalidTenancy error code.

  • instanceId :: Text

    The ID of the instance that you are modifying.

Instances

Instances details
ToHeaders ModifyInstancePlacement Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

ToPath ModifyInstancePlacement Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

ToQuery ModifyInstancePlacement Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

AWSRequest ModifyInstancePlacement Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

Generic ModifyInstancePlacement Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

Associated Types

type Rep ModifyInstancePlacement :: Type -> Type #

Read ModifyInstancePlacement Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

Show ModifyInstancePlacement Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

NFData ModifyInstancePlacement Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

Methods

rnf :: ModifyInstancePlacement -> () #

Eq ModifyInstancePlacement Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

Hashable ModifyInstancePlacement Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

type AWSResponse ModifyInstancePlacement Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

type Rep ModifyInstancePlacement Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

newModifyInstancePlacement Source #

Create a value of ModifyInstancePlacement with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

ModifyInstancePlacement, modifyInstancePlacement_affinity - The affinity setting for the instance.

ModifyInstancePlacement, modifyInstancePlacement_groupId - The Group Id of a placement group. You must specify the Placement Group Group Id to launch an instance in a shared placement group.

ModifyInstancePlacement, modifyInstancePlacement_groupName - The name of the placement group in which to place the instance. For spread placement groups, the instance must have a tenancy of default. For cluster and partition placement groups, the instance must have a tenancy of default or dedicated.

To remove an instance from a placement group, specify an empty string ("").

ModifyInstancePlacement, modifyInstancePlacement_hostId - The ID of the Dedicated Host with which to associate the instance.

ModifyInstancePlacement, modifyInstancePlacement_hostResourceGroupArn - The ARN of the host resource group in which to place the instance.

ModifyInstancePlacement, modifyInstancePlacement_partitionNumber - The number of the partition in which to place the instance. Valid only if the placement group strategy is set to partition.

ModifyInstancePlacement, modifyInstancePlacement_tenancy - The tenancy for the instance.

For T3 instances, you can't change the tenancy from dedicated to host, or from host to dedicated. Attempting to make one of these unsupported tenancy changes results in the InvalidTenancy error code.

ModifyInstancePlacement, modifyInstancePlacement_instanceId - The ID of the instance that you are modifying.

Request Lenses

modifyInstancePlacement_groupId :: Lens' ModifyInstancePlacement (Maybe Text) Source #

The Group Id of a placement group. You must specify the Placement Group Group Id to launch an instance in a shared placement group.

modifyInstancePlacement_groupName :: Lens' ModifyInstancePlacement (Maybe Text) Source #

The name of the placement group in which to place the instance. For spread placement groups, the instance must have a tenancy of default. For cluster and partition placement groups, the instance must have a tenancy of default or dedicated.

To remove an instance from a placement group, specify an empty string ("").

modifyInstancePlacement_hostId :: Lens' ModifyInstancePlacement (Maybe Text) Source #

The ID of the Dedicated Host with which to associate the instance.

modifyInstancePlacement_hostResourceGroupArn :: Lens' ModifyInstancePlacement (Maybe Text) Source #

The ARN of the host resource group in which to place the instance.

modifyInstancePlacement_partitionNumber :: Lens' ModifyInstancePlacement (Maybe Int) Source #

The number of the partition in which to place the instance. Valid only if the placement group strategy is set to partition.

modifyInstancePlacement_tenancy :: Lens' ModifyInstancePlacement (Maybe HostTenancy) Source #

The tenancy for the instance.

For T3 instances, you can't change the tenancy from dedicated to host, or from host to dedicated. Attempting to make one of these unsupported tenancy changes results in the InvalidTenancy error code.

modifyInstancePlacement_instanceId :: Lens' ModifyInstancePlacement Text Source #

The ID of the instance that you are modifying.

Destructuring the Response

data ModifyInstancePlacementResponse Source #

See: newModifyInstancePlacementResponse smart constructor.

Constructors

ModifyInstancePlacementResponse' 

Fields

Instances

Instances details
Generic ModifyInstancePlacementResponse Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

Associated Types

type Rep ModifyInstancePlacementResponse :: Type -> Type #

Read ModifyInstancePlacementResponse Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

Show ModifyInstancePlacementResponse Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

NFData ModifyInstancePlacementResponse Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

Eq ModifyInstancePlacementResponse Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

type Rep ModifyInstancePlacementResponse Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstancePlacement

type Rep ModifyInstancePlacementResponse = D1 ('MetaData "ModifyInstancePlacementResponse" "Amazonka.EC2.ModifyInstancePlacement" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "ModifyInstancePlacementResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "return'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newModifyInstancePlacementResponse Source #

Create a value of ModifyInstancePlacementResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:return':ModifyInstancePlacementResponse', modifyInstancePlacementResponse_return - Is true if the request succeeds, and an error otherwise.

$sel:httpStatus:ModifyInstancePlacementResponse', modifyInstancePlacementResponse_httpStatus - The response's http status code.

Response Lenses

modifyInstancePlacementResponse_return :: Lens' ModifyInstancePlacementResponse (Maybe Bool) Source #

Is true if the request succeeds, and an error otherwise.