To create an EC2 Instance Connect Endpoint
Use the create-instance-connect-endpoint
command.
aws ec2 create-instance-connect-endpoint \
--subnet-id subnet-0123456789example
To specify the type of traffic that the endpoint supports, include the
--ip-address-type parameter. Valid values are
ipv4, dualstack, or ipv6. The
subnet must support the IP address type that you specify. When the
--ip-address-type parameter is omitted, the default value
is determined by the IP address type supported by the subnet.
aws ec2 create-instance-connect-endpoint \
--subnet-id subnet-0123456789example \
--ip-address-type ipv4
The following is example output.
{
"OwnerId": "111111111111",
"InstanceConnectEndpointId": "eice-0123456789example",
"InstanceConnectEndpointArn": "arn:aws:ec2:us-east-1:111111111111:instance-connect-endpoint/eice-0123456789example",
"State": "create-complete",
"StateMessage": "",
"DnsName": "eice-0123456789example.0123abcd.ec2-instance-connect-endpoint.us-east-1.amazonaws.com",
"FipsDnsName": "eice-0123456789example.0123abcd.fips.ec2-instance-connect-endpoint.us-east-1.amazonaws.com",
"NetworkInterfaceIds": [
"eni-0123abcd"
],
"VpcId": "vpc-0123abcd",
"AvailabilityZone": "us-east-1a",
"CreatedAt": "2023-04-07T15:43:53.000Z",
"SubnetId": "subnet-0123abcd",
"PreserveClientIp": false,
"SecurityGroupIds": [
"sg-0123abcd"
],
"Tags": [],
"IpAddressType": "ipv4"
}
To monitor the creation status
The initial value for the State field is
create-in-progress. Before you can connect to an
instance using this endpoint, wait until the state is
create-complete. Use the describe-instance-connect-endpoints
command to monitor the status of the EC2 Instance Connect Endpoint. The
--query parameter filters the results to the
State field.
aws ec2 describe-instance-connect-endpoints --instance-connect-endpoint-ids eice-0123456789example --query InstanceConnectEndpoints[*].State --output text
The following is example output.
create-complete
To create the EC2 Instance Connect Endpoint
Use the New-EC2InstanceConnectEndpoint
cmdlet.
New-EC2InstanceConnectEndpoint -SubnetId subnet-0123456789example
To specify the type of traffic that the endpoint supports, include the
-IpAddressType parameter. Valid values are
ipv4, dualstack, or ipv6. The
subnet must support the IP address type that you specify. When the
-IpAddressType parameter is omitted, the default value is
determined by the IP address type supported by the subnet.
New-EC2InstanceConnectEndpoint -SubnetId subnet-0123456789example -IpAddressType ipv4
The following is example output.
OwnerId : 111111111111
InstanceConnectEndpointId : eice-0123456789example
InstanceConnectEndpointArn : arn:aws:ec2:us-east-1:111111111111:instance-connect-endpoint/eice-0123456789example
State : create-complete
StateMessage :
DnsName : eice-0123456789example.0123abcd.ec2-instance-connect-endpoint.us-east-1.amazonaws.com
FipsDnsName : eice-0123456789example.0123abcd.fips.ec2-instance-connect-endpoint.us-east-1.amazonaws.com
NetworkInterfaceIds : {eni-0123abcd}
VpcId : vpc-0123abcd
AvailabilityZone : us-east-1a
CreatedAt : 4/7/2023 3:43:53 PM
SubnetId : subnet-0123abcd
PreserveClientIp : False
SecurityGroupIds : {sg-0123abcd}
Tags : {}
IpAddressType : ipv4
To monitor the creation status
The initial value for the State field is
create-in-progress. Before you can connect to an
instance using this endpoint, wait until the state is
create-complete. Use the Get-EC2InstanceConnectEndpoint cmdlet to
monitor the status of the EC2 Instance Connect Endpoint. .State.Value
filters the results to the State field.
(Get-EC2InstanceConnectEndpoint -InstanceConnectEndpointId "eice-0123456789example").State.Value
The following is example output.
create-complete