Skip to content

aws.lightsail.get_instance_access_details

Example SQL Queries

SELECT * FROM
aws.lightsail.get_instance_access_details
WHERE
"instance_name" = 'VALUE';

Description

Returns temporary SSH keys you can use to connect to a specific virtual private server, or instance.

The get instance access details operation supports tag-based access control via resource tags applied to the resource identified by instance name. For more information, see the Amazon Lightsail Developer Guide.

Table Definition

Column NameColumn Data Type
instance_name Required Input Column

The name of the instance to access.

VARCHAR
protocol Input Column

The protocol to use to connect to your instance. Defaults to ssh.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
access_details

An array of key-value pairs containing information about a get instance access request.

STRUCT(
"cert_key" VARCHAR,
"expires_at" TIMESTAMP_S,
"ip_address" VARCHAR,
"ipv6_addresses" VARCHAR[],
"password" VARCHAR,
"password_data" STRUCT(
"ciphertext" VARCHAR,
"key_pair_name" VARCHAR
),
"private_key" VARCHAR,
"protocol" VARCHAR,
"instance_name" VARCHAR,
"username" VARCHAR,
"host_keys" STRUCT(
"algorithm" VARCHAR,
"public_key" VARCHAR,
"witnessed_at" TIMESTAMP_S,
"fingerprint_sha1" VARCHAR,
"fingerprint_sha256" VARCHAR,
"not_valid_before" TIMESTAMP_S,
"not_valid_after" TIMESTAMP_S
)[]
)
Show child fields
access_details.cert_key

For SSH access, the public key to use when accessing your instance For OpenSSH clients (command line SSH), you should save this value to tempkey-cert.pub.

access_details.expires_at

For SSH access, the date on which the temporary keys expire.

access_details.host_keys[]
Show child fields
access_details.host_keys[].algorithm

The SSH host key algorithm or the RDP certificate format.

For SSH host keys, the algorithm may be ssh-rsa, ecdsa-sha2-nistp256, ssh-ed25519, etc. For RDP certificates, the algorithm is always x509-cert.

access_details.host_keys[].fingerprint_sha1

The SHA-1 fingerprint of the returned SSH host key or RDP certificate.

  • Example of an SHA-1 SSH fingerprint:

    SHA1:1CHH6FaAaXjtFOsR/t83vf91SR0

  • Example of an SHA-1 RDP fingerprint:

    af:34:51:fe:09:f0:e0:da:b8:4e:56:ca:60:c2:10:ff:38:06:db:45

access_details.host_keys[].fingerprint_sha256

The SHA-256 fingerprint of the returned SSH host key or RDP certificate.

  • Example of an SHA-256 SSH fingerprint:

    SHA256:KTsMnRBh1IhD17HpdfsbzeGA4jOijm5tyXsMjKVbB8o

  • Example of an SHA-256 RDP fingerprint:

    03:9b:36:9f:4b:de:4e:61:70:fc:7c:c9:78:e7:d2:1a:1c:25:a8:0c:91:f6:7c:e4:d6:a0:85:c8:b4:53:99:68

access_details.host_keys[].not_valid_after

The returned RDP certificate is not valid after this point in time.

This value is listed only for RDP certificates.

access_details.host_keys[].not_valid_before

The returned RDP certificate is valid after this point in time.

This value is listed only for RDP certificates.

access_details.host_keys[].public_key

The public SSH host key or the RDP certificate.

access_details.host_keys[].witnessed_at

The time that the SSH host key or RDP certificate was recorded by Lightsail.

access_details.instance_name

The name of this Amazon Lightsail instance.

access_details.ip_address

The public IP address of the Amazon Lightsail instance.

access_details.ipv6_addresses[]
access_details.password

For RDP access, the password for your Amazon Lightsail instance. Password will be an empty string if the password for your new instance is not ready yet. When you create an instance, it can take up to 15 minutes for the instance to be ready.

If you create an instance using any key pair other than the default (LightsailDefaultKeyPair), password will always be an empty string.

If you change the Administrator password on the instance, Lightsail will continue to return the original password value. When accessing the instance using RDP, you need to manually enter the Administrator password after changing it from the default.

access_details.password_data

For a Windows Server-based instance, an object with the data you can use to retrieve your password. This is only needed if password is empty and the instance is not new (and therefore the password is not ready yet). When you create an instance, it can take up to 15 minutes for the instance to be ready.

Show child fields
access_details.password_data.ciphertext

The encrypted password. Ciphertext will be an empty string if access to your new instance is not ready yet. When you create an instance, it can take up to 15 minutes for the instance to be ready.

If you use the default key pair (LightsailDefaultKeyPair), the decrypted password will be available in the password field.

If you are using a custom key pair, you need to use your own means of decryption.

If you change the Administrator password on the instance, Lightsail will continue to return the original ciphertext value. When accessing the instance using RDP, you need to manually enter the Administrator password after changing it from the default.

access_details.password_data.key_pair_name

The name of the key pair that you used when creating your instance. If no key pair name was specified when creating the instance, Lightsail uses the default key pair (LightsailDefaultKeyPair).

If you are using a custom key pair, you need to use your own means of decrypting your password using the ciphertext. Lightsail creates the ciphertext by encrypting your password with the public key part of this key pair.

access_details.private_key

For SSH access, the temporary private key. For OpenSSH clients (command line SSH), you should save this value to tempkey).

access_details.protocol

The protocol for these Amazon Lightsail instance access details.

access_details.username

The user name to use when logging in to the Amazon Lightsail instance.