com.amazonaws.util

## クラス EC2MetadataUtils

- java.lang.Object
- - com.amazonaws.util.EC2MetadataUtils

-     public class EC2MetadataUtils
      extends java.lang.Object

  Utility class for retrieving Amazon EC2 instance metadata.
  You can use the data to build more generic AMIs that can be modified by configuration files supplied at launch time. For example, if you run web servers for various small businesses, they can all use the same AMI and retrieve their content from the Amazon S3 bucket you specify at launch. To add a new customer at any time, simply create a bucket for the customer, add their content, and launch your AMI.
  More information about Amazon EC2 Metadata
  関連項目:
    Amazon EC2 User Guide >> Instance Metadata

- - ### ネストされたクラスの概要

    ネストされたクラス
    修飾子とタイプ | クラスと説明
    --- | ---
    `static class` | `EC2MetadataUtils.IAMInfo` Information about the last time the instance profile was updated, including the instance's LastUpdated date, InstanceProfileArn, and InstanceProfileId.
    `static class` | `EC2MetadataUtils.IAMSecurityCredential` The temporary security credentials (AccessKeyId, SecretAcessKey, SessionToken, and Expiration) associated with the IAM role.
    `static class` | `EC2MetadataUtils.NetworkInterface` All of the metada associated with a network interface on the instance.

  - ### コンストラクタの概要

    コンストラクタ
    コンストラクタと説明
    `EC2MetadataUtils()`

  - ### メソッドの概要

    メソッド
    修飾子とタイプ | メソッドと説明
    --- | ---
    `static java.lang.String` | `getAmiId()` Get the AMI ID used to launch the instance.
    `static java.lang.String` | `getAmiLaunchIndex()` Get the index of this instance in the reservation.
    `static java.lang.String` | `getAmiManifestPath()` Get the manifest path of the AMI with which the instance was launched.
    `static java.util.List<java.lang.String>` | `getAncestorAmiIds()` Get the list of AMI IDs of any instances that were rebundled to created this AMI.
    `static java.lang.String` | `getAvailabilityZone()` Get the Availability Zone in which the instance launched.
    `static java.util.Map<java.lang.String,java.lang.String>` | `getBlockDeviceMapping()` Get the virtual devices associated with the ami, root, ebs, and swap.
    `static java.lang.String` | `getData(java.lang.String path)`
    `static java.lang.String` | `getData(java.lang.String path, int tries)`
    `static EC2MetadataUtils.IAMInfo` | `getIAMInstanceProfileInfo()` Get information about the last time the instance profile was updated, including the instance's LastUpdated date, InstanceProfileArn, and InstanceProfileId.
    `static java.util.Map<java.lang.String,EC2MetadataUtils.IAMSecurityCredential>` | `getIAMSecurityCredentials()` Returns the temporary security credentials (AccessKeyId, SecretAccessKey, SessionToken, and Expiration) associated with the IAM roles on the instance.
    `static java.lang.String` | `getInstanceAction()` Notifies the instance that it should reboot in preparation for bundling.
    `static java.lang.String` | `getInstanceId()` Get the ID of this instance.
    `static java.lang.String` | `getInstanceType()` Get the type of the instance.
    `static java.util.List<java.lang.String>` | `getItems(java.lang.String path)`
    `static java.util.List<java.lang.String>` | `getItems(java.lang.String path, int tries)`
    `static java.lang.String` | `getLocalHostName()` Get the local hostname of the instance.
    `static java.lang.String` | `getMacAddress()` Get the MAC address of the instance.
    `static java.util.List<EC2MetadataUtils.NetworkInterface>` | `getNetworkInterfaces()` Get the list of network interfaces on the instance.
    `static java.lang.String` | `getPrivateIpAddress()` Get the private IP address of the instance.
    `static java.util.List<java.lang.String>` | `getProductCodes()` Get the list of product codes associated with the instance, if any.
    `static java.lang.String` | `getPublicKey()` Get the public key.
    `static java.lang.String` | `getRamdiskId()` Get the ID of the RAM disk specified at launch time, if applicable.
    `static java.lang.String` | `getReservationId()` Get the ID of the reservation.
    `static java.util.List<java.lang.String>` | `getSecurityGroups()` Get the list of names of the security groups applied to the instance.
    `static java.lang.String` | `getUserData()` Get the metadata sent to the instance

    - ### クラスから継承されたメソッド java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### コンストラクタの詳細

    - #### EC2MetadataUtils

          public EC2MetadataUtils()

  - ### メソッドの詳細

    - #### getAmiId

          public static java.lang.String getAmiId()

      Get the AMI ID used to launch the instance.

    - #### getAmiLaunchIndex

          public static java.lang.String getAmiLaunchIndex()

      Get the index of this instance in the reservation.

    - #### getAmiManifestPath

          public static java.lang.String getAmiManifestPath()

      Get the manifest path of the AMI with which the instance was launched.

    - #### getAncestorAmiIds

          public static java.util.List<java.lang.String> getAncestorAmiIds()

      Get the list of AMI IDs of any instances that were rebundled to created this AMI. Will only exist if the AMI manifest file contained an ancestor-amis key.

    - #### getInstanceAction

          public static java.lang.String getInstanceAction()

      Notifies the instance that it should reboot in preparation for bundling. Valid values: none | shutdown | bundle-pending.

    - #### getInstanceId

          public static java.lang.String getInstanceId()

      Get the ID of this instance.

    - #### getInstanceType

          public static java.lang.String getInstanceType()

      Get the type of the instance.

    - #### getLocalHostName

          public static java.lang.String getLocalHostName()

      Get the local hostname of the instance. In cases where multiple network interfaces are present, this refers to the eth0 device (the device for which device-number is 0).

    - #### getMacAddress

          public static java.lang.String getMacAddress()

      Get the MAC address of the instance. In cases where multiple network interfaces are present, this refers to the eth0 device (the device for which device-number is 0).

    - #### getPrivateIpAddress

          public static java.lang.String getPrivateIpAddress()

      Get the private IP address of the instance. In cases where multiple network interfaces are present, this refers to the eth0 device (the device for which device-number is 0).

    - #### getAvailabilityZone

          public static java.lang.String getAvailabilityZone()

      Get the Availability Zone in which the instance launched.

    - #### getProductCodes

          public static java.util.List<java.lang.String> getProductCodes()

      Get the list of product codes associated with the instance, if any.

    - #### getPublicKey

          public static java.lang.String getPublicKey()

      Get the public key. Only available if supplied at instance launch time.

    - #### getRamdiskId

          public static java.lang.String getRamdiskId()

      Get the ID of the RAM disk specified at launch time, if applicable.

    - #### getReservationId

          public static java.lang.String getReservationId()

      Get the ID of the reservation.

    - #### getSecurityGroups

          public static java.util.List<java.lang.String> getSecurityGroups()

      Get the list of names of the security groups applied to the instance.

    - #### getIAMInstanceProfileInfo

          public static EC2MetadataUtils.IAMInfo getIAMInstanceProfileInfo()

      Get information about the last time the instance profile was updated, including the instance's LastUpdated date, InstanceProfileArn, and InstanceProfileId.

    - #### getIAMSecurityCredentials

          public static java.util.Map<java.lang.String,EC2MetadataUtils.IAMSecurityCredential> getIAMSecurityCredentials()

      Returns the temporary security credentials (AccessKeyId, SecretAccessKey, SessionToken, and Expiration) associated with the IAM roles on the instance.

    - #### getBlockDeviceMapping

          public static java.util.Map<java.lang.String,java.lang.String> getBlockDeviceMapping()

      Get the virtual devices associated with the ami, root, ebs, and swap.

    - #### getNetworkInterfaces

          public static java.util.List<EC2MetadataUtils.NetworkInterface> getNetworkInterfaces()

      Get the list of network interfaces on the instance.

    - #### getUserData

          public static java.lang.String getUserData()

      Get the metadata sent to the instance

    - #### getData

          public static java.lang.String getData(java.lang.String path)

    - #### getData

          public static java.lang.String getData(java.lang.String path,
                                 int tries)

    - #### getItems

          public static java.util.List<java.lang.String> getItems(java.lang.String path)

    - #### getItems

          public static java.util.List<java.lang.String> getItems(java.lang.String path,
                                                  int tries)