/
ec2_instance_connect.jl
117 lines (109 loc) · 3.89 KB
/
ec2_instance_connect.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: ec2_instance_connect
using AWS.Compat
using AWS.UUIDs
"""
send_serial_console_sshpublic_key(instance_id, sshpublic_key)
send_serial_console_sshpublic_key(instance_id, sshpublic_key, params::Dict{String,<:Any})
Pushes an SSH public key to the specified EC2 instance. The key remains for 60 seconds,
which gives you 60 seconds to establish a serial console connection to the instance using
SSH. For more information, see EC2 Serial Console in the Amazon EC2 User Guide.
# Arguments
- `instance_id`: The ID of the EC2 instance.
- `sshpublic_key`: The public key material. To use the public key, you must have the
matching private key. For information about the supported key formats and lengths, see
Requirements for key pairs in the Amazon EC2 User Guide.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"SerialPort"`: The serial port of the EC2 instance. Currently only port 0 is supported.
Default: 0
"""
function send_serial_console_sshpublic_key(
InstanceId, SSHPublicKey; aws_config::AbstractAWSConfig=global_aws_config()
)
return ec2_instance_connect(
"SendSerialConsoleSSHPublicKey",
Dict{String,Any}("InstanceId" => InstanceId, "SSHPublicKey" => SSHPublicKey);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function send_serial_console_sshpublic_key(
InstanceId,
SSHPublicKey,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return ec2_instance_connect(
"SendSerialConsoleSSHPublicKey",
Dict{String,Any}(
mergewith(
_merge,
Dict{String,Any}(
"InstanceId" => InstanceId, "SSHPublicKey" => SSHPublicKey
),
params,
),
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
send_sshpublic_key(instance_id, instance_osuser, sshpublic_key)
send_sshpublic_key(instance_id, instance_osuser, sshpublic_key, params::Dict{String,<:Any})
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.
# Arguments
- `instance_id`: The ID of the EC2 instance.
- `instance_osuser`: The OS user on the EC2 instance for whom the key can be used to
authenticate.
- `sshpublic_key`: The public key material. To use the public key, you must have the
matching private key.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"AvailabilityZone"`: The Availability Zone in which the EC2 instance was launched.
"""
function send_sshpublic_key(
InstanceId,
InstanceOSUser,
SSHPublicKey;
aws_config::AbstractAWSConfig=global_aws_config(),
)
return ec2_instance_connect(
"SendSSHPublicKey",
Dict{String,Any}(
"InstanceId" => InstanceId,
"InstanceOSUser" => InstanceOSUser,
"SSHPublicKey" => SSHPublicKey,
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function send_sshpublic_key(
InstanceId,
InstanceOSUser,
SSHPublicKey,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return ec2_instance_connect(
"SendSSHPublicKey",
Dict{String,Any}(
mergewith(
_merge,
Dict{String,Any}(
"InstanceId" => InstanceId,
"InstanceOSUser" => InstanceOSUser,
"SSHPublicKey" => SSHPublicKey,
),
params,
),
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end