aws::instance

Creates an Instance with the specified AMI, Subnet and Security group.

Example

aws::instance instance-example
    ami: "amzn-ami-hvm-2018.03.0.20181129-x86_64-gp2"
    shutdown-behavior: "STOP"
    instance-type: "t2.micro"
    key: "example"
    subnet: $(aws::subnet subnet)
    security-groups: [
        $(aws::security-group security-group)
    ]
    disable-api-termination: false
    ebs-optimized: false
    source-dest-check: true

    tags: {
        Name: "instance-example"
    }

    block-device-mapping
        device-name: "/dev/sdb"
        volume-size: 100
        auto-enable-io: false
    end

    capacity-reservation: "none"
end

Attributes

Attribute Description
ami The AMI to be used to launch the Instance.
core-count Launch instances with defined number of cores. Defaults to 0 which sets its to the instance type defaults. See Optimizing CPU Options.
thread-per-core Launch instances with defined number of threads per cores. Defaults to 0 which sets its to the instance type defaults. See Optimizing CPU Options.
ebs-optimized Enable EBS optimization for an instance. Defaults to false. See Amazon EBS–Optimized Instances.
configure-hibernate-option Enable Hibernate options for an instance. Defaults to false. See Hibernate your Instances.
shutdown-behavior Change the Shutdown Behavior options for an instance. Defaults to Stop. Valid values are stop or terminate. See Changing the Instance Initiated Shutdown Behavior.
instance-type Launch instance with the type of hardware you desire. See Instance Types.
key Launch instance with the key name of an EC2 Key Pair. This is a certificate required to access your instance. See Amazon EC2 Key Pairs.
enable-monitoring Enable or Disable monitoring for your instance. See Monitoring Your Instances.
security-groups set Launch instance with the security groups specified. See Amazon EC2 Security Groups for Linux Instances.
subnet Launch instance with the subnet specified. Required if no launch template used, or launch template with security groups used. See Vpcs and Subnets.
disable-api-termination Enable or Disable api termination of an instance. See Enabling Termination Protection for an Instance.
source-dest-check Enable or Disable Source/Dest Check for an instance. Defaults to true. See Disabling Source/Destination Checks.
user-data Set user data for your instance. See Instance Metadata and User Data.
capacity-reservation Capacity reservation for the instance.
block-device-mapping set subresource Set Block device Mapping for the instance.
instance-profile Attach IAM Instance profile.
launch-template subresource

The launch template specification to use to create the instance.

launch-template
The launch template to use for creating the instance. (Required)
version
The version of the launch template to use.
status The state of the instance. Valid values are running or stopped.
private-ip-address The private IP of this instance.

Outputs

Attribute Description
id Instance ID of this instance.
public-ip-address The public IP of this instance, if launched in a public subnet.
public-dns-name The public dns name of this instance, if launched in a public subnet.
instance-state Current state of this instance (running, pending, terminated, stopped).
instance-launch-date The date and time this instance was launched.