You can modify an attribute of an instance, such as its type, user data, or termination behavior. Depending on the attribute you want to modify, the instance must be running or stopped.

The following procedures are available:

Modifying an Instance Attribute Using Cockpit

Before you begin:

  • To modify the following attributes, you must stop the instance:
    • User Data
    • Instance Type

  • To modify the following attributes, you must start the instance:
    • Disable on termination
    • Delete on termination
    • Security Groups
    • Shutdown Behavior
    • Check source and destination
    • Keypairs

For more information, see Stopping and Starting Instances.

 

  1. In the navigation panel of the IaaS section, click Instances. 

  2. Click the instance whose attributes you want to modify.
    The instance is selected.

  3. Click Attributes.
    The MODIFY INSTANCE ATTRIBUTES dialog box appears.


  4. (optional) To modify user data for the instance:
    1. Click the User Data tab.
    2. In the UserData boxes, type the user data. For more information, see Configuring an Instance with User Data and Outscale Tags.
    3. Click Apply to validate.

  5. (optional) To modify the instance type:
    1. Click the Instance Type tab.
    2. From the list, select the new type for the instance, or select custom for a custom instance. For more information, see Instance Types.
    3. If you have selected custom, type the number of cores and the amount of memory (in GiB) in the corresponding boxes, or select them with the arrows or the slider.
    4. Click Apply to validate.

  6. (optional) To modify the termination behavior of the instance:
    1. Click the Instance cannot be terminated tab.
    2. Switch the button to true or false:
      • If set to true, you cannot terminate the instance.
      • If set to false, you can terminate it using Cockpit, the AWS CLI or the API.

  7. (optional) To modify the deletion behavior of the volumes attached to the instance:
    1. Click the Delete on termination tab.
    2. Switch the button to true or false:
      • If set to true, the volumes are deleted when the instance is terminated.
      • If set to false, the volumes are not deleted.

  8. (optional) To modify the security groups associated with the instance:
    1. Click the Security Groups tab.
    2. From the list, select the security group(s) you want to associate with the instance.
    3. To disassociate a security group from the instance, click   next to the name of the security group.
    4. Click Apply to validate.

  9. (optional) To modify the shutdown behavior of the instance:
    1. Click the Shutdown Behavior tab.
    2. From the list, select one of the following values:
      • stop: When you initiate shutdown, the instance stops.
      • terminate: When you initiate shutdown, the instance stops and is terminated.
      • restart: When you initiate shutdown, the instance stops, then automatically restarts.
      For more information, see About Instance Lifecycle > Termination.
    3. Click Apply to validate.

  10. (VPC only, optional) To modify the source and destination check:
    1. Click the Check source and destination tab.
    2. Switch the button to true or false:
      • If set to true, the source destination check is enabled.
      • It set to false, the source destination check is disabled.

      The value of this attribute must be false for a NAT instance to perform network address translation (NAT).

  11. (optional) To modify the keypair assigned to the instance:
    1. Click the Keypairs tab.
    2. From the list, select the new keypair you want to assign to the instance.
    3. Click Apply to validate.

  12. To close the dialog box, click Close.

Modifying an Instance Attribute Using AWS CLI

Before you begin:

  • To modify the instanceInitiatedShutdownBehavior attribute, you must start the instance.
  • To modify the following attributes, you must stop the instance: instanceType, userData, ebsOptimized.

For more information, see Stopping and Starting Instances.

 

  • To modify an instance attribute, use the modify-instance-attribute command following this syntax:

    You can modify only one instance attribute at a time.

    Request sample
    $> aws ec2 modify-instance-attribute \
    	--profile YOUR_PROFILE \
    	--instance-id i-12345678 \
    	--attribute ATTRIBUTE_NAME \
    	--value ATTRIBUTE_VALUE \	
    	--disable-api-termination \
    	--block-device-mappings VALUE \
    	--instance-type m1.large \
    	--user-data VALUE \
    	--instance-initiated-shutdown-behavior ATTRIBUTE_VALUE \
    	--groups sg-12345678 \
    	--source-dest-check \
    	[--ebs-optimized NOT_SPECIFIED] \
    	--endpoint https://fcu.eu-west-2.outscale.com

    This command contains the following attributes that you need to specify:

    • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Using AWS CLI in the Outscale Cloud.
    • instance-id: The ID of the instance whose attribute you want to modify. 
    • (optional) attribute: The name of the attribute (userData | rootDeviceName | instanceType | groupSet | ebsOptimizedsourceDestCheck blockDeviceMapping  |  disableApiTermination  | instanceInitiatedShutdownBehavior).
    • (optional) value: The value of the attribute (only for the following attributes: userData, disableApiTermination, or instanceInitiatedShutdownBehavior).
    • (optional) disable-api-termination: If true, you cannot terminate the instance using Cockpit, the CLI or the API. If false, you can.
    • (optional) block-device-mappings: Information about BSU volumes attached to the instance. This attribute contains the following elements that you need to specify: 

      • (optional) DeviceName: The device name used to attach the volume to the instance. For more information, see About Volumes > Volumes Attachment and Device Names.

        To modify the DeleteOnTermination attribute, this element is required.

      • (optional) Ebs: Information about the volume attached to the instance. This element contains the following element that you need to specify: 
        • (optional)  DeleteOnTermination: By default or if set to true, the volume is deleted when the instance is terminated. If set to false, it is not. 

        To modify the block-device-mappings attribute for several volumes at the same time, use the following syntax:

        [{"DeviceName" :"/dev/sda1", "Ebs":{ "DeleteOnTermination" : False} }, {"DeviceName":"/dev/sdb","Ebs":{}} ]
    • (optional) instance-type: The type of instance (amount of vCores, memory, storage). For more information, see Instance Types.
    • (optional) user-data: New user data for the instance. For more information, see Configuring an Instance with User Data and Outscale Tags.

      Existing user data is erased and replaced by the one you specify here.

    • (optional) instance-initiated-shutdown-behavior: The behavior when you initiate shutdown of the instance. By default or if set to stop, the instance stops. If set to terminate, the instance stops and is terminated. If set to restart, the instance stops, then automatically restarts.
    • (optional) groups: One or more security groups IDs for the instance. 
    • (optional) source-dest-check|no-source-dest-check: If set to source-dest-check, the source-destination check is enabled. If set to no-source-dest-check, it is disabled. This attribute must be disabled for a NAT instance to perform NAT. For more information, see Tutorial: Setting Up a NAT Instance.

    • (optional) ebs-optimized: Whether the instance is BSU-optimized.
    • endpoint: The endpoint corresponding to the Region you want to send the request to.

The specified attribute is modified.

 



Windows® is a registered mark of Microsoft Corporation in the United States and/or other countries.

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.

See Legal Mentions.