ssh_public_keys
Creates, updates, deletes, gets or lists a ssh_public_keys resource.
Overview​
| Name | ssh_public_keys |
| Type | Resource |
| Id | aws.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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
send_ssh_public_key | exec | region, InstanceId, InstanceOSUser, SSHPublicKey | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
Lifecycle Methods​
- send_ssh_public_key
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 }}"
}'
;