AWS OpsWorks

2015/03/26 - AWS OpsWorks - 2 updated api methods

CreateInstance (updated) Link ¶
Changes (request)
{'BlockDeviceMappings': [{'DeviceName': 'string',
                          'Ebs': {'DeleteOnTermination': 'boolean',
                                  'Iops': 'integer',
                                  'SnapshotId': 'string',
                                  'VolumeSize': 'integer',
                                  'VolumeType': 'gp2 | io1 | standard'},
                          'NoDevice': 'string',
                          'VirtualName': 'string'}]}

Creates an instance in a specified stack. For more information, see Adding an Instance to a Layer.

Required Permissions : To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions.

Request Syntax

client.create_instance(
    StackId='string',
    LayerIds=[
        'string',
    ],
    InstanceType='string',
    AutoScalingType='load'|'timer',
    Hostname='string',
    Os='string',
    AmiId='string',
    SshKeyName='string',
    AvailabilityZone='string',
    VirtualizationType='string',
    SubnetId='string',
    Architecture='x86_64'|'i386',
    RootDeviceType='ebs'|'instance-store',
    BlockDeviceMappings=[
        {
            'DeviceName': 'string',
            'NoDevice': 'string',
            'VirtualName': 'string',
            'Ebs': {
                'SnapshotId': 'string',
                'Iops': 123,
                'VolumeSize': 123,
                'VolumeType': 'gp2'|'io1'|'standard',
                'DeleteOnTermination': True|False
            }
        },
    ],
    InstallUpdatesOnBoot=True|False,
    EbsOptimized=True|False
)
type StackId

string

param StackId

[REQUIRED]

The stack ID.

type LayerIds

list

param LayerIds

[REQUIRED]

An array that contains the instance layer IDs.

  • (string) --

type InstanceType

string

param InstanceType

[REQUIRED]

The instance type. AWS OpsWorks supports all instance types except Cluster Compute, Cluster GPU, and High Memory Cluster. For more information, see Instance Families and Types. The parameter values that you use to specify the various types are in the API Name column of the Available Instance Types table.

type AutoScalingType

string

param AutoScalingType

For load-based or time-based instances, the type.

type Hostname

string

param Hostname

The instance host name.

type Os

string

param Os

The instance's operating system, which must be set to one of the following.

  • Standard operating systems: an Amazon Linux version such as Amazon Linux 2014.09 , Ubuntu 12.04 LTS , or Ubuntu 14.04 LTS .

  • Custom AMIs: Custom

The default option is the current Amazon Linux version. If you set this parameter to Custom , you must use the CreateInstance action's AmiId parameter to specify the custom AMI that you want to use. For more information on the standard operating systems, see Operating Systems For more information on how to use custom AMIs with OpsWorks, see Using Custom AMIs.

type AmiId

string

param AmiId

A custom AMI ID to be used to create the instance. The AMI should be based on one of the standard AWS OpsWorks AMIs: Amazon Linux, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS. For more information, see Instances.

Note

If you specify a custom AMI, you must set Os to Custom .

type SshKeyName

string

param SshKeyName

The instance's Amazon EC2 key pair name.

type AvailabilityZone

string

param AvailabilityZone

The instance Availability Zone. For more information, see Regions and Endpoints.

type VirtualizationType

string

param VirtualizationType

The instance's virtualization type, paravirtual or hvm .

type SubnetId

string

param SubnetId

The ID of the instance's subnet. If the stack is running in a VPC, you can use this parameter to override the stack's default subnet ID value and direct AWS OpsWorks to launch the instance in a different subnet.

type Architecture

string

param Architecture

The instance architecture. The default option is x86_64 . Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.

type RootDeviceType

string

param RootDeviceType

The instance root device type. For more information, see Storage for the Root Device.

type BlockDeviceMappings

list

param BlockDeviceMappings

An array of BlockDeviceMapping objects that specify the instance's block devices. For more information, see Block Device Mapping.

  • (dict) --

    Describes a block device mapping. This data type maps directly to the Amazon EC2 BlockDeviceMapping data type.

    • DeviceName (string) --

      The device name that is exposed to the instance, such as /dev/sdh . For the root device, you can use the explicit device name or you can set this parameter to ROOT_DEVICE and AWS OpsWorks will provide the correct device name.

    • NoDevice (string) --

      Suppresses the specified device included in the AMI's block device mapping.

    • VirtualName (string) --

      The virtual device name. For more information, see BlockDeviceMapping.

    • Ebs (dict) --

      An EBSBlockDevice that defines how to configure an Amazon EBS volume when the instance is launched.

      • SnapshotId (string) --

        The snapshot ID.

      • Iops (integer) --

        The number of I/O operations per second (IOPS) that the volume supports. For more information, see EbsBlockDevice.

      • VolumeSize (integer) --

        The volume size, in GiB. For more information, see EbsBlockDevice.

      • VolumeType (string) --

        The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

      • DeleteOnTermination (boolean) --

        Whether the volume is deleted on instance termination.

