AWS Classic
getInstance
Use this data source to get the ID of an Amazon EC2 Instance for use in other resources.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var foo = Output.Create(Aws.Ec2.GetInstance.InvokeAsync(new Aws.Ec2.GetInstanceArgs
{
Filters =
{
new Aws.Ec2.Inputs.GetInstanceFilterArgs
{
Name = "image-id",
Values =
{
"ami-xxxxxxxx",
},
},
new Aws.Ec2.Inputs.GetInstanceFilterArgs
{
Name = "tag:Name",
Values =
{
"instance-name-tag",
},
},
},
InstanceId = "i-instanceid",
}));
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.LookupInstance(ctx, &ec2.LookupInstanceArgs{
Filters: []ec2.GetInstanceFilter{
ec2.GetInstanceFilter{
Name: "image-id",
Values: []string{
"ami-xxxxxxxx",
},
},
ec2.GetInstanceFilter{
Name: "tag:Name",
Values: []string{
"instance-name-tag",
},
},
},
InstanceId: pulumi.StringRef("i-instanceid"),
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var foo = Output.of(Ec2Functions.getInstance(GetInstanceArgs.builder()
.filters(
%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.instanceId("i-instanceid")
.build()));
}
}
import pulumi
import pulumi_aws as aws
foo = aws.ec2.get_instance(filters=[
aws.ec2.GetInstanceFilterArgs(
name="image-id",
values=["ami-xxxxxxxx"],
),
aws.ec2.GetInstanceFilterArgs(
name="tag:Name",
values=["instance-name-tag"],
),
],
instance_id="i-instanceid")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const foo = pulumi.output(aws.ec2.getInstance({
filters: [
{
name: "image-id",
values: ["ami-xxxxxxxx"],
},
{
name: "tag:Name",
values: ["instance-name-tag"],
},
],
instanceId: "i-instanceid",
}));
variables:
foo:
Fn::Invoke:
Function: aws:ec2:getInstance
Arguments:
filters:
- name: image-id
values:
- ami-xxxxxxxx
- name: tag:Name
values:
- instance-name-tag
instanceId: i-instanceid
Using getInstance
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getInstance(args: GetInstanceArgs, opts?: InvokeOptions): Promise<GetInstanceResult>
function getInstanceOutput(args: GetInstanceOutputArgs, opts?: InvokeOptions): Output<GetInstanceResult>
def get_instance(filters: Optional[Sequence[GetInstanceFilter]] = None,
get_password_data: Optional[bool] = None,
get_user_data: Optional[bool] = None,
instance_id: Optional[str] = None,
instance_tags: Optional[Mapping[str, str]] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetInstanceResult
def get_instance_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetInstanceFilterArgs]]]] = None,
get_password_data: Optional[pulumi.Input[bool]] = None,
get_user_data: Optional[pulumi.Input[bool]] = None,
instance_id: Optional[pulumi.Input[str]] = None,
instance_tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetInstanceResult]
func LookupInstance(ctx *Context, args *LookupInstanceArgs, opts ...InvokeOption) (*LookupInstanceResult, error)
func LookupInstanceOutput(ctx *Context, args *LookupInstanceOutputArgs, opts ...InvokeOption) LookupInstanceResultOutput
> Note: This function is named LookupInstance
in the Go SDK.
public static class GetInstance
{
public static Task<GetInstanceResult> InvokeAsync(GetInstanceArgs args, InvokeOptions? opts = null)
public static Output<GetInstanceResult> Invoke(GetInstanceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstanceResult> getInstance(GetInstanceArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: aws:ec2/getInstance:getInstance
Arguments:
# Arguments dictionary
The following arguments are supported:
- Filters
List<Pulumi.
Aws. Ec2. Inputs. Get Instance Filter> One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out [describe-instances in the AWS CLI reference][1].
- Get
Password boolData If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the
password_data
attribute. See GetPasswordData for more information.- Get
User boolData Retrieve Base64 encoded User Data contents into the
user_data_base64
attribute. A SHA-1 hash of the User Data contents will always be present in theuser_data
attribute. Defaults tofalse
.- Instance
Id string Specify the exact Instance ID with which to populate the data source.
- Dictionary<string, string>
A map of tags, each pair of which must exactly match a pair on the desired Instance.
- Dictionary<string, string>
A map of tags assigned to the Instance.
- Filters
[]Get
Instance Filter One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out [describe-instances in the AWS CLI reference][1].
- Get
Password boolData If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the
password_data
attribute. See GetPasswordData for more information.- Get
User boolData Retrieve Base64 encoded User Data contents into the
user_data_base64
attribute. A SHA-1 hash of the User Data contents will always be present in theuser_data
attribute. Defaults tofalse
.- Instance
Id string Specify the exact Instance ID with which to populate the data source.
- map[string]string
A map of tags, each pair of which must exactly match a pair on the desired Instance.
- map[string]string
A map of tags assigned to the Instance.
- filters
List<Get
Instance Filter> One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out [describe-instances in the AWS CLI reference][1].
- get
Password BooleanData If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the
password_data
attribute. See GetPasswordData for more information.- get
User BooleanData Retrieve Base64 encoded User Data contents into the
user_data_base64
attribute. A SHA-1 hash of the User Data contents will always be present in theuser_data
attribute. Defaults tofalse
.- instance
Id String Specify the exact Instance ID with which to populate the data source.
- Map<String,String>
A map of tags, each pair of which must exactly match a pair on the desired Instance.
- Map<String,String>
A map of tags assigned to the Instance.
- filters
Get
Instance Filter[] One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out [describe-instances in the AWS CLI reference][1].
- get
Password booleanData If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the
password_data
attribute. See GetPasswordData for more information.- get
User booleanData Retrieve Base64 encoded User Data contents into the
user_data_base64
attribute. A SHA-1 hash of the User Data contents will always be present in theuser_data
attribute. Defaults tofalse
.- instance
Id string Specify the exact Instance ID with which to populate the data source.
- {[key: string]: string}
A map of tags, each pair of which must exactly match a pair on the desired Instance.
- {[key: string]: string}
A map of tags assigned to the Instance.
- filters
Sequence[Get
Instance Filter] One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out [describe-instances in the AWS CLI reference][1].
- get_
password_ booldata If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the
password_data
attribute. See GetPasswordData for more information.- get_
user_ booldata Retrieve Base64 encoded User Data contents into the
user_data_base64
attribute. A SHA-1 hash of the User Data contents will always be present in theuser_data
attribute. Defaults tofalse
.- instance_
id str Specify the exact Instance ID with which to populate the data source.
- Mapping[str, str]
A map of tags, each pair of which must exactly match a pair on the desired Instance.
- Mapping[str, str]
A map of tags assigned to the Instance.
- filters List<Property Map>
One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out [describe-instances in the AWS CLI reference][1].
- get
Password BooleanData If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the
password_data
attribute. See GetPasswordData for more information.- get
User BooleanData Retrieve Base64 encoded User Data contents into the
user_data_base64
attribute. A SHA-1 hash of the User Data contents will always be present in theuser_data
attribute. Defaults tofalse
.- instance
Id String Specify the exact Instance ID with which to populate the data source.
- Map<String>
A map of tags, each pair of which must exactly match a pair on the desired Instance.
- Map<String>
A map of tags assigned to the Instance.
getInstance Result
The following output properties are available:
- Ami string
The ID of the AMI used to launch the instance.
- Arn string
The ARN of the instance.
- Associate
Public boolIp Address Whether or not the Instance is associated with a public IP address or not (Boolean).
- Availability
Zone string The availability zone of the Instance.
- Credit
Specifications List<Pulumi.Aws. Ec2. Outputs. Get Instance Credit Specification> The credit specification of the Instance.
- Disable
Api boolStop Whether or not EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection) is enabled (Boolean).
- Disable
Api boolTermination Whether or not EC2 Instance Termination Protection is enabled (Boolean).
- Ebs
Block List<Pulumi.Devices Aws. Ec2. Outputs. Get Instance Ebs Block Device> The EBS block device mappings of the Instance.
- Ebs
Optimized bool Whether the Instance is EBS optimized or not (Boolean).
- Enclave
Options List<Pulumi.Aws. Ec2. Outputs. Get Instance Enclave Option> The enclave options of the instance.
- Ephemeral
Block List<Pulumi.Devices Aws. Ec2. Outputs. Get Instance Ephemeral Block Device> The ephemeral block device mappings of the Instance.
- Host
Id string The Id of the dedicated host the instance will be assigned to.
- Iam
Instance stringProfile The name of the instance profile associated with the Instance.
- Id string
The provider-assigned unique ID for this managed resource.
- Instance
State string The state of the instance. One of:
pending
,running
,shutting-down
,terminated
,stopping
,stopped
. See Instance Lifecycle for more information.- Dictionary<string, string>
- Instance
Type string The type of the Instance.
- Ipv6Addresses List<string>
The IPv6 addresses associated to the Instance, if applicable. NOTE: Unlike the IPv4 address, this doesn't change if you attach an EIP to the instance.
- Key
Name string The key name of the Instance.
- Maintenance
Options List<Pulumi.Aws. Ec2. Outputs. Get Instance Maintenance Option> The maintenance and recovery options for the instance.
- Metadata
Options List<Pulumi.Aws. Ec2. Outputs. Get Instance Metadata Option> The metadata options of the Instance.
- Monitoring bool
Whether detailed monitoring is enabled or disabled for the Instance (Boolean).
- Network
Interface stringId The ID of the network interface that was created with the Instance.
- Outpost
Arn string The Amazon Resource Name (ARN) of the Outpost.
- Password
Data string Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if
get_password_data
is true. See GetPasswordData for more information.- Placement
Group string The placement group of the Instance.
- Placement
Partition intNumber The number of the partition the instance is in.
- Private
Dns string The private DNS name assigned to the Instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC.
- Private
Dns List<Pulumi.Name Options Aws. Ec2. Outputs. Get Instance Private Dns Name Option> The options for the instance hostname.
- Private
Ip string The private IP address assigned to the Instance.
- Public
Dns string The public DNS name assigned to the Instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC.
- Public
Ip string The public IP address assigned to the Instance, if applicable. NOTE: If you are using an
aws.ec2.Eip
with your instance, you should refer to the EIP's address directly and not usepublic_ip
, as this field will change after the EIP is attached.- Root
Block List<Pulumi.Devices Aws. Ec2. Outputs. Get Instance Root Block Device> The root block device mappings of the Instance
- Secondary
Private List<string>Ips The secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.
- Security
Groups List<string> The associated security groups.
- Source
Dest boolCheck Whether the network interface performs source/destination checking (Boolean).
- Subnet
Id string The VPC subnet ID.
- Dictionary<string, string>
A map of tags assigned to the Instance.
- Tenancy string
The tenancy of the instance:
dedicated
,default
,host
.- User
Data string SHA-1 hash of User Data supplied to the Instance.
- User
Data stringBase64 Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if
get_user_data
is true.- Vpc
Security List<string>Group Ids The associated security groups in a non-default VPC.
- Filters
List<Pulumi.
Aws. Ec2. Outputs. Get Instance Filter> - Get
Password boolData - Get
User boolData - Instance
Id string
- Ami string
The ID of the AMI used to launch the instance.
- Arn string
The ARN of the instance.
- Associate
Public boolIp Address Whether or not the Instance is associated with a public IP address or not (Boolean).
- Availability
Zone string The availability zone of the Instance.
- Credit
Specifications []GetInstance Credit Specification The credit specification of the Instance.
- Disable
Api boolStop Whether or not EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection) is enabled (Boolean).
- Disable
Api boolTermination Whether or not EC2 Instance Termination Protection is enabled (Boolean).
- Ebs
Block []GetDevices Instance Ebs Block Device The EBS block device mappings of the Instance.
- Ebs
Optimized bool Whether the Instance is EBS optimized or not (Boolean).
- Enclave
Options []GetInstance Enclave Option The enclave options of the instance.
- Ephemeral
Block []GetDevices Instance Ephemeral Block Device The ephemeral block device mappings of the Instance.
- Host
Id string The Id of the dedicated host the instance will be assigned to.
- Iam
Instance stringProfile The name of the instance profile associated with the Instance.
- Id string
The provider-assigned unique ID for this managed resource.
- Instance
State string The state of the instance. One of:
pending
,running
,shutting-down
,terminated
,stopping
,stopped
. See Instance Lifecycle for more information.- map[string]string
- Instance
Type string The type of the Instance.
- Ipv6Addresses []string
The IPv6 addresses associated to the Instance, if applicable. NOTE: Unlike the IPv4 address, this doesn't change if you attach an EIP to the instance.
- Key
Name string The key name of the Instance.
- Maintenance
Options []GetInstance Maintenance Option The maintenance and recovery options for the instance.
- Metadata
Options []GetInstance Metadata Option The metadata options of the Instance.
- Monitoring bool
Whether detailed monitoring is enabled or disabled for the Instance (Boolean).
- Network
Interface stringId The ID of the network interface that was created with the Instance.
- Outpost
Arn string The Amazon Resource Name (ARN) of the Outpost.
- Password
Data string Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if
get_password_data
is true. See GetPasswordData for more information.- Placement
Group string The placement group of the Instance.
- Placement
Partition intNumber The number of the partition the instance is in.
- Private
Dns string The private DNS name assigned to the Instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC.
- Private
Dns []GetName Options Instance Private Dns Name Option The options for the instance hostname.
- Private
Ip string The private IP address assigned to the Instance.
- Public
Dns string The public DNS name assigned to the Instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC.
- Public
Ip string The public IP address assigned to the Instance, if applicable. NOTE: If you are using an
aws.ec2.Eip
with your instance, you should refer to the EIP's address directly and not usepublic_ip
, as this field will change after the EIP is attached.- Root
Block []GetDevices Instance Root Block Device The root block device mappings of the Instance
- Secondary
Private []stringIps The secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.
- Security
Groups []string The associated security groups.
- Source
Dest boolCheck Whether the network interface performs source/destination checking (Boolean).
- Subnet
Id string The VPC subnet ID.
- map[string]string
A map of tags assigned to the Instance.
- Tenancy string
The tenancy of the instance:
dedicated
,default
,host
.- User
Data string SHA-1 hash of User Data supplied to the Instance.
- User
Data stringBase64 Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if
get_user_data
is true.- Vpc
Security []stringGroup Ids The associated security groups in a non-default VPC.
- Filters
[]Get
Instance Filter - Get
Password boolData - Get
User boolData - Instance
Id string
- ami String
The ID of the AMI used to launch the instance.
- arn String
The ARN of the instance.
- associate
Public BooleanIp Address Whether or not the Instance is associated with a public IP address or not (Boolean).
- availability
Zone String The availability zone of the Instance.
- credit
Specifications List<GetInstance Credit Specification> The credit specification of the Instance.
- disable
Api BooleanStop Whether or not EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection) is enabled (Boolean).
- disable
Api BooleanTermination Whether or not EC2 Instance Termination Protection is enabled (Boolean).
- ebs
Block List<GetDevices Instance Ebs Block Device> The EBS block device mappings of the Instance.
- ebs
Optimized Boolean Whether the Instance is EBS optimized or not (Boolean).
- enclave
Options List<GetInstance Enclave Option> The enclave options of the instance.
- ephemeral
Block List<GetDevices Instance Ephemeral Block Device> The ephemeral block device mappings of the Instance.
- host
Id String The Id of the dedicated host the instance will be assigned to.
- iam
Instance StringProfile The name of the instance profile associated with the Instance.
- id String
The provider-assigned unique ID for this managed resource.
- instance
State String The state of the instance. One of:
pending
,running
,shutting-down
,terminated
,stopping
,stopped
. See Instance Lifecycle for more information.- Map<String,String>
- instance
Type String The type of the Instance.
- ipv6Addresses List<String>
The IPv6 addresses associated to the Instance, if applicable. NOTE: Unlike the IPv4 address, this doesn't change if you attach an EIP to the instance.
- key
Name String The key name of the Instance.
- maintenance
Options List<GetInstance Maintenance Option> The maintenance and recovery options for the instance.
- metadata
Options List<GetInstance Metadata Option> The metadata options of the Instance.
- monitoring Boolean
Whether detailed monitoring is enabled or disabled for the Instance (Boolean).
- network
Interface StringId The ID of the network interface that was created with the Instance.
- outpost
Arn String The Amazon Resource Name (ARN) of the Outpost.
- password
Data String Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if
get_password_data
is true. See GetPasswordData for more information.- placement
Group String The placement group of the Instance.
- placement
Partition IntegerNumber The number of the partition the instance is in.
- private
Dns String The private DNS name assigned to the Instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC.
- private
Dns List<GetName Options Instance Private Dns Name Option> The options for the instance hostname.
- private
Ip String The private IP address assigned to the Instance.
- public
Dns String The public DNS name assigned to the Instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC.
- public
Ip String The public IP address assigned to the Instance, if applicable. NOTE: If you are using an
aws.ec2.Eip
with your instance, you should refer to the EIP's address directly and not usepublic_ip
, as this field will change after the EIP is attached.- root
Block List<GetDevices Instance Root Block Device> The root block device mappings of the Instance
- secondary
Private List<String>Ips The secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.
- security
Groups List<String> The associated security groups.
- source
Dest BooleanCheck Whether the network interface performs source/destination checking (Boolean).
- subnet
Id String The VPC subnet ID.
- Map<String,String>
A map of tags assigned to the Instance.
- tenancy String
The tenancy of the instance:
dedicated
,default
,host
.- user
Data String SHA-1 hash of User Data supplied to the Instance.
- user
Data StringBase64 Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if
get_user_data
is true.- vpc
Security List<String>Group Ids The associated security groups in a non-default VPC.
- filters
List<Get
Instance Filter> - get
Password BooleanData - get
User BooleanData - instance
Id String
- ami string
The ID of the AMI used to launch the instance.
- arn string
The ARN of the instance.
- associate
Public booleanIp Address Whether or not the Instance is associated with a public IP address or not (Boolean).
- availability
Zone string The availability zone of the Instance.
- credit
Specifications GetInstance Credit Specification[] The credit specification of the Instance.
- disable
Api booleanStop Whether or not EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection) is enabled (Boolean).
- disable
Api booleanTermination Whether or not EC2 Instance Termination Protection is enabled (Boolean).
- ebs
Block GetDevices Instance Ebs Block Device[] The EBS block device mappings of the Instance.
- ebs
Optimized boolean Whether the Instance is EBS optimized or not (Boolean).
- enclave
Options GetInstance Enclave Option[] The enclave options of the instance.
- ephemeral
Block GetDevices Instance Ephemeral Block Device[] The ephemeral block device mappings of the Instance.
- host
Id string The Id of the dedicated host the instance will be assigned to.
- iam
Instance stringProfile The name of the instance profile associated with the Instance.
- id string
The provider-assigned unique ID for this managed resource.
- instance
State string The state of the instance. One of:
pending
,running
,shutting-down
,terminated
,stopping
,stopped
. See Instance Lifecycle for more information.- {[key: string]: string}
- instance
Type string The type of the Instance.
- ipv6Addresses string[]
The IPv6 addresses associated to the Instance, if applicable. NOTE: Unlike the IPv4 address, this doesn't change if you attach an EIP to the instance.
- key
Name string The key name of the Instance.
- maintenance
Options GetInstance Maintenance Option[] The maintenance and recovery options for the instance.
- metadata
Options GetInstance Metadata Option[] The metadata options of the Instance.
- monitoring boolean
Whether detailed monitoring is enabled or disabled for the Instance (Boolean).
- network
Interface stringId The ID of the network interface that was created with the Instance.
- outpost
Arn string The Amazon Resource Name (ARN) of the Outpost.
- password
Data string Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if
get_password_data
is true. See GetPasswordData for more information.- placement
Group string The placement group of the Instance.
- placement
Partition numberNumber The number of the partition the instance is in.
- private
Dns string The private DNS name assigned to the Instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC.
- private
Dns GetName Options Instance Private Dns Name Option[] The options for the instance hostname.
- private
Ip string The private IP address assigned to the Instance.
- public
Dns string The public DNS name assigned to the Instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC.
- public
Ip string The public IP address assigned to the Instance, if applicable. NOTE: If you are using an
aws.ec2.Eip
with your instance, you should refer to the EIP's address directly and not usepublic_ip
, as this field will change after the EIP is attached.- root
Block GetDevices Instance Root Block Device[] The root block device mappings of the Instance
- secondary
Private string[]Ips The secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.
- security
Groups string[] The associated security groups.
- source
Dest booleanCheck Whether the network interface performs source/destination checking (Boolean).
- subnet
Id string The VPC subnet ID.
- {[key: string]: string}
A map of tags assigned to the Instance.
- tenancy string
The tenancy of the instance:
dedicated
,default
,host
.- user
Data string SHA-1 hash of User Data supplied to the Instance.
- user
Data stringBase64 Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if
get_user_data
is true.- vpc
Security string[]Group Ids The associated security groups in a non-default VPC.
- filters
Get
Instance Filter[] - get
Password booleanData - get
User booleanData - instance
Id string
- ami str
The ID of the AMI used to launch the instance.
- arn str
The ARN of the instance.
- associate_
public_ boolip_ address Whether or not the Instance is associated with a public IP address or not (Boolean).
- availability_
zone str The availability zone of the Instance.
- credit_
specifications Sequence[GetInstance Credit Specification] The credit specification of the Instance.
- disable_
api_ boolstop Whether or not EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection) is enabled (Boolean).
- disable_
api_ booltermination Whether or not EC2 Instance Termination Protection is enabled (Boolean).
- ebs_
block_ Sequence[Getdevices Instance Ebs Block Device] The EBS block device mappings of the Instance.
- ebs_
optimized bool Whether the Instance is EBS optimized or not (Boolean).
- enclave_
options Sequence[GetInstance Enclave Option] The enclave options of the instance.
- ephemeral_
block_ Sequence[Getdevices Instance Ephemeral Block Device] The ephemeral block device mappings of the Instance.
- host_
id str The Id of the dedicated host the instance will be assigned to.
- iam_
instance_ strprofile The name of the instance profile associated with the Instance.
- id str
The provider-assigned unique ID for this managed resource.
- instance_
state str The state of the instance. One of:
pending
,running
,shutting-down
,terminated
,stopping
,stopped
. See Instance Lifecycle for more information.- Mapping[str, str]
- instance_
type str The type of the Instance.
- ipv6_
addresses Sequence[str] The IPv6 addresses associated to the Instance, if applicable. NOTE: Unlike the IPv4 address, this doesn't change if you attach an EIP to the instance.
- key_
name str The key name of the Instance.
- maintenance_
options Sequence[GetInstance Maintenance Option] The maintenance and recovery options for the instance.
- metadata_
options Sequence[GetInstance Metadata Option] The metadata options of the Instance.
- monitoring bool
Whether detailed monitoring is enabled or disabled for the Instance (Boolean).
- network_
interface_ strid The ID of the network interface that was created with the Instance.
- outpost_
arn str The Amazon Resource Name (ARN) of the Outpost.
- password_
data str Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if
get_password_data
is true. See GetPasswordData for more information.- placement_
group str The placement group of the Instance.
- placement_
partition_ intnumber The number of the partition the instance is in.
- private_
dns str The private DNS name assigned to the Instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC.
- private_
dns_ Sequence[Getname_ options Instance Private Dns Name Option] The options for the instance hostname.
- private_
ip str The private IP address assigned to the Instance.
- public_
dns str The public DNS name assigned to the Instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC.
- public_
ip str The public IP address assigned to the Instance, if applicable. NOTE: If you are using an
aws.ec2.Eip
with your instance, you should refer to the EIP's address directly and not usepublic_ip
, as this field will change after the EIP is attached.- root_
block_ Sequence[Getdevices Instance Root Block Device] The root block device mappings of the Instance
- secondary_
private_ Sequence[str]ips The secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.
- security_
groups Sequence[str] The associated security groups.
- source_
dest_ boolcheck Whether the network interface performs source/destination checking (Boolean).
- subnet_
id str The VPC subnet ID.
- Mapping[str, str]
A map of tags assigned to the Instance.
- tenancy str
The tenancy of the instance:
dedicated
,default
,host
.- user_
data str SHA-1 hash of User Data supplied to the Instance.
- user_
data_ strbase64 Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if
get_user_data
is true.- vpc_
security_ Sequence[str]group_ ids The associated security groups in a non-default VPC.
- filters
Sequence[Get
Instance Filter] - get_
password_ booldata - get_
user_ booldata - instance_
id str
- ami String
The ID of the AMI used to launch the instance.
- arn String
The ARN of the instance.
- associate
Public BooleanIp Address Whether or not the Instance is associated with a public IP address or not (Boolean).
- availability
Zone String The availability zone of the Instance.
- credit
Specifications List<Property Map> The credit specification of the Instance.
- disable
Api BooleanStop Whether or not EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection) is enabled (Boolean).
- disable
Api BooleanTermination Whether or not EC2 Instance Termination Protection is enabled (Boolean).
- ebs
Block List<Property Map>Devices The EBS block device mappings of the Instance.
- ebs
Optimized Boolean Whether the Instance is EBS optimized or not (Boolean).
- enclave
Options List<Property Map> The enclave options of the instance.
- ephemeral
Block List<Property Map>Devices The ephemeral block device mappings of the Instance.
- host
Id String The Id of the dedicated host the instance will be assigned to.
- iam
Instance StringProfile The name of the instance profile associated with the Instance.
- id String
The provider-assigned unique ID for this managed resource.
- instance
State String The state of the instance. One of:
pending
,running
,shutting-down
,terminated
,stopping
,stopped
. See Instance Lifecycle for more information.- Map<String>
- instance
Type String The type of the Instance.
- ipv6Addresses List<String>
The IPv6 addresses associated to the Instance, if applicable. NOTE: Unlike the IPv4 address, this doesn't change if you attach an EIP to the instance.
- key
Name String The key name of the Instance.
- maintenance
Options List<Property Map> The maintenance and recovery options for the instance.
- metadata
Options List<Property Map> The metadata options of the Instance.
- monitoring Boolean
Whether detailed monitoring is enabled or disabled for the Instance (Boolean).
- network
Interface StringId The ID of the network interface that was created with the Instance.
- outpost
Arn String The Amazon Resource Name (ARN) of the Outpost.
- password
Data String Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if
get_password_data
is true. See GetPasswordData for more information.- placement
Group String The placement group of the Instance.
- placement
Partition NumberNumber The number of the partition the instance is in.
- private
Dns String The private DNS name assigned to the Instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC.
- private
Dns List<Property Map>Name Options The options for the instance hostname.
- private
Ip String The private IP address assigned to the Instance.
- public
Dns String The public DNS name assigned to the Instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC.
- public
Ip String The public IP address assigned to the Instance, if applicable. NOTE: If you are using an
aws.ec2.Eip
with your instance, you should refer to the EIP's address directly and not usepublic_ip
, as this field will change after the EIP is attached.- root
Block List<Property Map>Devices The root block device mappings of the Instance
- secondary
Private List<String>Ips The secondary private IPv4 addresses assigned to the instance's primary network interface (eth0) in a VPC.
- security
Groups List<String> The associated security groups.
- source
Dest BooleanCheck Whether the network interface performs source/destination checking (Boolean).
- subnet
Id String The VPC subnet ID.
- Map<String>
A map of tags assigned to the Instance.
- tenancy String
The tenancy of the instance:
dedicated
,default
,host
.- user
Data String SHA-1 hash of User Data supplied to the Instance.
- user
Data StringBase64 Base64 encoded contents of User Data supplied to the Instance. This attribute is only exported if
get_user_data
is true.- vpc
Security List<String>Group Ids The associated security groups in a non-default VPC.
- filters List<Property Map>
- get
Password BooleanData - get
User BooleanData - instance
Id String
Supporting Types
GetInstanceCreditSpecification
- Cpu
Credits string
- Cpu
Credits string
- cpu
Credits String
- cpu
Credits string
- cpu_
credits str
- cpu
Credits String
GetInstanceEbsBlockDevice
- Delete
On boolTermination If the root block device will be deleted on termination.
- Device
Name string The physical name of the device.
- Encrypted bool
If the EBS volume is encrypted.
- Iops int
0
If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.- Kms
Key stringId - Snapshot
Id string The ID of the snapshot.
- Dictionary<string, string>
A map of tags assigned to the Instance.
- Throughput int
The throughput of the volume, in MiB/s.
- Volume
Id string - Volume
Size int The size of the volume, in GiB.
- Volume
Type string The type of the volume.
- Delete
On boolTermination If the root block device will be deleted on termination.
- Device
Name string The physical name of the device.
- Encrypted bool
If the EBS volume is encrypted.
- Iops int
0
If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.- Kms
Key stringId - Snapshot
Id string The ID of the snapshot.
- map[string]string
A map of tags assigned to the Instance.
- Throughput int
The throughput of the volume, in MiB/s.
- Volume
Id string - Volume
Size int The size of the volume, in GiB.
- Volume
Type string The type of the volume.
- delete
On BooleanTermination If the root block device will be deleted on termination.
- device
Name String The physical name of the device.
- encrypted Boolean
If the EBS volume is encrypted.
- iops Integer
0
If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.- kms
Key StringId - snapshot
Id String The ID of the snapshot.
- Map<String,String>
A map of tags assigned to the Instance.
- throughput Integer
The throughput of the volume, in MiB/s.
- volume
Id String - volume
Size Integer The size of the volume, in GiB.
- volume
Type String The type of the volume.
- delete
On booleanTermination If the root block device will be deleted on termination.
- device
Name string The physical name of the device.
- encrypted boolean
If the EBS volume is encrypted.
- iops number
0
If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.- kms
Key stringId - snapshot
Id string The ID of the snapshot.
- {[key: string]: string}
A map of tags assigned to the Instance.
- throughput number
The throughput of the volume, in MiB/s.
- volume
Id string - volume
Size number The size of the volume, in GiB.
- volume
Type string The type of the volume.
- delete_
on_ booltermination If the root block device will be deleted on termination.
- device_
name str The physical name of the device.
- encrypted bool
If the EBS volume is encrypted.
- iops int
0
If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.- kms_
key_ strid - snapshot_
id str The ID of the snapshot.
- Mapping[str, str]
A map of tags assigned to the Instance.
- throughput int
The throughput of the volume, in MiB/s.
- volume_
id str - volume_
size int The size of the volume, in GiB.
- volume_
type str The type of the volume.
- delete
On BooleanTermination If the root block device will be deleted on termination.
- device
Name String The physical name of the device.
- encrypted Boolean
If the EBS volume is encrypted.
- iops Number
0
If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.- kms
Key StringId - snapshot
Id String The ID of the snapshot.
- Map<String>
A map of tags assigned to the Instance.
- throughput Number
The throughput of the volume, in MiB/s.
- volume
Id String - volume
Size Number The size of the volume, in GiB.
- volume
Type String The type of the volume.
GetInstanceEnclaveOption
- Enabled bool
Whether Nitro Enclaves are enabled.
- Enabled bool
Whether Nitro Enclaves are enabled.
- enabled Boolean
Whether Nitro Enclaves are enabled.
- enabled boolean
Whether Nitro Enclaves are enabled.
- enabled bool
Whether Nitro Enclaves are enabled.
- enabled Boolean
Whether Nitro Enclaves are enabled.
GetInstanceEphemeralBlockDevice
- Device
Name string The physical name of the device.
- No
Device bool Whether the specified device included in the device mapping was suppressed or not (Boolean).
- Virtual
Name string The virtual device name.
- Device
Name string The physical name of the device.
- No
Device bool Whether the specified device included in the device mapping was suppressed or not (Boolean).
- Virtual
Name string The virtual device name.
- device
Name String The physical name of the device.
- no
Device Boolean Whether the specified device included in the device mapping was suppressed or not (Boolean).
- virtual
Name String The virtual device name.
- device
Name string The physical name of the device.
- no
Device boolean Whether the specified device included in the device mapping was suppressed or not (Boolean).
- virtual
Name string The virtual device name.
- device_
name str The physical name of the device.
- no_
device bool Whether the specified device included in the device mapping was suppressed or not (Boolean).
- virtual_
name str The virtual device name.
- device
Name String The physical name of the device.
- no
Device Boolean Whether the specified device included in the device mapping was suppressed or not (Boolean).
- virtual
Name String The virtual device name.
GetInstanceFilter
GetInstanceMaintenanceOption
- Auto
Recovery string The automatic recovery behavior of the instance.
- Auto
Recovery string The automatic recovery behavior of the instance.
- auto
Recovery String The automatic recovery behavior of the instance.
- auto
Recovery string The automatic recovery behavior of the instance.
- auto_
recovery str The automatic recovery behavior of the instance.
- auto
Recovery String The automatic recovery behavior of the instance.
GetInstanceMetadataOption
- Http
Endpoint string The state of the metadata service:
enabled
,disabled
.- Http
Put intResponse Hop Limit The desired HTTP PUT response hop limit for instance metadata requests.
- Http
Tokens string If session tokens are required:
optional
,required
.- string
If access to instance tags is allowed from the metadata service:
enabled
,disabled
.
- Http
Endpoint string The state of the metadata service:
enabled
,disabled
.- Http
Put intResponse Hop Limit The desired HTTP PUT response hop limit for instance metadata requests.
- Http
Tokens string If session tokens are required:
optional
,required
.- string
If access to instance tags is allowed from the metadata service:
enabled
,disabled
.
- http
Endpoint String The state of the metadata service:
enabled
,disabled
.- http
Put IntegerResponse Hop Limit The desired HTTP PUT response hop limit for instance metadata requests.
- http
Tokens String If session tokens are required:
optional
,required
.- String
If access to instance tags is allowed from the metadata service:
enabled
,disabled
.
- http
Endpoint string The state of the metadata service:
enabled
,disabled
.- http
Put numberResponse Hop Limit The desired HTTP PUT response hop limit for instance metadata requests.
- http
Tokens string If session tokens are required:
optional
,required
.- string
If access to instance tags is allowed from the metadata service:
enabled
,disabled
.
- http_
endpoint str The state of the metadata service:
enabled
,disabled
.- http_
put_ intresponse_ hop_ limit The desired HTTP PUT response hop limit for instance metadata requests.
- http_
tokens str If session tokens are required:
optional
,required
.- str
If access to instance tags is allowed from the metadata service:
enabled
,disabled
.
- http
Endpoint String The state of the metadata service:
enabled
,disabled
.- http
Put NumberResponse Hop Limit The desired HTTP PUT response hop limit for instance metadata requests.
- http
Tokens String If session tokens are required:
optional
,required
.- String
If access to instance tags is allowed from the metadata service:
enabled
,disabled
.
GetInstancePrivateDnsNameOption
- Enable
Resource boolName Dns ARecord Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- Enable
Resource boolName Dns Aaaa Record Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- Hostname
Type string The type of hostname for EC2 instances.
- Enable
Resource boolName Dns ARecord Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- Enable
Resource boolName Dns Aaaa Record Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- Hostname
Type string The type of hostname for EC2 instances.
- enable
Resource BooleanName Dns ARecord Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- enable
Resource BooleanName Dns Aaaa Record Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- hostname
Type String The type of hostname for EC2 instances.
- enable
Resource booleanName Dns ARecord Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- enable
Resource booleanName Dns Aaaa Record Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- hostname
Type string The type of hostname for EC2 instances.
- enable_
resource_ boolname_ dns_ a_ record Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- enable_
resource_ boolname_ dns_ aaaa_ record Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- hostname_
type str The type of hostname for EC2 instances.
- enable
Resource BooleanName Dns ARecord Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- enable
Resource BooleanName Dns Aaaa Record Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- hostname
Type String The type of hostname for EC2 instances.
GetInstanceRootBlockDevice
- Delete
On boolTermination If the root block device will be deleted on termination.
- Device
Name string The physical name of the device.
- Encrypted bool
If the EBS volume is encrypted.
- Iops int
0
If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.- Kms
Key stringId - Dictionary<string, string>
A map of tags assigned to the Instance.
- Throughput int
The throughput of the volume, in MiB/s.
- Volume
Id string - Volume
Size int The size of the volume, in GiB.
- Volume
Type string The type of the volume.
- Delete
On boolTermination If the root block device will be deleted on termination.
- Device
Name string The physical name of the device.
- Encrypted bool
If the EBS volume is encrypted.
- Iops int
0
If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.- Kms
Key stringId - map[string]string
A map of tags assigned to the Instance.
- Throughput int
The throughput of the volume, in MiB/s.
- Volume
Id string - Volume
Size int The size of the volume, in GiB.
- Volume
Type string The type of the volume.
- delete
On BooleanTermination If the root block device will be deleted on termination.
- device
Name String The physical name of the device.
- encrypted Boolean
If the EBS volume is encrypted.
- iops Integer
0
If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.- kms
Key StringId - Map<String,String>
A map of tags assigned to the Instance.
- throughput Integer
The throughput of the volume, in MiB/s.
- volume
Id String - volume
Size Integer The size of the volume, in GiB.
- volume
Type String The type of the volume.
- delete
On booleanTermination If the root block device will be deleted on termination.
- device
Name string The physical name of the device.
- encrypted boolean
If the EBS volume is encrypted.
- iops number
0
If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.- kms
Key stringId - {[key: string]: string}
A map of tags assigned to the Instance.
- throughput number
The throughput of the volume, in MiB/s.
- volume
Id string - volume
Size number The size of the volume, in GiB.
- volume
Type string The type of the volume.
- delete_
on_ booltermination If the root block device will be deleted on termination.
- device_
name str The physical name of the device.
- encrypted bool
If the EBS volume is encrypted.
- iops int
0
If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.- kms_
key_ strid - Mapping[str, str]
A map of tags assigned to the Instance.
- throughput int
The throughput of the volume, in MiB/s.
- volume_
id str - volume_
size int The size of the volume, in GiB.
- volume_
type str The type of the volume.
- delete
On BooleanTermination If the root block device will be deleted on termination.
- device
Name String The physical name of the device.
- encrypted Boolean
If the EBS volume is encrypted.
- iops Number
0
If the volume is not a provisioned IOPS image, otherwise the supported IOPS count.- kms
Key StringId - Map<String>
A map of tags assigned to the Instance.
- throughput Number
The throughput of the volume, in MiB/s.
- volume
Id String - volume
Size Number The size of the volume, in GiB.
- volume
Type String The type of the volume.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.