Skip to main content

ssh_public_keys

Creates, updates, deletes, gets or lists a ssh_public_keys resource.

Overview​

Namessh_public_keys
TypeResource
Idaws.ec2_instance_connect.ssh_public_keys

Fields​

The following fields are returned by SELECT queries:

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
send_ssh_public_keyexecregion, InstanceId, InstanceOSUser, SSHPublicKeyPushes an SSH public key to the specified EC2 instance for use by the specified user. The key remains for 60 seconds. For more information, see Connect to your Linux instance using EC2 Instance Connect in the Amazon EC2 User Guide.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

Lifecycle Methods​

Pushes an SSH public key to the specified EC2 instance for use by the specified user. The key remains for 60 seconds. For more information, see Connect to your Linux instance using EC2 Instance Connect in the Amazon EC2 User Guide.

EXEC aws.ec2_instance_connect.ssh_public_keys.send_ssh_public_key
@region='{{ region }}' --required
@@json=
'{
"InstanceId": "{{ InstanceId }}",
"InstanceOSUser": "{{ InstanceOSUser }}",
"SSHPublicKey": "{{ SSHPublicKey }}",
"AvailabilityZone": "{{ AvailabilityZone }}"
}'
;