type InstallUpdatesOnBoot

boolean

param InstallUpdatesOnBoot

Whether to install operating system and package updates when the instance boots. The default value is true . To control when updates are installed, set this value to false . You must then update your instances manually by using CreateDeployment to run the update_dependencies stack command or manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances.

Note

We strongly recommend using the default value of true to ensure that your instances have the latest security updates.

type EbsOptimized

boolean

param EbsOptimized

Whether to create an Amazon EBS-optimized instance.

rtype

dict

returns

Response Syntax

{
    'InstanceId': 'string'
}

Response Structure

  • (dict) --

    Contains the response to a CreateInstance request.

    • InstanceId (string) --

      The instance ID.

DescribeInstances (updated) Link ¶
Changes (response)
{'Instances': {'BlockDeviceMappings': [{'DeviceName': 'string',
                                        'Ebs': {'DeleteOnTermination': 'boolean',
                                                'Iops': 'integer',
                                                'SnapshotId': 'string',
                                                'VolumeSize': 'integer',
                                                'VolumeType': 'gp2 | io1 | '
                                                              'standard'},
                                        'NoDevice': 'string',
                                        'VirtualName': 'string'}],
               'ReportedAgentVersion': 'string'}}

Requests a description of a set of instances.

Note

You must specify at least one of the parameters.

Required Permissions : To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions.

Request Syntax

client.describe_instances(
    StackId='string',
    LayerId='string',
    InstanceIds=[
        'string',
    ]
)
type StackId

string

param StackId

A stack ID. If you use this parameter, DescribeInstances returns descriptions of the instances associated with the specified stack.

type LayerId

string

param LayerId

A layer ID. If you use this parameter, DescribeInstances returns descriptions of the instances associated with the specified layer.

type InstanceIds

list

param InstanceIds

An array of instance IDs to be described. If you use this parameter, DescribeInstances returns a description of the specified instances. Otherwise, it returns a description of every instance.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'Instances': [
        {
            'InstanceId': 'string',
            'Ec2InstanceId': 'string',
            'VirtualizationType': 'paravirtual'|'hvm',
            'Hostname': 'string',
            'StackId': 'string',
            'LayerIds': [
                'string',
            ],
            'SecurityGroupIds': [
                'string',
            ],
            'InstanceType': 'string',
            'InstanceProfileArn': 'string',
            'Status': 'string',
            'Os': 'string',
            'AmiId': 'string',
            'AvailabilityZone': 'string',
            'SubnetId': 'string',
            'PublicDns': 'string',
            'PrivateDns': 'string',
            'PublicIp': 'string',
            'PrivateIp': 'string',
            'ElasticIp': 'string',
            'AutoScalingType': 'load'|'timer',
            'SshKeyName': 'string',
            'SshHostRsaKeyFingerprint': 'string',
            'SshHostDsaKeyFingerprint': 'string',
            'CreatedAt': 'string',
            'LastServiceErrorId': 'string',
            'Architecture': 'x86_64'|'i386',
            'RootDeviceType': 'ebs'|'instance-store',
            'RootDeviceVolumeId': 'string',
            'BlockDeviceMappings': [
                {
                    'DeviceName': 'string',
                    'NoDevice': 'string',
                    'VirtualName': 'string',
                    'Ebs': {
                        'SnapshotId': 'string',
                        'Iops': 123,
                        'VolumeSize': 123,
                        'VolumeType': 'gp2'|'io1'|'standard',
                        'DeleteOnTermination': True|False
                    }
                },
            ],
            'InstallUpdatesOnBoot': True|False,
            'EbsOptimized': True|False,
            'ReportedAgentVersion': 'string',
            'ReportedOs': {
                'Family': 'string',
                'Name': 'string',
                'Version': 'string'
            },
            'InfrastructureClass': 'string',
            'RegisteredBy': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Contains the response to a DescribeInstances request.

    • Instances (list) --

      An array of Instance objects that describe the instances.

      • (dict) --

        Describes an instance.

        • InstanceId (string) --

          The instance ID.

        • Ec2InstanceId (string) --

          The ID of the associated Amazon EC2 instance.

        • VirtualizationType (string) --

          The instance's virtualization type, paravirtual or hvm .

        • Hostname (string) --

          The instance host name.

        • StackId (string) --

          The stack ID.

        • LayerIds (list) --

          An array containing the instance layer IDs.

          • (string) --

        • SecurityGroupIds (list) --

          An array containing the instance security group IDs.

          • (string) --

        • InstanceType (string) --

          The instance type. AWS OpsWorks supports all instance types except Cluster Compute, Cluster GPU, and High Memory Cluster. For more information, see Instance Families and Types. The parameter values that specify the various types are in the API Name column of the Available Instance Types table.

        • InstanceProfileArn (string) --

          The ARN of the instance's IAM profile. For more information about IAM ARNs, see Using Identifiers.

        • Status (string) --

          The instance status:

          • booting

          • connection_lost

          • online

          • pending

          • rebooting

          • requested

          • running_setup

          • setup_failed

          • shutting_down

          • start_failed

          • stopped

          • stopping

          • terminated

          • terminating

        • Os (string) --

          The instance's operating system.

        • AmiId (string) --

          A custom AMI ID to be used to create the instance. The AMI should be based on one of the standard AWS OpsWorks APIs: Amazon Linux, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS. For more information, see Instances

        • AvailabilityZone (string) --

          The instance Availability Zone. For more information, see Regions and Endpoints.

        • SubnetId (string) --

          The instance's subnet ID, if the stack is running in a VPC.

        • PublicDns (string) --

          The instance public DNS name.

        • PrivateDns (string) --

          The instance private DNS name.

        • PublicIp (string) --

          The instance public IP address.

        • PrivateIp (string) --

          The instance private IP address.

        • ElasticIp (string) --

          The instance Elastic IP address.

        • AutoScalingType (string) --

          For load-based or time-based instances, the type.

        • SshKeyName (string) --

          The instance's Amazon EC2 key pair name.

        • SshHostRsaKeyFingerprint (string) --

          The SSH key's RSA fingerprint.

        • SshHostDsaKeyFingerprint (string) --

          The SSH key's DSA fingerprint.

        • CreatedAt (string) --

          The time that the instance was created.

        • LastServiceErrorId (string) --

          The ID of the last service error. For more information, call DescribeServiceErrors.

        • Architecture (string) --

          The instance architecture, "i386" or "x86_64".

        • RootDeviceType (string) --

          The instance's root device type. For more information, see Storage for the Root Device.

        • RootDeviceVolumeId (string) --

          The root device volume ID.

        • BlockDeviceMappings (list) --

          An array of BlockDeviceMapping objects that specify the instance's block device mappings.

          • (dict) --

            Describes a block device mapping. This data type maps directly to the Amazon EC2 BlockDeviceMapping data type.

            • DeviceName (string) --

              The device name that is exposed to the instance, such as /dev/sdh . For the root device, you can use the explicit device name or you can set this parameter to ROOT_DEVICE and AWS OpsWorks will provide the correct device name.

            • NoDevice (string) --

              Suppresses the specified device included in the AMI's block device mapping.

            • VirtualName (string) --

              The virtual device name. For more information, see BlockDeviceMapping.

            • Ebs (dict) --

              An EBSBlockDevice that defines how to configure an Amazon EBS volume when the instance is launched.

              • SnapshotId (string) --

                The snapshot ID.

              • Iops (integer) --

                The number of I/O operations per second (IOPS) that the volume supports. For more information, see EbsBlockDevice.

              • VolumeSize (integer) --

                The volume size, in GiB. For more information, see EbsBlockDevice.

              • VolumeType (string) --

                The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

              • DeleteOnTermination (boolean) --

                Whether the volume is deleted on instance termination.

        • InstallUpdatesOnBoot (boolean) --

          Whether to install operating system and package updates when the instance boots. The default value is true . If this value is set to false , you must then update your instances manually by using CreateDeployment to run the update_dependencies stack command or manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances.

          Note

          We strongly recommend using the default value of true , to ensure that your instances have the latest security updates.

        • EbsOptimized (boolean) --

          Whether this is an Amazon EBS-optimized instance.

        • ReportedAgentVersion (string) --

          The instance's reported AWS OpsWorks agent version.

        • ReportedOs (dict) --

          For registered instances, the reported operating system.

          • Family (string) --

            The operating system family.

          • Name (string) --

            The operating system name.

          • Version (string) --

            The operating system version.

        • InfrastructureClass (string) --

          For registered instances, the infrastructure class: ec2 or on-premises

        • RegisteredBy (string) --

          For registered instances, who performed the registration.