You are on page 1of 843

Amazon Elastic Compute Cloud

CLI Reference

Amazon Elastic Compute Cloud: CLI Reference
Copyright © 2017 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.

Amazon Elastic Compute Cloud CLI Reference

Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner
that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not
owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by
Amazon.

Amazon Elastic Compute Cloud CLI Reference

Table of Contents
Welcome ........................................................................................................................................... 1
Alternative AWS Tools ................................................................................................................ 1
Setting Up the Tools .......................................................................................................................... 3
CLI Tools ................................................................................................................................... 3
Setting Up the CLI Tools (Linux and Mac OS X) .............................................................................. 3
Setting Up the Amazon EC2 CLI Tools on Amazon Linux .......................................................... 4
Setting Up the Amazon EC2 CLI Tools on RHEL, Ubuntu, or Mac OS X ....................................... 5
Setting Up the CLI Tools (Windows) ............................................................................................ 10
Task 1: Download the Command Line Interface Tools (CLI Tools) ............................................. 11
Task 2: Set the JAVA_HOME Environment Variable ................................................................ 11
Task 3: Set the EC2_HOME Environment Variable and Update the Path Environment Variable ...... 12
Task 4: Set the AWS_ACCESS_KEY and AWS_SECRET_KEY Environment Variables ...................... 13
Task 5: Set the Region (Optional) ....................................................................................... 14
Task 6: Use a Proxy (Optional) ........................................................................................... 14
Task 7: Download Remote Desktop ..................................................................................... 15
Verify the Signature (Optional) .................................................................................................. 16
Overview ......................................................................................................................... 16
Install the GPG Tools ........................................................................................................ 16
Authenticate the Public Key ............................................................................................... 17
Verify the Signature of the Package ................................................................................... 19
Launching an Instance ...................................................................................................................... 20
Creating a Key Pair ................................................................................................................... 20
Creating a Security Group ......................................................................................................... 21
EC2-Classic ...................................................................................................................... 21
EC2-VPC .......................................................................................................................... 21
Adding a Rule to Your Security Group ......................................................................................... 22
EC2-Classic ...................................................................................................................... 22
EC2-VPC .......................................................................................................................... 22
Launching an Instance .............................................................................................................. 22
EC2-Classic ...................................................................................................................... 22
EC2-VPC .......................................................................................................................... 23
Connecting to Your Instance ...................................................................................................... 23
List of Commands by Function ........................................................................................................... 24
Commands (CLI Tools) ...................................................................................................................... 30
ec2-accept-vpc-peering-connection ............................................................................................. 34
Description ...................................................................................................................... 34
Syntax ............................................................................................................................. 35
Options ........................................................................................................................... 35
Common Options ............................................................................................................. 35
Output ............................................................................................................................ 37
Examples ......................................................................................................................... 37
Related Topics ................................................................................................................. 37
ec2-allocate-address ................................................................................................................. 38
Description ...................................................................................................................... 38
Syntax ............................................................................................................................. 38
Options ........................................................................................................................... 38
Common Options ............................................................................................................. 39
Output ............................................................................................................................ 40
Examples ......................................................................................................................... 41
Related Topics ................................................................................................................. 41
ec2-assign-private-ip-addresses .................................................................................................. 41
Description ...................................................................................................................... 41
Syntax ............................................................................................................................. 42
Options ........................................................................................................................... 42

iii

Amazon Elastic Compute Cloud CLI Reference

Common Options ............................................................................................................. 43
Output ............................................................................................................................ 45
Examples ......................................................................................................................... 45
Related Topics ................................................................................................................. 45
ec2-associate-address ............................................................................................................... 46
Description ...................................................................................................................... 46
Syntax ............................................................................................................................. 46
Options ........................................................................................................................... 46
Common Options ............................................................................................................. 48
Output ............................................................................................................................ 49
Examples ......................................................................................................................... 50
Related Topics ................................................................................................................. 50
ec2-associate-dhcp-options ........................................................................................................ 51
Description ...................................................................................................................... 51
Syntax ............................................................................................................................. 51
Options ........................................................................................................................... 51
Common Options ............................................................................................................. 52
Output ............................................................................................................................ 53
Examples ......................................................................................................................... 54
Related Topics ................................................................................................................. 54
ec2-associate-route-table .......................................................................................................... 54
Description ...................................................................................................................... 54
Syntax ............................................................................................................................. 55
Options ........................................................................................................................... 55
Common Options ............................................................................................................. 55
Output ............................................................................................................................ 57
Examples ......................................................................................................................... 57
Related Topics ................................................................................................................. 57
ec2-attach-classic-link-vpc ......................................................................................................... 58
Description ...................................................................................................................... 58
Syntax ............................................................................................................................. 58
Options ........................................................................................................................... 58
Common Options ............................................................................................................. 59
Output ............................................................................................................................ 61
Example .......................................................................................................................... 61
Related Topics ................................................................................................................. 61
ec2-attach-internet-gateway ...................................................................................................... 62
Description ...................................................................................................................... 62
Syntax ............................................................................................................................. 62
Options ........................................................................................................................... 62
Common Options ............................................................................................................. 63
Output ............................................................................................................................ 64
Examples ......................................................................................................................... 65
Related Topics ................................................................................................................. 65
ec2-attach-network-interface ..................................................................................................... 65
Description ...................................................................................................................... 65
Syntax ............................................................................................................................. 65
Options ........................................................................................................................... 66
Common Options ............................................................................................................. 66
Output ............................................................................................................................ 68
Examples ......................................................................................................................... 68
Related Topics ................................................................................................................. 68
ec2-attach-volume .................................................................................................................... 69
Description ...................................................................................................................... 69
Syntax ............................................................................................................................. 69
Options ........................................................................................................................... 69
Common Options ............................................................................................................. 70

iv

Amazon Elastic Compute Cloud CLI Reference

Output ............................................................................................................................ 72
Examples ......................................................................................................................... 72
Related Topics ................................................................................................................. 72
ec2-attach-vpn-gateway ............................................................................................................ 73
Description ...................................................................................................................... 73
Syntax ............................................................................................................................. 73
Options ........................................................................................................................... 73
Common Options ............................................................................................................. 74
Output ............................................................................................................................ 75
Examples ......................................................................................................................... 76
Related Topics ................................................................................................................. 76
ec2-authorize ........................................................................................................................... 76
Description ...................................................................................................................... 76
Syntax ............................................................................................................................. 77
Options ........................................................................................................................... 77
Common Options ............................................................................................................. 79
Output ............................................................................................................................ 81
Examples ......................................................................................................................... 82
Related Topics ................................................................................................................. 82
ec2-bundle-instance .................................................................................................................. 83
Description ...................................................................................................................... 83
Syntax ............................................................................................................................. 83
Options ........................................................................................................................... 83
Common Options ............................................................................................................. 86
Output ............................................................................................................................ 88
Examples ......................................................................................................................... 88
Related Topics ................................................................................................................. 89
ec2-cancel-bundle-task ............................................................................................................. 89
Description ...................................................................................................................... 89
Syntax ............................................................................................................................. 89
Options ........................................................................................................................... 89
Common Options ............................................................................................................. 90
Output ............................................................................................................................ 91
Examples ......................................................................................................................... 92
Related Topics ................................................................................................................. 92
ec2-cancel-conversion-task ........................................................................................................ 92
Description ...................................................................................................................... 92
Syntax ............................................................................................................................. 93
Options ........................................................................................................................... 93
Common Options ............................................................................................................. 93
Output ............................................................................................................................ 95
Examples ......................................................................................................................... 95
Related Topics ................................................................................................................. 95
ec2-cancel-export-task .............................................................................................................. 96
Description ...................................................................................................................... 96
Syntax ............................................................................................................................. 96
Options ........................................................................................................................... 96
Common Options ............................................................................................................. 96
Output ............................................................................................................................ 98
Example .......................................................................................................................... 98
Related Topics ................................................................................................................. 99
ec2-cancel-reserved-instances-listing .......................................................................................... 99
Description ...................................................................................................................... 99
Syntax ............................................................................................................................. 99
Options ........................................................................................................................... 99
Common Options ........................................................................................................... 100
Output .......................................................................................................................... 101

v

Amazon Elastic Compute Cloud CLI Reference

Examples ....................................................................................................................... 102
Related Operations ......................................................................................................... 102
ec2-cancel-spot-instance-requests ............................................................................................. 103
Description .................................................................................................................... 103
Syntax ........................................................................................................................... 103
Options ......................................................................................................................... 103
Common Options ........................................................................................................... 103
Output .......................................................................................................................... 105
Examples ....................................................................................................................... 105
Related Topics ................................................................................................................ 105
ec2-confirm-product-instance ................................................................................................... 106
Description .................................................................................................................... 106
Syntax ........................................................................................................................... 106
Options ......................................................................................................................... 106
Common Options ........................................................................................................... 107
Output .......................................................................................................................... 108
Examples ....................................................................................................................... 109
Related Topics ................................................................................................................ 109
ec2-copy-image ...................................................................................................................... 110
Description .................................................................................................................... 110
Syntax ........................................................................................................................... 110
Options ......................................................................................................................... 110
Common Options ........................................................................................................... 111
Output .......................................................................................................................... 113
Examples ....................................................................................................................... 113
Related Topics ................................................................................................................ 114
ec2-copy-snapshot .................................................................................................................. 114
Description .................................................................................................................... 114
Syntax ........................................................................................................................... 114
Options ......................................................................................................................... 115
Common Options ........................................................................................................... 116
Output .......................................................................................................................... 118
Examples ....................................................................................................................... 118
Related Topics ................................................................................................................ 118
ec2-create-customer-gateway .................................................................................................. 119
Description .................................................................................................................... 119
Syntax ........................................................................................................................... 119
Options ......................................................................................................................... 119
Common Options ........................................................................................................... 120
Output .......................................................................................................................... 122
Examples ....................................................................................................................... 122
Related Topics ................................................................................................................ 122
ec2-create-dhcp-options .......................................................................................................... 123
Description .................................................................................................................... 123
Syntax ........................................................................................................................... 124
Options ......................................................................................................................... 124
Common Options ........................................................................................................... 124
Output .......................................................................................................................... 126
Examples ....................................................................................................................... 126
Related Topics ................................................................................................................ 126
ec2-create-group .................................................................................................................... 127
Description .................................................................................................................... 127
Syntax ........................................................................................................................... 127
Options ......................................................................................................................... 127
Common Options ........................................................................................................... 128
Output .......................................................................................................................... 130
Examples ....................................................................................................................... 130

vi

Amazon Elastic Compute Cloud CLI Reference

Related Topics ................................................................................................................ 131
ec2-create-image .................................................................................................................... 131
Description .................................................................................................................... 131
Syntax ........................................................................................................................... 132
Options ......................................................................................................................... 132
Common Options ........................................................................................................... 135
Output .......................................................................................................................... 137
Examples ....................................................................................................................... 137
Related Topics ................................................................................................................ 138
ec2-create-instance-export-task ................................................................................................ 138
Description .................................................................................................................... 138
Syntax ........................................................................................................................... 138
Options ......................................................................................................................... 138
Common Options ........................................................................................................... 140
Output .......................................................................................................................... 141
Examples ....................................................................................................................... 142
Related Topics ................................................................................................................ 142
ec2-create-internet-gateway .................................................................................................... 142
Description .................................................................................................................... 142
Syntax ........................................................................................................................... 143
Options ......................................................................................................................... 143
Common Options ........................................................................................................... 143
Output .......................................................................................................................... 144
Examples ....................................................................................................................... 145
Related Topics ................................................................................................................ 145
ec2-create-keypair .................................................................................................................. 145
Description .................................................................................................................... 145
Syntax ........................................................................................................................... 146
Options ......................................................................................................................... 146
Common Options ........................................................................................................... 146
Output .......................................................................................................................... 148
Examples ....................................................................................................................... 148
Related Topics ................................................................................................................ 149
ec2-create-network-acl ............................................................................................................ 149
Description .................................................................................................................... 149
Syntax ........................................................................................................................... 150
Options ......................................................................................................................... 150
Common Options ........................................................................................................... 150
Output .......................................................................................................................... 152
Examples ....................................................................................................................... 152
Related Topics ................................................................................................................ 152
ec2-create-network-acl-entry ................................................................................................... 153
Description .................................................................................................................... 153
Syntax ........................................................................................................................... 153
Options ......................................................................................................................... 153
Common Options ........................................................................................................... 155
Output .......................................................................................................................... 157
Examples ....................................................................................................................... 157
Related Topics ................................................................................................................ 158
ec2-create-network-interface ................................................................................................... 158
Description .................................................................................................................... 158
Syntax ........................................................................................................................... 158
Options ......................................................................................................................... 158
Common Options ........................................................................................................... 160
Output .......................................................................................................................... 162
Examples ....................................................................................................................... 162
Related Topics ................................................................................................................ 162

vii

Amazon Elastic Compute Cloud CLI Reference

ec2-create-placement-group .................................................................................................... 163
Description .................................................................................................................... 163
Syntax ........................................................................................................................... 163
Options ......................................................................................................................... 163
Common Options ........................................................................................................... 164
Output .......................................................................................................................... 165
Examples ....................................................................................................................... 166
Related Topics ................................................................................................................ 166
ec2-create-reserved-instances-listing ......................................................................................... 166
Description .................................................................................................................... 166
Syntax ........................................................................................................................... 167
Options ......................................................................................................................... 167
Common Options ........................................................................................................... 168
Output .......................................................................................................................... 169
Examples ....................................................................................................................... 170
Related Operations ......................................................................................................... 170
ec2-create-route ..................................................................................................................... 171
Description .................................................................................................................... 171
Syntax ........................................................................................................................... 171
Options ......................................................................................................................... 171
Common Options ........................................................................................................... 173
Output .......................................................................................................................... 174
Examples ....................................................................................................................... 175
Related Topics ................................................................................................................ 175
ec2-create-route-table ............................................................................................................. 176
Description .................................................................................................................... 176
Syntax ........................................................................................................................... 176
Options ......................................................................................................................... 176
Common Options ........................................................................................................... 176
Output .......................................................................................................................... 178
Examples ....................................................................................................................... 178
Related Topics ................................................................................................................ 178
ec2-create-snapshot ................................................................................................................ 179
Description .................................................................................................................... 179
Syntax ........................................................................................................................... 180
Options ......................................................................................................................... 180
Common Options ........................................................................................................... 180
Output .......................................................................................................................... 182
Examples ....................................................................................................................... 182
Related Topics ................................................................................................................ 183
ec2-create-spot-datafeed-subscription ....................................................................................... 183
Description .................................................................................................................... 183
Syntax ........................................................................................................................... 183
Options ......................................................................................................................... 183
Common Options ........................................................................................................... 184
Output .......................................................................................................................... 186
Examples ....................................................................................................................... 186
Related Topics ................................................................................................................ 186
ec2-create-subnet ................................................................................................................... 187
Description .................................................................................................................... 187
Syntax ........................................................................................................................... 187
Options ......................................................................................................................... 187
Common Options ........................................................................................................... 188
Output .......................................................................................................................... 190
Examples ....................................................................................................................... 190
Related Topics ................................................................................................................ 190
ec2-create-tags ...................................................................................................................... 191

viii

Amazon Elastic Compute Cloud CLI Reference

Description .................................................................................................................... 191
Syntax ........................................................................................................................... 191
Options ......................................................................................................................... 191
Common Options ........................................................................................................... 192
Output .......................................................................................................................... 193
Examples ....................................................................................................................... 194
Related Topics ................................................................................................................ 194
ec2-create-volume .................................................................................................................. 194
Description .................................................................................................................... 194
Syntax ........................................................................................................................... 195
Options ......................................................................................................................... 195
Common Options ........................................................................................................... 197
Output .......................................................................................................................... 199
Examples ....................................................................................................................... 199
Related Topics ................................................................................................................ 200
ec2-create-vpc ........................................................................................................................ 201
Description .................................................................................................................... 201
Syntax ........................................................................................................................... 201
Options ......................................................................................................................... 201
Common Options ........................................................................................................... 202
Output .......................................................................................................................... 203
Examples ....................................................................................................................... 204
Related Topics ................................................................................................................ 204
ec2-create-vpc-endpoint .......................................................................................................... 204
Description .................................................................................................................... 204
Syntax ........................................................................................................................... 205
Options ......................................................................................................................... 205
Common Options ........................................................................................................... 206
Output .......................................................................................................................... 207
Examples ....................................................................................................................... 208
Related Topics ................................................................................................................ 208
ec2-create-vpc-peering-connection ........................................................................................... 209
Description .................................................................................................................... 209
Syntax ........................................................................................................................... 209
Options ......................................................................................................................... 209
Common Options ........................................................................................................... 210
Output .......................................................................................................................... 211
Examples ....................................................................................................................... 212
Related Topics ................................................................................................................ 212
ec2-create-vpn-connection ....................................................................................................... 213
Description .................................................................................................................... 213
Syntax ........................................................................................................................... 213
Options ......................................................................................................................... 214
Common Options ........................................................................................................... 215
Output .......................................................................................................................... 217
Examples ....................................................................................................................... 217
Related Topics ................................................................................................................ 217
ec2-create-vpn-connection-route .............................................................................................. 218
Description .................................................................................................................... 218
Syntax ........................................................................................................................... 218
Options ......................................................................................................................... 218
Common Options ........................................................................................................... 219
Output .......................................................................................................................... 220
Examples ....................................................................................................................... 220
Related Topics ................................................................................................................ 221
ec2-create-vpn-gateway .......................................................................................................... 221
Description .................................................................................................................... 221

ix

Amazon Elastic Compute Cloud CLI Reference

Syntax ........................................................................................................................... 221
Options ......................................................................................................................... 221
Common Options ........................................................................................................... 222
Output .......................................................................................................................... 223
Examples ....................................................................................................................... 224
Related Topics ................................................................................................................ 224
ec2-delete-customer-gateway .................................................................................................. 224
Description .................................................................................................................... 224
Syntax ........................................................................................................................... 225
Options ......................................................................................................................... 225
Common Options ........................................................................................................... 225
Output .......................................................................................................................... 227
Examples ....................................................................................................................... 227
Related Topics ................................................................................................................ 227
ec2-delete-dhcp-options .......................................................................................................... 228
Description .................................................................................................................... 228
Syntax ........................................................................................................................... 228
Options ......................................................................................................................... 228
Common Options ........................................................................................................... 228
Output .......................................................................................................................... 230
Examples ....................................................................................................................... 230
Related Topics ................................................................................................................ 230
ec2-delete-disk-image ............................................................................................................. 231
Description .................................................................................................................... 231
Syntax ........................................................................................................................... 231
Options ......................................................................................................................... 231
Common Options ........................................................................................................... 233
Output .......................................................................................................................... 234
Examples ....................................................................................................................... 235
Related Topics ................................................................................................................ 235
ec2-delete-group .................................................................................................................... 235
Description .................................................................................................................... 235
Syntax ........................................................................................................................... 235
Options ......................................................................................................................... 235
Common Options ........................................................................................................... 236
Output .......................................................................................................................... 238
Examples ....................................................................................................................... 238
Related Topics ................................................................................................................ 238
ec2-delete-internet-gateway .................................................................................................... 239
Description .................................................................................................................... 239
Syntax ........................................................................................................................... 239
Options ......................................................................................................................... 239
Common Options ........................................................................................................... 239
Output .......................................................................................................................... 241
Examples ....................................................................................................................... 241
Related Topics ................................................................................................................ 242
ec2-delete-keypair .................................................................................................................. 242
Description .................................................................................................................... 242
Syntax ........................................................................................................................... 242
Options ......................................................................................................................... 242
Common Options ........................................................................................................... 243
Output .......................................................................................................................... 244
Examples ....................................................................................................................... 245
Related Topics ................................................................................................................ 245
ec2-delete-network-acl ............................................................................................................ 245
Description .................................................................................................................... 245
Syntax ........................................................................................................................... 245

x

Amazon Elastic Compute Cloud CLI Reference

Options ......................................................................................................................... 245
Common Options ........................................................................................................... 246
Output .......................................................................................................................... 247
Examples ....................................................................................................................... 248
Related Topics ................................................................................................................ 248
ec2-delete-network-acl-entry ................................................................................................... 248
Description .................................................................................................................... 248
Syntax ........................................................................................................................... 248
Options ......................................................................................................................... 249
Common Options ........................................................................................................... 249
Output .......................................................................................................................... 251
Examples ....................................................................................................................... 251
Related Topics ................................................................................................................ 251
ec2-delete-network-interface ................................................................................................... 252
Description .................................................................................................................... 252
Syntax ........................................................................................................................... 252
Options ......................................................................................................................... 252
Common Options ........................................................................................................... 252
Output .......................................................................................................................... 254
Examples ....................................................................................................................... 254
Related Topics ................................................................................................................ 255
ec2-delete-placement-group .................................................................................................... 255
Description .................................................................................................................... 255
Syntax ........................................................................................................................... 255
Options ......................................................................................................................... 255
Common Options ........................................................................................................... 256
Output .......................................................................................................................... 257
Examples ....................................................................................................................... 258
ec2-delete-route ..................................................................................................................... 258
Description .................................................................................................................... 258
Syntax ........................................................................................................................... 258
Options ......................................................................................................................... 259
Common Options ........................................................................................................... 259
Output .......................................................................................................................... 261
Examples ....................................................................................................................... 261
Related Topics ................................................................................................................ 261
ec2-delete-route-table ............................................................................................................ 262
Description .................................................................................................................... 262
Syntax ........................................................................................................................... 262
Options ......................................................................................................................... 262
Common Options ........................................................................................................... 262
Output .......................................................................................................................... 264
Examples ....................................................................................................................... 264
Related Topics ................................................................................................................ 264
ec2-delete-snapshot ................................................................................................................ 265
Description .................................................................................................................... 265
Syntax ........................................................................................................................... 265
Options ......................................................................................................................... 265
Common Options ........................................................................................................... 266
Output .......................................................................................................................... 267
Examples ....................................................................................................................... 268
Related Topics ................................................................................................................ 268
ec2-delete-spot-datafeed-subscription ...................................................................................... 268
Description .................................................................................................................... 268
Syntax ........................................................................................................................... 268
Options ......................................................................................................................... 268
Common Options ........................................................................................................... 269

xi

Amazon Elastic Compute Cloud CLI Reference

Output .......................................................................................................................... 270
Examples ....................................................................................................................... 270
Related Topics ................................................................................................................ 271
ec2-delete-subnet ................................................................................................................... 271
Description .................................................................................................................... 271
Syntax ........................................................................................................................... 271
Options ......................................................................................................................... 271
Common Options ........................................................................................................... 272
Output .......................................................................................................................... 273
Examples ....................................................................................................................... 274
Related Topics ................................................................................................................ 274
ec2-delete-tags ...................................................................................................................... 274
Description .................................................................................................................... 274
Syntax ........................................................................................................................... 274
Options ......................................................................................................................... 275
Common Options ........................................................................................................... 275
Output .......................................................................................................................... 277
Examples ....................................................................................................................... 277
Related Topics ................................................................................................................ 278
ec2-delete-volume .................................................................................................................. 278
Description .................................................................................................................... 278
Syntax ........................................................................................................................... 278
Options ......................................................................................................................... 279
Common Options ........................................................................................................... 279
Output .......................................................................................................................... 281
Examples ....................................................................................................................... 281
Related Topics ................................................................................................................ 281
ec2-delete-vpc ....................................................................................................................... 281
Description .................................................................................................................... 281
Syntax ........................................................................................................................... 282
Options ......................................................................................................................... 282
Common Options ........................................................................................................... 282
Output .......................................................................................................................... 284
Examples ....................................................................................................................... 284
Related Topics ................................................................................................................ 284
ec2-delete-vpc-endpoints ........................................................................................................ 285
Description .................................................................................................................... 285
Syntax ........................................................................................................................... 285
Options ......................................................................................................................... 285
Common Options ........................................................................................................... 285
Output .......................................................................................................................... 287
Examples ....................................................................................................................... 287
Related Topics ................................................................................................................ 287
ec2-delete-vpc-peering-connection ........................................................................................... 288
Description .................................................................................................................... 288
Syntax ........................................................................................................................... 288
Options ......................................................................................................................... 288
Common Options ........................................................................................................... 288
Output .......................................................................................................................... 290
Examples ....................................................................................................................... 290
Related Topics ................................................................................................................ 290
ec2-delete-vpn-connection ...................................................................................................... 291
Description .................................................................................................................... 291
Syntax ........................................................................................................................... 291
Options ......................................................................................................................... 291
Common Options ........................................................................................................... 292
Output .......................................................................................................................... 293

xii

Amazon Elastic Compute Cloud CLI Reference

Examples ....................................................................................................................... 294
Related Topics ................................................................................................................ 294
ec2-delete-vpn-connection-route .............................................................................................. 294
Description .................................................................................................................... 294
Syntax ........................................................................................................................... 294
Options ......................................................................................................................... 295
Common Options ........................................................................................................... 295
Output .......................................................................................................................... 297
Examples ....................................................................................................................... 297
Related Topics ................................................................................................................ 297
ec2-delete-vpn-gateway .......................................................................................................... 297
Description .................................................................................................................... 297
Syntax ........................................................................................................................... 298
Options ......................................................................................................................... 298
Common Options ........................................................................................................... 298
Output .......................................................................................................................... 300
Examples ....................................................................................................................... 300
Related Topics ................................................................................................................ 300
ec2-deregister ........................................................................................................................ 301
Description .................................................................................................................... 301
Syntax ........................................................................................................................... 301
Options ......................................................................................................................... 301
Common Options ........................................................................................................... 301
Output .......................................................................................................................... 303
Examples ....................................................................................................................... 303
Related Topics ................................................................................................................ 303
ec2-describe-account-attributes ................................................................................................ 304
Description .................................................................................................................... 304
Syntax ........................................................................................................................... 304
Options ......................................................................................................................... 304
Common Options ........................................................................................................... 304
Output .......................................................................................................................... 306
Examples ....................................................................................................................... 306
Related Topics ................................................................................................................ 307
ec2-describe-addresses ............................................................................................................ 307
Description .................................................................................................................... 307
Syntax ........................................................................................................................... 308
Options ......................................................................................................................... 308
Common Options ........................................................................................................... 309
Output .......................................................................................................................... 311
Examples ....................................................................................................................... 312
Related Topics ................................................................................................................ 313
ec2-describe-availability-zones ................................................................................................. 313
Description .................................................................................................................... 313
Syntax ........................................................................................................................... 313
Options ......................................................................................................................... 314
Common Options ........................................................................................................... 315
Output .......................................................................................................................... 317
Examples ....................................................................................................................... 317
Related Topics ................................................................................................................ 317
ec2-describe-bundle-tasks ....................................................................................................... 318
Description .................................................................................................................... 318
Syntax ........................................................................................................................... 318
Options ......................................................................................................................... 318
Common Options ........................................................................................................... 320
Output .......................................................................................................................... 321
Examples ....................................................................................................................... 322

xiii

Amazon Elastic Compute Cloud CLI Reference

Related Topics ................................................................................................................ 322
ec2-describe-classic-link-instances ............................................................................................ 323
Description .................................................................................................................... 323
Syntax ........................................................................................................................... 323
Options ......................................................................................................................... 323
Common Options ........................................................................................................... 325
Output .......................................................................................................................... 326
Example ........................................................................................................................ 327
Related Topics ................................................................................................................ 327
ec2-describe-conversion-tasks .................................................................................................. 328
Description .................................................................................................................... 328
Syntax ........................................................................................................................... 328
Options ......................................................................................................................... 328
Common Options ........................................................................................................... 328
Output .......................................................................................................................... 330
Example ........................................................................................................................ 330
Related Topics ................................................................................................................ 330
ec2-describe-customer-gateways .............................................................................................. 331
Description .................................................................................................................... 331
Syntax ........................................................................................................................... 331
Options ......................................................................................................................... 331
Common Options ........................................................................................................... 333
Output .......................................................................................................................... 335
Examples ....................................................................................................................... 335
Related Topics ................................................................................................................ 336
ec2-describe-dhcp-options ....................................................................................................... 336
Description .................................................................................................................... 336
Syntax ........................................................................................................................... 336
Options ......................................................................................................................... 337
Common Options ........................................................................................................... 338
Output .......................................................................................................................... 340
Examples ....................................................................................................................... 340
Related Topics ................................................................................................................ 341
ec2-describe-export-tasks ........................................................................................................ 341
Description .................................................................................................................... 341
Syntax ........................................................................................................................... 341
Options ......................................................................................................................... 342
Common Options ........................................................................................................... 342
Output .......................................................................................................................... 344
Examples ....................................................................................................................... 344
Related Topics ................................................................................................................ 344
ec2-describe-group ................................................................................................................. 345
Description .................................................................................................................... 345
Syntax ........................................................................................................................... 345
Options ......................................................................................................................... 345
Common Options ........................................................................................................... 347
Output .......................................................................................................................... 349
Examples ....................................................................................................................... 350
Related Topics ................................................................................................................ 350
ec2-describe-image-attribute ................................................................................................... 351
Description .................................................................................................................... 351
Syntax ........................................................................................................................... 351
Options ......................................................................................................................... 351
Common Options ........................................................................................................... 353
Output .......................................................................................................................... 354
Examples ....................................................................................................................... 355
Related Topics ................................................................................................................ 355

xiv

Amazon Elastic Compute Cloud CLI Reference

ec2-describe-images ............................................................................................................... 356
Description .................................................................................................................... 356
Syntax ........................................................................................................................... 356
Options ......................................................................................................................... 356
Common Options ........................................................................................................... 362
Output .......................................................................................................................... 363
Examples ....................................................................................................................... 364
Related Topics ................................................................................................................ 365
ec2-describe-instance-attribute ................................................................................................ 365
Description .................................................................................................................... 365
Syntax ........................................................................................................................... 366
Options ......................................................................................................................... 366
Common Options ........................................................................................................... 368
Output .......................................................................................................................... 370
Examples ....................................................................................................................... 370
Related Topics ................................................................................................................ 371
ec2-describe-instance-status .................................................................................................... 371
Description .................................................................................................................... 371
Syntax ........................................................................................................................... 372
Options ......................................................................................................................... 373
Common Options ........................................................................................................... 375
Output .......................................................................................................................... 376
Examples ....................................................................................................................... 377
Related Topics ................................................................................................................ 378
ec2-describe-instances ............................................................................................................. 378
Description .................................................................................................................... 378
Syntax ........................................................................................................................... 379
Options ......................................................................................................................... 379
Common Options ........................................................................................................... 388
Output .......................................................................................................................... 390
Examples ....................................................................................................................... 392
Related Topics ................................................................................................................ 393
ec2-describe-internet-gateways ................................................................................................ 394
Description .................................................................................................................... 394
Syntax ........................................................................................................................... 394
Options ......................................................................................................................... 394
Common Options ........................................................................................................... 396
Output .......................................................................................................................... 398
Examples ....................................................................................................................... 398
Related Topics ................................................................................................................ 398
ec2-describe-keypairs .............................................................................................................. 399
Description .................................................................................................................... 399
Syntax ........................................................................................................................... 399
Options ......................................................................................................................... 399
Common Options ........................................................................................................... 400
Output .......................................................................................................................... 402
Examples ....................................................................................................................... 402
Related Topics ................................................................................................................ 402
ec2-describe-network-acls ....................................................................................................... 403
Description .................................................................................................................... 403
Syntax ........................................................................................................................... 403
Options ......................................................................................................................... 403
Common Options ........................................................................................................... 406
Output .......................................................................................................................... 408
Examples ....................................................................................................................... 408
Related Topics ................................................................................................................ 408
ec2-describe-network-interface-attribute ................................................................................... 409

xv

Amazon Elastic Compute Cloud CLI Reference

Description .................................................................................................................... 409
Syntax ........................................................................................................................... 409
Options ......................................................................................................................... 409
Common Options ........................................................................................................... 410
Output .......................................................................................................................... 412
Examples ....................................................................................................................... 412
Related Topics ................................................................................................................ 412
ec2-describe-network-interfaces ............................................................................................... 413
Description .................................................................................................................... 413
Syntax ........................................................................................................................... 413
Options ......................................................................................................................... 413
Common Options ........................................................................................................... 417
Output .......................................................................................................................... 419
Examples ....................................................................................................................... 420
Related Topics ................................................................................................................ 420
ec2-describe-placement-groups ................................................................................................ 421
Description .................................................................................................................... 421
.................................................................................................................................... 421
Options ......................................................................................................................... 421
Common Options ........................................................................................................... 423
Output .......................................................................................................................... 424
Examples ....................................................................................................................... 425
Related Topics ................................................................................................................ 425
ec2-describe-prefix-lists ........................................................................................................... 425
Description .................................................................................................................... 425
Syntax ........................................................................................................................... 426
Options ......................................................................................................................... 426
Supported Filters ............................................................................................................ 426
Common Options ........................................................................................................... 427
Output .......................................................................................................................... 428
Examples ....................................................................................................................... 429
Related Topics ................................................................................................................ 429
ec2-describe-regions ............................................................................................................... 429
Description .................................................................................................................... 429
Syntax ........................................................................................................................... 430
Options ......................................................................................................................... 430
Common Options ........................................................................................................... 431
Output .......................................................................................................................... 432
Examples ....................................................................................................................... 433
Related Topics ................................................................................................................ 433
ec2-describe-reserved-instances ............................................................................................... 433
Description .................................................................................................................... 433
Syntax ........................................................................................................................... 434
Options ......................................................................................................................... 434
Common Options ........................................................................................................... 436
Output .......................................................................................................................... 438
Examples ....................................................................................................................... 439
Related Topics ................................................................................................................ 439
ec2-describe-reserved-instances-listings .................................................................................... 440
Description .................................................................................................................... 440
Syntax ........................................................................................................................... 440
Options ......................................................................................................................... 440
Common Options ........................................................................................................... 441
Output .......................................................................................................................... 443
Examples ....................................................................................................................... 444
Related Operations ......................................................................................................... 444
ec2-describe-reserved-instances-modifications ........................................................................... 444

xvi

............................................................................................................................................................................................................................................................... 449 Examples .......................... 458 ec2-describe-route-tables ...................................................... 450 ec2-describe-reserved-instances-offerings ...................... 467 ec2-describe-snapshots ........................................................................................................................................................... 457 Related Operations .......................................................................................................................................................................................................................................................... 469 Common Options ................................................................................................................................................................................................ 469 Options ................................ 447 Output ................................................................................................................................................................................................................................................................. 468 Syntax ................................................................................................................................................................................................................................................................................................................................................................... 475 Output ..................... 445 Options ........................................................................................................................................................................................................................................... 472 Output ................................................................................................................................................................................................................................. 478 Options ................................................................... 454 Output .................................................... 449 Related Topics ...................... 475 ec2-describe-spot-datafeed-subscription .......................... 465 Output ........................................................................... 464 Options ............................................. 464 Common Options ......................................................................... 487 ec2-describe-spot-price-history ................................................................................................................................................................ Amazon Elastic Compute Cloud CLI Reference Description ................... 474 Related Topics ......................................... 475 Common Options ........................... 467 Related Topics ....................... 487 Description .............................................. 475 Options ................................................................................................................................................................................ 478 Syntax ....................................... 477 Related Topics ......................................... 458 Syntax .................................... 451 Common Options ......................... 487 xvii ..................................................................................................................................................................................................................................................................... 450 Description ........................................................ 464 Syntax ............................................................................................................................................................................................................................................................................ 486 Related Topics .... 463 Related Topics .................................. 458 Options ............................ 464 Description .................................................................................................................................................................................................................................................... 464 ec2-describe-snapshot-attribute ........................................................................................................................................ 461 Output ............................................................................... 456 Examples ............................... 477 Examples ....................................................................................... 458 Description ..... 475 Description .................................................. 451 Options ............. 463 Examples ...................................................................................................................... 467 Examples ............................................................................................................................................................................................................................................................. 445 Common Options ..................................................................................................................................................................................................................................................................................................................................................................................................... 468 Description ....................................................................................................................................................................................................................................... 479 Common Options ........................................................................................................................................................................................................................................................ 474 Examples ....................................................................................................................... 484 Output ........ 475 Syntax .................................................................................................................................................................................................................................................................................................................................................... 485 Examples ................................................... 450 Syntax ...................................................................................................................................................... 444 Syntax ... 478 Description ..................................... 458 Common Options ................................................................................................................................................... 478 ec2-describe-spot-instance-requests ...............................................

................................................................................................................................................................ 499 Description .................................................................................... 493 Options ..... 504 Syntax ........................................................................................................................................................ 524 xviii ................................................................. 493 Syntax .................................................................................................................................................................. 496 Output ................................................................................................. 504 Common Options ............................ 521 Output ....................................... 513 ec2-describe-volumes ................................................................................................. 523 Examples ........................................................................................................................................................... 498 ec2-describe-tags ...... 499 Options ......................................... 518 Examples .............................................................................................. 499 Common Options ............ 506 Related Topics ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................ 492 ec2-describe-subnets .............................................. 513 Description ........................................ 524 ec2-describe-vpc-classic-link .......................................................................................................................................................... 508 Options ........... 519 Related Topics .................................................................................................................................................................................................................................................................................. 502 Examples ....................... 520 Description ............................................................................................................. 506 Example ........................................................ 507 Description ................................................ 510 Output ............................................................................................................................................. 507 Syntax .......................................................................................................................................................... 520 Syntax .............................................................. 524 Syntax .... 504 Options ...................................................................................................... 502 Related Topics ........... 523 Related Topics .......................................................................................................... 499 Syntax ............................................................. 504 Description ......................................................................................................... 504 Output ................................... 498 Related Topics ......................................................... 497 Examples ....................... 521 Options ............................................... 520 ec2-describe-vpc-attribute .................................................................................................................................. 500 Output ................................................................................................................................................................................................................................................................................................................................................... 507 ec2-describe-volume-status ......................................................................................................................................................................................................................................................................................................................................................................................................................................... 512 Related Topics ................................ 508 Common Options ........................................................................................................................................................................................................... 513 Options ........................................................................................................ 513 Common Options .......................... 492 Related Topics ...................................................................................................................................................................................................................................................................................................................... 493 Common Options ...................................................................................................................... 512 Examples ........................................................................................................................ 490 Output .. 503 ec2-describe-volume-attribute .................................................................................................................................................................................................................................... 488 Options ............................................................................................................................................................................................................................................................................... 521 Common Options ................................................... Amazon Elastic Compute Cloud CLI Reference Syntax ......................................................................... 524 Description ................................................................................................................ 513 Syntax ................................................................................................................................................................... 493 Description .............................................................................................................................................. 492 Examples ................................................................................................................................................................... 488 Common Options ........................... 517 Output ..............................................................................................................................................................................................................................................

...................................................................................................................................................................................................................................................................................................................................................................................................... 530 Common Options ............................................................................ 543 Syntax ........................................................................................................................................................................................................................................................................................ 536 Options ............................................................................................................................................... 554 Description ............................................................................. 532 Examples .......................................................... 545 Output .................................. 542 ec2-describe-vpcs ........ 533 Options ............................................................................................................................................................................................... 528 ec2-describe-vpc-endpoints .......................................... 559 Related Topics .................................................................................... 551 Output ........................................................................................................................................ 530 Output ............................. 553 Examples ............................................................................................................................ 555 Options ........................................ 547 Examples .................................................................................................................................................................................. 529 Syntax .................................................................................................. 555 Common Options ....... 528 Related Topics ...................................................................................................................................................................... 560 xix ....................................... 547 Related Topics .......................................................................................................................................................................................................................................................................... 559 Examples ................................................................................................................. 536 Common Options .......... 533 Output .................... 539 Output ................................................................................................................................................................................................................................................... 524 Supported Filters .. 529 Supported Filters ..................................................................................................................................... 554 Related Topics ........................................................................................................................................................ 548 Options ........................................................................................... 541 Examples ............... 554 ec2-describe-vpn-gateways ........................................................................................................................... 543 Description .......................................................................................................................................................................................................................................................... 557 Output ...................................................................................................... 529 Description .............................................................. 529 Options .................................................................................................................................................................................................. 560 Description ........................................................... 525 Common Options .......... 548 Description ........ 533 Syntax ........................................................................... 548 ec2-describe-vpn-connections ...................................................................................................................................................................................................... 536 Syntax ....................................................................... 535 Related Topics ............................................................................................................................................................................... Amazon Elastic Compute Cloud CLI Reference Options ............ 533 ec2-describe-vpc-endpoint-services ...................................................... 541 Related Topics .................................. 528 Example ................................................................................................................................................................................. 548 Syntax ....................................... 533 Description ............................................. 543 Options ..................................................................................................................................... 533 Common Options .................................................................................................................................................................................................................................................................................................................... 559 ec2-detach-classic-link-vpc .................................................................................................................................... 543 Common Options ................................ 536 Description ............... 548 Common Options ................................................................................................... 535 Examples ............................... 554 Syntax ............................................................................................................................................................................................... 536 ec2-describe-vpc-peering-connections ......................................................................................................................................................................................................................................................................................................................................................... 526 Output .................................................................................................................................................................................. 532 Related Topics .......................................................................................................................................

.............. 584 xx ....... 567 Options ......................................................................................... 562 Example ................................................................................................................................................................................................................. 566 Related Topics ....... 566 Examples ........................................................................................................................................................................... Amazon Elastic Compute Cloud CLI Reference Syntax ........................................................ 564 Common Options ............................................................................................................. 577 Related Topics .................................................................................................................. 567 Common Options ..................................... 574 Syntax ................................................................................................................................................................................................................................................................................................................................................................................................................................ 578 Common Options ...................................................................................................... 567 Output ............................. 574 Description ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 575 Common Options ............................................................................................................ 570 Syntax ....................................................................................................................... 575 Output ............. 584 Syntax ........................................................... 581 Common Options ........................................................ 581 Options .......................................................................................... 584 ec2-disassociate-address ......................................................................................................................... 584 Description ........................................................................................................... 561 Output ............................................................................................................................................................................................................................................................................................ 578 Description ................................................................................................ 580 Related Topics ................................................................................................................................................................................................................................................................................................... 580 ec2-disable-vpc-classic-link ....... 563 Description ...... 581 Description .......... 563 Syntax ......................................................................................................................................................................................................................................................... 564 Output ............................................................................... 571 Output ...... 578 Options ................ 580 Example ...................................................... 578 Output ................................................................................................................ 570 Options ....................................................................................................................................................................... 567 Description ................................................................................................. 569 Related Topics .................................................................................................................................................................................................................................................. 570 ec2-detach-volume .................... 575 Options ............................................................................................................................................................................................. 574 Related Topics ........................................................................................................................................................ 560 Common Options .................................................... 581 Syntax ........................................................ 583 Related Topics .................................................... 567 Syntax ................................................................ 583 Example ...................................................................................................................................................................................................................................................................................................................................... 577 ec2-disable-vgw-route-propagation .................. 571 Common Options .................................................................................................................................................................... 577 Examples .............. 574 ec2-detach-vpn-gateway ..................... 569 Examples ................................ 563 Options ................................................................................................................................................................................................................................................................................ 578 Syntax ..................................................................................... 563 ec2-detach-internet-gateway ......................................................................................................................................................................................................................................................................................... 570 Description .... 573 Examples ....................................................................... 560 Options ........................................................................................................................................................ 581 Output ....................................................................................................... 566 ec2-detach-network-interface .................................................................................... 563 Related Topics ........................................................................................

........................................................................... 603 Syntax ......................... 600 Syntax ......................................................................................................................................................................................................................................................................... 588 Output ................................................................... 588 Common Options ................................................................................................ 591 Common Options ........................................................................................................................... 585 Output ..... 597 Description ............................................................ 591 Description ....................................................................... 604 Common Options ....................................................................................................................................................................................................................................... 588 Description .................. 603 Description ............................................................................................................. 601 Common Options ................................................................................................................................................................................................................................................................................ 603 Examples ............................................................................................................................................................................................................... 600 Related Topics ..................................... 603 ec2-get-console-output .............................................................................................................................................................................................. 590 Related Topics .................................................................................................................................................................................. 596 Example .................................................................................................................... 588 Syntax ............................................................................................................................................................................................ 601 Output ................................................................................................................................................... 603 Related Topics ....... 594 Options ............................................................................................................................................................................................................. 594 Description ........................................................................................................... 591 ec2-enable-vgw-route-propagation ................................................. 587 Examples ........................................................................................................................................................................................................................................................................................................................................................................ 598 Common Options ......................................................................................... 594 Related Topics ..................................................................................................................................................................... 597 Options ............................................. 595 Output .................................................................................................................................................................................................................................... 597 Related Topics ............................ 598 Output ..................................................................................................... 593 Example .............................................................................. 607 ec2-get-password .......................................................................................................................................................................................................... 594 Common Options ....................................................................................................................................................... 594 ec2-enable-volume-io ....................................................................................................................................... 591 Syntax ..................................................................................................................................................................................................................................................................................................................................... 597 Syntax .............. 608 Syntax .......................................................................................................................................... 601 Options ............................................................................ 604 Output ...................................................... 594 Syntax ...................... 600 Description ........... 604 Options ....................................................................................... 608 xxi ............................................ 592 Output ..................................................................................... 591 Options ............................................................................................................................................................................ Amazon Elastic Compute Cloud CLI Reference Options ... 584 Common Options ......................................................................................... 588 Options ............................................................................................... 597 ec2-enable-vpc-classic-link ....................... 608 Options ............................. 587 Related Topics ................................................................................................................................................................................................................................................................................................................................................................................................................................................................ 587 ec2-disassociate-route-table ............................................................... 600 Example ............................. 606 Related Topics ................................................................... 600 ec2-fingerprint-key ..................................................................... 606 Examples ............ 608 Description ..................... 590 Examples ......................................................................................................................................................................................................

....................................................................................................................................... 619 ec2-import-keypair ....................................................................................................................................................... 630 Options ...................................................................................................................................................................................... 647 Options ....................................... 647 Common Options ........................................................................................................................................ 619 Related Topics ............................................... 635 Related Topics ................................................................................................................................................ 623 Related Topics ....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 640 Description .................................................................................................................................................................................................................................................................................................................................................................................... 611 ec2-import-instance .......................................... 640 Options ........................................................................................................................................................................................................... 636 Common Options ................................ Amazon Elastic Compute Cloud CLI Reference Common Options ............................................................................ 635 Syntax ....................................................... 611 Related Topics ................................................................................................................................................................................................................... 646 Examples . 634 Examples .................................. 640 ec2-modify-instance-attribute .................................................................................................................................................................................................................................... 635 ec2-modify-image-attribute ......................................................................................................................................................... 623 Description .............................................................................................................................................................................................................................................................................................. 612 Common Options .................................................................................................................................................................................................................................................. 640 Common Options ....................................................... 619 Example . 633 Output ............................................................................................................... 629 ec2-migrate-image ............................................................................................................................................................................... 610 Examples ...................................................................................................................................................................................................... 623 ec2-import-volume .............................................................................................................................................................................................................................. 627 Output ....... 647 Syntax ................................ 624 Common Options ................................................................................................................................................................................ 620 Options ............................................................................................................. 617 Output ........................................................................................... 639 Related Topics .......... 620 Common Options .................................... 636 Options ....................................................... 622 Examples ... 623 Options ............................................................................................................................................................ 637 Output ................................................................................................................................................................................................................................................................................................. 646 ec2-modify-network-interface-attribute .......... 620 Description ............................................................................................................................................................................... 629 Related Topics ........................................................................ 612 Options ............................................................................... 646 Related Topics .................................................................................................................................................................................................................................................................................... 609 Output ........................................................................................................ 647 Description ... 611 Description .................. 621 Output ........................ 630 Common Options .................................... 639 Examples .......... 640 Syntax ................................................................................................................ 611 Syntax ................................................... 620 Syntax ........ 635 Description ....................................................................................................... 649 xxii ................................................................................................................................................................................................................... 623 Syntax ................................................. 644 Output .... 629 Example ................................................................................................................................... 630 Description ........ 630 Syntax ......................................................................

....................................................................................................................... 674 Syntax ............ 664 Common Options ......................................................................................................................................... 652 Options ........................................................................................................................................................................................................................................................................................................................... 670 Description ...................................................... 674 ec2-monitor-instances ...... 663 Description ........................................................................ 666 Example .............................................................................................................................................................................................................................................................................................................................................................................................................. 670 Examples ............................................................................................ 655 ec2-modify-snapshot-attribute .......................................................................................................................................................... 670 ec2-modify-vpc-endpoint ................................................................. 662 Examples ............................................................................................................................................................................................................................ 671 Options ......................... 660 Common Options ........................................................................................................ 660 Syntax ............................................................................................................................................................. 663 Related Topics ....................................................................................................... 670 Related Topics ...................................................................................................... 675 Output .................................................................................... 667 Syntax ................. 664 Output .............. 663 ec2-modify-volume-attribute ............... 655 Examples ................ 652 Syntax .............................. 653 Output ............................................................................................................................................. 666 ec2-modify-vpc-attribute ............................. 657 Output ......................................................... 672 Output ................................................................................................................................................................................. 651 ec2-modify-reserved-instances .................... 674 Related Topics ........................ 655 Related Topics ......................................................................................................................................................................................................................................................................... 656 Common Options ....... 671 Common Options ....................................... 664 Options ......................................................................................................................................................................................................................................................................................................................................................................................... 661 Output ............................................................................................................................................................. 667 Description ............................................................... 652 Common Options ............................................................................................................................................ 650 Examples .......................................................... 652 Description ............................................................................................................... 659 ec2-modify-subnet-attribute ...... 659 Related Topics ................................................... Amazon Elastic Compute Cloud CLI Reference Output ...... 674 Description ...................................................... 660 Description .......................................................................................................................................................................................................... 667 Options ..................................................................................... 667 Common Options ................................................................................................................................................... 651 Related Topics .................................................................................................................................................................................................................................................................................................................................... 656 Options ................................... 663 Syntax ....................................................... 666 Related Topics ....................................................................................................................................................................................................................................... 659 Examples ................................................................................................ 677 xxiii .............................................................................................................................................................................................................................................. 668 Output .......................................................... 660 Options ........................................................................................................................................................................................... 675 Options .................................. 656 Description ............................................................................................................................... 656 Syntax ....................................................................................... 673 Examples ........................................................................................................................................................................................................................................................................................................................................................................................................................................ 675 Common Options ..................................................................................................................... 670 Syntax ...................................

. 678 Description .. 695 Related Topics ........................................................................................................................................................................................................................ 684 ec2-register .................................................................................... 684 Syntax ....................................................................................................................... 696 Syntax ..................................................................................................................................................................... 697 Common Options .. 678 Options ..................................................................... 685 Options ...... 700 Options .......................................................................................................................................................................................................................................................... 678 Common Options ........................... 679 Output ............................................................................................................................................................................................................................... 684 Examples ............................................ 703 Description ................................................................................................................................................................. 693 Common Options ................................................................................................................................................................................................................................................................. 682 Common Options ............................................................... 704 Common Options ........ 690 Output .............................. 681 Syntax ............................................................... 697 Output .............................................................. 706 Output ............. 696 Description ....................................................................................................................................... 681 ec2-reboot-instances ..................................................................................................................................................................................................................................................................................................................... 677 ec2-purchase-reserved-instances-offering ................................................................ 677 Related Topics ............................... 699 Related Topics ................................................................................. 682 Options ............................................................................................................................................................................. 693 Options ...................................................... 681 Description ............................... 693 Description .............................................................................................................. Amazon Elastic Compute Cloud CLI Reference Examples ..................................................................................... 703 Related Topics ......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 707 Examples ........................................... 697 Options ................................................................................................................................................................................................. 703 ec2-replace-network-acl-entry .......................................................................................................................................................................... 681 Related Operations ....................................................................... 693 Syntax ............... 681 Examples .......................................................................................................................... 678 Syntax ................. 708 xxiv ...................... 703 Options ................................................................. 699 ec2-replace-network-acl-association ......................................................................................... 696 ec2-release-address ................................................................................................................................................................................................................................................................................................... 692 ec2-reject-vpc-peering-connection ........................................................ 684 Related Topics .......................................................... 699 Examples ............................................................................................................................................................ 700 Common Options ....................................................................................................................................................................... 691 Examples ............................................................................................................................................................................................................................................................................................................................. 703 Syntax ......................................................................................................................................................... 682 Output ............................................................................................................................................................................................................ 684 Description ................................................................................................................................. 700 Syntax ................................................................. 692 Related Topics ............................................................................................................................................................................................................... 702 Examples ........................................................ 693 Output ........ 701 Output .......................................................... 685 Common Options ...................................................................................................................................................................................................................... 695 Examples ................................................. 700 Description ............................................

..................................................................................... 708 Syntax ............................................................................................................................ 712 Related Topics ............................................................................................................................................................ 735 Options ......................................................................... 744 Examples ....... 721 Options ........................... 735 Syntax ..................................... 708 ec2-replace-route ..................................................... 741 Examples ............................................................................................................................................... 709 Common Options ....................... 715 Related Topics .............................................. 720 Related Topics ................................................................................................................................ 713 Common Options .................................................................. 716 Description ................................................... 735 Common Options ........................................................ 734 ec2-reset-image-attribute .................................................................................................................................................................................... 737 Related Topics .......... 741 Related Topics ................................................... 708 Options ............................................................................................................................................................................................... 713 Output .......................................................................................................................................... 741 ec2-reset-network-interface-attribute ............................................................................................................................................................................. 742 Description ...... 743 Output ............................. 708 Description ................................................. Amazon Elastic Compute Cloud CLI Reference Related Topics ........................................................................................................................................................................................................................................................................................................................................ 742 Common Options .......................................................................................... 738 Options ..................................... 738 ec2-reset-instance-attribute ..................................................................................................... 721 Common Options ....................................................................................................................................................................................................... 721 Description ....................................................................................................................................................... 735 Output ................................. 720 Examples ..................... 739 Output ................................................................................................................................................................................................................................................................................................................. 735 Description ............................................................................................................................................................................................................................................................................................................ 716 ec2-report-instance-status .......................................................................................................................................................... 734 Related Topics ........ 717 Common Options .... 731 Output .............................................................................................................................................................................................................................................................................................................................................................................................................. 738 Description ................................................... 721 Syntax ...................................................................................................................................................................................................................................................................................................................... 717 Options ............................. 720 ec2-request-spot-instances .............................................................................................................................. 710 Output .............. 738 Common Options .................................... 713 Description ................................................................................................................................................ 742 Options .............................................. 737 Examples ...... 713 Syntax .................................................................................................................................................................................... 718 Output .............................................................................................................................................................................................. 713 Options .......................................................................................................................................................................................... 745 xxv ....................................................................................................... 712 ec2-replace-route-table-association .............. 738 Syntax ................................................................................................................ 715 Examples .............................................................................. 716 Syntax ................................................................................................. 733 Examples .................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 745 Related Topics .................................................................... 712 Examples .................................................................................................................................................... 742 Syntax ..........................................................................................

................................................................................................................................. 782 Related Commands ........................................................................... 749 Common Options ............................................................................................. 773 Related Topics ......................................................................................................................... 749 Options ................................................. 775 Description ....................................................................................................... 753 Description .................................................................................................................................................................................................................. 754 Options ............................................................................. 751 Output ................................................ 770 Output .................................................................................... 753 Syntax .................................. 748 Related Topics ............................................................................................................................................................................................................. 748 Examples ........................................................................................................................................... 776 Output ....................................................................... 749 Syntax ........................................ 760 Description ............................................................ 779 Options ... 779 Syntax ....................................................................................................................................... 746 Output ................... 745 Options ...................................................................................................................................................... 746 Common Options ................................................................................................................................................................................................................... 776 Options ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ 753 Examples .......................................................................................................................................................................................................................................................................................... 775 Syntax ....................................................................................... 784 Output ................... 756 Output .......................................................................................................................... 775 ec2-start-instances ...................................................................... 783 Syntax ........................................................................................... 749 Description ..... 785 Examples ..................................................................................................................................................................................................................................................................................... 782 Related Topics .................................................................................................................................. 780 Output .................................................................................................................................................................................................................................................................................................................................................................................... 771 Examples .................................................................................................................................... 753 Related Topics ........................ Amazon Elastic Compute Cloud CLI Reference ec2-reset-snapshot-attribute ............ 778 Related Topics ................... 760 Syntax ................................................................................................................................................................................................ 759 ec2-run-instances ....................................................................................................................................................................................... 753 ec2-revoke .......................... 783 Common Options .... 783 Options ......................... 776 Common Options ........................................................................................................................................................... 758 Examples ................................................................................... 754 Common Options .............................................................................. 782 Examples ...................................................... 759 Related Topics ................................................................................................................... 783 Description ..... 760 Common Options ................................................................................................................................................................................................................ 780 Common Options .................................................................. 760 Options .................... 745 Description .................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 779 Description .............. 778 Examples ............................................................................ 778 ec2-stop-instances .. 786 xxvi .................................................................................................................................................................. 745 Syntax ....................................................................................................................................................................................................................... 786 Related Topics .................................................................................................................................. 748 ec2-resume-import ....... 783 ec2-terminate-instances .......................................

.................................................... 797 Description ................................................................................................................. 790 Common Options ...................................................................................................................... 813 Limitations ......... 787 Output .............................................................................................................................. 800 Deprecated Options .......................... 815 Importing a Disk ........................................................................... 803 Volume Types and File Systems ........................................ 797 Example ...................................................................................................................................................................................................................................................................................................................... 789 ec2-unmonitor-instances .................... 793 Common Options ................................... 792 Related Topics .................................................................................................... 786 Syntax ................................... 807 Step 4: Import Your VM to Amazon EC2 .............. 786 Options ........................................................ 801 VM Import/Export ................................................................................................................................................... 806 Step 3: Export Your VM from Its Virtual Environment .............................. 798 Output ....................... 790 Description .................................................................................................................................................................................................................................................................................... 804 Amazon S3 Buckets .......................................................................................................... 800 Common Options .................... 814 Monitor Instance Export ............................................................................................. 813 Export an Instance ....................................................... 815 xxvii ....................................................................................................................................................................... 800 Related Topics ............................................... 803 Operating Systems ..................................................................................................................... 793 Syntax ................................................................ 790 Output ............................................................................................................................................................ 804 Limitations ........................................... 814 Cancel or Stop the Export of an Instance ............................................................................................................................................................................................................................................................................................................................... 797 Syntax ........................................................................................... 793 Description ............................................................................................................................................................................................ 789 Examples ...................................................................................................................................... 812 Prerequisites ...................................................... 795 Output ................................................................................................................................................................................................................................................................................................................ 787 Common Options ......................................................... 797 ec2-version .......................................................................................................... 793 Options .................................................................................................................................................................................................. 805 Step 1: Install the Amazon EC2 CLI ............................................................................................ Amazon Elastic Compute Cloud CLI Reference ec2-unassign-private-ip-addresses ............................................................................................................................................................................................................................................................................................................................................. 790 Syntax .............................................................................................. 806 Step 2: Prepare Your VM ......................................................................................................................... 798 Common Options ...................................................................................................................................................................................................................................................................................................................................................................................................... 803 Prerequisites .......................................................................................................................................... 786 Description .................................................................................................................................................... 804 Importing a VM ........................................................................................................................................ 808 Step 5: Start the Instance ................................................................................................................ 792 ec2-upload-disk-image ..................................................................................................................................................................................... 799 Example .................................................. 789 Related Topics .............. 790 Options .............................................. 798 Options ...................................... 792 Examples ................................. 812 Exporting an Instance ....... 797 Related Topics .......

We recommend that you use the alternative AWS tools instead: Alternative AWS Tools (p. To get started. and Linux/ Unix. How Do I? Relevant Topics Get set up to use the CLI tools Setting Up the CLI Tools (Linux and Mac OS X) (p. Mac. 1). see the AWS Command Line Interface User Guide. see ec2 in the AWS Command Line Interface Reference. 10) Get the alphabetical list of commands Commands (CLI Tools) (p. 800) the commands Get descriptions of the error codes Error Codes (in the Amazon EC2 API Reference) Get the list of regions and endpoints Regions and Endpoints (in the AWS General Reference) Note If you're looking for information about setting up the AMI tools. see Setting Up the AMI Tools in the Amazon EC2 User Guide for Linux Instances. The commands wrap the Amazon EC2 API actions. For more information about the AWS CLI commands for Amazon EC2. 1 . Alternative AWS Tools You can also use one of these AWS command line interfaces to manage your Amazon EC2 resources: AWS Command Line Interface (AWS CLI) Provides commands for a broad set of AWS products. Important The Amazon EC2 CLI predates alternative AWS command line tools. It provides descriptions. and is supported on Windows. 3) Setting Up the CLI Tools (Windows) (p. 30) Get the list of the common options for Common Options for CLI Tools (p. syntax. and usage examples for each of the commands for Amazon EC2 and Amazon Virtual Private Cloud (Amazon VPC). and can only be used for Amazon EC2 and Amazon VPC resources. Amazon Elastic Compute Cloud CLI Reference Alternative AWS Tools Welcome This is the Amazon EC2 Command Line Reference.

2 . Amazon Elastic Compute Cloud CLI Reference Alternative AWS Tools AWS Tools for Windows PowerShell Provides commands for a broad set of AWS products for those who script in the PowerShell environment. To get started. see the AWS Tools for Windows PowerShell User Guide.

or Unix. To get started with the AWS CLI. To get started with the AWS 3 . 3) • Setting Up the CLI Tools (Windows) (p. you must download them. including Amazon EC2. you can use the AWS Command Line Interface (AWS CLI). Note For information about setting up the AMI tools. which provides commands for a broad set of AWS products. configure them. and Amazon VPC. To set up the CLI tools. Note Alternatively. and ensure that any required software is installed. These tools are written in Java and include shell scripts for both Windows and Linux. see the AWS Command Line Interface User Guide. macOS. 10) Setting Up the Amazon EC2 Command Line Interface Tools on Linux/Unix and Mac OS X The Amazon EC2 command line interface tools (also called the EC2 CLI tools) wrap the Amazon EC2 API actions. Amazon EBS. see the following documentation: • Setting Up the CLI Tools (Linux and Mac OS X) (p. CLI Tools You can use the CLI tools to create and manage your resources for Amazon EC2. see ec2 in the AWS Command Line Interface Reference. For more information about the AWS CLI commands for Amazon EC2. you can use the AWS Command Line Interface (AWS CLI). Note Alternatively. Amazon Elastic Compute Cloud CLI Reference CLI Tools Setting Up the Amazon EC2 CLI Before you can start using the Amazon EC2 command line interface (CLI) tools. see Setting Up the AMI Tools in the Amazon EC2 User Guide for Linux Instances.

export AWS_ACCESS_KEY=your-aws-access-key-id export AWS_SECRET_KEY=your-aws-secret-key After you've updated ~/. For more information. 4) • Setting Up the Amazon EC2 CLI Tools on RHEL. Use the set of directions for your operating system: • Setting Up the Amazon EC2 CLI Tools on Amazon Linux (p. run the following command: $ C:\> ec2-describe-regions If you get an error that required option is missing. and to sign requests on your behalf. The Amazon EC2 CLI tools use your access keys to identify you. and AWS rejects the request.bashrc and save the file. you must install the tools and set the environment variables used by the tools. you can't retrieve your secret access key. Therefore. Ubuntu. check the following settings. Ensure that your computer's date and time are set correctly. Although you can retrieve your access key ID from the Your Security Credentials page. if you can't find your secret access key. you'll need to create new access keys before you can use the CLI tools. There are two types of access keys: access key IDs and secret access keys. First. If they are not. Note The EC2 CLI tools use your access keys as well as a time stamp to sign your requests. and you can install them with the following command: [ec2-user ~]$ sudo yum install -y aws-apitools-ec2 Each time you use the Amazon EC2 CLI tools on your instance. run the following command: $ C:\> source ~/. 5) • Setting Up the CLI Tools (Windows) (p. you must provide your identity. and try the command again: 4 . see ec2 in the AWS Command Line Interface Reference. however. Before you can use the Amazon EC2 CLI tools on your computer or your instance. 10) Setting Up the Amazon EC2 CLI Tools on Amazon Linux Instances that you launch using a non-minimal version of the Amazon Linux AMI already include the Amazon EC2 CLI tools. Amazon Elastic Compute Cloud CLI Reference Setting Up the Amazon EC2 CLI Tools on Amazon Linux CLI. The easiest way to provide your access keys to the Amazon EC2 CLI is to set the AWS_ACCESS_KEY and AWS_SECRET_KEY environment variables. or Mac OS X (p. add the following lines to ~/.bashrc. see the AWS Command Line Interface User Guide. fix any errors. You should have stored your access keys in a safe place when you created them. they are available in the default yum repositories.bashrc To verify that your CLI tools are set up correctly. the date in the signature may not match the date of the request. For more information about the AWS CLI commands for Amazon EC2. see Setting the Time for Your Linux Instance in the Amazon EC2 User Guide for Linux Instances. Note The minimal versions of the Amazon Linux AMI (amzn-ami-minimal-*) do not contain the Amazon EC2 CLI tools.

or Mac OS X • Check AWS_ACCESS_KEY for missing option -O • Check AWS_SECRET_KEY for missing option -W The default region for the Amazon EC2 CLI tools is us-east-1. While Amazon Linux already includes Java. 5 . 10). Setting Up the Amazon EC2 CLI Tools on RHEL.zip -d /usr/local/ec2 Notice that the . such as /usr/local/ec2. Install and configure Java The Amazon EC2 CLI tools require Java.zip file on this site: Amazon EC2 CLI Tools.0. Unzip the files into a suitable installation directory. 5) • Set the CLI Tools location (p. 5) • Install and configure Java (p.com/ec2-downloads/ec2-api-tools. You can also download them with the wget utility: $ C:\> wget http://s3. If you don't have Java 1. Topics • Download and Install the CLI Tools (p. $ C:\> sudo mkdir /usr/local/ec2 $ C:\> sudo unzip ec2-api-tools. where x. or Mac OS X You must complete the following setup tasks before you can use the Amazon EC2 CLI tools on your own computer. 16).com/ec2-downloads/ec2-api-tools. (Optional) Verify that the CLI tools package has not been altered or corrupted after publication.7.x is the version number of the tools (for example. download and install Java. you may need to install Java on your Red Hat or Ubuntu system. 7) • Set your identity for the CLI Tools (p.amazonaws. For more information about authenticating the download before unzipping the file. Find the right JDK package for your platform at Java SE Development Kit 8 Downloads. see (Optional) Change the region (p.x. Amazon Elastic Compute Cloud CLI Reference Setting Up the Amazon EC2 CLI Tools on RHEL. 10) Download and Install the CLI Tools To download and install the CLI tools 1. For information about configuring the Amazon EC2 CLI tools to use a different region. you can download them using cURL: $ C:\> curl -O http://s3. Ubuntu.0). 9) • (Optional) Change the region (p.x. ec2-api-tools-1.zip Alternatively. 8) • (Optional) Set a proxy server (p. Ubuntu. 8) • Verify the Tools Setup (p.zip file contains a folder ec2-api-tools-x. The CLI tools are available as a .amazonaws.zip 2. see (Optional) Verify the Signature of the CLI Tools Download (p.7 or later installed.x. 3.x.x.

(Mac OS X only) For Mac OS X systems.0_55. Verify that you have Java installed with the following command: $ which java If Java is present. the /usr/libexec/java_home command returns a path suitable for setting the JAVA_HOME variable.. but in most cases this is a symbolic link.a (p. (Linux only) For Linux systems. in this example. The JAVA_HOME environment variable requires the true path to the binary. This location is the actual binary (notice that it is listed as an executable). you can recursively run the file command on the which java output until you find the binary. The Amazon EC2 CLI tools read the JAVA_HOME environment variable to locate the Java runtime. so you need to run the file command on that location to see whether that is the real binary. or Mac OS X Alternatively. Verify this by running the file command on this location: file /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java: ELF 64-bit LSB executable. /usr/libexec/java_home /System/Library/Java/JavaVirtualMachines/1. Set JAVA_HOME to the full path of the Java home directory.jdk/Contents/Home 3. This environment variable should specify the full path of the directory that contains a subdirectory named bin that contains the Java executable you installed (java. b. export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64/jre" 6 . a.exe). To set the JAVA_HOME environment variable on Linux/Unix and Mac OS X 1. which is the actual binary. 6). the Java home directory is /usr/lib/jvm/ java-7-openjdk-amd64/jre. set the JAVA_HOME variable to the directory where bin/java was located in Step 2. The which java command executed earlier returns Java's location in the $PATH environment variable. you can install the latest JDK using your Red Hat or Ubuntu package manager. consult the documentation for your Linux distribution. The Java home directory is where bin/java lives. Ubuntu. file /etc/alternatives/java /etc/alternatives/java: symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/ bin/java' This returns a new location. a. For example: file $(which java) /usr/bin/java: symbolic link to `/etc/alternatives/java' The /usr/bin/java location is actually a link to /etc/alternatives/java.7.. you should see something like the following output: /usr/bin/java 2. For more information. (Linux only) For the Linux example above. Amazon Elastic Compute Cloud CLI Reference Setting Up the Amazon EC2 CLI Tools on RHEL. Find the Java home directory on your system.

To set the EC2_HOME and PATH environment variables on Linux/Unix 1. $ export JAVA_HOME=$(/usr/libexec/java_home) 4. It contains subdirectories named bin and lib. If the file does not exist. Ubuntu. if you unzipped the tools into the /usr/local/ec2 directory created earlier. Add them to your shell start up scripts so that they're set every time you log in or spawn a new shell. Use this command to set the EC2_HOME environment variable. This directory is named ec2-api-tools-w. you can create it. You can verify your JAVA_HOME setting using this command: $ $JAVA_HOME/bin/java -version If you have set the environment variable correctly. and then retrying the command. x.bashrc. and z are components of the version number).4.04.12. set the JAVA_HOME variable to $(/usr/ libexec/java_home).0 7 . You can set the EC2_HOME and PATH environment variables as follows. mixed mode) 5.x.4.y.7) (7u55-2. 6) and save.2) OpenJDK 64-Bit Server VM (build 24. the benefit of setting the variable this way is that it updates to the correct value if you change the location of your Java installation later. (Mac OS X only) For the Mac OS X example above.bash_profile and in RHEL and Ubuntu. or Mac OS X b. to make things a little easier. Amazon Elastic Compute Cloud CLI Reference Setting Up the Amazon EC2 CLI Tools on RHEL. logging back in again. set EC2_HOME to the directory path where you unzipped them. In Mac OS X.0.z (where w. The following command sets this variable to the output of the java_home command.0_55" OpenJDK Runtime Environment (IcedTea6 2. Then add the JAVA_HOME variable definition you set in Step 3 (p.7. For example. Set the CLI Tools location The Amazon EC2 CLI tools read the EC2_HOME environment variable to locate supporting libraries. this file is commonly called ~/. execute the following command. Verify that the variable is set properly for new shells by opening a new terminal window and testing that the variable is set with the following command: $JAVA_HOME/bin/java -version Note If the java -version command does not correctly display the version.7-1ubuntu0. The name of this startup file differs across platforms. Before using these tools.51-b03. try logging out. In addition. the output looks something like the following: java version "1. substituting the correct version number of the tools: export EC2_HOME=/usr/local/ec2/ec2-api-tools-1. Use your favorite text editor to create a new file with that name. you can add the bin directory for the CLI tools to your system path. consult the help documentation for your platform. y. it is commonly called ~/. If you're unsure. 6. Add this environment variable definition to your shell start up scripts so that it is set every time you log in or spawn a new shell.7. Most of the examples in the Amazon EC2 User Guide for Linux Instances assume that you have done so.

Amazon Elastic Compute Cloud CLI Reference Setting Up the Amazon EC2 CLI Tools on RHEL. You can add them to your shell startup scripts so that they're set every time you log in or spawn a new shell. their values serve as the default values for these required options. AKIAIOSFODNN7EXAMPLE) and secret access keys (for example. Property Description https. Use when EC2_URL specifies an HTTP host. if you can't find your secret access key. the http. 8 . even if the value is quoted or the spaces are escaped. Ubuntu. You should have stored your access keys in a safe place when you received them. Use this command to set the PATH variable: export PATH=$PATH:$EC2_HOME/bin Set your identity for the CLI Tools Your access keys identify you to the Amazon EC2 CLI tools. you must specify your access keys using the --aws-access-key and -- aws-secret-key (or -O and -W) options. /usr/bin instead of C:\usr\bin). Every time you issue a command.proxyHost HTTP proxy host. the value of EC2_HOME cannot contain any spaces. Alternatively. Although you can retrieve your access key ID from the Your Security Credentials page on the IAM console (if you are an IAM user). you can't retrieve your secret access key. The properties that are required depend on the type of proxy server being used. wJalrXUtnFEMI/ K7MDENG/bPxRfiCYEXAMPLEKEY). https. you might find it easier to store your access keys using the following environment variables: • AWS_ACCESS_KEY • AWS_SECRET_KEY If these environment variables are set properly. or Mac OS X Note If you are using Cygwin. http. 2.proxyWorkstation properties are only used with a Windows NTLM proxy. You can set these environment variables as follows: export AWS_ACCESS_KEY=your-aws-access-key-id export AWS_SECRET_KEY=your-aws-secret-key (Optional) Set a proxy server If the computer on which you have installed the Amazon EC2 CLI tools requires the use of a proxy server. For example. Use when EC2_URL specifies an HTTPS host. Use when EC2_URL specifies an HTTPS host.proxyPort HTTPS proxy port. Therefore.proxyDomain and http. so you can omit them from the commands.proxyHost HTTPS proxy host. you'll need to create or request new access keys before you can use the CLI tools. The following table contains the proxy configuration properties that can be set for the EC2_JVM_ARGS variable. There are two types of access keys: access key IDs (for example. EC2_HOME must use Linux/Unix paths (for example. Additionally. set the EC2_JVM_ARGS environment variable.

http. Use when EC2_URL specifies an HTTP host.proxyUser Proxy user name (HTTPS and HTTP) http.proxyWorkstation Proxy workstation (HTTPS and HTTP) http. Error Mitigation Required option -O is missing Check the setting of AWS_ACCESS_KEY. and check that the date and time are set correctly on your computer. use the following command: export EC2_JVM_ARGS="${EC2_JVM_ARGS} -Dhttps.proxyHost=my. or if you are setting the variable for the first time on your computer.proxyPort=8080" Verify the Tools Setup Verify that your Amazon EC2 CLI tools are set up correctly. use the following command: echo $EC2_JVM_ARGS If the command above returns no value. and try the command again.proxyHost=my.proxy. fix any errors. bypassing the proxy. the output lists regions and their corresponding service endpoints. If you're using an instance that you launched from an Amazon Linux AMI. 9 .AuthFailure Check that you've entered your AWS_ACCESS_KEY and AWS_SECRET_KEY correctly. To check the value of the variable. Client. The following tables lists some errors you might encounter.com -Dhttps.proxyPass Proxy password (HTTPS and HTTP) http. fix any errors. to append your proxy information to an existing variable value.proxy. Required option -W is missing Check the setting of AWS_SECRET_KEY.proxyPort HTTP proxy port. along with their mitigations.com -Dhttps. or Mac OS X Property Description http. Each item in the list is separated by '|'.proxyDomain Proxy domain (HTTPS and HTTP) http. Ubuntu. and try the command again. Amazon Elastic Compute Cloud CLI Reference Setting Up the Amazon EC2 CLI Tools on RHEL.proxyPort=8080" Alternatively. it may already have the EC2_JVM_ARGS environment variable set to a value. Run the following command to view your available regions: $ ec2-describe-regions If your environment variables are set correctly. use the following command: export EC2_JVM_ARGS="-Dhttps.nonProxyHosts A list of hosts that should be reached directly.

you can use the AWS Command Line Interface (AWS CLI).UnauthorizedOperation error ec2:DescribeRegions action. Download the CLI tools (p. You can verify the region for the instance by checking the region selector in the console navigation bar. These tools are written in Java and include shell scripts for both Windows and Linux/UNIX/Mac OSX. see the AWS Command Line Interface User Guide. see Regions and Endpoints in the Amazon Web Services General Reference. You can set up the tools on your own computer or on an Amazon EC2 instance. 3. 13). including Amazon EC2. 14). (Optional) Set the region (p. 2. call the ec2-describe-regions command. 2. To list your available service endpoint URLs. To get started with the AWS CLI.amazonaws. (Optional) Change the region By default. see ec2 in the AWS Command Line Interface Reference. 4. Setting Up the Amazon EC2 Command Line Interface Tools on Windows The Amazon EC2 command line interface tools (also called the CLI tools) wrap the Amazon EC2 API actions. For more information about the regions and endpoints for Amazon EC2. 12). To access a different region with the CLI tools. Before you can use the Amazon EC2 CLI tools. Set the EC2_URL environment variable using the service endpoint URL returned from the ec2- describe-regions command as follows: export EC2_URL=https://<service_endpoint> If you've already launched an instance using the console and wish to work with the instance using the CLI. For more information about the AWS CLI commands for Amazon EC2. 5. you need to download them and configure them to use your AWS account. the Amazon EC2 CLI tools use the US East (Northern Virginia) region (us-east-1) with the ec2. Check your IAM policies. Set the JAVA_HOME environment variable (p. 11). and then test the tools using an action that you have permission to use. 11). Note Alternatively.com service endpoint URL. Complete the following tasks to set up your Amazon EC2 environment: 1. To set the service endpoint URL 1. Amazon Elastic Compute Cloud CLI Reference Setting Up the CLI Tools (Windows) Error Mitigation You are an IAM user and get a You may not have permission to use the Client. Set the AWS_ACCESS_KEY and AWS_SECRET_KEY environment variables (p. which provides commands for a broad set of AWS products. 10 . you must specify the endpoint URL for the instance's region. you must set the EC2_URL environment variable to the proper service endpoint URL.us-east-1. Set the EC2_HOME environment variable (p.

set JAVA_HOME to C:\Program Files (x86)\Java\jre7. c. In Variable value.exe). d. Note These instructions are written for a Windows 7 client.zip file is self-contained. For example. C:\Program Files (x86)\Java\jre7). Under User variables. and then click Properties. What you need to do to complete some tasks may vary if you're using a different version of Windows. Click OK. This is why it's necessary for you to open a new Command Prompt window to verify that your environment is set up properly. They read the JAVA_HOME environment variable to locate the Java runtime. no installation is required. Important Don't include the bin folder in JAVA_HOME. 15). The . Amazon Elastic Compute Cloud CLI Reference Task 1: Download the Command Line Interface Tools (CLI Tools) 6. see Free Java Download. (Optional) You can verify that the CLI tools package has not been altered or corrupted after publication. For more information about authenticating the download before unzipping the file. right-click Computer. but the CLI tools won't work if you do this. Set JAVA_HOME to the full path of the Java home. Open a new Command Prompt window and verify your JAVA_HOME setting using this command: C:\> "%JAVA_HOME%"\bin\java -version 11 . Click Environment Variables. Click Start. type the path to your Java home (for example. 16). type JAVA_HOME. The Command Prompt windows that you open after you complete these steps will contain the updates. This environment variable should specify the full path of the folder that contains a subfolder named bin that contains the Java executable you installed (java.7 or later installed. f.zip file on the Amazon EC2 CLI Tools site. 14). b. 2. if your Java executable is in C: \Program Files (x86)\Java\jre7\bin. g. 7. You can simply download the file and unzip it. e. In Variable name. If you don't have Java 1. This is a common mistake. (Optional) Use a proxy (p. Task 2: Set the JAVA_HOME Environment Variable The Amazon EC2 CLI tools require Java. Important These steps don't update the environment variables in your current Command Prompt windows. a. 3. Either a JRE or JDK installation is acceptable. click New. To set the JAVA_HOME environment variable on your computer or instance 1. see (Optional) Verify the Signature of the CLI Tools Download (p. Task 1: Download the Command Line Interface Tools (CLI Tools) The CLI tools are available as a . Click Advanced system settings. Download Remote Desktop (p. The tools are written in Java and include shell scripts for both Windows and Linux/UNIX/Mac OSX. download and install Java. To view and download JREs for a range of platforms.

Click Advanced system settings. c. check the setting of JAVA_HOME. Click Start.z (where w.) b. The Command Prompt windows that you open after you complete these steps will contain the updates. a. type the path to the folder where you installed the CLI tools. Set EC2_HOME to the path of the folder into which you unzipped the CLI tools.7. This is why it's necessary for you to open a new Command Prompt window to verify that your environment is set up properly. click New.0_45" Java(TM) SE Runtime Environment (build 1. select Path. f. create it. and then click Edit. In User variables. 5. Task 3: Set the EC2_HOME Environment Variable and Update the Path Environment Variable The Amazon EC2 CLI tools read the EC2_HOME environment variable to locate supporting libraries. 2. e. Click OK. fix any errors. C:\> dir "%EC2_HOME%" 12 .%JAVA_HOME%\bin. Add the bin folder that contains the Java executable to your path before other versions of Java. In Variable name. right-click Computer.0_45-b18) Java HotSpot(TM) Client VM (build 24. x. Otherwise. Open a new Command Prompt window and verify your update to the Path environment variable using this command. before any other versions of Java. y. For example. mixed mode. Open a new Command Prompt window and verify your EC2_HOME setting using this command. (If this environment variable doesn't exist. Then click OK. 4. type EC2_HOME. You'll need to set this environment variable to the path where you unzipped the CLI tools.x. and try the command again. Amazon Elastic Compute Cloud CLI Reference Task 3: Set the EC2_HOME Environment Variable and Update the Path Environment Variable If you've set the environment variable correctly. In Variable values. sharing) Otherwise. add . It contains subdirectories named bin and lib. Return to the Environment Variables window. Important These steps don't update the environment variables in your current Command Prompt windows. the output looks something like this: java version "1. This folder is named ec2-api-tools-w. and try the command again.7. open a new Command Prompt window. fix any errors. Under User variables. d. and z are components of the version number). Click Environment Variables. open a new Command Prompt window.7.0. C:\> java -version You should see the same output as before. In Variable value. b. a. and then click Properties. C: \AWS\EC2\ec2-api-tools-1. You'll then need to update the Path environment variable to include the bin subdirectory.45-b08.0. check the setting of Path. To set the EC2_HOME variable and update the Path variable on your computer or instance 1.y.

Task 4: Set the AWS_ACCESS_KEY and AWS_SECRET_KEY Environment Variables The Amazon EC2 CLI tools use your access keys to identify you. the date in the signature may not match the date of the request. open a new Command Prompt window. Amazon Elastic Compute Cloud CLI Reference Task 4: Set the AWS_ACCESS_KEY and AWS_SECRET_KEY Environment Variables If you've set the environment variable correctly. In Variable name. 13 . and then click OK. AKIAIOSFODNN7EXAMPLE) and secret access keys (for example. Update the Path environment variable by adding the bin folder for the tools. so you can omit them from the command line. 3.%EC2_HOME%\bin. Therefore. To set up your environment variables on your computer or instance 1. Click OK. In Variable values. Click Environment Variables. type AWS_ACCESS_KEY. 4. b. In User variables. click New. Under User variables. fix any errors. a. You should have stored your access keys in a safe place when you received them. and then click Edit. you'll see output for the folder listing. For more information about setting the time on your Windows instance. If you get a File Not Found error. their values serve as the default values for these required options. 2. you can't retrieve your secret access key. In Variable value. right-click Computer. 5. type AWS_SECRET_KEY. 6. add . Click Advanced system settings. 7. specify your access key ID. you must specify your access keys using the --aws-access-key and -- aws-secret-key (or -O and -W) options. and then click Properties. Click OK. In Variable value. 9. Although you can retrieve your access key ID from the Your Security Credentials page or the IAM console (if you are an IAM user). Click Start. and to sign requests on your behalf. In Variable name. Alternatively. select Path. 8. specify your secret access key. wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY). you might find it easier to store your access keys using the following environment variables: • AWS_ACCESS_KEY—Your access key ID • AWS_SECRET_KEY—Your secret access key If these environment variables are set properly. click New. There are two types of access keys: access key IDs (for example. and try the command again. Every time you issue a command. If they are not. Note The EC2 CLI tools use your access keys as well as a time stamp to sign your requests. and AWS rejects the request. Under User variables. if you can't find your secret access key. Return to the Environment Variables window. Ensure that your computer's date and time are set correctly. see Setting the Time for a Windows Instance in the Amazon EC2 User Guide for Windows Instances. you'll need to create or request new access keys before you can use the CLI tools. 3. check the setting of EC2_HOME. The following procedure describes how to create environment variables that specify your access keys.

and try the command again.AuthFailure error. fix any errors.com REGION sa-east-1 ec2. c.com REGION eu-west-1 ec2. check that you've entered your AWS_ACCESS_KEY and AWS_SECRET_KEY correctly. Task 5: Set the Region (Optional) By default. If you get an error that required option -W is missing. Click OK. check the setting of AWS_SECRET_KEY. and check that the date and time are set correctly on your computer. open a new Command Prompt window. 14 .com REGION ap-southeast-1 ec2. check the setting of the EC2_HOME and Path environment variables. fix any errors.amazonaws. you must specify the eu-west-1 region by using the --region eu-west-1 option or by setting the EC2_URL environment variable. The following example sets EC2_URL.us-west-1.com service endpoint URL. d.eu-west-1.amazonaws. open a new Command Prompt window. the Amazon EC2 CLI tools use the us-east-1 region with the ec2.amazonaws.com REGION us-west-1 ec2.eu-west-1. open a new Command Prompt window and run the following command. Amazon Elastic Compute Cloud CLI Reference Task 5: Set the Region (Optional) To verify that all your environment variables are set up correctly. To view available regions. C:\> ec2-describe-regions If your environment variables are set correctly. type EC2_URL. set the EC2_URL environment variable. Task 6: Use a Proxy (Optional) If the computer with the installed CLI tools requires the use of a proxy server. see Regions and Endpoints in the Amazon Web Services General Reference. f. b. If your instances are in a different region. In Variable name.amazonaws. you must tell the CLI tools to use the proxy server with the EC2_JVM_ARGS environment variable. Click Advanced system settings. If you get an error that required option -O is missing. 2. If you get a Client. Under User variables.us-west-2.com REGION us-west-2 ec2.com REGION ap-northeast-1 ec2. a. type https://ec2. and then click Properties.amazonaws.sa-east-1.ap-northeast-1.com. To change the service endpoint. open a new Command Prompt window.com If you get an error that this command is not recognized as an internal or external command. fix any errors. In Variable value. and try the command again. you must specify the region where your instances reside.amazonaws.ap-southeast-1.us-east-1. you'll see output that looks something like this. REGION us-east-1 ec2.us-east-1. For example. if your instances are in Europe. e.amazonaws. click New. This section describes how to specify a different region by changing the service endpoint URL. check the setting of AWS_ACCESS_KEY. Click Start. right-click Computer. Click Environment Variables.amazonaws. To specify a different region on your computer or instance 1.amazonaws. and try the command again.

type EC2_JVM_ARGS. https.proxyPort=8080.proxyDomain Proxy domain (HTTPS and HTTP) http. click New. If this command displays the Remote Desktop Connection window. The most recent versions of Windows include a Remote Desktop client already.proxyHost HTTPS proxy host.com -Dhttps. you'll need a Remote Desktop client. Click Advanced system settings. 5. http.proxyPass Proxy password (HTTPS and HTTP) http. specify the proxy configuration properties.proxyWorkstation properties are only used with a Windows NTLM proxy. Each item in the list is separated by '|'.proxyHost=my.nonProxyHosts A list of hosts that should be reached directly.proxyWorkstation Proxy workstation (HTTPS and HTTP) http. To check whether you have one.proxyPort HTTP proxy port. the http. The properties that are required depend on the type of proxy server being used. Otherwise. To set up the EC2_JVM_ARGS environment variable on your computer or instance 1. 4. go to the Microsoft Windows home page and search for the download for Remote Desktop Connection. For example. Now you're ready to start using Amazon EC2 from a Command Prompt window! 15 . Amazon Elastic Compute Cloud CLI Reference Task 7: Download Remote Desktop The following table contains the proxy configuration properties that can be set for the EC2_JVM_ARGS variable. Use when EC2_URL specifies an HTTPS host. Under User variables. 2. Property Description https. http. In Variable value. Then click OK. In Variable name. For example. Click Start. 3. you're set.proxyPort HTTPS proxy port. - Dhttps. http. and then click Properties. bypassing the proxy.proxy. Task 7: Download Remote Desktop To connect to a Windows instance. Use when EC2_URL specifies an HTTP host. Use when EC2_URL specifies an HTTP host. Use when EC2_URL specifies an HTTPS host.proxyHost HTTP proxy host.proxyUser Proxy user name (HTTPS and HTTP) http. 6. right-click Computer.proxyDomain and http. open a Command Prompt window and type mstsc. Click Environment Variables.

Your keyring is a collection of known public keys. the GPG tools are likely already installed. type gpg at a command line prompt. Topics • Overview (p. you can have confidence that the application has not been altered. After you've established the authenticity of the public key. Amazon Elastic Compute Cloud CLI Reference Verify the Signature (Optional) (Optional) Verify the Signature of the CLI Tools Download Whenever you download an application from the Internet. and then add the public key to your keyring. You can install the GnuPG package from a repository. Instead. you get a GPG command prompt. To install GPG tools on Debian-based Linux • From a terminal. run the following command. check that the owner of the public key is who they claim to be. If the GPG tools are not installed. To test whether the tools are installed on your system. 16) • Authenticate the Public Key (p. you should authenticate the identity of the software publisher and check that the application has not been altered or corrupted since it was published. contact Amazon Web Services. do not unzip or install the file that you downloaded. GnuPG provides authentication and integrity checking through a 128-bit digital signature.gnupg. 17) • Verify the Signature of the Package (p. Amazon EC2 publishes a public key and signatures you can use to verify the downloaded Amazon EC2 CLI tools. Amazon EC2 CLI tools are signed using GnuPG. you'll calculate a signature from the publisher's public key and your downloaded copy of the application. apt-get install gnupg 16 . If the GPG tools are installed. or trust it implicitly because the public key is trusted by someone with whom you have a pre-existing trust relationship. you can use it to verify the signature of the application. an open implementation of the Pretty Good Privacy (OpenPGP) standard for secure digital signatures. 19) Overview The first step is to establish trust with the software publisher: download the public key of the software publisher. You can then explicitly trust the public key.org. Install the GPG Tools If your operating system is Linux or Unix. you get an error stating that the command cannot be found. see http://www. This protects you from installing a version of the application that contains a virus or other malicious code. For more information about PGP and GnuPG (GPG). Using security tools. If the calculated signature matches the signature the software developer has published for the application. If you determine that the software for the CLI tools has been altered. 16) • Install the GPG Tools (p.

html. You'll need this later to sign changes to your trust status. During installation of Gpg4win. use them to create a public-private key set. 2. To authenticate the EC2 Packages public key 1. gpg --gen-key 2.key. If you have previously installed the GPG tools and already have a public-private key set. Make a note of the passphrase you use to create the private key. Amazon Elastic Compute Cloud CLI Reference Authenticate the Public Key To install GPG tools on Red Hat–based Linux • From a terminal. setting a root certificate establishes trust with all publishers trusted by that certificate. This includes everything from -----BEGIN PGP PUBLIC KEY BLOCK----- to -----END PGP PUBLIC KEY BLOCK-----. you can also download and compile the source code from http://gnupg. Either option is fine for the purpose of verifying the signature of the Amazon EC2 CLI tools package. follow the instructions in the text box. you can skip this step. you can use the default values suggested by Gpg4win.org/download/index. In addition to installing pre-compiled implementations of GnuPG. You can use the suggested default values. run the following command. Note This text file must use ASCII encoding.key and copy the public key from EC2 Packages Public Key into the text file. To create a private key for the GPG tools 1. 17 . Create a text file named ec2-packages-public. yum install gnupg To install GPG tools on Windows • Download and install Gpg4win. Defining a root certificate is a way to establish trust with many software publishers. Authenticate the Public Key The next step in the process is to authenticate the EC2 Packages public key and add it as a trusted key in your GPG keyring. Answer the questions that follow. If you want to define a root certificate. click the check box to skip this step. You'll need this value later. After you have installed a set of GPG tools. you are asked whether you want to define a root certificate. From the command line. Import the EC2 Packages public key into your keyring using the following command in the directory where you saved the file ec2-packages-public. If not. an implementation of GnuPG that runs on Mac OS X. To install GPG tools on Mac OS X • Download and install GPGTools. run the following command.en. As part of the installation process. Save the text file. an implementation of GnuPG that runs on Windows.

pg: key 0349E66A: public key "AWS EC2 Packages <ec2-packages@amazon. and contact Amazon Web Services. 0m. To learn more about these trust options. 0q.com> 4. 0n.com website. Amazon Elastic Compute Cloud CLI Reference Authenticate the Public Key gpg --import ec2-packages-public. If the fingerprint matches the one published on the aws. you'll need it in the next step. 1 complete(s) needed. go to the The GNU Privacy Handbook. do not continue to install the CLI tools. checking fingerprints from different sources. with a prompt such as the following.com>" imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) gpg: 3 marginal(s) needed. 2u gpg: depth: 1 valid: 1 signed: 0 trust: 0-. In the example below. 1f. remove the following line from the ec2-packages-public. 0q.14 (Darwin) 3. where key-value is replaced by the value from the previous step. trust The GPG tools ask you to establish a level of trust for EC2 Packages. you may choose to trust EC2 Packages public key. To do so. the key value is 0349E66A. Please decide how far you trust this user to correctly verify other users' keys (by looking at passports. Verify the fingerprint by running the following command. pub 4096R/0349E66A 2011-04-04 Key fingerprint = A262 37CF 2294 C30E 9844 96C9 116B 3651 0349 E66A uid AWS EC2 Packages <ec2-packages@amazon. gpg --edit-key key-value Type the following command at the GPG tools prompt.0. 0m. PGP trust model gpg: depth: 0 valid: 2 signed: 1 trust: 0-. etc. where key-value is replaced by the key value from Step 2.key file: Version: GnuPG/MacGPG2 v2. 0f. 0n.) 1 = I don't know or won't say 2 = I do NOT trust 3 = I trust marginally 4 = I trust fully 5 = I trust ultimately m = back to the main menu Your decision? 18 . Make a note of the key value. Compare the key fingerprint to that published on EC2 Packages Public Key. run the following command.key The command returns results similar to the following. If they don't. gpg --fingerprint key-value This command returns results similar to the following.amazon. 0u gpg: next trustdb check due at 2014-07-20 Note If you get an error starting with invalid radix64 character. They should match.

to -----END PGP SIGNATURE----. gpg: Signature made Mon Mar 12 14:51:33 2012 PDT using RSA key ID 0349E66A gpg: Good signature from "AWS EC2 Packages <ec2-packages@amazon. Copy everything including the -----BEGIN PGP SIGNATURE----.zip. and press Enter.asc. Verify the Signature of the Package With the GPG tools installed and the EC2 Packages public key authenticated and the EC2 Packages public key trusted. type y. and you can proceed to unzip and install the Amazon EC2 CLI tools. from Amazon EC2 CLI Tools.asc and the CLI package ec2-api-tools. gpg --verify ec2-api-tools. ec2-api-tools.com>"' the signature has successfully been verified. If the output includes the phrase "BAD signature".zip. If you continue to get this response. 2.lines. Amazon Elastic Compute Cloud CLI Reference Verify the Signature of the Package Type 4 and press Enter. under Related Documents. 19 . Create a new text file named ec2-api-tools. copy the contents from the Verify the signature of the package link into this file. save This saves your changes to the keyring. you're ready to check the signature of the Amazon EC2 CLI tools package. 3. You are asked for the passcode that you used when you created your private key. To verify the signature of Amazon EC2 CLI tools package 1. check that you performed the procedure correctly. Type your passcode and press Enter. Do this using the following command. 6. Both files must be present. Verify the signature of the CLI tools by typing the following at a command line prompt in the directory where you saved the file ec2-api-tools.com>" If the output contains the phrase 'Good signature from "AWS EC2 Packages <ec2- packages@amazon.zip.zip The output should be something like the following. contact Amazon Web Services and do not unzip or install the file that you downloaded. Save the file.asc ec2-api-tools. It should also exit the PGP session. 5. sign You are asked to confirm.zip. On the Amazon EC2 CLI Tools page. Sign the key with your private key (created when you installed the GPG tools) to set the new trust level. If it doesn't. Download the Amazon EC2 CLI tools package. Save your changes using the following command. press CTRL+Z to exit the PGP session and return to the main terminal.zip.

Your key pair is required to decrypt login information for when you connect to your instance. To get started using an instance 1.) Before you can launch your instance. You must add a rule to your security group that enables you to access your instance. you must create a key pair and a security group. Amazon Elastic Compute Cloud CLI Reference Creating a Key Pair Launching an Instance Using the Amazon EC2 CLI You can use the Amazon EC2 command line interface (CLI) tools to launch an instance. see Setting Up the Amazon EC2 CLI (p. Create a security group (p. see Amazon EC2 Key Pairs and Amazon EC2 Security Groups in the Amazon EC2 User Guide for Linux Instances. 145) command as follows: ec2-create-keypair my-key-pair The following is example output: KEYPAIR my-key-pair 1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f ---. A security group acts as a firewall that controls the traffic allowed to reach your instance. Add a rule to your security group (p. Create a key pair (p. 21) 3. 22) 4.BEGIN RSA PRIVATE KEY ---- MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6 b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd BgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcN MTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYD VQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25z 20 . Connect to your instance (p. Launch an instance (p. 20) 2. For more information. 3). use the ec2-create-keypair (p. 22) 5. (If you haven't already installed the Amazon EC2 CLI tools. 23) Creating a Key Pair To create a key pair named my-key-pair.

127) command. use the ec2-create-group (p.pem and paste the entire key. You create a security group for either EC2-Classic or EC2-VPC. EC2-Classic The following command creates a security group named my-security-group for EC2-Classic: ec2-create-group my-security-group -d "My security group" The following is example output: GROUP sg-xxxxxxxx my-security-group My security group EC2-VPC The following command creates a security group named my-security-group for EC2-VPC: ec2-create-group my-security-group -d "My security group" -c vpc-xxxxxxxx The following is example output: 21 . For more information. Amazon Elastic Compute Cloud CLI Reference Creating a Security Group b2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFt YXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ 21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9T rDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpE Ibb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4 nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0Fkb FFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTb NYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE -----END RSA PRIVATE KEY----- Make a note of the fingerprint for the private key of the key pair displayed on the first line. They should be identical. use the following command to set the permissions of your private key file so that only you can read it. If you're using an SSH client on a Linux computer to connect to your instance. chmod 400 my-key-pair. see Supported Platforms in the Amazon EC2 User Guide for Linux Instances.pem Creating a Security Group To create a security group. including the following lines: "----BEGIN RSA PRIVATE KEY----" "-----END RSA PRIVATE KEY-----" Save the file with ASCII encoding so that it can be read by an SSH client when you connect to your instance. Create a file named my-key-pair. You do this by comparing the fingerprint for the private key with the fingerprint of the public key. You can use the fingerprint to verify that your private key is a correct match with the public key stored in AWS.

0. EC2-Classic The following command launches a t1. If you are connecting through an ISP or from behind your firewall without a static IP address. 760) command to launch an instance into either EC2-Classic or EC2-VPC. you need to find out the range of IP addresses used by client computers. you must add a rule to my-security-group to allow inbound traffic on TCP port 3389 (RDP). You also need to select an Amazon Machine Image (AMI) and note its AMI ID (ami-xxxxxxxx). One of the required parameters of this command is the public IP address of your computer. 76) command to add a rule to your security group. For example. To locate another service that provides your IP address. If you're launching a Linux instance. Amazon Elastic Compute Cloud CLI Reference Adding a Rule to Your Security Group GROUP sg-xxxxxxxx my-security-group My security group Adding a Rule to Your Security Group If you're launching a Windows instance. or you can go to AWS Marketplace.0. you need the key pair and security group that you created.25/32 EC2-VPC The following command adds a rule for RDP to a security group for EC2-VPC: ec2-authorize sg-xxxxxxxx -P tcp -p 3389 -s 203.com/. use the search phrase "what is my IP address". You can find an AMI using the Amazon EC2 console. Use the ec2-run-instances (p. Tip You can get the public IP address of your local computer using a service.25/32 The following command adds a rule for SSH to a security group for EC2-VPC: ec2-authorize sg-xxxxxxxx -P tcp -p 22 -s 203.25/32 The following command adds a rule for SSH to a security group for EC2-Classic: ec2-authorize my-security-group -p 22 -s 203.micro instance in EC2-Classic: 22 .113. in CIDR notation. you must add a rule to allow inbound traffic on TCP port 22 (SSH). EC2-Classic The following command adds a rule for RDP to a security group for EC2-Classic: ec2-authorize my-security-group -p 3389 -s 203.amazonaws.25/32 Launching an Instance To launch an Amazon EC2 instance.113.0.0. Use the ec2-authorize (p.113. we provide the following service: http://checkip.113.

micro -s subnet-xxxxxxxx -k my-key-pair -g sg-xxxxxxxx --associate-public-ip-address true The following is example output for EC2-VPC: RESERVATION r-xxxxxxxx 111122223333 INSTANCE i-xxxxxxxx ami-xxxxxxxx ip-10-0-1-153. see Connect to Your Amazon EC2 Instance in the Amazon EC2 User Guide for Linux Instances. but will be in the running state in a few minutes. you can view updated information about the instance using the ec2-describe-instances (p.ec2.153 ip-10-0-1-153.ec2.internal Connecting to Your Instance Initially. For more information. you can connect to it and use it just as you'd use a computer sitting in front of you. your instance is in the pending state. 23 . Amazon Elastic Compute Cloud CLI Reference EC2-VPC ec2-run-instances ami-xxxxxxxx -t t1.1.153 ip-10-0-1-153. Then.internal true NICATTACHMENT eni-attach-xxxxxxxx 0 attaching 2013-09-25T16:10:56-0800 true GROUP sg-xxxxxxxx my-security-group PRIVATEIPADDRESS 10.0.micro 2013-09-25T22:25:43+0000 us-east-1d windows monitoring-disabled ebs hvm xen sg-xxxxxxxx default false EC2-VPC The following command launches a t1. While your instance is running.1. and requests a public IP address: ec2-run-instances ami-xxxxxxxx -t t1.micro -k my-key-pair -g my-security-group The following is example output for EC2-Classic: RESERVATION r-xxxxxxxx 111122223333 my-security-group INSTANCE i-xxxxxxxx ami-xxxxxxxx pending my-key-pair 0 t1.internal pending my-key-pair 0 t1. the root volume.ec2. 378) command. the public and private IP addresses.micro 2013-09-25T22:25:43+0000 us- east-1d windows monitoring-disabled 10-0-1-153 vpc-xxxxxxxx subnet-xxxxxxxx ebs hvm xen sg-xxxxxxxx default false NIC eni-xxxxxxxx subnet-xxxxxxxx vpc-xxxxxxxx 111122223333 in-use 10. such as the updated state. and the public DNS name.micro instance into a nondefault subnet in EC2-VPC.0.

684) • ec2-reset-image-attribute (p. 318) 24 . 83) • ec2-cancel-bundle-task (p. 301) • ec2-describe-image-attribute (p. 131) • ec2-deregister (p. 735) Bundle Tasks • ec2-bundle-instance (p. 89) • ec2-describe-bundle-tasks (p. 3) • Setting Up the CLI Tools (Windows) (p. 635) • ec2-register (p. Amazon EBS. 10) Account Attributes • ec2-describe-account-attributes (p. For more information. 110) • ec2-create-image (p. 106) AMIs • ec2-copy-image (p. 356) • ec2-migrate-image (p. you must download and configure them. Amazon Elastic Compute Cloud CLI Reference List of Commands by Function The Amazon EC2 CLI includes commands for Amazon EC2. 630) • ec2-modify-image-attribute (p. 304) AWS Marketplace • ec2-confirm-product-instance (p. Before you can start using the tools. 351) • ec2-describe-images (p. and Amazon VPC. see the following topics: • Setting Up the CLI Tools (Linux and Mac OS X) (p.

228) • ec2-describe-dhcp-options (p. 524) • ec2-detach-classic-link-vpc (p. 513) • ec2-describe-volume-status (p. 468) • ec2-describe-volume-attribute (p. 663) • ec2-reset-snapshot-attribute (p. 231) • ec2-delete-snapshot (p. 464) • ec2-describe-snapshots (p. 507) • ec2-detach-volume (p. 570) • ec2-enable-volume-io (p. 331) DHCP Options (Amazon VPC) • ec2-associate-dhcp-options (p. 581) • ec2-enable-vpc-classic-link (p. 597) Customer Gateways (Amazon VPC) • ec2-create-customer-gateway (p. 38) • ec2-associate-address (p. 336) Elastic Block Store • ec2-attach-volume (p. 114) • ec2-create-snapshot (p. 224) • ec2-describe-customer-gateways (p. 119) • ec2-delete-customer-gateway (p. 194) • ec2-delete-disk-image (p. 307) 25 . Amazon Elastic Compute Cloud CLI Reference ClassicLink • ec2-attach-classic-link-vpc (p. 69) • ec2-copy-snapshot (p. 46) • ec2-describe-addresses (p. 51) • ec2-create-dhcp-options (p. 123) • ec2-delete-dhcp-options (p. 594) • ec2-modify-snapshot-attribute (p. 179) • ec2-create-volume (p. 58) • ec2-describe-classic-link-instances (p. 656) • ec2-modify-volume-attribute (p. 323) • ec2-describe-vpc-classic-link (p. 745) Elastic IP Addresses • ec2-allocate-address (p. 278) • ec2-describe-snapshot-attribute (p. 560) • ec2-disable-vpc-classic-link (p. 265) • ec2-delete-volume (p. 504) • ec2-describe-volumes (p.

696) Elastic Network Interfaces (Amazon VPC) • ec2-assign-private-ip-addresses (p. 779) • ec2-terminate-instances (p. 394) • ec2-detach-internet-gateway (p. 365) • ec2-describe-instance-status (p. 242) • ec2-describe-keypairs (p. 239) • ec2-describe-internet-gateways (p. 608) • ec2-modify-instance-attribute (p. 563) Key Pairs • ec2-create-keypair (p. 783) Internet Gateways (Amazon VPC) • ec2-attach-internet-gateway (p. 640) • ec2-reboot-instances (p. 65) • ec2-create-network-interface (p. 378) • ec2-get-console-output (p. 742) • ec2-unassign-private-ip-addresses (p. 603) • ec2-get-password (p. 738) • ec2-run-instances (p. 62) • ec2-create-internet-gateway (p. 252) • ec2-describe-network-interfaces (p. Amazon Elastic Compute Cloud CLI Reference • ec2-disassociate-address (p. 371) • ec2-describe-instances (p. 647) • ec2-reset-network-interface-attribute (p. 584) • ec2-release-address (p. 681) • ec2-reset-instance-attribute (p. 142) • ec2-delete-internet-gateway (p. 145) • ec2-delete-keypair (p. 620) 26 . 41) • ec2-attach-network-interface (p. 409) • ec2-detach-network-interface (p. 413) • ec2-describe-network-interface-attribute (p. 786) Instances • ec2-describe-instance-attribute (p. 158) • ec2-delete-network-interface (p. 775) • ec2-stop-instances (p. 760) • ec2-start-instances (p. 600) • ec2-import-keypair (p. 567) • ec2-modify-network-interface-attribute (p. 399) • ec2-fingerprint-key (p.

450) • ec2-modify-reserved-instances (p. 153) • ec2-delete-network-acl (p. 166) • ec2-describe-reserved-instances (p. 458) • ec2-disable-vgw-route-propagation (p. 790) Network ACLs (Amazon VPC) • ec2-create-network-acl (p. 245) • ec2-delete-network-acl-entry (p. 578) • ec2-disassociate-route-table (p. 588) • ec2-enable-vgw-route-propagation (p. 700) • ec2-replace-network-acl-entry (p. 703) Placement Groups • ec2-create-placement-group (p. Amazon Elastic Compute Cloud CLI Reference Monitoring • ec2-monitor-instances (p. 591) 27 . 163) • ec2-delete-placement-group (p. 421) Regions and Availability Zones • ec2-describe-availability-zones (p. 429) Reserved Instances • ec2-cancel-reserved-instances-listing (p. 248) • ec2-describe-network-acls (p. 255) • ec2-describe-placement-groups (p. 176) • ec2-delete-route (p. 313) • ec2-describe-regions (p. 99) • ec2-create-reserved-instances-listing (p. 440) • ec2-describe-reserved-instances-modifications (p. 433) • ec2-describe-reserved-instances-listings (p. 54) • ec2-create-route (p. 678) Route Tables (Amazon VPC) • ec2-associate-route-table (p. 674) • ec2-unmonitor-instances (p. 262) • ec2-describe-route-tables (p. 171) • ec2-create-route-table (p. 444) • ec2-describe-reserved-instances-offerings (p. 149) • ec2-create-network-acl-entry (p. 258) • ec2-delete-route-table (p. 652) • ec2-purchase-reserved-instances-offering (p. 403) • ec2-replace-network-acl-association (p.

274) • ec2-describe-tags (p. 231) • ec2-describe-conversion-tasks (p. 191) • ec2-delete-tags (p. 92) • ec2-delete-disk-image (p. 271) • ec2-describe-subnets (p. 328) • ec2-import-instance (p. 127) • ec2-delete-group (p. 475) • ec2-describe-spot-instance-requests (p. 76) • ec2-create-group (p. Amazon Elastic Compute Cloud CLI Reference • ec2-replace-route (p. 611) • ec2-import-volume (p. 268) • ec2-describe-spot-datafeed-subscription (p. 187) • ec2-delete-subnet (p. 499) VM Import • ec2-cancel-conversion-task (p. 345) • ec2-revoke (p. 623) • ec2-resume-import (p. 235) • ec2-describe-group (p. 660) Tags • ec2-create-tags (p. 713) Security Groups • ec2-authorize (p. 708) • ec2-replace-route-table-association (p. 96) • ec2-create-instance-export-task (p. 341) 28 . 138) • ec2-describe-export-tasks (p. 753) Spot Instances • ec2-cancel-spot-instance-requests (p. 478) • ec2-describe-spot-price-history (p. 493) • ec2-modify-subnet-attribute (p. 721) Subnets (Amazon VPC) • ec2-create-subnet (p. 749) VM Export • ec2-cancel-export-task (p. 487) • ec2-request-spot-instances (p. 103) • ec2-create-spot-datafeed-subscription (p. 183) • ec2-delete-spot-datafeed-subscription (p.

294) • ec2-describe-vpn-connections (p. 201) • ec2-delete-vpc (p. 285) • ec2-describe-prefix-lists (p. 670) VPC Peering Connections (Amazon VPC) • ec2-accept-vpc-peering-connection (p. 693) VPN Connections (Amazon VPC) • ec2-create-vpn-connection (p. 213) • ec2-create-vpn-connection-route (p. 73) • ec2-create-vpn-gateway (p. Amazon Elastic Compute Cloud CLI Reference VPCs (Amazon VPC) • ec2-create-vpc (p. 221) • ec2-delete-vpn-gateway (p. 529) • ec2-describe-vpc-endpoint-services (p. 667) VPC Endpoints (Amazon VPC) • ec2-create-vpc-endpoint (p. 554) • ec2-detach-vpn-gateway (p. 520) • ec2-describe-vpcs (p. 204) • ec2-delete-vpc-endpoints (p. 297) • ec2-describe-vpn-gateways (p. 218) • ec2-delete-vpn-connection (p. 536) • ec2-reject-vpc-peering-connection (p. 288) • ec2-describe-vpc-peering-connections (p. 291) • ec2-delete-vpn-connection-route (p. 281) • ec2-describe-vpc-attribute (p. 543) • ec2-modify-vpc-attribute (p. 548) Virtual Private Gateways (Amazon VPC) • ec2-attach-vpn-gateway (p. 34) • ec2-create-vpc-peering-connection (p. 533) • ec2-modify-vpc-endpoint (p. 574) 29 . 209) • ec2-delete-vpc-peering-connection (p. 425) • ec2-describe-vpc-endpoints (p.

For more information. 54) • ec2-attach-classic-link-vpc (p. 69) • ec2-attach-vpn-gateway (p. route tables. subnets. and Internet gateways). 10) Topics • ec2-accept-vpc-peering-connection (p. 73) • ec2-authorize (p. 83) • ec2-cancel-bundle-task (p. 51) • ec2-associate-route-table (p. 46) • ec2-associate-dhcp-options (p. see the following topics: • Setting Up the CLI Tools (Linux and Mac OS X) (p. 96) • ec2-cancel-reserved-instances-listing (p. 3) • Setting Up the CLI Tools (Windows) (p. 92) • ec2-cancel-export-task (p. 58) • ec2-attach-internet-gateway (p. security groups. 76) • ec2-bundle-instance (p. and volumes) and your Amazon VPC resources (such as VPCs. 38) • ec2-assign-private-ip-addresses (p. 62) • ec2-attach-network-interface (p. you must download and configure them. 34) • ec2-allocate-address (p. Amazon Elastic Compute Cloud CLI Reference Commands (CLI Tools) You can use the CLI tools to manage your Amazon EC2 resources (such as instances. Before you can start using the tools. 99) 30 . 65) • ec2-attach-volume (p. 89) • ec2-cancel-conversion-task (p. 41) • ec2-associate-address (p.

224) • ec2-delete-dhcp-options (p. 110) • ec2-copy-snapshot (p. 183) • ec2-create-subnet (p. 252) • ec2-delete-placement-group (p. 248) • ec2-delete-network-interface (p. 235) • ec2-delete-internet-gateway (p. 179) • ec2-create-spot-datafeed-subscription (p. 204) • ec2-create-vpc-peering-connection (p. Amazon Elastic Compute Cloud CLI Reference • ec2-cancel-spot-instance-requests (p. 255) • ec2-delete-route (p. 187) • ec2-create-tags (p. 209) • ec2-create-vpn-connection (p. 228) • ec2-delete-disk-image (p. 153) • ec2-create-network-interface (p. 131) • ec2-create-instance-export-task (p. 103) • ec2-confirm-product-instance (p. 201) • ec2-create-vpc-endpoint (p. 158) • ec2-create-placement-group (p. 176) • ec2-create-snapshot (p. 106) • ec2-copy-image (p. 119) • ec2-create-dhcp-options (p. 142) • ec2-create-keypair (p. 163) • ec2-create-reserved-instances-listing (p. 245) • ec2-delete-network-acl-entry (p. 213) • ec2-create-vpn-connection-route (p. 149) • ec2-create-network-acl-entry (p. 258) • ec2-delete-route-table (p. 242) • ec2-delete-network-acl (p. 239) • ec2-delete-keypair (p. 191) • ec2-create-volume (p. 171) • ec2-create-route-table (p. 114) • ec2-create-customer-gateway (p. 166) • ec2-create-route (p. 138) • ec2-create-internet-gateway (p. 145) • ec2-create-network-acl (p. 127) • ec2-create-image (p. 231) • ec2-delete-group (p. 262) 31 . 218) • ec2-create-vpn-gateway (p. 221) • ec2-delete-customer-gateway (p. 123) • ec2-create-group (p. 194) • ec2-create-vpc (p.

336) • ec2-describe-export-tasks (p. 288) • ec2-delete-vpn-connection (p. 345) • ec2-describe-image-attribute (p. 285) • ec2-delete-vpc-peering-connection (p. 403) • ec2-describe-network-interface-attribute (p. 265) • ec2-delete-spot-datafeed-subscription (p. 421) • ec2-describe-prefix-lists (p. 323) • ec2-describe-conversion-tasks (p. 440) • ec2-describe-reserved-instances-modifications (p. 356) • ec2-describe-instance-attribute (p. 278) • ec2-delete-vpc (p. 444) • ec2-describe-reserved-instances-offerings (p. 268) • ec2-delete-subnet (p. 399) • ec2-describe-network-acls (p. Amazon Elastic Compute Cloud CLI Reference • ec2-delete-snapshot (p. 450) • ec2-describe-route-tables (p. 464) 32 . 425) • ec2-describe-regions (p. 458) • ec2-describe-snapshot-attribute (p. 429) • ec2-describe-reserved-instances (p. 378) • ec2-describe-internet-gateways (p. 409) • ec2-describe-network-interfaces (p. 274) • ec2-delete-volume (p. 328) • ec2-describe-customer-gateways (p. 304) • ec2-describe-addresses (p. 307) • ec2-describe-availability-zones (p. 365) • ec2-describe-instance-status (p. 331) • ec2-describe-dhcp-options (p. 371) • ec2-describe-instances (p. 291) • ec2-delete-vpn-connection-route (p. 351) • ec2-describe-images (p. 271) • ec2-delete-tags (p. 433) • ec2-describe-reserved-instances-listings (p. 294) • ec2-delete-vpn-gateway (p. 318) • ec2-describe-classic-link-instances (p. 281) • ec2-delete-vpc-endpoints (p. 297) • ec2-deregister (p. 341) • ec2-describe-group (p. 413) • ec2-describe-placement-groups (p. 394) • ec2-describe-keypairs (p. 313) • ec2-describe-bundle-tasks (p. 301) • ec2-describe-account-attributes (p.

584) • ec2-disassociate-route-table (p. 623) • ec2-migrate-image (p. 513) • ec2-describe-vpc-attribute (p. 543) • ec2-describe-vpn-connections (p. 533) • ec2-describe-vpc-peering-connections (p. 591) • ec2-enable-volume-io (p. 536) • ec2-describe-vpcs (p. 581) • ec2-disassociate-address (p. 635) • ec2-modify-instance-attribute (p. 660) 33 . 487) • ec2-describe-subnets (p. 600) • ec2-get-console-output (p. 608) • ec2-import-instance (p. 652) • ec2-modify-snapshot-attribute (p. 647) • ec2-modify-reserved-instances (p. 640) • ec2-modify-network-interface-attribute (p. 507) • ec2-describe-volumes (p. 548) • ec2-describe-vpn-gateways (p. 560) • ec2-detach-internet-gateway (p. 578) • ec2-disable-vpc-classic-link (p. 563) • ec2-detach-network-interface (p. 504) • ec2-describe-volume-status (p. 603) • ec2-get-password (p. 630) • ec2-modify-image-attribute (p. Amazon Elastic Compute Cloud CLI Reference • ec2-describe-snapshots (p. 574) • ec2-disable-vgw-route-propagation (p. 524) • ec2-describe-vpc-endpoints (p. 493) • ec2-describe-tags (p. 594) • ec2-enable-vpc-classic-link (p. 468) • ec2-describe-spot-datafeed-subscription (p. 567) • ec2-detach-volume (p. 570) • ec2-detach-vpn-gateway (p. 478) • ec2-describe-spot-price-history (p. 597) • ec2-fingerprint-key (p. 656) • ec2-modify-subnet-attribute (p. 499) • ec2-describe-volume-attribute (p. 529) • ec2-describe-vpc-endpoint-services (p. 475) • ec2-describe-spot-instance-requests (p. 554) • ec2-detach-classic-link-vpc (p. 588) • ec2-enable-vgw-route-propagation (p. 620) • ec2-import-volume (p. 611) • ec2-import-keypair (p. 520) • ec2-describe-vpc-classic-link (p.

Use the ec2-describe-vpc- peering-connections (p. 693) • ec2-release-address (p. 760) • ec2-start-instances (p. 783) • ec2-unassign-private-ip-addresses (p. To accept a request. the VPC peering connection must be in the pending-acceptance state. 700) • ec2-replace-network-acl-entry (p. 745) • ec2-resume-import (p. 738) • ec2-reset-network-interface-attribute (p. 775) • ec2-stop-instances (p. 797) • Common Options for CLI Tools (p. 674) • ec2-purchase-reserved-instances-offering (p. Amazon Elastic Compute Cloud CLI Reference ec2-accept-vpc-peering-connection • ec2-modify-volume-attribute (p. 536) command to view your outstanding VPC peering connection requests. 793) • ec2-version (p. The short version of this command is ec2apcx. 800) ec2-accept-vpc-peering-connection Description Accepts a VPC peering connection request. 34 . 681) • ec2-register (p. 670) • ec2-monitor-instances (p. 716) • ec2-request-spot-instances (p. 713) • ec2-report-instance-status (p. 753) • ec2-run-instances (p. 708) • ec2-replace-route-table-association (p. 667) • ec2-modify-vpc-endpoint (p. 735) • ec2-reset-instance-attribute (p. and you must be the owner of the peer VPC. 703) • ec2-replace-route (p. 684) • ec2-reject-vpc-peering-connection (p. 779) • ec2-terminate-instances (p. 696) • ec2-replace-network-acl-association (p. 790) • ec2-upload-disk-image (p. 742) • ec2-reset-snapshot-attribute (p. see accept-vpc-peering-connection instead. Tip If you are using the AWS CLI. 663) • ec2-modify-vpc-attribute (p. 678) • ec2-reboot-instances (p. 786) • ec2-unmonitor-instances (p. 721) • ec2-reset-image-attribute (p. 749) • ec2-revoke (p.

Default: The region specified by the EC2_URL environment variable. or https://ec2. and the URL specified by the -U option.com if EC2_URL isn't set. Default: The value of the AWS_ACCESS_KEY environment variable. Type: String Default: None Required: Yes Example: pcx-1a2b3c4d Common Options Option Description --region region The region. --security-token The delegation token to pass along to the AWS request. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. see Tell the Tools Who aws_access_key_id You Are. Amazon Elastic Compute Cloud CLI Reference Syntax Syntax ec2-accept-vpc-peering-connection vpc_peering_connection Options Name Description vpc_peering_connection The VPC peering connection ID. or us-east-1 if EC2_URL isn't set.amazonaws. --aws-secret-key Your secret access key. you must specify this option. 35 . If AWS_SECRET_KEY isn't set. Example: -U https://ec2. see Using Temporary Security Credentials. the region specified by the EC2_URL environment variable.eu-west-1amazonaws. If AWS_ACCESS_KEY isn't set. Example: --region eu-west-1 -U. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Overrides the default region. For more information. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. --aws-access-key Your access key ID. Example: -O AKIAIOSFODNN7EXAMPLE -W. you must specify this option. Default: The endpoint specified by the EC2_URL environment variable. For more information.com -O. This is only delegation_token required when you are using temporary security credentials.

--cert ec2_cert The X. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. see SOAP Requests. --show-empty-fields Shows empty columns as (nil). Default: The value of the EC2_CERT environment variable. in seconds. --aws-access-key) and secret access key (-W. 36 .<remainder of security token> --connection-timeout timeout The connection timeout. For more information. --cert) options are not supported. Example: --connection-timeout 30 --request-timeout timeout The request timeout. the command returns DryRunOperation. the private key (-K. --auth-dry-run Checks whether you have the required permissions for the command. Deprecated Options We have deprecated the SOAP API for Amazon EC2.0 onwards of the Amazon EC2 CLI tools. in seconds. For more information. --headers Includes column headers in the command output. -h Displays usage information for the command. it returns UnauthorizedOperation. Option Description -K. --private-key) and X. Example: -T AQoDYXdzEJr. without actually running the command. Reads arguments from standard input. This is useful when piping the output from one command to the input of another. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.6. including the API request and response on the command line. --hide-tags Omits tags for tagged resources. This is useful if you are building tools to talk directly to the Query API. If you have the required permissions. -D. --aws-secret-key) instead. otherwise... -v.509 certificate (-C. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Example: --request-timeout 45 -H. --help. see Setting Up the Amazon EC2 CLI. This can assist us when helping you troubleshooting problems.509 certificate to use when constructing requests to Amazon EC2. .14. From version 1. --debug Displays internal debugging information. --verbose Displays verbose output. --private-key The private key to use when constructing requests to Amazon EC2.pem -C. Use your access key ID (-O.

0. Examples Example 1 This example accepts the specified VPC peering connection request. PROMPT> ec2-accept-vpc-peering-connection pcx-1a2b3c4d VPCPEERINGCONNECTION pcx-1a2b3c4d provisioning: Provisioning REQUESTERVPCINFO vpc-111abc45 10.pem Output This command returns a table that contains the following information: • The VPC peering connection information • The VPCPEERINGCONNECTION identifier • The VPC peering connection ID • The status of the VPC peering connection request • The requester VPC information • The REQUESTERVPCINFO identifier • The VPC ID • The CIDR block • The AWS account ID • The peer VPC information • The ACCEPTERVPCINFO identifier • The VPC ID • The CIDR block • The AWS account ID Amazon EC2 command line tools display errors on stderr. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. 3) • Setting Up the CLI Tools (Windows) (p.0. 37 . Amazon Elastic Compute Cloud CLI Reference Output Option Description Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.0.1.0/28 444455556666 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.0/28 444455556666 ACCEPTERVPCINFO vpc-44455566 10. For more information. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.

693) • ec2-create-route (p. Syntax ec2-allocate-address [-d domain] Options Name Description -d. 708) ec2-allocate-address Description Acquires an Elastic IP address. An Elastic IP address is for use either in the EC2-Classic platform or in a VPC. Required: Conditional Condition: Required when allocating the address for use in a VPC. Tip If you are using the AWS CLI. 209) • ec2-reject-vpc-peering-connection (p. see allocate-address instead. Amazon Elastic Compute Cloud CLI Reference ec2-allocate-address Related Action • AcceptVpcPeeringConnection Related Commands • ec2-delete-vpc-peering-connection (p. --domain domain Set to vpc to allocate the address for use with instances in a VPC. The short version of this command is ec2allocaddr. 171) • ec2-replace-route (p. Example: -d vpc 38 . 288) • ec2-describe-vpc-peering-connections (p. 536) • ec2-create-vpc-peering-connection (p. Type: String Valid values: vpc Default: The address is for use in EC2-Classic. For more information. see Elastic IP Addresses in the Amazon EC2 User Guide for Linux Instances.

Example: -T AQoDYXdzEJr.amazonaws. --hide-tags Omits tags for tagged resources. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Overrides the default region. Default: The endpoint specified by the EC2_URL environment variable.<remainder of security token> --connection-timeout timeout The connection timeout. or https://ec2. --show-empty-fields Shows empty columns as (nil). If AWS_SECRET_KEY isn't set. see Tell the Tools Who aws_access_key_id You Are.com if EC2_URL isn't set. Example: --region eu-west-1 -U. Example: --connection-timeout 30 --request-timeout timeout The request timeout. in seconds. in seconds. Default: The region specified by the EC2_URL environment variable. and the URL specified by the -U option. If AWS_ACCESS_KEY isn't set. --headers Includes column headers in the command output. or us-east-1 if EC2_URL isn't set. Default: The value of the AWS_ACCESS_KEY environment variable. see Using Temporary Security Credentials. --security-token The delegation token to pass along to the AWS request. Example: -U https://ec2.com -O. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set).. --aws-access-key Your access key ID. --aws-secret-key Your secret access key. This is only delegation_token required when you are using temporary security credentials. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. the region specified by the EC2_URL environment variable. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region. Example: -O AKIAIOSFODNN7EXAMPLE -W. For more information.eu-west-1amazonaws.. you must specify this option. you must specify this option. Example: --request-timeout 45 -H. For more information. 39 .

including the API request and response on the command line. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?.6. Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information. -D. Use your access key ID (-O. otherwise. --auth-dry-run Checks whether you have the required permissions for the command. see SOAP Requests.pem Output This command returns a table that contains the following information: • The ADDRESS identifier • The Elastic IP address for use with your account • Indicates whether this Elastic IP address is for use with instances in EC2-Classic (standard) or instances in a VPC (vpc). ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --aws-secret-key) instead. Default: The value of the EC2_CERT environment variable. without actually running the command.0 onwards of the Amazon EC2 CLI tools. If you have the required permissions. the command returns DryRunOperation. the private key (-K. For more information. --cert) options are not supported. --aws-access-key) and secret access key (-W.14. Reads arguments from standard input. Option Description -K. This can assist us when helping you troubleshooting problems. From version 1. -v. This is useful if you are building tools to talk directly to the Query API. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. -h Displays usage information for the command. --verbose Displays verbose output. --cert ec2_cert The X. Deprecated Options We have deprecated the SOAP API for Amazon EC2.509 certificate to use when constructing requests to Amazon EC2. --private-key) and X. This is useful when piping the output from one command to the input of another. --help.509 certificate (-C. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. see Setting Up the Amazon EC2 CLI. it returns UnauthorizedOperation. For more information. --private-key The private key to use when constructing requests to Amazon EC2. • [EC2-VPC] The allocation ID (an ID that Amazon EC2 assigns to represent the allocation of an address for use in a VPC) 40 . .pem -C.

3) • Setting Up the CLI Tools (Windows) (p. 584) • ec2-release-address (p. 696) ec2-assign-private-ip-addresses Description Assigns one or more secondary private IP addresses to the specified network interface.51. see Private IP Addresses Per ENI Per Instance Type and Elastic IP Addresses in the Amazon EC2 User Guide for Linux Instances. 41 . PROMPT> ec2-allocate-address ADDRESS 192.1 vpc eipalloc-5723d13e Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.100. For more information. 307) • ec2-disassociate-address (p.2.0.1 standard Example 2 This example command allocates an Elastic IP address for use with instances in a VPC. The number of secondary IP addresses that you can assign to an instance varies by instance type. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. Amazon Elastic Compute Cloud CLI Reference Examples Amazon EC2 command line tools display errors on stderr. You can specify one or more specific secondary IP addresses. Related Action • AllocateAddress Related Commands • ec2-associate-address (p. PROMPT> ec2-allocate-address -d vpc ADDRESS 198. For more information. or you can specify the number of secondary IP addresses to be automatically assigned within the subnet's CIDR block range. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. Examples Example 1 This example command allocates an Elastic IP address for use with instances in EC2-Classic. 46) • ec2-describe-addresses (p.

This option can be used multiple times to assign multiple secondary IP addresses to the network interface.28 -secondary-private-ip-address. Example: --secondary-private-ip-address-count 2 42 . interface_id Type: String Default: None Required: Yes Example: -n eni-bc7299d4 -secondary-private-ip-address The IP address to be assigned as a secondary private IP ip_address address to the network interface. Amazon Elastic Compute Cloud CLI Reference Syntax The short version of this command is ec2apip. If you don't specify an IP address. Syntax ec2-assign-private-ip-addresses --network-interface interface_id {[--secondary-private-ip- address-count count] | [--secondary-private-ip-address ip_address]} Options Name Description -n. Example: --secondary-private-ip-address 10.2. Tip If you are using the AWS CLI. Amazon EC2 selects an IP address within the subnet range.2. Type: Integer Default: None Required: Conditional Condition: You can't specify this parameter when also specifying --secondary-private-ip-address. see assign-private-ip-addresses instead. Type: String Default: None Required: Conditional Condition: You can't specify this parameter when also specifying --secondary-private-ip-address-count.0. The number of secondary IP addresses to assign to the count count network interface. --network-interface The ID of the network interface.0.18 -- secondary-private-ip-address 10.

amazonaws. you must specify this option. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). For more information. For more information. This is only delegation_token required when you are using temporary security credentials. and the URL specified by the -U option. Overrides the default region. Example: --region eu-west-1 -U. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description --allow-reassignment Specifies whether to allow an IP address that is already assigned to another network interface to be reassigned to the specified network interface. see Using Temporary Security Credentials. If AWS_SECRET_KEY isn't set. Example: -U https://ec2. Default: The value of the AWS_ACCESS_KEY environment variable. Example: -O AKIAIOSFODNN7EXAMPLE -W. you must specify this option..com if EC2_URL isn't set. or us-east-1 if EC2_URL isn't set. the region specified by the EC2_URL environment variable.eu-west-1amazonaws.<remainder of security token> 43 . --security-token The delegation token to pass along to the AWS request.. --aws-access-key Your access key ID. Example: -T AQoDYXdzEJr. Type: Boolean Default: false Required: No Common Options Option Description --region region The region. If AWS_ACCESS_KEY isn't set. Default: The region specified by the EC2_URL environment variable. or https://ec2. --aws-secret-key Your secret access key.com -O. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Default: The endpoint specified by the EC2_URL environment variable. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. see Tell the Tools Who aws_access_key_id You Are. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable.

This is useful when piping the output from one command to the input of another. Example: --request-timeout 45 -H. including the API request and response on the command line. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description --connection-timeout timeout The connection timeout. otherwise. . in seconds. it returns UnauthorizedOperation. -h Displays usage information for the command. --private-key) and X. the command returns DryRunOperation. Example: --connection-timeout 30 --request-timeout timeout The request timeout. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. see Setting Up the Amazon EC2 CLI. This is useful if you are building tools to talk directly to the Query API. This can assist us when helping you troubleshooting problems.0 onwards of the Amazon EC2 CLI tools. --show-empty-fields Shows empty columns as (nil). --cert ec2_cert The X. --verbose Displays verbose output. If you have the required permissions. -D. Reads arguments from standard input. the private key (-K. --help. -v. --headers Includes column headers in the command output. Option Description -K. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Use your access key ID (-O. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --aws-secret-key) instead. From version 1.pem 44 .509 certificate to use when constructing requests to Amazon EC2. without actually running the command.14. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?.pem -C. Deprecated Options We have deprecated the SOAP API for Amazon EC2. For more information. Default: The value of the EC2_CERT environment variable.509 certificate (-C.6. --debug Displays internal debugging information. --aws-access-key) and secret access key (-W. --auth-dry-run Checks whether you have the required permissions for the command. --cert) options are not supported. For more information. see SOAP Requests. in seconds. --hide-tags Omits tags for tagged resources. --private-key The private key to use when constructing requests to Amazon EC2.

Related Action • AssignPrivateIpAddresses 45 .0. PROMPT> ec2-assign-private-ip-addresses --network-interface eni-c08a35a9 --secondary-private-ip-address 10.82 RETURN true Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Amazon Elastic Compute Cloud CLI Reference Output Output The command returns true if the operation succeeds or an error if the operation does not succeed.0.119 RETURN true Example 2 This example command assigns two secondary private IP addresses to the network interface eni- c08a35a9.82 to the network interface eni-73e05a1. Amazon EC2 command line tools display errors on stderr.0. For more information. PROMPT> ec2-assign-private-ip-addresses --network-interface eni-c08a35a9 --secondary-private-ip-address-count 2 RETURN true Example 3 This example command assigns a secondary private IP address of 10. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.0. 3) • Setting Up the CLI Tools (Windows) (p.119) to the network interface eni-c08a35a9. Amazon EC2 automatically assigns these IP addresses from the available IP addresses within the subnet's CIDR block range.118 --secondary-private-ip-address 10. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.118 and 10.0.0.0.0. PROMPT> ec2-assign-private-ip-addresses --network-interface eni-73e05a1 --secondary-private-ip-address 10. Examples Example 1 This example command assigns two secondary private IP addresses (10.0.0.0.0.

you can specify either an instance ID or a network interface ID. but not both. This is an idempotent operation. Type: String Default: None Required: Conditional Condition: Required for EC2-Classic. [EC2-Classic. see associate-address instead. If the Elastic IP address is already associated with a different instance or a network interface. it is disassociated from that instance and associated with the specified instance. Example: -i i-43a4412a ip_address The Elastic IP address. --instance instance_id The ID of the instance. 786) ec2-associate-address Description Associates an Elastic IP address with an instance or a network interface. Tip If you are using the AWS CLI. see Elastic IP Addresses in the Amazon EC2 User Guide for Linux Instances. Type: String Default: None Required: Conditional 46 . [VPC in an EC2-Classic account] If you do not specify a private IP address. Syntax ec2-associate-address [-i instance_id | -n interface_id] [ip_address | -a allocation_id] [--private-ip-address private_ip_address] [--allow-reassociation] Options Name Description -i. Amazon EC2 doesn't return an error. the Elastic IP address is associated with the primary IP address. For more information. you get an error unless you specify the --allow-reassociation option. The short version of this command is ec2assocaddr. Amazon Elastic Compute Cloud CLI Reference ec2-associate-address Related Commands • ec2-unassign-private-ip-addresses (p. VPC in an EC2-VPC-only account] If the Elastic IP address is already associated with a different instance. If you perform the operation more than once. For EC2-VPC.

Example: -a eipalloc-5723d13e -n. Type: Boolean Default: The operation fails if the address is already associated.45 --allow-reassociation [EC2-VPC] Allows an Elastic IP address that is already associated with an instance or a network interface to be re- associated with the specified instance or network interface. Otherwise. --private-ip-address [EC2-VPC] The primary or secondary private IP address to private_ip_address associate with the Elastic IP address. Example: 192. If no private IP address is specified. Association fails interface_id when specifying an instance ID unless exactly one interface is attached. Type: String Default: None Required: Conditional Condition: Required for EC2-VPC.1 -a. --network-interface [EC2-VPC] The ID of the network interface. Amazon Elastic Compute Cloud CLI Reference Options Name Description Condition: Required for EC2-Classic.0. the operation fails. Required: No Example: --allow-reassociation 47 .0. Type: String Default: None Required: No Example: -p 10.0.2. Type: String Default: None Required: Conditional Condition: If the instance has more than one network interface. you must specify a network interface ID. the Elastic IP address is associated with the primary private IP address. --allocation-id allocation_id [EC2-VPC] The allocation ID. Example: -n eni-bc7299d4 -p.

eu-west-1amazonaws. Example: --request-timeout 45 -H. or us-east-1 if EC2_URL isn't set. --show-empty-fields Shows empty columns as (nil). Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region. For more information. This is only delegation_token required when you are using temporary security credentials.amazonaws. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Overrides the default region. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. If AWS_ACCESS_KEY isn't set. see Tell the Tools Who aws_access_key_id You Are. in seconds. Default: The value of the AWS_ACCESS_KEY environment variable. --aws-secret-key Your secret access key. --security-token The delegation token to pass along to the AWS request. If AWS_SECRET_KEY isn't set. 48 .com -O. For more information. --aws-access-key Your access key ID.<remainder of security token> --connection-timeout timeout The connection timeout. Example: -O AKIAIOSFODNN7EXAMPLE -W. you must specify this option.com if EC2_URL isn't set. you must specify this option. see Using Temporary Security Credentials.. Example: -T AQoDYXdzEJr. and the URL specified by the -U option. Default: The region specified by the EC2_URL environment variable. --hide-tags Omits tags for tagged resources. Example: -U https://ec2. in seconds. --headers Includes column headers in the command output. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Default: The endpoint specified by the EC2_URL environment variable. Example: --connection-timeout 30 --request-timeout timeout The request timeout. the region specified by the EC2_URL environment variable. or https://ec2.. Example: --region eu-west-1 -U.

Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. --cert ec2_cert The X. see SOAP Requests. This is useful if you are building tools to talk directly to the Query API. Reads arguments from standard input. the command returns DryRunOperation. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --aws-secret-key) instead. This is useful when piping the output from one command to the input of another. From version 1. Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information.509 certificate to use when constructing requests to Amazon EC2. --private-key) and X. -h Displays usage information for the command. --auth-dry-run Checks whether you have the required permissions for the command. -v. 49 . --cert) options are not supported. For more information. Use your access key ID (-O. --private-key The private key to use when constructing requests to Amazon EC2. without actually running the command. the private IP address associated with the Elastic IP address Amazon EC2 command line tools display errors on stderr. Option Description -K. --help.pem Output This command returns a table that contains the following information: • The ADDRESS identifier • The Elastic IP address • The instance or network interface to which the Elastic IP address is associated • [EC2-VPC] The allocation ID • [EC2-VPC] If specified. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. otherwise. including the API request and response on the command line. Deprecated Options We have deprecated the SOAP API for Amazon EC2. For more information.14. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. -D. Default: The value of the EC2_CERT environment variable.6. This can assist us when helping you troubleshooting problems. it returns UnauthorizedOperation. see Setting Up the Amazon EC2 CLI.509 certificate (-C.0 onwards of the Amazon EC2 CLI tools. --aws-access-key) and secret access key (-W. --verbose Displays verbose output.pem -C. If you have the required permissions. . the private key (-K.

PROMPT> ec2-associate-address -a eipalloc-5723d13e -i i-4fd2431a ADDRESS i-43a4412a eipalloc-5723d13e eipassoc-fc5ca095 Example 3 This example command associates an Elastic IP address with a network interface.0 -i i-43a4412a ADDRESS 203. The allow-reassociation option allows the Elastic IP address to be associated with the specified instance even if it's already associated with a different instance or a network interface.0.85 --allow- reassociation ADDRESS i-ba6a0dee eipalloc-bf66dcd6 eipassoc-9c66dcf5 10.0.0 i-43a4412a Example 2 This example command associates an Elastic IP address with an instance in a VPC. Amazon Elastic Compute Cloud CLI Reference Examples Examples Example 1 This example command associates an Elastic IP address with an instance in EC2-Classic. PROMPT> ec2-associate-address -a eipalloc-4a4c6c23 -n eni-1001fa78 ADDRESS i-1ae1ae78 eipalloc-4a4c6c23 eipassoc-1841907a Example 4 This example command associates an Elastic IP address with a private IP address for the specified instance in a VPC.113. PROMPT> ec2-associate-address 203. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.0.0.0. For more information.85 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. PROMPT> ec2-associate-address -a eipalloc-bf66dcd6 -i i-ba6a0dee -p 10.0.113. Related Action • AssociateAddress 50 . 10) IAM Policies You can create an IAM policy to grant users permission to use this command. 3) • Setting Up the CLI Tools (Windows) (p.

Amazon Elastic Compute Cloud CLI Reference
ec2-associate-dhcp-options

Related Commands
• ec2-allocate-address (p. 38)
• ec2-describe-addresses (p. 307)
• ec2-disassociate-address (p. 584)
• ec2-release-address (p. 696)

ec2-associate-dhcp-options
Description
Associates a set of DHCP options (that you've previously created) with the specified VPC, or associates no
DHCP options with the VPC.

After you associate the options with the VPC, any existing instances and all new instances that
you launch in that VPC use the options. You don't need to restart or relaunch the instances. They
automatically pick up the changes within a few hours, depending on how frequently the instance renews
its DHCP lease. You can explicitly renew the lease using the operating system on the instance.

For more information, see DHCP Options Sets in the Amazon VPC User Guide.

The short version of this command is ec2assocdopt.
Tip
If you are using the AWS CLI, see associate-dhcp-options instead.

Syntax
ec2-associate-dhcp-options { dhcp_options_id | default } -c vpc_id

Options
Name Description

dhcp_options_id The ID of the DHCP options set, or default to associate no
DHCP options with the VPC.

Type: String

Default: None

Required: Yes

Example: dopt-7a8b9c2d

-c vpc_id The ID of the VPC.

Type: String

Default: None

Required: Yes

Example: -c vpc-1a2b3c4d

51

Amazon Elastic Compute Cloud CLI Reference
Common Options

Common Options
Option Description

--region region The region. Overrides the default region, the region specified by
the EC2_URL environment variable, and the URL specified by the -U
option.

Default: The region specified by the EC2_URL environment variable,
or us-east-1 if EC2_URL isn't set.

Example: --region eu-west-1

-U, --url url The uniform resource locator (URL) of the Amazon EC2 web service
entry point.

Default: The endpoint specified by the EC2_URL environment
variable, or https://ec2.amazonaws.com if EC2_URL isn't set.

Example: -U https://ec2.eu-west-1amazonaws.com

-O, --aws-access-key Your access key ID. For more information, see Tell the Tools Who
aws_access_key_id You Are.

Default: The value of the AWS_ACCESS_KEY environment variable. If
AWS_ACCESS_KEY isn't set, you must specify this option.

Example: -O AKIAIOSFODNN7EXAMPLE

-W, --aws-secret-key Your secret access key.
aws_secret_access_key
Default: The value of the AWS_SECRET_KEY environment variable. If
AWS_SECRET_KEY isn't set, you must specify this option.

Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

-T, --security-token The delegation token to pass along to the AWS request. This is only
delegation_token required when you are using temporary security credentials. For
more information, see Using Temporary Security Credentials.

Default: The value of the AWS_DELEGATION_TOKEN environment
variable (if set).

Example: -T AQoDYXdzEJr...<remainder of security token>

--connection-timeout timeout The connection timeout, in seconds.

Example: --connection-timeout 30

--request-timeout timeout The request timeout, in seconds.

Example: --request-timeout 45

-H, --headers Includes column headers in the command output.

--show-empty-fields Shows empty columns as (nil).

--hide-tags Omits tags for tagged resources.

52

Amazon Elastic Compute Cloud CLI Reference
Output

Option Description

--debug Displays internal debugging information. This can assist us when
helping you troubleshooting problems.

-D, --auth-dry-run Checks whether you have the required permissions for the
command, without actually running the command. If you have
the required permissions, the command returns DryRunOperation;
otherwise, it returns UnauthorizedOperation.

-v, --verbose Displays verbose output, including the API request and response
on the command line. This is useful if you are building tools to talk
directly to the Query API.

- Reads arguments from standard input. This is useful when piping
the output from one command to the input of another.

Example: ec2-describe-instances | grep stopped | cut -f 2 |
ec2-start-instances -

-?, --help, -h Displays usage information for the command.

Deprecated Options
We have deprecated the SOAP API for Amazon EC2. For more information, see SOAP Requests. From
version 1.6.14.0 onwards of the Amazon EC2 CLI tools, the private key (-K, --private-key) and X.509
certificate (-C, --cert) options are not supported. Use your access key ID (-O, --aws-access-key) and secret
access key (-W, --aws-secret-key) instead. For more information, see Setting Up the Amazon EC2 CLI.

Option Description

-K, --private-key The private key to use when constructing requests to Amazon EC2.
ec2_private_key
Default: The value of the EC2_PRIVATE_KEY environment variable.

Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem

-C, --cert ec2_cert The X.509 certificate to use when constructing requests to Amazon
EC2.

Default: The value of the EC2_CERT environment variable.

Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem

Output
This command returns a table that contains the following information:

• The DHCPOPTIONS identifier
• The ID of the DHCP options (or default if no DHCP options are associated with the VPC)
• The ID of the VPC

Amazon EC2 command line tools display errors on stderr.

53

Amazon Elastic Compute Cloud CLI Reference
Examples

Examples
Example 1
This example command associates the DHCP options set with the ID dopt-7a8b9c2d and the VPC with the
ID vpc-1a2b3c4d.

PROMPT> ec2-associate-dhcp-options dopt-7a8b9c2d -c vpc-1a2b3c4d
DHCPOPTIONS dopt-7a8b9c2d vpc-1a2b3c4d

Example 2
This example command changes the VPC with the ID vpc-1a2b3c4d to have no associated DHCP options
set.

PROMPT> ec2-associate-dhcp-options default -c vpc-1a2b3c4d
DHCPOPTIONS default vpc-1a2b3c4d

Related Topics
Setting Up
• Setting Up the CLI Tools (Linux and Mac OS X) (p. 3)
• Setting Up the CLI Tools (Windows) (p. 10)

IAM Policies

You can create an IAM policy to grant users permission to use this command. For more information, see
IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.

Related Action
• AssociateDhcpOptions

Related Commands
• ec2-create-dhcp-options (p. 123)
• ec2-delete-dhcp-options (p. 228)
• ec2-describe-dhcp-options (p. 336)

ec2-associate-route-table
Description
Associates a subnet with a route table. The subnet and route table must be in the same VPC. This
association causes traffic originating from the subnet to be routed according to the routes in the route
table. The action returns an association ID, which you need in order to disassociate the route table from
the subnet later. A route table can be associated with multiple subnets.

For more information about route tables, see Route Tables in the Amazon VPC User Guide.

54

Amazon Elastic Compute Cloud CLI Reference
Syntax

The short version of this command is ec2assocrtb.
Tip
If you are using the AWS CLI, see associate-route-table instead.

Syntax
ec2-associate-route-table route_table_id -s subnet_id

Options
Name Description

route_table_id The ID of the route table.

Type: String

Default: None

Required: Yes

Example: rtb-6aa34603

-s subnet_id The ID of the subnet.

Type: String

Default: None

Required: Yes

Example: -s subnet-92a045fb

Common Options
Option Description

--region region The region. Overrides the default region, the region specified by
the EC2_URL environment variable, and the URL specified by the -U
option.

Default: The region specified by the EC2_URL environment variable,
or us-east-1 if EC2_URL isn't set.

Example: --region eu-west-1

-U, --url url The uniform resource locator (URL) of the Amazon EC2 web service
entry point.

Default: The endpoint specified by the EC2_URL environment
variable, or https://ec2.amazonaws.com if EC2_URL isn't set.

Example: -U https://ec2.eu-west-1amazonaws.com

-O, --aws-access-key Your access key ID. For more information, see Tell the Tools Who
aws_access_key_id You Are.

55

Amazon Elastic Compute Cloud CLI Reference
Common Options

Option Description
Default: The value of the AWS_ACCESS_KEY environment variable. If
AWS_ACCESS_KEY isn't set, you must specify this option.

Example: -O AKIAIOSFODNN7EXAMPLE

-W, --aws-secret-key Your secret access key.
aws_secret_access_key
Default: The value of the AWS_SECRET_KEY environment variable. If
AWS_SECRET_KEY isn't set, you must specify this option.

Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

-T, --security-token The delegation token to pass along to the AWS request. This is only
delegation_token required when you are using temporary security credentials. For
more information, see Using Temporary Security Credentials.

Default: The value of the AWS_DELEGATION_TOKEN environment
variable (if set).

Example: -T AQoDYXdzEJr...<remainder of security token>

--connection-timeout timeout The connection timeout, in seconds.

Example: --connection-timeout 30

--request-timeout timeout The request timeout, in seconds.

Example: --request-timeout 45

-H, --headers Includes column headers in the command output.

--show-empty-fields Shows empty columns as (nil).

--hide-tags Omits tags for tagged resources.

--debug Displays internal debugging information. This can assist us when
helping you troubleshooting problems.

-D, --auth-dry-run Checks whether you have the required permissions for the
command, without actually running the command. If you have
the required permissions, the command returns DryRunOperation;
otherwise, it returns UnauthorizedOperation.

-v, --verbose Displays verbose output, including the API request and response
on the command line. This is useful if you are building tools to talk
directly to the Query API.

- Reads arguments from standard input. This is useful when piping
the output from one command to the input of another.

Example: ec2-describe-instances | grep stopped | cut -f 2 |
ec2-start-instances -

-?, --help, -h Displays usage information for the command.

56

Amazon Elastic Compute Cloud CLI Reference
Output

Deprecated Options
We have deprecated the SOAP API for Amazon EC2. For more information, see SOAP Requests. From
version 1.6.14.0 onwards of the Amazon EC2 CLI tools, the private key (-K, --private-key) and X.509
certificate (-C, --cert) options are not supported. Use your access key ID (-O, --aws-access-key) and secret
access key (-W, --aws-secret-key) instead. For more information, see Setting Up the Amazon EC2 CLI.

Option Description

-K, --private-key The private key to use when constructing requests to Amazon EC2.
ec2_private_key
Default: The value of the EC2_PRIVATE_KEY environment variable.

Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem

-C, --cert ec2_cert The X.509 certificate to use when constructing requests to Amazon
EC2.

Default: The value of the EC2_CERT environment variable.

Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem

Output
This command returns a table that contains the following information:

• The ASSOCIATION identifier
• The route table association ID (needed to disassociate the route table)
• The ID of the route table

Amazon EC2 command line tools display errors on stderr.

Examples
Example
This example command associates the route-table with the ID rtb-6aa34603 with the subnet with the ID
subnet-92a045fb.

PROMPT> ec2-associate-route-table rtb-6aa34603 -s subnet-92a045fb
ASSOCIATION rtbassoc-61a34608 rtb-6aa34603 subnet-92a045fb

Related Topics
Setting Up
• Setting Up the CLI Tools (Linux and Mac OS X) (p. 3)
• Setting Up the CLI Tools (Windows) (p. 10)

IAM Policies

You can create an IAM policy to grant users permission to use this command. For more information, see
IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.

57

Amazon Elastic Compute Cloud CLI Reference
ec2-attach-classic-link-vpc

Related Action
• AssociateRouteTable

Related Commands
• ec2-create-route-table (p. 176)
• ec2-delete-route-table (p. 262)
• ec2-describe-route-tables (p. 458)
• ec2-disassociate-route-table (p. 588)
• ec2-replace-route-table-association (p. 713)

ec2-attach-classic-link-vpc
Description
Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or more of the VPC's security
groups. You cannot link an EC2-Classic instance to more than one VPC at a time. You can only link an
instance that's in the running state. An instance is automatically unlinked from a VPC when it's stopped -
you can link it to the VPC again when you restart it.

After you've linked an instance, you cannot change the VPC security groups that are associated with it. To
change the security groups, you must first unlink the instance, and then link it again.

Note
Linking your instance to a VPC is sometimes referred to as attaching your instance.

The short version of this command is ec2attachcl.
Tip
If you are using the AWS CLI, see attach-classic-link-vpc instead.

Syntax
ec2-attach-classic-link-vpc --group-id group_id --instance-id instance_id --vpc-id vpc_id

Options
Name Description

-g --group-id group_id The ID of a VPC's security group. You cannot specify a
security group from a different VPC. You can specify more
than one group in the request.

Type: String

Default: None

Required: Yes

Example: --group-id sg-11122233

58

Amazon Elastic Compute Cloud CLI Reference
Common Options

Name Description

-i instance_id The ID of an EC2-Classic instance to link to the ClassicLink-
enabled VPC.

Type: String

Default: None

Required: Yes

Example: -i i-1a1a1a1a

-c vpc_id The ID of the ClassicLink-enabled VPC.

Type: String

Default: None

Required: Yes

Example: -c vpc-1a2b3c4d

Common Options
Option Description

--region region The region. Overrides the default region, the region specified by
the EC2_URL environment variable, and the URL specified by the -U
option.

Default: The region specified by the EC2_URL environment variable,
or us-east-1 if EC2_URL isn't set.

Example: --region eu-west-1

-U, --url url The uniform resource locator (URL) of the Amazon EC2 web service
entry point.

Default: The endpoint specified by the EC2_URL environment
variable, or https://ec2.amazonaws.com if EC2_URL isn't set.

Example: -U https://ec2.eu-west-1amazonaws.com

-O, --aws-access-key Your access key ID. For more information, see Tell the Tools Who
aws_access_key_id You Are.

Default: The value of the AWS_ACCESS_KEY environment variable. If
AWS_ACCESS_KEY isn't set, you must specify this option.

Example: -O AKIAIOSFODNN7EXAMPLE

-W, --aws-secret-key Your secret access key.
aws_secret_access_key
Default: The value of the AWS_SECRET_KEY environment variable. If
AWS_SECRET_KEY isn't set, you must specify this option.

Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

59

Amazon Elastic Compute Cloud CLI Reference
Common Options

Option Description

-T, --security-token The delegation token to pass along to the AWS request. This is only
delegation_token required when you are using temporary security credentials. For
more information, see Using Temporary Security Credentials.

Default: The value of the AWS_DELEGATION_TOKEN environment
variable (if set).

Example: -T AQoDYXdzEJr...<remainder of security token>

--connection-timeout timeout The connection timeout, in seconds.

Example: --connection-timeout 30

--request-timeout timeout The request timeout, in seconds.

Example: --request-timeout 45

-H, --headers Includes column headers in the command output.

--show-empty-fields Shows empty columns as (nil).

--hide-tags Omits tags for tagged resources.

--debug Displays internal debugging information. This can assist us when
helping you troubleshooting problems.

-D, --auth-dry-run Checks whether you have the required permissions for the
command, without actually running the command. If you have
the required permissions, the command returns DryRunOperation;
otherwise, it returns UnauthorizedOperation.

-v, --verbose Displays verbose output, including the API request and response
on the command line. This is useful if you are building tools to talk
directly to the Query API.

- Reads arguments from standard input. This is useful when piping
the output from one command to the input of another.

Example: ec2-describe-instances | grep stopped | cut -f 2 |
ec2-start-instances -

-?, --help, -h Displays usage information for the command.

Deprecated Options
We have deprecated the SOAP API for Amazon EC2. For more information, see SOAP Requests. From
version 1.6.14.0 onwards of the Amazon EC2 CLI tools, the private key (-K, --private-key) and X.509
certificate (-C, --cert) options are not supported. Use your access key ID (-O, --aws-access-key) and secret
access key (-W, --aws-secret-key) instead. For more information, see Setting Up the Amazon EC2 CLI.

Option Description

-K, --private-key The private key to use when constructing requests to Amazon EC2.
ec2_private_key
Default: The value of the EC2_PRIVATE_KEY environment variable.

Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem

60

Amazon Elastic Compute Cloud CLI Reference
Output

Option Description

-C, --cert ec2_cert The X.509 certificate to use when constructing requests to Amazon
EC2.

Default: The value of the EC2_CERT environment variable.

Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem

Output
This command returns a Boolean value indicating whether the request succeeded.

• Boolean value representing whether the call succeeded.

Amazon EC2 command line tools display errors on stderr.

Example
Example 1
This example links instance i-1a2b3c4d to VPC vpc-88888888 through the VPC's security group
sg-12312312.

PROMPT> ec2-attach-classic-link-vpc -i i-1a2b3c4d -c vpc-88888888 --group-id sg-12312312
RETURN true

Example 2
This example links instance i-1a2b3c4d to VPC vpc-88888888 through the VPC's security groups
sg-12312312 and sg-44455566.

PROMPT> ec2-attach-classic-link-vpc -i i-1a2b3c4d -c vpc-88888888 --group-id sg-12312312 --
group-id sg44455566
RETURN true

Related Topics
Setting Up
• Setting Up the CLI Tools (Linux and Mac OS X) (p. 3)
• Setting Up the CLI Tools (Windows) (p. 10)

IAM Policies

You can create an IAM policy to grant users permission to use this command. For more information, see
IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.

Related Action
• AttachClassicLinkVpc

61

Amazon Elastic Compute Cloud CLI Reference
ec2-attach-internet-gateway

Related Commands
• ec2-disable-vpc-classic-link (p. 581)
• ec2-enable-vpc-classic-link (p. 597)
• ec2-detach-classic-link-vpc (p. 560)
• ec2-describe-classic-link-instances (p. 323)
• ec2-describe-vpc-classic-link (p. 524)

ec2-attach-internet-gateway
Description
Attaches an Internet gateway to a VPC, enabling connectivity between the Internet and the VPC. For
more information about your VPC and Internet gateway, see the Amazon VPC User Guide.

The short version of this command is ec2attigw.
Tip
If you are using the AWS CLI, see attach-internet-gateway instead.

Syntax
ec2-attach-internet-gateway internet_gateway_id -c vpc_id

Options
Name Description

internet_gateway_id The ID of the Internet gateway.

Type: String

Default: None

Required: Yes

Example: igw-c3a643aa

-c, --vpc vpc_id The ID of the VPC.

Type: String

Default: None

Required: Yes

Example: -c vpc-d9a045b0

62

Amazon Elastic Compute Cloud CLI Reference
Common Options

Common Options
Option Description

--region region The region. Overrides the default region, the region specified by
the EC2_URL environment variable, and the URL specified by the -U
option.

Default: The region specified by the EC2_URL environment variable,
or us-east-1 if EC2_URL isn't set.

Example: --region eu-west-1

-U, --url url The uniform resource locator (URL) of the Amazon EC2 web service
entry point.

Default: The endpoint specified by the EC2_URL environment
variable, or https://ec2.amazonaws.com if EC2_URL isn't set.

Example: -U https://ec2.eu-west-1amazonaws.com

-O, --aws-access-key Your access key ID. For more information, see Tell the Tools Who
aws_access_key_id You Are.

Default: The value of the AWS_ACCESS_KEY environment variable. If
AWS_ACCESS_KEY isn't set, you must specify this option.

Example: -O AKIAIOSFODNN7EXAMPLE

-W, --aws-secret-key Your secret access key.
aws_secret_access_key
Default: The value of the AWS_SECRET_KEY environment variable. If
AWS_SECRET_KEY isn't set, you must specify this option.

Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

-T, --security-token The delegation token to pass along to the AWS request. This is only
delegation_token required when you are using temporary security credentials. For
more information, see Using Temporary Security Credentials.

Default: The value of the AWS_DELEGATION_TOKEN environment
variable (if set).

Example: -T AQoDYXdzEJr...<remainder of security token>

--connection-timeout timeout The connection timeout, in seconds.

Example: --connection-timeout 30

--request-timeout timeout The request timeout, in seconds.

Example: --request-timeout 45

-H, --headers Includes column headers in the command output.

--show-empty-fields Shows empty columns as (nil).

--hide-tags Omits tags for tagged resources.

63

Amazon Elastic Compute Cloud CLI Reference
Output

Option Description

--debug Displays internal debugging information. This can assist us when
helping you troubleshooting problems.

-D, --auth-dry-run Checks whether you have the required permissions for the
command, without actually running the command. If you have
the required permissions, the command returns DryRunOperation;
otherwise, it returns UnauthorizedOperation.

-v, --verbose Displays verbose output, including the API request and response
on the command line. This is useful if you are building tools to talk
directly to the Query API.

- Reads arguments from standard input. This is useful when piping
the output from one command to the input of another.

Example: ec2-describe-instances | grep stopped | cut -f 2 |
ec2-start-instances -

-?, --help, -h Displays usage information for the command.

Deprecated Options
We have deprecated the SOAP API for Amazon EC2. For more information, see SOAP Requests. From
version 1.6.14.0 onwards of the Amazon EC2 CLI tools, the private key (-K, --private-key) and X.509
certificate (-C, --cert) options are not supported. Use your access key ID (-O, --aws-access-key) and secret
access key (-W, --aws-secret-key) instead. For more information, see Setting Up the Amazon EC2 CLI.

Option Description

-K, --private-key The private key to use when constructing requests to Amazon EC2.
ec2_private_key
Default: The value of the EC2_PRIVATE_KEY environment variable.

Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem

-C, --cert ec2_cert The X.509 certificate to use when constructing requests to Amazon
EC2.

Default: The value of the EC2_CERT environment variable.

Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem

Output
This command returns a table that contains the following information:

• The ATTACHMENT identifier
• The ID of the VPC
• The attachment state (attaching, attached, detached, detaching, error)

Amazon EC2 command line tools display errors on stderr.

64

Amazon Elastic Compute Cloud CLI Reference
Examples

Examples
Example
This example command attaches the Internet gateway with the ID igw-eaad4883 to the VPC with the ID
vpc-11ad4878.

PROMPT> ec2-attach-internet-gateway igw-eaad4883 -c vpc-11ad4878
ATTACHMENT vpc-11ad4878 attaching

Related Topics
Setting Up
• Setting Up the CLI Tools (Linux and Mac OS X) (p. 3)
• Setting Up the CLI Tools (Windows) (p. 10)

IAM Policies

You can create an IAM policy to grant users permission to use this command. For more information, see
IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.

Related Action
• AttachInternetGateway

Related Commands
• ec2-create-internet-gateway (p. 142)
• ec2-delete-internet-gateway (p. 239)
• ec2-describe-internet-gateways (p. 394)
• ec2-detach-internet-gateway (p. 563)

ec2-attach-network-interface
Description
Attaches a network interface to an instance.

The short version of this command is ec2attnic.
Tip
If you are using the AWS CLI, see attach-network-interface instead.

Syntax
ec2-attach-network-interface interface_id -i, --instance instance_id -d, --device-index
device_index

65

Amazon Elastic Compute Cloud CLI Reference
Options

Options
Name Description

interface_id The ID of the network interface.

Type: String

Default: None

Required: Yes

Example: eni-b35da6da

-i, --instance instance_id The ID of the instance.

Type: String

Default: None

Required: Yes

Example: -i i-640a3c17

-d, --device-index device_index The index of the device for the network interface
attachment.

Type: String

Default: None

Required: Yes

Example: -d 1

Common Options
Option Description

--region region The region. Overrides the default region, the region specified by
the EC2_URL environment variable, and the URL specified by the -U
option.

Default: The region specified by the EC2_URL environment variable,
or us-east-1 if EC2_URL isn't set.

Example: --region eu-west-1

-U, --url url The uniform resource locator (URL) of the Amazon EC2 web service
entry point.

Default: The endpoint specified by the EC2_URL environment
variable, or https://ec2.amazonaws.com if EC2_URL isn't set.

Example: -U https://ec2.eu-west-1amazonaws.com

66

If you have the required permissions.<remainder of security token> --connection-timeout timeout The connection timeout. --verbose Displays verbose output. the command returns DryRunOperation. Example: --request-timeout 45 -H. --help. --aws-access-key Your access key ID. For more information. Example: -T AQoDYXdzEJr. Default: The value of the AWS_ACCESS_KEY environment variable. you must specify this option. This is useful when piping the output from one command to the input of another. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -O. you must specify this option. Example: --connection-timeout 30 --request-timeout timeout The request timeout. -v. --aws-secret-key Your secret access key. . This is only delegation_token required when you are using temporary security credentials. --show-empty-fields Shows empty columns as (nil).. it returns UnauthorizedOperation. in seconds. For more information. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set).. If AWS_SECRET_KEY isn't set. --auth-dry-run Checks whether you have the required permissions for the command. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. --hide-tags Omits tags for tagged resources. including the API request and response on the command line. Reads arguments from standard input. see Using Temporary Security Credentials. If AWS_ACCESS_KEY isn't set. see Tell the Tools Who aws_access_key_id You Are. otherwise. --debug Displays internal debugging information. This can assist us when helping you troubleshooting problems. --headers Includes column headers in the command output. without actually running the command. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. in seconds. -D. Example: -O AKIAIOSFODNN7EXAMPLE -W. -h Displays usage information for the command. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. This is useful if you are building tools to talk directly to the Query API. --security-token The delegation token to pass along to the AWS request. 67 .

pem -C.pem Output This command returns the ID of the network interface attachment. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. 3) • Setting Up the CLI Tools (Windows) (p. For more information.14. --cert ec2_cert The X. Option Description -K.0 onwards of the Amazon EC2 CLI tools. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. see Setting Up the Amazon EC2 CLI. --private-key The private key to use when constructing requests to Amazon EC2. Examples Example This example command attaches the specified network interface to the specified instance. Default: The value of the EC2_CERT environment variable.509 certificate to use when constructing requests to Amazon EC2. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. Amazon EC2 command line tools display errors on stderr. Use your access key ID (-O. Related Action • AttachNetworkInterface 68 . --aws-access-key) and secret access key (-W. --aws-secret-key) instead.509 certificate (-C. PROMPT> ec2-attach-network-interface eni-b35da6da -i i-640a3c17 -d 1 eni-attach-dd3fdab4 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.6. For more information. the private key (-K. --cert) options are not supported. For more information. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. --private-key) and X. Amazon Elastic Compute Cloud CLI Reference Output Deprecated Options We have deprecated the SOAP API for Amazon EC2. From version 1. see SOAP Requests.

For more information. • AWS Marketplace product codes are copied from the volume to the instance. For example. For a list of supported device names. see Amazon EC2 Instance Store in the Amazon EC2 User Guide for Linux Instances. see attach-volume instead. see Introducing AWS Marketplace. Amazon Elastic Compute Cloud CLI Reference ec2-attach-volume Related Commands • ec2-create-network-interface (p. Any device names that aren't reserved for instance store volumes can be used for Amazon EBS volumes. • You must be subscribed to the product. Type: String 69 . 647) • ec2-reset-network-interface-attribute (p. see Amazon EBS encryption in the Amazon EC2 User Guide for Linux Instances. For more information. Syntax ec2-attach-volume volume_id --instance instance_id --device device Options Name Description volume_id The ID of the volume. Note If a volume has an AWS Marketplace product code: • The volume can be attached only to a stopped instance. 742) ec2-attach-volume Description Attaches an Amazon EBS volume to a running or stopped instance and exposes it to the instance with the specified device name. you can't detach a volume from a Windows instance and attach it to a Linux instance. Encrypted Amazon EBS volumes can be attached only to instances that support Amazon EBS encryption. • The instance type and operating system of the instance must support the product. The short version of this command is ec2attvol. 413) • ec2-detach-network-interface (p. 158) • ec2-delete-network-interface (p. For an overview of the AWS Marketplace. 252) • ec2-describe-network-interface-attribute (p. 409) • ec2-describe-network-interfaces (p. The volume and instance must be in the same Availability Zone. 567) • ec2-modify-network-interface-attribute (p. Tip If you are using the AWS CLI. see Attaching the Volume to an Instance.

--url url The uniform resource locator (URL) of the Amazon EC2 web service entry point.com -O. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description Default: None Required: Yes Example: vol-4d826724 -i.com if EC2_URL isn't set. or https://ec2. and the URL specified by the -U option. Default: The endpoint specified by the EC2_URL environment variable. --instance instance_id The ID of the instance. Default: The region specified by the EC2_URL environment variable. Type: String Default: None Required: Yes Example: -d /dev/sdf (for Linux/UNIX) or -d xvdf (for Windows) Common Options Option Description --region region The region. Default: The value of the AWS_ACCESS_KEY environment variable. / dev/sdh or xvdh). you must specify this option. The instance and volume must be in the same Availability Zone. If AWS_ACCESS_KEY isn't set. Example: --region eu-west-1 -U.amazonaws. see Tell the Tools Who aws_access_key_id You Are. Type: String Default: None Required: Yes Example: -i i-6058a509 -d. For more information. --device device The device name to expose to the instance (for example. Example: -O AKIAIOSFODNN7EXAMPLE 70 . or us-east-1 if EC2_URL isn't set. Overrides the default region. --aws-access-key Your access key ID. the region specified by the EC2_URL environment variable.eu-west-1amazonaws. Example: -U https://ec2.

aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. --auth-dry-run Checks whether you have the required permissions for the command. --aws-secret-key Your secret access key. This can assist us when helping you troubleshooting problems.509 certificate (-C. --aws-secret-key) instead.14. see SOAP Requests. Deprecated Options We have deprecated the SOAP API for Amazon EC2. For more information. If you have the required permissions. --hide-tags Omits tags for tagged resources. in seconds. the private key (-K. the command returns DryRunOperation. --help. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). This is useful when piping the output from one command to the input of another. From version 1. Example: -T AQoDYXdzEJr. --debug Displays internal debugging information. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. -v. see Setting Up the Amazon EC2 CLI. Use your access key ID (-O. This is useful if you are building tools to talk directly to the Query API. it returns UnauthorizedOperation. --aws-access-key) and secret access key (-W. Reads arguments from standard input. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?.<remainder of security token> --connection-timeout timeout The connection timeout. --security-token The delegation token to pass along to the AWS request. . 71 . For more information. otherwise. --verbose Displays verbose output. -h Displays usage information for the command. --headers Includes column headers in the command output. Example: --request-timeout 45 -H. Example: --connection-timeout 30 --request-timeout timeout The request timeout. --cert) options are not supported. in seconds. see Using Temporary Security Credentials..0 onwards of the Amazon EC2 CLI tools. --show-empty-fields Shows empty columns as (nil). If AWS_SECRET_KEY isn't set. including the API request and response on the command line. --private-key) and X. For more information.. without actually running the command. -D. you must specify this option. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -W. This is only delegation_token required when you are using temporary security credentials.6.

--private-key The private key to use when constructing requests to Amazon EC2. Examples Example This example command attaches the volume with the ID vol-1a2b3c4d to the instance with the ID i-1a2b3c4d and exposes it as /dev/sdh. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. 3) • Setting Up the CLI Tools (Windows) (p. Default: The value of the EC2_CERT environment variable.509 certificate to use when constructing requests to Amazon EC2. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. Amazon Elastic Compute Cloud CLI Reference Output Option Description -K. For more information.pem Output This command returns a table that contains the following information: • The ATTACHMENT identifier • The ID of the volume • The ID of the instance • The device name • The attachment state of the volume (attaching | attached | detaching | detached) • The time stamp when the attachment initiated • Whether the volume is set to delete on termination (true or false) Amazon EC2 command line tools display errors using stderr. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem -C. 72 . PROMPT> ec2-attach-volume vol-1a2b3c4d -i i-1a2b3c4d -d /dev/sdh ATTACHMENT vol-1a2b3c4d i-1a2b3c4d /dev/sdh attaching YYYY-MM-DDTHH:MM:SS+0000 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. --cert ec2_cert The X.

The short version of this command is ec2attvgw. --vpc vpc_id The ID of the VPC. see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon VPC User Guide. Type: String Default: None Required: Yes Example: -c vpc-1a2b3c4d 73 . 570) ec2-attach-vpn-gateway Description Attaches a virtual private gateway to a VPC. Amazon Elastic Compute Cloud CLI Reference ec2-attach-vpn-gateway Related Action • AttachVolume Related Commands • ec2-create-volume (p. see attach-vpn-gateway instead. 513) • ec2-detach-volume (p. Syntax ec2-attach-vpn-gateway vpn_gateway_id -c vpc_id Options Name Description vpn_gateway_id The ID of the virtual private gateway. Tip If you are using the AWS CLI. 194) • ec2-delete-volume (p. For more information. Type: String Default: None Required: Yes Example: vgw-8db04f81 -c. 278) • ec2-describe-volumes (p.

Default: The value of the AWS_ACCESS_KEY environment variable. --security-token The delegation token to pass along to the AWS request.<remainder of security token> --connection-timeout timeout The connection timeout. Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region.. see Using Temporary Security Credentials. Example: --region eu-west-1 -U. For more information. 74 . Example: -U https://ec2. see Tell the Tools Who aws_access_key_id You Are. Overrides the default region. or us-east-1 if EC2_URL isn't set. or https://ec2. Example: -O AKIAIOSFODNN7EXAMPLE -W. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. in seconds. Default: The region specified by the EC2_URL environment variable.amazonaws. Example: --request-timeout 45 -H.com -O. If AWS_ACCESS_KEY isn't set.. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point.eu-west-1amazonaws. Example: --connection-timeout 30 --request-timeout timeout The request timeout. --headers Includes column headers in the command output. If AWS_SECRET_KEY isn't set. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). --aws-access-key Your access key ID. For more information. Example: -T AQoDYXdzEJr. you must specify this option. This is only delegation_token required when you are using temporary security credentials. and the URL specified by the -U option. in seconds.com if EC2_URL isn't set. --hide-tags Omits tags for tagged resources. --show-empty-fields Shows empty columns as (nil). the region specified by the EC2_URL environment variable. --aws-secret-key Your secret access key. you must specify this option. Default: The endpoint specified by the EC2_URL environment variable. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T.

Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. the private key (-K. it returns UnauthorizedOperation.509 certificate (-C. Option Description -K. without actually running the command. -v. Default: The value of the EC2_CERT environment variable. detaching. From version 1.0 onwards of the Amazon EC2 CLI tools. This is useful if you are building tools to talk directly to the Query API. the command returns DryRunOperation. --cert ec2_cert The X. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Use your access key ID (-O.pem -C. Deprecated Options We have deprecated the SOAP API for Amazon EC2.509 certificate to use when constructing requests to Amazon EC2. see Setting Up the Amazon EC2 CLI. This is useful when piping the output from one command to the input of another. 75 . --verbose Displays verbose output. For more information. If you have the required permissions.14.6. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. otherwise. --cert) options are not supported. This can assist us when helping you troubleshooting problems. For more information.pem Output This command returns a table that contains the following information: • The VGWATTACHMENT identifier • The ID of the attached VPC • The state of the attachment (attaching. --aws-secret-key) instead. including the API request and response on the command line. detached) Amazon EC2 command line tools display errors on stderr. Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information. attached. --aws-access-key) and secret access key (-W. --auth-dry-run Checks whether you have the required permissions for the command. --private-key) and X. see SOAP Requests. . -D. Reads arguments from standard input. --private-key The private key to use when constructing requests to Amazon EC2. -h Displays usage information for the command. --help.

PROMPT> ec2-attach-vpn-gateway vgw-8db04f81 -c vpc-1a2b3c4d VGWATTACHMENT vpc-1a2b3c4d attaching Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. 574) • ec2-create-vpc (p. EC2- Classic doesn't support rules for egress traffic. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. For more information. However. Related Action • AttachVpnGateway Related Commands • ec2-create-vpn-gateway (p. 554) • ec2-detach-vpn-gateway (p. For more information. 213) ec2-authorize Description Adds a rule to a security group. Rule changes are propagated to affected instances as quickly as possible. 3) • Setting Up the CLI Tools (Windows) (p. EC2-VPC: You can have up to 50 rules per group (covering both ingress and egress). a small delay might occur. Important EC2-Classic: You can have up to 100 rules per group. A security group is for use with instances either in the EC2-Classic platform or in a specific VPC. 76 . see Amazon EC2 Security Groups in the Amazon EC2 User Guide for Linux Instances and Security Groups for Your VPC in the Amazon VPC User Guide. Amazon Elastic Compute Cloud CLI Reference Examples Examples Example This example command attaches the virtual private gateway with the ID vgw-8db04f81 to the VPC with the ID vpc-1a2b3c4d. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. 221) • ec2-describe-vpn-gateways (p. 201) • ec2-create-vpn-connection (p.

this command permits instances in the VPC to send traffic to either one or more destination CIDR IP address ranges.. default VPC] The name or ID of the security group.. Syntax ec2-authorize group [--egress] [-P protocol] (-p port_range | -t icmp_type_code) [-u source_or_dest_group_owner . the protocol value returned is the number. For egress rules.. or another. The groups must all be in the same VPC. or it gives one or more other security groups (called the source groups) permission to access a security group for your VPC.. and ICMP.. EC2-VPC: For ingress rules.] Options Name Description group [EC2-Classic. -P. see authorize-security-group-egress and authorize-security-group- ingress instead. Default: If this option is not specified. Security groups for EC2-Classic can have rules only for TCP. or icmp). Tip If you are using the AWS CLI. Type: String Valid values for EC2-Classic: tcp | udp | icmp or the corresponding protocol number (6 | 17 | 1). A source group can be for your own AWS account. the value returned is the name (tcp. udp. or to one or more destination security groups for the same VPC. 77 . 345). [Nondefault VPC] The ID of the security group. this command either gives one or more CIDR IP address ranges permission to access a security group for your VPC. --protocol protocol The IP protocol name or number (see Protocol Numbers).. the rule applies to ingress traffic for the specified security group.] [-o source_or_dest_group . The short version of this command is ec2auth. UDP. or it gives one or more security groups (called the source groups) permission to access a security group for your account.. Exception: For TCP. UDP. Amazon Elastic Compute Cloud CLI Reference Syntax EC2-Classic: This command either gives one or more CIDR IP address ranges permission to access a security group for your account. and ICMP. When you use ec2-describe-group (p.] [-r prefix_list .] [-s source_or_dest_cidr .. whereas security groups for EC2-VPC can have rules assigned to any protocol number. Type: String Default: None Required: Yes Example: websrv --egress [EC2-VPC] Designates the rule as an egress rule (controls traffic leaving the VPC).

Type: String Default: None Required: No Example: -o headoffice 78 . or destination security group (for egress rules). Type: String Valid values: A single integer or a range (min-max). port range 0-65535). UDP. Example: -P udp -p port_range For TCP or UDP: The range of ports to allow. [Nondefault VPC] You must specify the ID of the group (for example. Amazon Elastic Compute Cloud CLI Reference Options Name Description Default for EC2-Classic: Defaults to TCP if source CIDR is specified (or implied by default). You can use -1 for the type or code to mean all types or all codes. You can't use this option when using the -s option. or all three protocols (TCP. and ICMP) if source group is specified (to ensure backwards compatibility). Type: String Default: None Required: Required if specifying icmp (or the equivalent number) for the protocol. Required: Required for EC2-VPC. Use the format type:code. Valid values for EC2-VPC: tcp | udp | icmp or any protocol number (see Protocol Numbers). Example: -p 80-84 -t icmp_type_code For ICMP: The ICMP type and code. You can specify -1 to mean all ports (for example. sg-1a2b3c4d) instead of its name. where both are integers. Default: None Required: Required if specifying tcp or udp (or the equivalent number) for the protocol. Use all to specify all protocols. Example: -t -1:-1 -o source_or_dest_group The source security group (for ingress rules).

0.amazonaws. Default: The region specified by the EC2_URL environment variable. Type: String Required: No Example: -r pl-12345678 Common Options Option Description --region region The region.192.0. Type: String Default: 0. --prefix-list prefix_list [EC2-VPC] One or more prefix list IDs for an AWS service. the region specified by the EC2_URL environment variable. or us-east-1 if EC2_URL isn't set. Required: No Example: -s 205.8. source_or_dest_group_owner [EC2-Classic] The ID of the AWS account that owns the source security group.com if EC2_URL isn't set. Valid for egress rules only. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. or https://ec2. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description -u. Default: The endpoint specified by the EC2_URL environment variable.com 79 . Example: -U https://ec2.0/0 Constraints: A valid CIDR IP address range. Overrides the default region. Type: String Default: None Required: No Example: -u 111122223333 -s. You can't use this option when using the -o option. Example: --region eu-west-1 -U.45/24 -r. --cidr source_or_dest_cidr The CIDR IP address range. if it's not the current AWS account. and the URL specified by the -U option.eu-west-1amazonaws.

in seconds. including the API request and response on the command line. If AWS_SECRET_KEY isn't set. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -O. If AWS_ACCESS_KEY isn't set. --verbose Displays verbose output. --debug Displays internal debugging information.. -D. 80 . --hide-tags Omits tags for tagged resources. --auth-dry-run Checks whether you have the required permissions for the command. --help. --show-empty-fields Shows empty columns as (nil). This is useful when piping the output from one command to the input of another. This is only delegation_token required when you are using temporary security credentials. the command returns DryRunOperation. This is useful if you are building tools to talk directly to the Query API. --aws-access-key Your access key ID. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. --security-token The delegation token to pass along to the AWS request. you must specify this option. If you have the required permissions. without actually running the command. --headers Includes column headers in the command output. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. Example: --request-timeout 45 -H. Reads arguments from standard input. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Default: The value of the AWS_ACCESS_KEY environment variable.. This can assist us when helping you troubleshooting problems. -v. For more information. For more information. . you must specify this option.<remainder of security token> --connection-timeout timeout The connection timeout. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Example: -T AQoDYXdzEJr. see Using Temporary Security Credentials. -h Displays usage information for the command. see Tell the Tools Who aws_access_key_id You Are. Example: -O AKIAIOSFODNN7EXAMPLE -W. Example: --connection-timeout 30 --request-timeout timeout The request timeout. otherwise. --aws-secret-key Your secret access key. in seconds. it returns UnauthorizedOperation.

only ALLOWS rules are supported • The protocol to allow (for example. --cert) options are not supported. --aws-secret-key) instead. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Some of these fields may be blank.509 certificate to use when constructing requests to Amazon EC2. the private key (-K.6. From version 1. Default: The value of the EC2_CERT environment variable. --private-key The private key to use when constructing requests to Amazon EC2.0 onwards of the Amazon EC2 CLI tools. --private-key) and X. • The GROUP identifier • The ID of the security group • The AWS account ID of the owner of the security group • The name of the security group • A description of the security group • [EC2-VPC] The ID of the VPC the group belongs to One of each of the following lines for each permission defined by the group: • The PERMISSION identifier • The AWS account ID of the owner of the security group • The name of the security group granting permission • The type of rule. Amazon Elastic Compute Cloud CLI Reference Output Deprecated Options We have deprecated the SOAP API for Amazon EC2. For more information. For more information. see Setting Up the Amazon EC2 CLI. tcp and udp) • The start of port range • The end of port range • FROM for an ingress rule or TO for an egress rule • The source type (for ingress rules) or destination type (for egress rules) • The source (for ingress rules) or destination (for egress rules) • [USER only] The name of the source or destination entity • [USER only] The ID of the security group • Whether the rule is ingress rule or an egress rule 81 . see SOAP Requests. --cert ec2_cert The X. Option Description -K. Use your access key ID (-O.509 certificate (-C. --aws-access-key) and secret access key (-W.14. Currently.pem -C.pem Output This command returns a table that contains the following information: A line containing the group information.

see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.0.0/24 ingress Example 2 This example command grants TCP port 80 access from the source group for EC2-Classic named OtherAccountGroup (in AWS account 111122223333) to the security group for EC2-Classic named websrv. Amazon Elastic Compute Cloud CLI Reference Examples Amazon EC2 command line tools display errors on stderr. PROMPT> ec2-authorize websrv -P tcp -p 80 -u 111122223333 -o OtherAccountGroup GROUP websrv PERMISSION websrv ALLOWS tcp 80 80 FROM USER 111122223333 NAME OtherAccountGroup ingress Example 3 This example command grants TCP port 80 access from the 192.0/24 ingress Example 4 This example command grants egress access from the security group for EC2-VPC with the ID sg-1a2b3c4d to the destination security group with the ID sg-2a2b3c4d on TCP port 1433.0.0/24 address range to the security group for EC2-Classic named websrv. 82 .2. PROMPT> ec2-authorize sg-1a2b3c4d -P tcp -p 80 -s 192.0.2.2. 3) • Setting Up the CLI Tools (Windows) (p.2.2.0. Examples Example 1 This example command grants TCP port 80 access from the 192.0/24 address range to the security group for EC2-VPC with the ID sg-1a2b3c4d. For more information.2.0. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. PROMPT> ec2-authorize --egress sg-1a2b3c4d -P tcp -p 1433 -o sg-2a2b3c4d GROUP sg-1a2b3c4d PERMISSION ALLOWS tcp 1433 1433 TO USER ID sg-2a2b3c4d egress Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. PROMPT> ec2-authorize websrv -P tcp -p 80 -s 192.0/24 GROUP sg-1a2b3c4d PERMISSION ALLOWS tcp 80 80 FROM CIDR 192.0.0/24 GROUP websrv PERMISSION websrv ALLOWS tcp 80 80 FROM CIDR 192.

If you'd prefer to create an instance store-backed Linux AMI. Amazon Elastic Compute Cloud CLI Reference ec2-bundle-instance Related Actions • AuthorizeSecurityGroupEgress • AuthorizeSecurityGroupIngress Related Commands • ec2-create-group (p. Tip If you are using the AWS CLI. see Creating an Instance Store-Backed Windows AMI in the Amazon EC2 User Guide for Windows Instances. see Storage for the Root Device in the Amazon EC2 User Guide for Linux Instances. 127) • ec2-delete-group (p. 131). The AMI creation process is different for Amazon EBS-backed AMIs. Type: String Default: None Required: Yes 83 . During bundling. The short version of this command is ec2bundle. 235) • ec2-describe-group (p. For more information about the differences between Amazon EBS-backed and instance store-backed instances. see bundle-instance instead. only the root device volume (C:\) is bundled. see Creating an Instance Store-Backed Linux AMIin the Amazon EC2 User Guide for Linux Instances. 753) ec2-bundle-instance Description Bundles an instance store-backed Windows instance. Data on other instance store volumes is not preserved. To create an Amazon EBS-backed Windows AMI. use ec2-create-image (p. Syntax ec2-bundle-instance instance_id -b bucket -p prefix -o access_key_id {-c policy | -s policy_signature |-w owner_secret_access_key} [-x hours] [--location location] [-B] Options Name Description instance_id The ID of the instance to bundle. 345) • ec2-revoke (p. For more information.

--bucket bucket The bucket in which to store the AMI. Amazon Elastic Compute Cloud CLI Reference Options Name Description Example: i-5e73d509 -b. review and follow the guidance in Best Practices for Managing AWS Access Keys. Amazon EC2 returns an error. Type: String Default: None Required: Yes Example: -p winami -o. Type: String Default: None Required: Yes Example: -o AKIAIOSFODNN7EXAMPLE 84 . You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. Type: String Default: None Required: Yes Example: -b myawsbucket -p. --owner-akid access_key_id The access key ID of the owner of the Amazon S3 bucket. Before you specify a value for this option. --prefix prefix The prefix for the image component names being stored in Amazon S3. If you specify a bucket that belongs to someone else.

Before you specify a value for this option. Type: String Default: None Required: Conditional Example: -w wJalrXUtnFEMI/K7MDENG/ bPxRfiCYEXAMPLEKEY 85 . --policy-signature The base64-encoded signature for the Amazon S3 upload policy_signature policy. so that we can create a policy signature for you (the secret access key is not passed to Amazon EC2). For more information about upload policies and how to sign them. see the sections about policy construction and signatures in the Amazon Simple Storage Service Developer Guide. Amazon Elastic Compute Cloud CLI Reference Options Name Description -c. If you provide this parameter. If you do not provide this parameter. This parameter is required in either of these cases: • If you don't provide the --policy parameter • If you provide the --policy parameter. If you provide --policy but not --policy-signature. but don't provide the --policy-signature parameter The command line tools client uses the secret access key to sign a policy for you. then --owner-sak is required. you must also provide either a policy signature. and we use it to automatically sign the policy. the --owner-sak parameter is required. or your secret access key. but does not send the secret access key to Amazon EC2. review and follow the guidance in Best Practices for Managing AWS Access Keys. and we generate an upload policy and policy signature for you automatically. Type: String Default: None Required: Conditional Example: -s upload-policy -w. --policy policy A base64-encoded Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on the user's behalf. --owner-sak The AWS secret access key for the owner of the Amazon owner_secret_access_key S3 bucket specified in the -b parameter. Type: String Default: None Required: Conditional Example: -c upload-policy -s.

Example: -U https://ec2. the region specified by the EC2_URL environment variable.com 86 . or https://ec2. --no-bucket-setup Indicates that no Amazon S3 bucket should be created if one doesn't already exist. Type: String Default: None Required: No Example: --location my-bucket-location -B. for a generated upload policy.amazonaws. in hours.eu-west-1amazonaws. Overrides the default region. Type: String Default: 24 Required: No Example: -x 8 --location bucket_location The location of the destination Amazon S3 bucket. Default: The endpoint specified by the EC2_URL environment variable. and the URL specified by the -U option. Default: The region specified by the EC2_URL environment variable. Example: --region eu-west-1 -U. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description -x. --expires hours The validity period. and that no attempt should be made to fix incorrect permissions. or us-east-1 if EC2_URL isn't set. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Type: Boolean Default: false Required: No Example: -B Common Options Option Description --region region The region.com if EC2_URL isn't set.

87 . including the API request and response on the command line. it returns UnauthorizedOperation. otherwise. If you have the required permissions. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. -D. This is useful when piping the output from one command to the input of another. Example: --connection-timeout 30 --request-timeout timeout The request timeout. you must specify this option. -h Displays usage information for the command.. --headers Includes column headers in the command output. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -O. This is only delegation_token required when you are using temporary security credentials. Example: --request-timeout 45 -H. --debug Displays internal debugging information. If AWS_SECRET_KEY isn't set. --help. --aws-secret-key Your secret access key. in seconds. --aws-access-key Your access key ID. Example: -O AKIAIOSFODNN7EXAMPLE -W. . without actually running the command. --verbose Displays verbose output. Example: -T AQoDYXdzEJr. Reads arguments from standard input. This is useful if you are building tools to talk directly to the Query API. in seconds. see Tell the Tools Who aws_access_key_id You Are.<remainder of security token> --connection-timeout timeout The connection timeout. you must specify this option. For more information. If AWS_ACCESS_KEY isn't set. For more information.. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). This can assist us when helping you troubleshooting problems. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. --show-empty-fields Shows empty columns as (nil). Default: The value of the AWS_ACCESS_KEY environment variable. --hide-tags Omits tags for tagged resources. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. --auth-dry-run Checks whether you have the required permissions for the command. the command returns DryRunOperation. --security-token The delegation token to pass along to the AWS request. see Using Temporary Security Credentials. -v.

14. Important Before you specify a value for your access key ID or secret access key. --aws-access-key) and secret access key (-W. For more information. --aws-secret-key) instead. see SOAP Requests. review and follow the guidance in Best Practices for Managing AWS Access Keys. From version 1. Examples Example This example command bundles the specified instance.0 onwards of the Amazon EC2 CLI tools. the private key (-K. For more information. --private-key) and X. Use your access key ID (-O.6.509 certificate (-C. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem -C. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Amazon Elastic Compute Cloud CLI Reference Output Deprecated Options We have deprecated the SOAP API for Amazon EC2. Default: The value of the EC2_CERT environment variable.pem Output This command returns a table that contains the following information: • The BUNDLE identifier • The ID of the bundle • The ID of the instance • The bucket name • The bundle prefix • The bundle start time • The bundle update time • The current state (usually pending) Amazon EC2 command line tools display errors on stderr. --cert) options are not supported. see Setting Up the Amazon EC2 CLI.509 certificate to use when constructing requests to Amazon EC2. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --private-key The private key to use when constructing requests to Amazon EC2. PROMPT> ec2-bundle-instance i-12345678 -b myawsbucket -p winami -o AKIAIOSFODNN7EXAMPLE -w wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY BUNDLE bun-c1a540a8 i-12345678 myawsbucket winami 2008-09-15T17:15:20+0000 pending 88 . Option Description -K. --cert ec2_cert The X.

see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. 318) ec2-cancel-bundle-task Description Cancels a bundling operation for an instance store-backed Windows instance. Type: String Default: None Required: Yes Example: bun-cla432a3 89 . Syntax ec2-cancel-bundle-task bundle_id Options Name Description bundle_id The ID of the bundle task. The short version of this command is ec2cbun. 89) • ec2-create-image (p. 131) • ec2-describe-bundle-tasks (p. Related Action • BundleInstance Related Commands • ec2-cancel-bundle-task (p. 3) • Setting Up the CLI Tools (Windows) (p. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. Tip If you are using the AWS CLI. see cancel-bundle-task instead. Amazon Elastic Compute Cloud CLI Reference Related Topics Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. For more information.

in seconds. Example: -U https://ec2. For more information. you must specify this option. Default: The value of the AWS_ACCESS_KEY environment variable. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. Overrides the default region. This is only delegation_token required when you are using temporary security credentials.. If AWS_SECRET_KEY isn't set. Example: --request-timeout 45 -H. Example: -O AKIAIOSFODNN7EXAMPLE -W.amazonaws. see Tell the Tools Who aws_access_key_id You Are. or https://ec2. Example: -T AQoDYXdzEJr. in seconds.com -O. or us-east-1 if EC2_URL isn't set. --headers Includes column headers in the command output. see Using Temporary Security Credentials. If AWS_ACCESS_KEY isn't set. Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region. Default: The endpoint specified by the EC2_URL environment variable. --security-token The delegation token to pass along to the AWS request. and the URL specified by the -U option. the region specified by the EC2_URL environment variable.<remainder of security token> --connection-timeout timeout The connection timeout. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. --aws-access-key Your access key ID. --hide-tags Omits tags for tagged resources. Example: --region eu-west-1 -U.com if EC2_URL isn't set. you must specify this option. Default: The region specified by the EC2_URL environment variable. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. 90 . Example: --connection-timeout 30 --request-timeout timeout The request timeout. For more information.eu-west-1amazonaws. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set).. --aws-secret-key Your secret access key. --show-empty-fields Shows empty columns as (nil).

ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --verbose Displays verbose output. -D. --cert) options are not supported. For more information. --help. --auth-dry-run Checks whether you have the required permissions for the command. Default: The value of the EC2_CERT environment variable. it returns UnauthorizedOperation. the private key (-K. including the API request and response on the command line. This is useful when piping the output from one command to the input of another. This is useful if you are building tools to talk directly to the Query API. -h Displays usage information for the command. Use your access key ID (-O.pem Output This command returns a table that contains the following information: • The BUNDLE identifier • The ID of the bundle • The ID of the instance • The bucket name • The cancel status • The prefix • The start time 91 . Option Description -K.509 certificate (-C. --aws-access-key) and secret access key (-W. --cert ec2_cert The X.509 certificate to use when constructing requests to Amazon EC2.0 onwards of the Amazon EC2 CLI tools. Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. -v. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Deprecated Options We have deprecated the SOAP API for Amazon EC2. --private-key) and X. the command returns DryRunOperation. --private-key The private key to use when constructing requests to Amazon EC2. Reads arguments from standard input.6.14. without actually running the command. If you have the required permissions. see Setting Up the Amazon EC2 CLI. see SOAP Requests. . Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?.pem -C. This can assist us when helping you troubleshooting problems. --aws-secret-key) instead. otherwise. For more information. From version 1.

811). see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. including a partially uploaded volume or instance. For more information. 318) ec2-cancel-conversion-task Description Cancels an active conversion task. If the conversion is complete or is in the process of transferring the final disk image. For more information. 83) • ec2-describe-bundle-tasks (p. Related Action • CancelBundleTask Related Commands • ec2-bundle-instance (p. 3) • Setting Up the CLI Tools (Windows) (p. The command removes all artifacts of the conversion. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. see (Optional) Cancel an Upload (p. 92 . the command fails and returns an exception. The task can be the import of an instance or volume. Amazon Elastic Compute Cloud CLI Reference Examples • The update time • The status (cancelling) Amazon EC2 command line tools display errors on stderr. The short version of this command is ec2cct. PROMPT> ec2-cancel-bundle-task bun-cla322b9 BUNDLE bun-cla322b9 i-2674d22r myawsbucket winami 2008-09-15T17:15:20+0000 2008-09-15T17:15:20+0000 cancelling Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Examples Example This example command cancels the specified bundle task.

Example: -O AKIAIOSFODNN7EXAMPLE -W. Example: -U https://ec2. or https://ec2. Syntax ec2-cancel-conversion-task task_id Options Name Description task_id The ID of the conversion task. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Amazon Elastic Compute Cloud CLI Reference Syntax Tip If you are using the AWS CLI. Example: --region eu-west-1 -U. Type: String Default: None Required: Yes Example: import-i-fh95npoc Common Options Option Description --region region The region. Default: The endpoint specified by the EC2_URL environment variable. see cancel-conversion-task instead.eu-west-1amazonaws. see Tell the Tools Who aws_access_key_id You Are. and the URL specified by the -U option. For more information. Overrides the default region. Default: The value of the AWS_ACCESS_KEY environment variable. --aws-access-key Your access key ID. Default: The region specified by the EC2_URL environment variable.com if EC2_URL isn't set. --aws-secret-key Your secret access key. you must specify this option. If AWS_SECRET_KEY isn't set.com -O. the region specified by the EC2_URL environment variable. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. If AWS_ACCESS_KEY isn't set. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY 93 . or us-east-1 if EC2_URL isn't set. you must specify this option.amazonaws.

in seconds. the command returns DryRunOperation. see Setting Up the Amazon EC2 CLI. --verbose Displays verbose output. --show-empty-fields Shows empty columns as (nil). --private-key The private key to use when constructing requests to Amazon EC2. -D. see SOAP Requests. If you have the required permissions. --private-key) and X.14. --help. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set).. --debug Displays internal debugging information.6. it returns UnauthorizedOperation. From version 1. This can assist us when helping you troubleshooting problems. --aws-access-key) and secret access key (-W.0 onwards of the Amazon EC2 CLI tools. Example: --connection-timeout 30 --request-timeout timeout The request timeout. -h Displays usage information for the command. --auth-dry-run Checks whether you have the required permissions for the command. This is useful when piping the output from one command to the input of another. --aws-secret-key) instead. including the API request and response on the command line. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. For more information. This is only delegation_token required when you are using temporary security credentials. --headers Includes column headers in the command output. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. This is useful if you are building tools to talk directly to the Query API. --security-token The delegation token to pass along to the AWS request. without actually running the command. --cert) options are not supported. Reads arguments from standard input. . see Using Temporary Security Credentials. For more information. -v. Deprecated Options We have deprecated the SOAP API for Amazon EC2. Use your access key ID (-O.<remainder of security token> --connection-timeout timeout The connection timeout..509 certificate (-C. in seconds. --hide-tags Omits tags for tagged resources. For more information. the private key (-K. Example: -T AQoDYXdzEJr. otherwise. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -T. Option Description -K. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. Example: --request-timeout 45 -H.pem 94 .

--cert ec2_cert The X. Examples Example This example command cancels the conversion task with the ID import-i-fh95npoc. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. PROMPT> ec2-cancel-conversion-task –region us-west-2 import-i-fhuoi09c CONVERSION-TASK import-i-fhuoi09c Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Default: The value of the EC2_CERT environment variable. PROMPT> ec2-cancel-conversion-task import-i-fh95npoc CONVERSION-TASK import-i-fh95npoc If the task fails. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.509 certificate to use when constructing requests to Amazon EC2. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. 3) • Setting Up the CLI Tools (Windows) (p.DeleteConversionTask Error: Failed to delete conversion task import-i-fh95npoc Example This command cancels the conversion task with the ID import-i-fhuoi09c in the us-west-2 region. 95 .pem Output This command returns a table that contains the following information: • The CONVERSION-TASK identifier • The ID of the conversion task Amazon EC2 command line tools display errors on stderr. Amazon Elastic Compute Cloud CLI Reference Output Option Description -C. you receive the following error: Client. For more information.

and the URL specified by the -U option. 611) • ec2-import-volume (p. Amazon Elastic Compute Cloud CLI Reference ec2-cancel-export-task Related Action • CancelConversionTask Related Commands • ec2-delete-disk-image (p. see cancel-export-task instead. The command removes all artifacts of the export. If the export task is complete or is in the process of transferring the final disk image. Overrides the default region. This is the ID returned by ec2- create-instance-export-task. Type: String Default: None Required: Yes Example: export-i-fgelt0i7 Common Options Option Description --region region The region. the region specified by the EC2_URL environment variable. 749) ec2-cancel-export-task Description Cancels an active export task. the command fails and returns an error. Tip If you are using the AWS CLI. Syntax ec2-cancel-export-task task_id Options Name Description task_id The ID of the export task. 328) • ec2-import-instance (p. 96 . 231) • ec2-describe-conversion-tasks (p. 623) • ec2-resume-import (p. The short version of this command is ec2cxt. including any partially created Amazon S3 objects.

the command returns DryRunOperation. If you have the required permissions. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). If AWS_ACCESS_KEY isn't set. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. you must specify this option. Example: --region eu-west-1 -U. or us-east-1 if EC2_URL isn't set. Default: The endpoint specified by the EC2_URL environment variable.com -O.eu-west-1amazonaws.. Example: -T AQoDYXdzEJr.<remainder of security token> --connection-timeout timeout The connection timeout. 97 . --auth-dry-run Checks whether you have the required permissions for the command. see Using Temporary Security Credentials. If AWS_SECRET_KEY isn't set. --debug Displays internal debugging information.amazonaws. in seconds. Example: -O AKIAIOSFODNN7EXAMPLE -W. For more information. For more information. you must specify this option.. Example: --connection-timeout 30 --request-timeout timeout The request timeout. --hide-tags Omits tags for tagged resources. --aws-secret-key Your secret access key. Default: The value of the AWS_ACCESS_KEY environment variable. -D. This is only delegation_token required when you are using temporary security credentials.com if EC2_URL isn't set. it returns UnauthorizedOperation. --show-empty-fields Shows empty columns as (nil). --headers Includes column headers in the command output. otherwise. in seconds. --aws-access-key Your access key ID. or https://ec2. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. --security-token The delegation token to pass along to the AWS request. see Tell the Tools Who aws_access_key_id You Are. Example: --request-timeout 45 -H. without actually running the command. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description Default: The region specified by the EC2_URL environment variable. Example: -U https://ec2. This can assist us when helping you troubleshooting problems. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point.

--help. For more information. --private-key The private key to use when constructing requests to Amazon EC2.pem Output This command returns a table that contains the following information: • The EXPORT-TASK identifier • The ID of the export task Amazon EC2 command line tools display errors on stderr. --private-key) and X. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.509 certificate (-C. . PROMPT> ec2-cancel-export-task export-i-fgelt0i7 EXPORT-TASK export-i-fgelt0i7 98 . Deprecated Options We have deprecated the SOAP API for Amazon EC2.14. --aws-secret-key) instead.6. --verbose Displays verbose output. -h Displays usage information for the command. see SOAP Requests. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. This is useful if you are building tools to talk directly to the Query API.pem -C. Amazon Elastic Compute Cloud CLI Reference Output Option Description -v. --aws-access-key) and secret access key (-W.0 onwards of the Amazon EC2 CLI tools. Option Description -K. the private key (-K. --cert) options are not supported. Example Example This example command cancels the export task with the ID export-i-fgelt0i7. including the API request and response on the command line. Default: The value of the EC2_CERT environment variable. Reads arguments from standard input. From version 1. see Setting Up the Amazon EC2 CLI. --cert ec2_cert The X. This is useful when piping the output from one command to the input of another. For more information. Use your access key ID (-O.509 certificate to use when constructing requests to Amazon EC2. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?.

3) • Setting Up the CLI Tools (Windows) (p. 341) ec2-cancel-reserved-instances-listing Description Cancels the specified Reserved Instance listing in the Reserved Instance Marketplace. see cancel-reserved-instances-listing instead. For more information. 138) • ec2-describe-export-tasks (p. Syntax ec2-cancel-reserved-instances-listing LISTING Options Name Description LISTING The ID of the Reserved Instance listing to be canceled. For more information. Type: String 99 . Tip If you are using the AWS CLI. Related Action • CancelExportTask Related Commands • ec2-create-instance-export-task (p. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. Amazon Elastic Compute Cloud CLI Reference Related Topics Example This example command cancels the export task with the ID import-i-fhuoi09c in the us-west-2 region. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. see Reserved Instance Marketplace in the Amazon EC2 User Guide for Linux Instances. PROMPT> ec2-cancel-export-task --region us-west-2 import-i-fhuoi09c EXPORT-TASK export-i-fgelt0i7 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.

see Using Temporary Security Credentials. For more information. or us-east-1 if EC2_URL isn't set.amazonaws.<remainder of security token> --connection-timeout timeout The connection timeout.com -O. and the URL specified by the -U option. you must specify this option. --aws-access-key Your access key ID.. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. --aws-secret-key Your secret access key. Example: --connection-timeout 30 --request-timeout timeout The request timeout. Example: --region eu-west-1 -U. in seconds. see Tell the Tools Who aws_access_key_id You Are.eu-west-1amazonaws. Example: -O AKIAIOSFODNN7EXAMPLE -W. If AWS_SECRET_KEY isn't set. Default: The endpoint specified by the EC2_URL environment variable. Example: -T AQoDYXdzEJr. Example: -U https://ec2.. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. This is only delegation_token required when you are using temporary security credentials. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Default: The value of the AWS_ACCESS_KEY environment variable.com if EC2_URL isn't set. If AWS_ACCESS_KEY isn't set. For more information. Overrides the default region. the region specified by the EC2_URL environment variable. Example: --request-timeout 45 100 . Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). or https://ec2. in seconds. you must specify this option. Default: The region specified by the EC2_URL environment variable. --security-token The delegation token to pass along to the AWS request. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description Required: Yes Default: None Common Options Option Description --region region The region.

--private-key The private key to use when constructing requests to Amazon EC2. without actually running the command. --debug Displays internal debugging information. --aws-secret-key) instead. --show-empty-fields Shows empty columns as (nil). --hide-tags Omits tags for tagged resources. .509 certificate (-C. --help. If you have the required permissions.pem -C. including the API request and response on the command line. --cert) options are not supported. the command returns DryRunOperation. it returns UnauthorizedOperation. This is useful when piping the output from one command to the input of another. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --aws-access-key) and secret access key (-W. --headers Includes column headers in the command output.509 certificate to use when constructing requests to Amazon EC2. the private key (-K. see SOAP Requests. see Setting Up the Amazon EC2 CLI. Option Description -K. This is useful if you are building tools to talk directly to the Query API. Use your access key ID (-O.pem Output The command returns a table that contains the following information: The listing information • The LISTING identifier 101 . otherwise.14. --auth-dry-run Checks whether you have the required permissions for the command. For more information.6.0 onwards of the Amazon EC2 CLI tools. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. --cert ec2_cert The X. --verbose Displays verbose output. Reads arguments from standard input. Amazon Elastic Compute Cloud CLI Reference Output Option Description -H. For more information. From version 1. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. Default: The value of the EC2_CERT environment variable. This can assist us when helping you troubleshooting problems. Deprecated Options We have deprecated the SOAP API for Amazon EC2. -h Displays usage information for the command. --private-key) and X. -D. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. -v.

Examples Example This example command cancels a Reserved Instance listing in the Reserved Instance Marketplace. 440) • ec2-create-reserved-instances-listing (p. 166) • ec2-describe-reserved-instances (p. 433) 102 .2 false PRICE-SCHEDULE 1 $1.2 false PRICE-SCHEDULE 3 $1.2 true Related Operations • ec2-describe-reserved-instances-listings (p. PROMPT> ec2-cancel-reserved-instances-listing 095c0e18-c9e6-4692-97e5-653e0example Amazon EC2 returns output similar to the following: PROMPT> ec2-cancel-reserved-instances-listing Type ReservedInstancesListingId ReservedInstancesId CreateDate UpdateDate Status StatusMessage LISTING 095c0e18-c9e6-4692-97e5-653e0example b847fa93-c736-4eae-bca1-e3147example Tue Aug 28 18:21:07 PDT 2012 Tue Aug 28 18:21:07 PDT 2012 cancelled cancelled INSTANCE-COUNT available 0 INSTANCE-COUNT sold 0 INSTANCE-COUNT cancelled 1 INSTANCE-COUNT pending 0 PRICE-SCHEDULE 5 $1. Amazon Elastic Compute Cloud CLI Reference Examples • Reserved instance listing ID • Reserved instance ID • The create date • The update date • Status • Status message One or more rows that contain instance count information • The INSTANCE-COUNT identifier • The instance count state • The instance count One or more rows that contain price schedule information • The PRICE-SCHEDULE identifier • The term • The price • Whether or not the schedule is active Amazon EC2 command line tools display errors on stderr.2 false PRICE-SCHEDULE 2 $1.2 true PRICE-SCHEDULE 4 $1.

com 103 . Syntax ec2-cancel-spot-instance-requests request_id [request_id. Amazon EC2 periodically sets the Spot Price based on available Spot Instance capacity and current Spot Instance requests..com if EC2_URL isn't set. the region specified by the EC2_URL environment variable. and the URL specified by the -U option. Default: The endpoint specified by the EC2_URL environment variable.eu-west-1amazonaws. Spot Instances are instances that Amazon EC2 launches when the bid price that you specify exceeds the current Spot Price. The short version of this command is ec2csir. Overrides the default region. Example: -U https://ec2. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Amazon Elastic Compute Cloud CLI Reference ec2-cancel-spot-instance-requests ec2-cancel-spot-instance-requests Description Cancels one or more Spot Instance requests. or https://ec2. Default: The region specified by the EC2_URL environment variable. or us-east-1 if EC2_URL isn't set.] Options Name Description request_id One or more Spot Instance request IDs.. Important Canceling a Spot Instance request does not terminate running Spot Instances associated with the request. see Spot Instance Requests in the Amazon EC2 User Guide for Linux Instances.amazonaws. Example: --region eu-west-1 -U. see cancel-spot-instance-requests instead. For more information. Type: String Default: None Required: Yes Example: sir-8456a32b Common Options Option Description --region region The region. Tip If you are using the AWS CLI.

--show-empty-fields Shows empty columns as (nil). see Tell the Tools Who aws_access_key_id You Are. Example: --connection-timeout 30 --request-timeout timeout The request timeout. -h Displays usage information for the command. Reads arguments from standard input.. it returns UnauthorizedOperation. including the API request and response on the command line. in seconds. If you have the required permissions. --headers Includes column headers in the command output. If AWS_SECRET_KEY isn't set. --hide-tags Omits tags for tagged resources. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. If AWS_ACCESS_KEY isn't set. you must specify this option. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable.<remainder of security token> --connection-timeout timeout The connection timeout. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. Example: -O AKIAIOSFODNN7EXAMPLE -W. without actually running the command. Example: -T AQoDYXdzEJr. the command returns DryRunOperation. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -O. This can assist us when helping you troubleshooting problems. For more information. --help. --verbose Displays verbose output. in seconds. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). -D. This is useful if you are building tools to talk directly to the Query API. --security-token The delegation token to pass along to the AWS request. --aws-secret-key Your secret access key. otherwise. For more information. 104 .. . see Using Temporary Security Credentials. -v. --aws-access-key Your access key ID. Default: The value of the AWS_ACCESS_KEY environment variable. Example: --request-timeout 45 -H. --auth-dry-run Checks whether you have the required permissions for the command. --debug Displays internal debugging information. This is useful when piping the output from one command to the input of another. This is only delegation_token required when you are using temporary security credentials. you must specify this option.

Examples Example This example command cancels a Spot Instance request. --private-key The private key to use when constructing requests to Amazon EC2. --aws-access-key) and secret access key (-W. PROMPT> ec2-cancel-spot-instance-requests sir-1a2b3c4d sir-2a2b3c4d SPOTINSTANCEREQUEST sir-1a2b3c4d cancelled SPOTINSTANCEREQUEST sir-2a2b3c4d cancelled Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.0 onwards of the Amazon EC2 CLI tools. Use your access key ID (-O.pem Output This command returns a table that contains the following information: • The SPOTINSTANCEREQUEST identifier • The Spot Instance request ID • The current state Amazon EC2 command line tools display errors on stderr. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. 3) • Setting Up the CLI Tools (Windows) (p.6. --cert ec2_cert The X.14.pem -C. From version 1. --aws-secret-key) instead. Amazon Elastic Compute Cloud CLI Reference Output Deprecated Options We have deprecated the SOAP API for Amazon EC2. see SOAP Requests. --cert) options are not supported. --private-key) and X. For more information. the private key (-K. Default: The value of the EC2_CERT environment variable. Option Description -K. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. For more information.509 certificate to use when constructing requests to Amazon EC2. see Setting Up the Amazon EC2 CLI.509 certificate (-C. 10) IAM Policies 105 .

Type: String Default: None Required: Yes Example: 774F4FF8 -i instance_id The instance. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. see confirm-product-instance instead. This command can only be run by the owner of the product code. Type: String Default: None Required: Yes Example: -i i-10a64379 106 . It is useful when a product code owner needs to verify whether another user's instance is eligible for support. Tip If you are using the AWS CLI. 478) • ec2-describe-spot-price-history (p. Amazon Elastic Compute Cloud CLI Reference ec2-confirm-product-instance You can create an IAM policy to grant users permission to use this command. The short version of this command is ec2cpi. For more information. Related Action • CancelSpotInstanceRequests Related Commands • ec2-describe-spot-instance-requests (p. 721) ec2-confirm-product-instance Description Determines whether a product code is associated with an instance. 487) • ec2-request-spot-instances (p. Syntax ec2-confirm-product-instance product_code -i instance_id Options Name Description product_code The product code.

see Using Temporary Security Credentials. --aws-access-key Your access key ID.eu-west-1amazonaws. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point.com -O. Example: -T AQoDYXdzEJr. If AWS_ACCESS_KEY isn't set. you must specify this option. Example: -U https://ec2. you must specify this option. --security-token The delegation token to pass along to the AWS request. --hide-tags Omits tags for tagged resources.com if EC2_URL isn't set. Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region. or us-east-1 if EC2_URL isn't set. the region specified by the EC2_URL environment variable. This is only delegation_token required when you are using temporary security credentials. Default: The endpoint specified by the EC2_URL environment variable. --headers Includes column headers in the command output. Example: --region eu-west-1 -U. Example: -O AKIAIOSFODNN7EXAMPLE -W... For more information. see Tell the Tools Who aws_access_key_id You Are. --show-empty-fields Shows empty columns as (nil). Default: The value of the AWS_ACCESS_KEY environment variable. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Overrides the default region. in seconds. Example: --connection-timeout 30 --request-timeout timeout The request timeout. 107 . aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. --aws-secret-key Your secret access key.amazonaws. For more information.<remainder of security token> --connection-timeout timeout The connection timeout. Default: The region specified by the EC2_URL environment variable. or https://ec2. Example: --request-timeout 45 -H. and the URL specified by the -U option. If AWS_SECRET_KEY isn't set. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. in seconds.

For more information.6. . From version 1. Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information. -D. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. Deprecated Options We have deprecated the SOAP API for Amazon EC2. --help. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. This is useful when piping the output from one command to the input of another.509 certificate (-C. If you have the required permissions. --aws-access-key) and secret access key (-W. --auth-dry-run Checks whether you have the required permissions for the command. --cert) options are not supported. see Setting Up the Amazon EC2 CLI. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. otherwise. including the API request and response on the command line. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Use your access key ID (-O. Reads arguments from standard input.pem -C. the command returns DryRunOperation. see SOAP Requests.pem Output This command returns a table that contains the following information: • The product code • The ID of the instance • A Boolean value indicating whether the product code is attached to the instance • The account ID of the instance owner (if the product code is attached) Amazon EC2 command line tools display errors on stderr. Default: The value of the EC2_CERT environment variable.509 certificate to use when constructing requests to Amazon EC2. --aws-secret-key) instead. without actually running the command. -h Displays usage information for the command. This can assist us when helping you troubleshooting problems. This is useful if you are building tools to talk directly to the Query API. -v. --private-key The private key to use when constructing requests to Amazon EC2. it returns UnauthorizedOperation. --private-key) and X. --verbose Displays verbose output.14.0 onwards of the Amazon EC2 CLI tools. --cert ec2_cert The X. Option Description -K. 108 . the private key (-K. For more information.

Related Action • ConfirmProductInstance Related Commands • ec2-describe-instances (p. Amazon Elastic Compute Cloud CLI Reference Examples Examples Example This example command determines whether the specified product code is associated with the specified instance. 760) 109 . For more information. PROMPT> ec2-confirm-product-instance 774F4FF8 -i i-10a64379 774F4FF8 i-10a64379 true 111122223333 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. 378) • ec2-run-instances (p. 3) • Setting Up the CLI Tools (Windows) (p. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.

--source-region source_region The name of the region that contains the AMI to copy. --source-ami-id source_ami_id The ID of the AMI to copy. Tip If you are using the AWS CLI. see Copying an AMI in the Amazon EC2 User Guide for Linux Instances. and then type the following: ec2-copy-image -r source_region -s source_ami_id [-n ami_name] [-d ami_description] [-c token] Options Name Description -r. Type: String Default: None Required: Yes Example: ami-4fa54026 -n. use the AWS CLI copy-image command instead. the AMI is copied from the region specified with the --source-region option to the region specified with the --region option or the EC2_URL environment variable. The short version of this command is ec2cpimg. Syntax At a command prompt. --name ami_name The name of the new AMI in the destination region. If you wish to change the encryption status of an AMI's backing snapshots while copying them. Amazon Elastic Compute Cloud CLI Reference ec2-copy-image ec2-copy-image Description Initiates the copy of an AMI from the specified source region to the current region. Type: String Default: None Required: Yes Example: us-west-2 -s. In cross-region copy operations. Type: String Default: Same name as the AMI being copied. Tip The ec2-copy-image command does not support encryption operations while copying. You can copy the AMI within the same region or from one region to another. switch to the destination region. see copy-image instead. 110 . For more information.

Amazon Elastic Compute Cloud CLI Reference Common Options Name Description Required: No Example: My-Standard-AMI -d. Default: The endpoint specified by the EC2_URL environment variable. For more information. the region specified by the EC2_URL environment variable.com if EC2_URL isn't set. Constraints: Up to 255 characters. see How to Ensure Idempotency in the Amazon EC2 User Guide for Linux Instances. or https://ec2.com 111 .amazonaws. Type: String Default: Same description as the AMI being copied. --description ami_description A description for the new AMI in the destination region. case-sensitive identifier you provide to ensure idempotency of the request. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Type: String Default: None Constraints: Up to 255 characters Required: No Example: 550e8400-e29b-41d4-a716-446655440000 Common Options Option Description --region region The region. Default: The region specified by the EC2_URL environment variable. Required: No Example: -d "This is the new version of My-Standard-AMI" -c. and the URL specified by the -U option. Overrides the default region. --client-token token Unique. or us-east-1 if EC2_URL isn't set.eu-west-1amazonaws. Example: --region eu-west-1 -U. Example: -U https://ec2.

Reads arguments from standard input. --verbose Displays verbose output. --aws-access-key Your access key ID. --hide-tags Omits tags for tagged resources. see Using Temporary Security Credentials. in seconds. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -O. in seconds. Example: --connection-timeout 30 --request-timeout timeout The request timeout. you must specify this option. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. This is useful when piping the output from one command to the input of another. For more information. If AWS_ACCESS_KEY isn't set. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set)... For more information. If AWS_SECRET_KEY isn't set. --security-token The delegation token to pass along to the AWS request. otherwise. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. --debug Displays internal debugging information. -D.<remainder of security token> --connection-timeout timeout The connection timeout. you must specify this option. --show-empty-fields Shows empty columns as (nil). Example: -O AKIAIOSFODNN7EXAMPLE -W. including the API request and response on the command line. If you have the required permissions. This is useful if you are building tools to talk directly to the Query API. --aws-secret-key Your secret access key. see Tell the Tools Who aws_access_key_id You Are. -v. This can assist us when helping you troubleshooting problems. the command returns DryRunOperation. --auth-dry-run Checks whether you have the required permissions for the command. This is only delegation_token required when you are using temporary security credentials. Default: The value of the AWS_ACCESS_KEY environment variable. without actually running the command. --headers Includes column headers in the command output. 112 . it returns UnauthorizedOperation. --help. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. Example: -T AQoDYXdzEJr. Example: --request-timeout 45 -H. . -h Displays usage information for the command.

509 certificate to use when constructing requests to Amazon EC2.from us-west-2" -c 550e8400-e29b-41d4-a716-46655440001 IMAGE ami-1a2b3c4d Example 2 This example command copies the AMI with the ID ami-4d3c2b1a in region us-east-1 to ap-northeast-1.509 certificate (-C. --aws-secret-key) instead.pem Output This command returns a table that contains the following information: • The IMAGE identifier • The ID of the new image Amazon EC2 command line tools display errors on stderr. naming the new AMI My-Standard-AMI: PROMPT> ec2-copy-image -r us-west-2 -s ami-4d3c2b1a -n "My-Standard-AMI" -d "This is a copy of ami-4fa54026 --My-standard-AMI-. --private-key) and X. see Setting Up the Amazon EC2 CLI. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --cert) options are not supported.0 onwards of the Amazon EC2 CLI tools. --cert ec2_cert The X.pem -C. Option Description -K. naming the new AMI My-Standard-AMI: PROMPT> ec2-copy-image -r us-east-1 --region ap-northeast-1 -s ami-4d3c2b1a -n "My- Standard-AMI" -d "This is a copy of ami-4fa54026 --My-Standard-AMI-. For more information. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Use your access key ID (-O. Examples Example 1 This example command copies the AMI with the ID ami-4d3c2b1a in region us-west-2. --private-key The private key to use when constructing requests to Amazon EC2. --aws-access-key) and secret access key (-W. see SOAP Requests. Amazon Elastic Compute Cloud CLI Reference Output Deprecated Options We have deprecated the SOAP API for Amazon EC2. From version 1. Default: The value of the EC2_CERT environment variable. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.from us-east-1" -c 550e8400-e29b-41d4-a716-46655440000 IMAGE ami-1a2b3c4d 113 . the private key (-K. For more information.6.14.

see copy-snapshot instead. Related Action • CopyImage Related Commands • ec2-describe-images (p. Amazon Elastic Compute Cloud CLI Reference Related Topics Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. You can copy the snapshot within the same region or from one region to another. encrypted snapshot copies use the default AWS Key Management Service customer master key (CMK) for EBS. see Copying an Amazon EBS Snapshot in the Amazon EC2 User Guide for Linux Instances. you can specify a non-default master key with the --kms-key-id option. Copies of encrypted EBS snapshots remain encrypted. For more information. Copies of unencrypted snapshots remain unencrypted. Tip If you are using the AWS CLI. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. unless the --encrypted flag is specified during the snapshot copy operation. Syntax ec2-copy-snapshot -r source_region -s source_snapshot_id [-d description] [--encrypted] [-- kms-key-id kms_key_id] 114 . see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. the snapshot is copied from the region specified with the -- source-region option to the region specified with the --region option or the EC2_URL environment variable. The short version of this command is ec2cpsnap. however. 3) • Setting Up the CLI Tools (Windows) (p. For more information. 356) • ec2-deregister (p. In cross-region snapshot copy operations. By default. 301) ec2-copy-snapshot Description Copies a point-in-time snapshot of an Amazon Elastic Block Store (Amazon EBS) volume and stores it in Amazon Simple Storage Service (Amazon S3).

--source-snapshot-id The ID of the Amazon EBS snapshot to copy. Type: String Default: None Required: Yes Example: us-west-1 -s. you can encrypt a copy of an unencrypted snapshot with this flag. --description description A description for the destination Amazon EBS snapshot. Type: String Default: The source's snapshot description or "[Copied from SOURCE_REGION]" if the source snapshot doesn't have a description. Required: No Example: -d "Copy of user data from us-west-1" -r. Constraints: Up to 255 characters. see Amazon EBS Encryption in the Amazon EC2 User Guide for Linux Instances. Default: No Required: No 115 . --source-region source_region The name of the region that contains the snapshot to be copied. There is no way to create an unencrypted snapshot copy from an encrypted snapshot. The default CMK is used unless a non-default AWS KMS CMK is specified with the --kms-key-id option. For more information. however. Amazon Elastic Compute Cloud CLI Reference Options Options Name Description -d. source_snapshot_id Type: String Default: None Required: Yes Example: snap-4d826724 --encrypted Specifies whether the destination snapshot should be encrypted.

If the --kms- key-id option is specified. If AWS_SECRET_KEY isn't set. Required: No Common Options Option Description --region region The region. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY 116 . Amazon Elastic Compute Cloud CLI Reference Common Options Name Description -k. or https://ec2. Example: -O AKIAIOSFODNN7EXAMPLE -W. the --encrypted option must also be set. you must specify this option.com -O. the region specified by the EC2_URL environment variable. the default CMK for EBS is used. and the URL specified by the -U option. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. For more information. The specified key must exist in the region that the snapshot is being copied to. Default: The region specified by the EC2_URL environment variable.com if EC2_URL isn't set. --aws-access-key Your access key ID. Example: -U https://ec2. Example: --region eu-west-1 -U. or us-east-1 if EC2_URL isn't set. If AWS_ACCESS_KEY isn't set. you must specify this option. see Tell the Tools Who aws_access_key_id You Are. --kms-key-id kms_key_id The full ARN of the AWS KMS CMK to use when creating the snapshot copy. --aws-secret-key Your secret access key. if this parameter is not specified.eu-west-1amazonaws. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point.amazonaws. Overrides the default region. Default: The value of the AWS_ACCESS_KEY environment variable. This parameter is only required if you want to use a non-default CMK. Default: The full ARN of the aws/ebs master key for your account in the region specified. Default: The endpoint specified by the EC2_URL environment variable.

it returns UnauthorizedOperation. --private-key) and X. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. -D. --aws-secret-key) instead. Reads arguments from standard input. Example: -T AQoDYXdzEJr. --debug Displays internal debugging information.509 certificate (-C. otherwise. --show-empty-fields Shows empty columns as (nil). -v. For more information. Example: --connection-timeout 30 --request-timeout timeout The request timeout. If you have the required permissions.pem 117 . From version 1. This is useful when piping the output from one command to the input of another.14.. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable.<remainder of security token> --connection-timeout timeout The connection timeout. For more information. -h Displays usage information for the command. see SOAP Requests. --private-key The private key to use when constructing requests to Amazon EC2. see Setting Up the Amazon EC2 CLI. Use your access key ID (-O. Deprecated Options We have deprecated the SOAP API for Amazon EC2. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -T. --hide-tags Omits tags for tagged resources. see Using Temporary Security Credentials. --headers Includes column headers in the command output.. --cert) options are not supported. --help. including the API request and response on the command line. . without actually running the command. Example: --request-timeout 45 -H.6. --verbose Displays verbose output. --aws-access-key) and secret access key (-W. This can assist us when helping you troubleshooting problems. --auth-dry-run Checks whether you have the required permissions for the command. in seconds. This is useful if you are building tools to talk directly to the Query API.0 onwards of the Amazon EC2 CLI tools. in seconds. For more information. Option Description -K. the command returns DryRunOperation. This is only delegation_token required when you are using temporary security credentials. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. the private key (-K. --security-token The delegation token to pass along to the AWS request.

179) • ec2-delete-snapshot (p. Amazon Elastic Compute Cloud CLI Reference Output Option Description -C. Related Action • CopySnapshot Related Commands • ec2-create-snapshot (p. 3) • Setting Up the CLI Tools (Windows) (p. For more information.pem Output This command returns a table that contains the following information: • The SNAPSHOT identifier • The ID of the new snapshot Amazon EC2 command line tools display errors on stderr.509 certificate to use when constructing requests to Amazon EC2. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. 265) • ec2-describe-snapshots (p. 468) 118 . see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. Examples Example This example command copies the snapshot in the us-west-1 region with the ID snap-1a2b3c4d. --cert ec2_cert The X. Default: The value of the EC2_CERT environment variable. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. PROMPT> ec2-copy-snapshot -r us-west-1 -s snap-1a2b3c4d --description "Copy of user data from us-west-1" SNAPSHOT snap-2a2b3c4d Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.

IP address. The IP address must be static and can't be behind a device performing NAT. see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon VPC User Guide. with the exception of 7224.65534 range). which is reserved in the EU (Ireland) Region. The IP address must be static and can't be behind a device performing network address translation (NAT).1 119 . Virginia) Region. which is reserved in the US East (N. and subsequent requests return information about the existing customer gateway. If you don't have an ASN already. For more information about VPN customer gateways. you can use a private ASN (in the 64512 .1 Default: None Required: Yes Example: -t ipsec. The subsequent requests do not create new customer gateway resources. You must provide the Internet-routable IP address of the customer gateway's external interface.65534. If you run an identical request more than one time. Type: String Valid values: ipsec. see the Wikipedia article. see create-customer-gateway instead. (The device on the AWS side of the VPN connection is the virtual private gateway. you can also provide the device's BGP Autonomous System Number (ASN). Tip If you are using the AWS CLI. Amazon Elastic Compute Cloud CLI Reference ec2-create-customer-gateway ec2-create-customer-gateway Description Provides information to AWS about your VPN customer gateway device. For devices that use Border Gateway Protocol (BGP). Note Amazon EC2 supports all 2-byte ASN numbers in the range of 1 . the first request creates the customer gateway.) You must provide the Internet-routable IP address of the customer gateway's external interface. Important You cannot create more than one customer gateway with the same VPN type. and 9059. and BGP ASN parameter values. The customer gateway is the appliance at your end of the VPN connection. The short version of this command is ec2addcgw. Syntax ec2-create-customer-gateway -t type -i ip_address -b bgp_asn Options Name Description -t type The type of VPN connection this customer gateway supports. You can use an existing ASN assigned to your network. For more information about ASNs.

amazonaws. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description -i ip_address The Internet-routable IP address for the customer gateway's outside interface. Default: The value of the AWS_ACCESS_KEY environment variable. --aws-access-key Your access key ID.eu-west-1amazonaws.1. Type: String Default: None Required: Yes Example: -i 12. Type: Integer Default: None Required: Yes Example: -b 65534 Common Options Option Description --region region The region.3 -b bgp_asn For devices that support BGP.com -O. For more information. The address must be static. or https://ec2. the region specified by the EC2_URL environment variable.2. Overrides the default region. you must specify this option. see Tell the Tools Who aws_access_key_id You Are. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Example: --region eu-west-1 -U. Example: -U https://ec2. If AWS_ACCESS_KEY isn't set. or us-east-1 if EC2_URL isn't set. and the URL specified by the -U option. Example: -O AKIAIOSFODNN7EXAMPLE 120 . Default: The region specified by the EC2_URL environment variable. Default: The endpoint specified by the EC2_URL environment variable. the customer gateway's BGP ASN.com if EC2_URL isn't set.

121 . Example: --connection-timeout 30 --request-timeout timeout The request timeout. --aws-secret-key) instead.6. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. --aws-secret-key Your secret access key. -h Displays usage information for the command. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). From version 1. --cert) options are not supported. without actually running the command. --hide-tags Omits tags for tagged resources. Deprecated Options We have deprecated the SOAP API for Amazon EC2. This is useful when piping the output from one command to the input of another. -D.<remainder of security token> --connection-timeout timeout The connection timeout. For more information. If you have the required permissions. in seconds. Example: -T AQoDYXdzEJr. Use your access key ID (-O. --private-key) and X. --help.509 certificate (-C. the private key (-K. Example: --request-timeout 45 -H. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -W. see Setting Up the Amazon EC2 CLI. -v. --debug Displays internal debugging information. otherwise. For more information. --show-empty-fields Shows empty columns as (nil). --aws-access-key) and secret access key (-W. --verbose Displays verbose output. This can assist us when helping you troubleshooting problems. . This is only delegation_token required when you are using temporary security credentials. This is useful if you are building tools to talk directly to the Query API. in seconds. Reads arguments from standard input. --security-token The delegation token to pass along to the AWS request. including the API request and response on the command line. --auth-dry-run Checks whether you have the required permissions for the command.14. --headers Includes column headers in the command output. see SOAP Requests. it returns UnauthorizedOperation..0 onwards of the Amazon EC2 CLI tools. If AWS_SECRET_KEY isn't set. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T.. see Using Temporary Security Credentials. For more information. the command returns DryRunOperation. you must specify this option.

509 certificate to use when constructing requests to Amazon EC2. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. 3) • Setting Up the CLI Tools (Windows) (p.2. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --private-key The private key to use when constructing requests to Amazon EC2. deleting. PROMPT> ec2-create-customer-gateway -t ipsec.3 and ASN 65534.pem -C. Examples Example This example command passes information to AWS about the customer gateway with the IP address 12. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.pem Output This command returns a table that contains the following information: • The CUSTOMERGATEWAY identifier • The customer gateway ID.3 -b 65534 CUSTOMERGATEWAY cgw-b4dc3961 pending ipsec. deleted) • The type of VPN connection the customer gateway supports • The Internet-routable IP address for the customer gateway's outside interface • The customer gateway's BGP ASN Amazon EC2 command line tools display errors on stderr. which uniquely identifies the customer gateway • The current state of the customer gateway (pending.1 -i 12.2. available. 122 .1 12. Default: The value of the EC2_CERT environment variable. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Amazon Elastic Compute Cloud CLI Reference Output Option Description -K.1.3 65534 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.1. For more information.1. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.2. --cert ec2_cert The X.

Important By default.compute. Amazon Elastic Compute Cloud CLI Reference ec2-create-dhcp-options Related Action • CreateCustomerGateway Related Commands • ec2-delete-customer-gateway (p. For more information about the options. The following table lists the individual DHCP options that you can specify. see DHCP Options Sets in the Amazon VPC User Guide. 224) • ec2-describe-customer-gateways (p. Otherwise. or AmazonProvidedDNS. domain-name If you're using AmazonProvidedDNS in us- east-1. For more information about these node types. 2. The default DHCP option set specifies AmazonProvidedDNS. If you create a set of DHCP options. and your VPC has an Internet gateway. 4.internal. you must associate it with the VPC. ap-northeast-1. see RFC 2132. DHCP Option Name Description domain-name-servers The IP addresses of up to four domain name servers.internal). For more information. MyCompany. specify region. make sure to set the domain-name-servers option either to AmazonProvidedDNS or to a domain name server of your choice. your VPC has a set of DHCP options that includes only a DNS server that we provide (AmazonProvidedDNS). go to RFC 2132. netbios-node-type The NetBIOS node type (1. or 8). specify ec2.internal (for example. causing all existing and new instances that you launch in the VPC to use this set of DHCP options. specify a domain name (for example. We recommend that you specify 2 (broadcast and multicast are not currently supported). After creating the set. If you're using AmazonProvidedDNS in another region. 123 . netbios-name-servers The IP addresses of up to four NetBIOS name servers. If specifying more than one domain name server.com). 331) ec2-create-dhcp-options Description Creates a set of DHCP options for your VPC. separate them with commas.compute. ntp-servers The IP addresses of up to four Network Time Protocol (NTP) servers.

] . Tip If you are using the AWS CLI.] [ name=value[.10.value"). Example: --region eu-west-1 -U. "name=value..eu-west-1amazonaws.com if EC2_URL isn't set.value The DHCP option (including the option's name and its value).2. If you're using the command line tools on a Windows system.amazonaws. If you're using Windows Powershell. you must specify this option..2. or https://ec2. and more than one value per option. escaped with backticks (for example. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Overrides the default region. Amazon Elastic Compute Cloud CLI Reference Syntax The short version of this command is ec2adddopt. or us-east-1 if EC2_URL isn't set.com -O. You can specify more than one option in the request..5.... --aws-access-key Your access key ID. 124 .5.2" Common Options Option Description --region region The region. see create-dhcp-options instead. you might need to use a second set of quotation marks. and the URL specified by the -U option. you might need to use quotation marks (for example. ] Options Name Description name=value. Default: The endpoint specified by the EC2_URL environment variable.value. see Tell the Tools Who aws_access_key_id You Are. "`"name=value`""). Type: String Default: None Required: Yes Example: "domain-name-servers=10. Default: The region specified by the EC2_URL environment variable.1. Example: -U https://ec2. Syntax ec2-create-dhcp-options name=value[. If AWS_ACCESS_KEY isn't set.value. For more information. Default: The value of the AWS_ACCESS_KEY environment variable. the region specified by the EC2_URL environment variable.

--hide-tags Omits tags for tagged resources. -D. -h Displays usage information for the command. Example: --request-timeout 45 -H. Example: --connection-timeout 30 --request-timeout timeout The request timeout.14. --auth-dry-run Checks whether you have the required permissions for the command. For more information. . it returns UnauthorizedOperation. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. This can assist us when helping you troubleshooting problems. For more information. From version 1. see Setting Up the Amazon EC2 CLI. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set).509 certificate (-C. Example: -T AQoDYXdzEJr. --verbose Displays verbose output. Reads arguments from standard input. you must specify this option. --help. If you have the required permissions. in seconds. --aws-access-key) and secret access key (-W. This is useful when piping the output from one command to the input of another. without actually running the command. the command returns DryRunOperation. --private-key) and X. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description Example: -O AKIAIOSFODNN7EXAMPLE -W. --show-empty-fields Shows empty columns as (nil). otherwise. -v. This is only delegation_token required when you are using temporary security credentials. --headers Includes column headers in the command output. including the API request and response on the command line.0 onwards of the Amazon EC2 CLI tools.<remainder of security token> --connection-timeout timeout The connection timeout. For more information. Deprecated Options We have deprecated the SOAP API for Amazon EC2. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. in seconds. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. 125 . --cert) options are not supported..6. --debug Displays internal debugging information. If AWS_SECRET_KEY isn't set. --aws-secret-key Your secret access key. --aws-secret-key) instead. the private key (-K. This is useful if you are building tools to talk directly to the Query API. see SOAP Requests. --security-token The delegation token to pass along to the AWS request. see Using Temporary Security Credentials. Use your access key ID (-O..

509 certificate to use when constructing requests to Amazon EC2. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.2. --cert ec2_cert The X.5. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.1 and 10.2. 126 .2. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable.2).5.2 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Amazon Elastic Compute Cloud CLI Reference Output Option Description -K.2. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.com and two DNS servers (10.1. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.1.com OPTION domain-name-servers 10. Examples Example This example command creates a set of DHCP options with a domain name mydomain. Default: The value of the EC2_CERT environment variable.2.5. --private-key The private key to use when constructing requests to Amazon EC2.2.10. PROMPT> ec2-create-dhcp-options "domain-name=mydomain. For more information.10.2" DHCPOPTIONS dopt-7a8b9c2d OPTION domain-name mydomain.pem Output This command returns a table that contains the following information: • The DHCPOPTIONS identifier • The ID of the DHCP options set • The OPTION identifier • The name of the option and its value Amazon EC2 command line tools display errors on stderr.5.5.5. 3) • Setting Up the CLI Tools (Windows) (p.pem -C.com" "domain-name- servers=10.

A security group is for use with instances either in the EC2-Classic platform or in a specific VPC. see create-security-group instead. see AWS Service Limits. Tip If you are using the AWS CLI. 51) • ec2-delete-dhcp-options (p. When you create a security group. However. You can have a security group for use in EC2-Classic with the same name as a security group for use in a VPC. Syntax ec2-create-group group_name -d description [-c vpc_id] Options Name Description group_name The name of the security group. 336) ec2-create-group Description Creates a security group. Important You have a limit on the number of security groups you can create. Amazon Elastic Compute Cloud CLI Reference ec2-create-group Related Action • CreateDhcpOptions Related Commands • ec2-associate-dhcp-options (p. you specify a friendly name of your choice. 228) • ec2-describe-dhcp-options (p. For more information. you can't have two security groups for use in EC2-Classic with the same name or two security groups for use in a VPC with the same name. You have a default security group for EC2-Classic and a default security group for your VPC. You can add or remove rules from your security groups using the ec2-authorize and ec2-revoke commands. The short version of this command is ec2addgrp. the instance is launched into the appropriate default security group. Type: String Default: None 127 . A default security group includes a default rule that grants instances unrestricted network access to each other. For more information. see Amazon EC2 Security Groups in the Amazon EC2 User Guide for Linux Instances and Security Groups for Your VPC in the Amazon VPC User Guide. If you don't specify a security group when you launch an instance.

or us-east-1 if EC2_URL isn't set. spaces.@[]+=&. 0-9. Default: The region specified by the EC2_URL environment variable. the region specified by the EC2_URL environment variable. and . and the URL specified by the -U option. This is informational only. A-Z._-:/ ()#.@[]+=&. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description Constraints: Up to 255 characters in length Constraints for EC2-Classic: ASCII characters Constraints for EC2-VPC: a-z. and . A-Z.{}!$* Required: Yes Example: -d "Web Servers" -c._-:/ ()#. Type: String Default: None Required: Conditional Condition: Required for EC2-VPC Example: -c vpc-1a2b3c4d Common Options Option Description --region region The region. Overrides the default region.{}!$* Required: Yes Example: websrv -d. --vpc vpc_id [EC2-VPC] The ID of the VPC. 0-9. --description description A description for the security group. Type: String Default: None Constraints: Up to 255 characters in length Constraints for EC2-Classic: ASCII characters Constraints for EC2-VPC: a-z. Example: --region eu-west-1 128 . spaces.

it returns UnauthorizedOperation. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. For more information.. If you have the required permissions. -v. Default: The value of the AWS_ACCESS_KEY environment variable. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. --verbose Displays verbose output. Example: -O AKIAIOSFODNN7EXAMPLE -W. without actually running the command.com -O. in seconds. you must specify this option. including the API request and response on the command line. -D. If AWS_SECRET_KEY isn't set. --aws-secret-key Your secret access key. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -U. If AWS_ACCESS_KEY isn't set. --auth-dry-run Checks whether you have the required permissions for the command.com if EC2_URL isn't set.eu-west-1amazonaws. --security-token The delegation token to pass along to the AWS request. Default: The endpoint specified by the EC2_URL environment variable. --hide-tags Omits tags for tagged resources. in seconds. Example: -U https://ec2. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. the command returns DryRunOperation. Example: --connection-timeout 30 --request-timeout timeout The request timeout. This can assist us when helping you troubleshooting problems. For more information. Example: --request-timeout 45 -H.amazonaws. --debug Displays internal debugging information.<remainder of security token> --connection-timeout timeout The connection timeout. --aws-access-key Your access key ID. This is only delegation_token required when you are using temporary security credentials. --headers Includes column headers in the command output. see Using Temporary Security Credentials. --show-empty-fields Shows empty columns as (nil). Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). This is useful if you are building tools to talk directly to the Query API. see Tell the Tools Who aws_access_key_id You Are.. 129 . or https://ec2. otherwise. Example: -T AQoDYXdzEJr. you must specify this option.

--private-key) and X.509 certificate to use when constructing requests to Amazon EC2. Amazon Elastic Compute Cloud CLI Reference Output Option Description . From version 1.6. --private-key The private key to use when constructing requests to Amazon EC2. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. For more information. This is useful when piping the output from one command to the input of another.pem Output This command returns a table that contains the following information: • The GROUP identifier • The ID of the new security group • The name of the security group • The description of the security group Amazon EC2 command line tools display errors on stderr. --cert) options are not supported.509 certificate (-C. see Setting Up the Amazon EC2 CLI. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. -h Displays usage information for the command. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Examples Example 1 This example command creates a security group named websrv for EC2-Classic. Option Description -K. --aws-secret-key) instead. Reads arguments from standard input. the private key (-K. --cert ec2_cert The X.pem -C. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.0 onwards of the Amazon EC2 CLI tools. --aws-access-key) and secret access key (-W. Deprecated Options We have deprecated the SOAP API for Amazon EC2. Default: The value of the EC2_CERT environment variable.14. --help. For more information. Use your access key ID (-O. PROMPT> ec2-create-group websrv -d "Web Servers" GROUP sg-1a2b3c4d websrv Web Servers 130 . see SOAP Requests.

For more information. When you launch an instance from this new AMI. 760) ec2-create-image Description Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped. If you customized your instance with instance store volumes or Amazon EBS volumes in addition to the root device volume. the instance automatically launches with those additional volumes. Amazon Elastic Compute Cloud CLI Reference Related Topics Example 2 This example command creates a security group named WebServerSG for the specified VPC. see the following topics: • Creating an Amazon EBS-Backed Linux AMI (Amazon EC2 User Guide for Linux Instances) • Creating an Amazon EBS-Backed Windows AMI (Amazon EC2 User Guide for Windows Instances) The AMI creation process is different for instance store-backed AMIs. 76) • ec2-delete-group (p. For more information. For more information about the differences between Amazon EBS-backed and instance store-backed instances. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. 345) • ec2-revoke (p. PROMPT> ec2-create-group WebServerSG -d "Web Servers" -c vpc-3325caf2 GROUP sg-0a42d66a WebServerSG Web Servers Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. 235) • ec2-describe-group (p. Related Action • CreateSecurityGroup Related Commands • ec2-authorize (p. 3) • Setting Up the CLI Tools (Windows) (p. 753) • ec2-run-instances (p. the new AMI contains block device mapping information for those volumes. see Storage for the Root 131 .

--name name A name for the new AMI. slashes (/). Amazon Elastic Compute Cloud CLI Reference Syntax Device in the Amazon EC2 User Guide for Linux Instances. Tip If you are using the AWS CLI. or underscores(_). To create an instance store-backed AMI. Type: String Default: None Constraints: Up to 255 ASCII characters Required: No Example: -d Fedora_v11 --no-reboot When this option is absent. therefore. Syntax ec2-create-image instance_id --name name [--description description] [--no-reboot] [-b. square brackets ([]). see create-image instead. --description description A description for the new AMI. Amazon EC2 attempts to cleanly shut down the instance before image creation and reboots the instance. use ec2-bundle-vol (Linux) or ec2-bundle-instance (p. at-signs (@). When this option is used. parentheses (()).). Required: Yes Example: -n "Standard Web Server" -d. Allows spaces if the name is enclosed in quotation marks. file system integrity on the created image can't be guaranteed. Type: String Default: None Constraints: 3-128 alphanumeric characters. dashes (-). single quotes ('). -- blockdevicemapping mapping ] Options Name Description instance_id The ID of the instance. Amazon EC2 doesn't shut down the instance before creating the image. Type: String Default: None Required: Yes Example: i-10a64379 -n. 83) (Windows). The short version of this command is ec2cim. periods (. 132 .

Amazon Elastic Compute Cloud CLI Reference Options Name Description Type: Boolean Default: false Required: No Example: --no-reboot 133 .

--block-device-mapping mapping An entry for the block device mapping for the instance. Amazon Elastic Compute Cloud CLI Reference Options Name Description -b. [volume-size] To create an empty Amazon EBS volume. Instance store volumes are numbered starting from 0. For more information. Each entry is passed in the form <devicename>=<blockdevice>. You can specify multiple --block-device-mapping options in one call. you must also specify the number of IOPS that the volume should support. The default for the root volume is true and the default for other volumes is false. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1. For more information. and blockdevice can be one of the following values: • none – Suppresses an existing mapping of the device from the AMI used to launch the instance. [volume-type] The default volume type is standard. [snapshot-id] To create a volume from a snapshot. To create a General Purpose SSD volume. • [snapshot-id]:[volume-size]:[delete-on-termination]: [volume-type[:iops]]:[encrypted] – An Amazon EBS volume to map to the device. see Block Device Mapping in the Amazon EC2 User Guide for Linux Instances. • ephemeraln – An instance store volume to be mapped to the device. see Preserving Amazon EBS Volumes on Instance Termination in the Amazon EC2 User Guide for Linux Instances. [iops] The number of provisioned IOPS that the volume supports (this option is only valid with io1 volume types). [delete-on-termination] To prevent deletion on instance termination. specify the snapshot ID. specify false. For example: "/dev/sdc=ephemeral0". If the volume type is io1. For example: "/dev/sdh=:20". For example: "/dev/ sdc=none". The devicename is the device name of the physical device on the instance to map. omit the snapshot ID and specify a volume size instead. 134 . see Amazon EBS Volume Types in the Amazon EC2 User Guide for Linux Instances. To create a Provisioned IOPS SSD volume. For more information. specify gp2. specify io1.

Common Options Option Description --region region The region. Default: The region specified by the EC2_URL environment variable. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. For more information. see Amazon EBS Encryption in the Amazon EC2 User Guide for Linux Instances. the region specified by the EC2_URL environment variable. we ignore any instance store volumes specified in the block device mapping for the AMI. you must specify instance store volumes in the block device mapping for the instance. Example: -U https://ec2. Default: The endpoint specified by the EC2_URL environment variable. specify true. When you launch an M3 instance.com if EC2_URL isn't set. the mapping argument must be enclosed in double quotes. or https://ec2. An encrypted Amazon EBS volume must be attached to an instance that supports Amazon EBS encryption. Volumes created from encrypted snapshots are automatically encrypted. you must launch it using a supported instance type. or us-east-1 if EC2_URL isn't set. Overrides the default region.eu-west-1amazonaws. and the URL specified by the -U option. Note For M3 instances. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description [encrypted] To encrypt the volume.com 135 .amazonaws. Type: String Default: None Required: No Example: -b "/dev/ sdc=snap-7eb96d16:100:false:io1:500" Note On Windows. If your AMI uses an encrypted volume. Example: --region eu-west-1 -U. as shown in the example.

For more information. --aws-access-key Your access key ID. in seconds. -h Displays usage information for the command. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -O. see Tell the Tools Who aws_access_key_id You Are. --headers Includes column headers in the command output. This is only delegation_token required when you are using temporary security credentials. the command returns DryRunOperation. see Using Temporary Security Credentials. you must specify this option. you must specify this option. Example: --connection-timeout 30 --request-timeout timeout The request timeout. in seconds.. -D. Example: -O AKIAIOSFODNN7EXAMPLE -W. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Example: --request-timeout 45 -H. Reads arguments from standard input. including the API request and response on the command line. This can assist us when helping you troubleshooting problems. --debug Displays internal debugging information. --help. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T..<remainder of security token> --connection-timeout timeout The connection timeout. If AWS_SECRET_KEY isn't set. --auth-dry-run Checks whether you have the required permissions for the command. . otherwise. --show-empty-fields Shows empty columns as (nil). without actually running the command. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). --aws-secret-key Your secret access key. --hide-tags Omits tags for tagged resources. If you have the required permissions. --verbose Displays verbose output. --security-token The delegation token to pass along to the AWS request. This is useful when piping the output from one command to the input of another. For more information. If AWS_ACCESS_KEY isn't set. Default: The value of the AWS_ACCESS_KEY environment variable. 136 . it returns UnauthorizedOperation. -v. Example: -T AQoDYXdzEJr. This is useful if you are building tools to talk directly to the Query API.

--private-key) and X.pem Output This command returns a table that contains the following information: • The IMAGE identifier • The ID of the new AMI Amazon EC2 command line tools display errors on stderr.pem -C. see Setting Up the Amazon EC2 CLI. Default: The value of the EC2_CERT environment variable. --cert ec2_cert The X.14. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. From version 1. For more information. The first volume is based on an Amazon EBS snapshot.0 onwards of the Amazon EC2 CLI tools. The third volume is an instance store volume.6. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Amazon Elastic Compute Cloud CLI Reference Output Deprecated Options We have deprecated the SOAP API for Amazon EC2. --cert) options are not supported. ephemeral0. --private-key The private key to use when constructing requests to Amazon EC2. --aws-access-key) and secret access key (-W. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Use your access key ID (-O. PROMPT> ec2-create-image i-10a64379 --name "Standard Web Server" --description "Standard web server AMI" IMAGE ami-4fa54026 Example This example command creates an AMI with three volumes. Option Description -K. the private key (-K. For more information. --aws-secret-key) instead.509 certificate to use when constructing requests to Amazon EC2. The second volume is an empty 100 GiB Amazon EBS volume. PROMPT> ec2-create-image i-10a64379 --name "Standard Web Server" --description "Standard web server AMI" -b "/dev/sdf=snap-2a3b4c5d" -b "/dev/sdg=:100" -b "/dev/sdc=ephemeral0" IMAGE ami-4fa54026 137 .509 certificate (-C. Examples Example This example command creates an AMI from the specified instance. see SOAP Requests.

You can only export an instance that you previously imported into Amazon EC2. Amazon Elastic Compute Cloud CLI Reference Related Topics Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. For more information. Tip If you are using the AWS CLI. Related Action • CreateImage Related Commands • ec2-deregister (p. image formats. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. 760) ec2-create-instance-export-task Description Exports a running or stopped instance to an Amazon S3 bucket. The short version of this command is ec2addixt. 3) • Setting Up the CLI Tools (Windows) (p. 138 . see Exporting EC2 Instances in the Amazon EC2 User Guide for Linux Instances. 356) • ec2-run-instances (p. For information about the supported operating systems. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. target_environment Citrix supports Xen 6. Microsoft supports Microsoft Hyper-V. VMware supports VMware 4 and 5. and known limitations for the types of instances you can export. Syntax ec2-create-instance-export-task instance_id -e target_environment -f disk_image_format [-c container_format] -b S3_bucket [-p S3_prefix] [-d description] Options Name Description instance_id The ID of the instance. see create-instance-export-task instead. Required: Yes -e. 301) • ec2-describe-images (p. --target-environment The target environment.

The maximum length is 255 bytes. Type: String Required: Yes -p. --container-format The container format used to combine disk images with container_format metadata (such as OVF). otherwise empty Required: No -b. only the disk image will be exported. --description description A description for the conversion task or the resource being exported. otherwise vhd Required: No -c. Type: String Valid values: OVA Default: If -e = VMware.com. --bucket S3_bucket The name of the destination Amazon S3 bucket where the file will be exported. then -f = vmdk. The destination bucket must exist and grant WRITE and READ_ACL permissions to the AWS account vm-import-export@amazon. and other relevant parameters. Amazon Elastic Compute Cloud CLI Reference Options Name Description Type: String Valid values: VMware | Citrix | Microsoft Required: Yes -f. then -c = OVA. Type: String Required: No Example: my-export-. --disk-image-format The disk image file format used to represent the exported disk_image_format disk. the export task ID. The maximum length is 1000 bytes of UTF-8 character encoding. Type: String Required: No 139 . incoming/vm-export/ -d. If absent. --prefix S3_prefix The prefix for the Amazon S3 key (object name) used for the exported file. Type: String Valid values: vmdk | vhd Default: If -e = vmware. The final key is composed from this prefix (if specified).

in seconds. Default: The endpoint specified by the EC2_URL environment variable. --security-token The delegation token to pass along to the AWS request. Example: -U https://ec2. the region specified by the EC2_URL environment variable. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region. If AWS_SECRET_KEY isn't set. --aws-secret-key Your secret access key.eu-west-1amazonaws. If AWS_ACCESS_KEY isn't set.com -O. --show-empty-fields Shows empty columns as (nil). 140 . Overrides the default region. see Using Temporary Security Credentials. see Tell the Tools Who aws_access_key_id You Are. Example: --request-timeout 45 -H.com if EC2_URL isn't set. For more information.. --aws-access-key Your access key ID. Example: --region eu-west-1 -U. Default: The region specified by the EC2_URL environment variable. and the URL specified by the -U option. This is only delegation_token required when you are using temporary security credentials. Example: --connection-timeout 30 --request-timeout timeout The request timeout. you must specify this option. --hide-tags Omits tags for tagged resources. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. in seconds. Default: The value of the AWS_ACCESS_KEY environment variable. or us-east-1 if EC2_URL isn't set.<remainder of security token> --connection-timeout timeout The connection timeout. or https://ec2. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set).amazonaws. you must specify this option. --headers Includes column headers in the command output. Example: -O AKIAIOSFODNN7EXAMPLE -W. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Example: -T AQoDYXdzEJr. For more information..

--private-key The private key to use when constructing requests to Amazon EC2. For more information. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Reads arguments from standard input. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?.pem -C. -v. without actually running the command. From version 1.0 onwards of the Amazon EC2 CLI tools. Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information. For more information.509 certificate (-C. --aws-secret-key) instead. otherwise. . If you have the required permissions. see SOAP Requests. --auth-dry-run Checks whether you have the required permissions for the command. Option Description -K. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable.14. --private-key) and X. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.6.pem Output This command returns a table that contains the following information: • The EXPORTTASK identifier • The ID of the export task • The state of the conversion task (active | cancelling | cancelled | completed) • The instance being exported • The target virtualization environment (vmware | citrix) • The format for the exported image (vmdk | vhd) 141 . it returns UnauthorizedOperation. --cert ec2_cert The X. see Setting Up the Amazon EC2 CLI. --aws-access-key) and secret access key (-W. This is useful when piping the output from one command to the input of another. including the API request and response on the command line. This is useful if you are building tools to talk directly to the Query API. Default: The value of the EC2_CERT environment variable. This can assist us when helping you troubleshooting problems. the private key (-K. --cert) options are not supported. the command returns DryRunOperation. --help. -h Displays usage information for the command. Deprecated Options We have deprecated the SOAP API for Amazon EC2.509 certificate to use when constructing requests to Amazon EC2. -D. --verbose Displays verbose output. Use your access key ID (-O.

vmdk Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. see the Amazon VPC User Guide. see create-internet-gateway instead. you attach it to a VPC using ec2-attach-internet-gateway. PROMPT> ec2-create-instance-export-task i-38e485d8 -e vmware -f vmdk -c ova -b myexportbucket EXPORTTASK export-i-fgelt0i7 active i-38e485d8 vmware vmdk myexportbucket export-i-fgelt0i7. 341) ec2-create-internet-gateway Description Creates an Internet gateway for use with a VPC. Amazon EC2 command line tools display errors on stderr. 96) • ec2-describe-export-tasks (p. For more information. Examples Example This example command creates a task to export an instance. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. Tip If you are using the AWS CLI. The short version of this command is ec2addigw. After creating the Internet gateway. For more information about your VPC and Internet gateway. Related Action • CreateInstanceExportTask Related Commands • ec2-cancel-export-task (p. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. Amazon Elastic Compute Cloud CLI Reference Examples • The Amazon S3 bucket for the destination image. 142 . 3) • Setting Up the CLI Tools (Windows) (p.

For more information. you must specify this option. 143 .com -O.. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). the region specified by the EC2_URL environment variable. Common Options Option Description --region region The region. in seconds.<remainder of security token> --connection-timeout timeout The connection timeout. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. For more information. Default: The value of the AWS_ACCESS_KEY environment variable. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. see Using Temporary Security Credentials.. Example: -T AQoDYXdzEJr. or https://ec2. If AWS_SECRET_KEY isn't set. --aws-access-key Your access key ID. you must specify this option. Amazon Elastic Compute Cloud CLI Reference Syntax Syntax ec2-create-internet-gateway Options This command has no options. Example: --region eu-west-1 -U. Default: The endpoint specified by the EC2_URL environment variable. This is only delegation_token required when you are using temporary security credentials. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. Example: -O AKIAIOSFODNN7EXAMPLE -W.amazonaws.eu-west-1amazonaws. Example: -U https://ec2.com if EC2_URL isn't set. in seconds. --security-token The delegation token to pass along to the AWS request. Default: The region specified by the EC2_URL environment variable. see Tell the Tools Who aws_access_key_id You Are. Example: --connection-timeout 30 --request-timeout timeout The request timeout. --aws-secret-key Your secret access key. Overrides the default region. If AWS_ACCESS_KEY isn't set. and the URL specified by the -U option. or us-east-1 if EC2_URL isn't set.

otherwise. see SOAP Requests. --help. --aws-secret-key) instead.pem Output This command returns a table that contains the following information: • The INTERNETGATEWAY identifier 144 . --verbose Displays verbose output. For more information. If you have the required permissions. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Option Description -K. This can assist us when helping you troubleshooting problems. Use your access key ID (-O. From version 1. see Setting Up the Amazon EC2 CLI.pem -C. --cert ec2_cert The X. . --show-empty-fields Shows empty columns as (nil). Deprecated Options We have deprecated the SOAP API for Amazon EC2. -v. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. This is useful when piping the output from one command to the input of another. --auth-dry-run Checks whether you have the required permissions for the command. without actually running the command.14. For more information. -h Displays usage information for the command. the private key (-K. the command returns DryRunOperation. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable.0 onwards of the Amazon EC2 CLI tools. --headers Includes column headers in the command output.509 certificate (-C. --debug Displays internal debugging information.6. Reads arguments from standard input. --private-key The private key to use when constructing requests to Amazon EC2. Amazon Elastic Compute Cloud CLI Reference Output Option Description Example: --request-timeout 45 -H. Default: The value of the EC2_CERT environment variable. This is useful if you are building tools to talk directly to the Query API. --aws-access-key) and secret access key (-W. including the API request and response on the command line. --hide-tags Omits tags for tagged resources.509 certificate to use when constructing requests to Amazon EC2. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --private-key) and X. it returns UnauthorizedOperation. -D. --cert) options are not supported.

145 . Related Action • CreateInternetGateway Related Commands • ec2-attach-internet-gateway (p. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. PROMPT> ec2-create-internet-gateway INTERNETGATEWAY igw-c0a643a9 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. For more information. 394) • ec2-detach-internet-gateway (p. To create a key pair that is available in all regions. 3) • Setting Up the CLI Tools (Windows) (p. If a key with the specified name already exists. use ec2-import-keypair (p. Tip The key pair returned to you is available only in the region in which you create it. Examples Example This example command creates an Internet gateway. 563) ec2-create-keypair Description Creates a 2048-bit RSA key pair with the specified name. Amazon EC2 stores the public key and displays the private key for you to save to a file. 62) • ec2-delete-internet-gateway (p. see Key Pairs in the Amazon EC2 User Guide for Linux Instances. Amazon Elastic Compute Cloud CLI Reference Examples • The ID of the Internet gateway Amazon EC2 command line tools display errors on stderr. 620). You can have up to five thousand key pairs per region. For more information. Amazon EC2 returns an error. The private key is returned as an unencrypted PEM encoded PKCS#8 private key. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. 239) • ec2-describe-internet-gateways (p.

--aws-secret-key Your secret access key. Syntax ec2-create-keypair key Options Name Description key A unique name for the key pair. Required: Yes Example: my-key-pair Common Options Option Description --region region The region. If AWS_SECRET_KEY isn't set.com -O. the region specified by the EC2_URL environment variable. Default: The region specified by the EC2_URL environment variable. For more information. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Overrides the default region. Amazon Elastic Compute Cloud CLI Reference Syntax The short version of this command is ec2addkey. Example: --region eu-west-1 -U. you must specify this option.com if EC2_URL isn't set. Default: The endpoint specified by the EC2_URL environment variable. Tip If you are using the AWS CLI. Type: String Default: None Constraints: Up to 255 ASCII characters. Example: -U https://ec2. Example: -O AKIAIOSFODNN7EXAMPLE -W. or https://ec2. you must specify this option. or us-east-1 if EC2_URL isn't set.eu-west-1amazonaws. see create-key-pair instead. --aws-access-key Your access key ID. If AWS_ACCESS_KEY isn't set. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Default: The value of the AWS_ACCESS_KEY environment variable.amazonaws. and the URL specified by the -U option. see Tell the Tools Who aws_access_key_id You Are. 146 .

If you have the required permissions. --aws-access-key) and secret access key (-W. --hide-tags Omits tags for tagged resources.<remainder of security token> --connection-timeout timeout The connection timeout. --verbose Displays verbose output. This is only delegation_token required when you are using temporary security credentials. it returns UnauthorizedOperation. For more information. including the API request and response on the command line. in seconds. Use your access key ID (-O. This is useful if you are building tools to talk directly to the Query API. Example: -T AQoDYXdzEJr. --aws-secret-key) instead. --debug Displays internal debugging information.. For more information. This can assist us when helping you troubleshooting problems. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. Deprecated Options We have deprecated the SOAP API for Amazon EC2. the private key (-K. see SOAP Requests. see Using Temporary Security Credentials. --headers Includes column headers in the command output. in seconds.509 certificate (-C. see Setting Up the Amazon EC2 CLI.. --private-key) and X. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. otherwise. --show-empty-fields Shows empty columns as (nil). --auth-dry-run Checks whether you have the required permissions for the command. -v. For more information. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. without actually running the command. This is useful when piping the output from one command to the input of another. the command returns DryRunOperation. --security-token The delegation token to pass along to the AWS request.6. 147 . From version 1. Option Description -K.14. -h Displays usage information for the command. Example: --connection-timeout 30 --request-timeout timeout The request timeout. Example: --request-timeout 45 -H.0 onwards of the Amazon EC2 CLI tools. --private-key The private key to use when constructing requests to Amazon EC2. --cert) options are not supported. Reads arguments from standard input. -D. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). --help. .

BEGIN RSA PRIVATE KEY ---- 148 . Default: The value of the EC2_CERT environment variable. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.BEGIN RSA PRIVATE KEY ---- MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6 b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd BgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcN MTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYD VQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25z b2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFt YXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ 21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9T rDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpE Ibb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4 nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0Fkb FFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTb NYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE -----END RSA PRIVATE KEY----- Create a file named my-key-pair.pem and paste the entire key from the response into this file.pem Output This command returns a table that contains the following information: • The KEYPAIR identifier • The name of the key pair • The private key fingerprint • The private key contents Amazon EC2 command line tools display errors on stderr. ---. PROMPT> ec2-create-keypair my-key-pair KEYPAIR my-key-pair 1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f ---.BEGIN RSA PRIVATE KEY ----" "-----END RSA PRIVATE KEY-----" Confirm that the file contents are similar to the following and save the file to a local directory. "---. Amazon Elastic Compute Cloud CLI Reference Output Option Description Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. including the following lines.pem -C.509 certificate to use when constructing requests to Amazon EC2. Examples Example This example command creates a key pair named my-key-pair. --cert ec2_cert The X.

see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. For more information. 760) ec2-create-network-acl Description Creates a network ACL in a VPC. it is required to decrypt login information when you connect to an instance that you launched using this key pair. Related Action • CreateKeyPair Related Commands • ec2-delete-keypair (p. Amazon Elastic Compute Cloud CLI Reference Related Topics MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6 b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd BgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcN MTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYD VQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25z b2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFt YXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ 21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9T rDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpE Ibb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4 nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0Fkb FFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTb NYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE -----END RSA PRIVATE KEY----- Keep this file in a safe place.pem Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. 399) • ec2-run-instances (p. Network ACLs provide an optional layer of security (in addition to security groups) for the instances in your VPC. If you're using an SSH client on a Linux computer to connect to your instance. $ chmod 400 my-key-pair. 3) • Setting Up the CLI Tools (Windows) (p. 149 . 242) • ec2-describe-keypairs (p. use the following command to set the permissions of your private key file so that only you can read it. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.

eu-west-1amazonaws. Default: The value of the AWS_ACCESS_KEY environment variable.com -O. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Example: --region eu-west-1 -U. Example: -O AKIAIOSFODNN7EXAMPLE -W. Syntax ec2-create-network-acl vpc_id Options Name Description vpc_id The ID of the VPC. see Network ACLs in the Amazon VPC User Guide. Type: String Default: None Required: Yes Example: vpc-9ea045f7 Common Options Option Description --region region The region. the region specified by the EC2_URL environment variable. and the URL specified by the -U option. If AWS_SECRET_KEY isn't set. Amazon Elastic Compute Cloud CLI Reference Syntax For more information. If AWS_ACCESS_KEY isn't set. see Tell the Tools Who aws_access_key_id You Are. or https://ec2. see create-network-acl instead. you must specify this option. Overrides the default region. you must specify this option.com if EC2_URL isn't set. Example: -U https://ec2. Default: The endpoint specified by the EC2_URL environment variable. Default: The region specified by the EC2_URL environment variable.amazonaws. --aws-secret-key Your secret access key. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. The short version of this command is ec2addnacl. For more information. --aws-access-key Your access key ID. or us-east-1 if EC2_URL isn't set. 150 . Tip If you are using the AWS CLI.

it returns UnauthorizedOperation. --hide-tags Omits tags for tagged resources. For more information. the private key (-K. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. -v. --security-token The delegation token to pass along to the AWS request. This is useful when piping the output from one command to the input of another.509 certificate (-C.14.<remainder of security token> --connection-timeout timeout The connection timeout. --show-empty-fields Shows empty columns as (nil). Example: --connection-timeout 30 --request-timeout timeout The request timeout. without actually running the command. Use your access key ID (-O. From version 1.. --private-key The private key to use when constructing requests to Amazon EC2. -h Displays usage information for the command. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. in seconds.0 onwards of the Amazon EC2 CLI tools. For more information. the command returns DryRunOperation. --private-key) and X. --auth-dry-run Checks whether you have the required permissions for the command. see SOAP Requests. . --cert) options are not supported. For more information. --verbose Displays verbose output. see Setting Up the Amazon EC2 CLI. Example: --request-timeout 45 -H. --aws-access-key) and secret access key (-W. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). --help. --headers Includes column headers in the command output. Reads arguments from standard input. -D. in seconds.6. Option Description -K. including the API request and response on the command line. Deprecated Options We have deprecated the SOAP API for Amazon EC2. --aws-secret-key) instead. 151 . This can assist us when helping you troubleshooting problems. Example: -T AQoDYXdzEJr. see Using Temporary Security Credentials. This is useful if you are building tools to talk directly to the Query API. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. otherwise.. --debug Displays internal debugging information. If you have the required permissions. This is only delegation_token required when you are using temporary security credentials.

and another for ingress. 3) • Setting Up the CLI Tools (Windows) (p. Amazon Elastic Compute Cloud CLI Reference Output Option Description Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.0. The response includes a default entry for egress. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. The -1 means all protocols and ports. PROMPT> ec2-create-network-acl vpc-11ad4878 NETWORKACL acl-5fb85d36 vpc-11ad4878 ENTRY egress 32767 deny 0. then these default entries ultimately deny the traffic.0/0 all ENTRY ingress 32767 deny 0. These are the last entries that we process to decide whether traffic is allowed into our out of an associated subnet.pem Output This command returns a table that contains the following information: • The NETWORKACL identifier • The ACL ID • The ID of the VPC for the network ACL • The default ENTRY elements Amazon EC2 command line tools display errors on stderr. --cert ec2_cert The X.pem -C.0. Examples Example This example command creates a network ACL in the specified VPC. Related Action • CreateNetworkAcl 152 . For more information. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. each with a very high rule number (32767). If the traffic doesn't match any rules with a lower rule number.0. Default: The value of the EC2_CERT environment variable.0/0 all Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.0. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.509 certificate to use when constructing requests to Amazon EC2.

. 100). you can't modify it. Syntax ec2-create-network-acl-entry acl_id -n rule_number [--egress] -P protocol -r cidr [-p port_range] [-t icmp_type_code] { --allow | --deny } Options Name Description acl_id The ID of the ACL for the entry. 700) ec2-create-network-acl-entry Description Creates an entry (a rule) in a network ACL with the specified rule number. --rule-number rule_number The rule number for the entry (for example. After you add an entry.. 101. 110. . Each network ACL has a set of numbered ingress rules and a separate set of numbered egress rules. we process the entries in the ACL according to the rule numbers. in ascending order. Tip If you are using the AWS CLI. Amazon Elastic Compute Cloud CLI Reference ec2-create-network-acl-entry Related Commands • ec2-delete-network-acl (p. Tip We recommend that you leave room between the rule numbers (for example. 403) • ec2-replace-network-acl-association (p. When determining whether a packet should be allowed in or out of a subnet associated with the ACL. you must either replace it or create an entry and delete the old one.. 100.). Type: Number Default: None 153 . 120. For more information. Each network ACL has a set of ingress rules and a separate set of egress rules. see create-network-acl-entry instead. This makes it easier to add a rule between existing ones without having to renumber the rules. 245) • ec2-describe-network-acls (p.. The short version of this command is ec2addnae.). 102. Type: String Default: None Required: Yes Example: acl-5fb85d36 -n. and not number them one right after the other (for example.. see Network ACLs in the Amazon VPC User Guide. ACL entries are processed in ascending order by rule number. 103.

Default: If not specified. Default: None Required: Conditional Condition: Required if specifying tcp or udp (or the equivalent number) for the protocol. The range 32767 to 65535 is reserved for internal use. --port-range port_range For TCP or UDP: The range of ports to allow.16. --cidr cidr The CIDR range to allow or deny. Required: Yes Example: -n 100 --egress Indicates that the rule be applied to traffic leaving the subnet. see Protocol Numbers). You can specify all or -1 to mean all protocols. the rule applies to ingress traffic into the subnet. Type: String Default: None Required: Yes Example: -r 172.0. Amazon Elastic Compute Cloud CLI Reference Options Name Description Constraints: Positive integer from 1 to 32766. You can specify -1 to mean all ports (for example. Type: String Valid values: all | -1 | tcp | udp | icmp or any protocol number (for a list. Example: -p 80-84 154 .0/24 -p. in CIDR notation. Required: Yes Example: -P 6 -r. Type: String Valid values: A single integer or a range (min-max). Required: No -P. port range 0-65535). --protocol protocol The IP protocol.

--icmp-type-code For ICMP: The ICMP type and code using format type:code. Example: --region eu-west-1 -U. but not both options. icmp_type_code where both are integers.amazonaws. the region specified by the EC2_URL environment variable. or https://ec2. Common Options Option Description --region region The region. You can use -1 for the type or code to mean all types or all codes. --deny Specifies that any traffic matching the rule is denied. but not both. Default: The region specified by the EC2_URL environment variable. and the URL specified by the -U option. Default: The endpoint specified by the EC2_URL environment variable. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description -t. Required: Conditional Condition: You must specify either --allow or --deny.com if EC2_URL isn't set. Type: String Default: None Required: Conditional Condition: Required if specifying icmp (or the equivalent number) for the protocol. Example: -t -1:-1 --allow Specifies that any traffic matching the rule is allowed. Required: Conditional Condition: You must specify either --allow or --deny.com 155 . Overrides the default region. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. or us-east-1 if EC2_URL isn't set. Example: -U https://ec2.eu-west-1amazonaws.

--hide-tags Omits tags for tagged resources. Example: -O AKIAIOSFODNN7EXAMPLE -W. --help. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. in seconds. If AWS_ACCESS_KEY isn't set. For more information. --security-token The delegation token to pass along to the AWS request. see Using Temporary Security Credentials. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. 156 . If you have the required permissions. --headers Includes column headers in the command output. --verbose Displays verbose output. This can assist us when helping you troubleshooting problems. --show-empty-fields Shows empty columns as (nil). without actually running the command.. . otherwise.<remainder of security token> --connection-timeout timeout The connection timeout. Example: -T AQoDYXdzEJr. If AWS_SECRET_KEY isn't set. Default: The value of the AWS_ACCESS_KEY environment variable. you must specify this option. Reads arguments from standard input. including the API request and response on the command line. --debug Displays internal debugging information. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -O. --aws-access-key Your access key ID. For more information. it returns UnauthorizedOperation. -h Displays usage information for the command.. --aws-secret-key Your secret access key. --auth-dry-run Checks whether you have the required permissions for the command. This is only delegation_token required when you are using temporary security credentials. -v. you must specify this option. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). the command returns DryRunOperation. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. This is useful if you are building tools to talk directly to the Query API. Example: --connection-timeout 30 --request-timeout timeout The request timeout. This is useful when piping the output from one command to the input of another. Example: --request-timeout 45 -H. -D. see Tell the Tools Who aws_access_key_id You Are. in seconds.

0/0 -P udp -p 53 --allow ENTRY ingress 100 allow 0. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.0/0) on UDP port 53 into any associated subnet. Use your access key ID (-O. see Setting Up the Amazon EC2 CLI. --private-key The private key to use when constructing requests to Amazon EC2.0/0 udp 53 53 157 .6. --cert ec2_cert The X.0. --cert) options are not supported. Option Description -K. Examples Example This example command creates an entry with rule number 100 in the network ACL with the ID acl-2cb85d45. For more information.0. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable.0.509 certificate to use when constructing requests to Amazon EC2. see SOAP Requests. For more information. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Amazon Elastic Compute Cloud CLI Reference Output Deprecated Options We have deprecated the SOAP API for Amazon EC2.pem -C.0.0.pem Output This command returns a table that contains the following information: • The ENTRY identifier • The traffic allowed or denied (ingress | egress) • The rule number • Indicates what to do with the traffic (allow | deny) • The CIDR range to allow or deny • The protocol • The first port in the range • The last port in the range Amazon EC2 command line tools display errors on stderr. --aws-access-key) and secret access key (-W.14.0 onwards of the Amazon EC2 CLI tools.509 certificate (-C. Default: The value of the EC2_CERT environment variable. PROMPT> ec2-create-network-acl-entry acl-2cb85d45 -n 100 -r 0. The rule allows ingress traffic from anywhere (0. --private-key) and X. --aws-secret-key) instead. From version 1. the private key (-K.0.

10) IAM Policies You can create an IAM policy to grant users permission to use this command. Amazon Elastic Compute Cloud CLI Reference Related Topics Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Syntax ec2-create-network-interface -d. The short version of this command is ec2addnic. see Elastic Network Interfaces in the Amazon EC2 User Guide for Linux Instances. see create-network-interface instead. --group security_group_id] Options Name Description -d. Related Action • CreateNetworkAclEntry Related Commands • ec2-delete-network-acl-entry (p. For more information. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. Type: String Default: None Required: No 158 . --description description [--private-ip-address ip_address] [--secondary-private-ip-address ip_address] [--secondary-private-ip-address- count address_count] [-g. 403) • ec2-replace-network-acl-entry (p. 703) ec2-create-network-interface Description Creates a network interface in the specified subnet. 248) • ec2-describe-network-acls (p. --description description A description for the network interface. 3) • Setting Up the CLI Tools (Windows) (p. Tip If you are using the AWS CLI. For more information.

Type: Integer Default: None Required: No Example: --secondary-private-ip-address-count 2 159 .2.17 --secondary-private-ip-address The IP address to be assigned as a secondary private IP ip_address address to the network interface. For more information. Amazon EC2 selects one from the subnet range. You can use this option multiple times to assign multiple secondary IP addresses to the network interface. Type: String Default: None Required: No Example: --secondary-private-ip-address 10. Amazon Elastic Compute Cloud CLI Reference Options Name Description Example: -d "My ENI" --private-ip-address ip_address The primary private IP address of the network interface.0. You can't specify this parameter when you also specify -- secondary-private-ip-address.2. If you don't specify an IP address. The number of secondary IP addresses to assign to the count address_count network interface. Type: String Default: None Required: No Example: --private-ip-address 10. see Private IP Addresses Per ENI Per Instance Type in the Amazon EC2 User Guide for Linux Instances.18 - secondary-private-ip-address 10. If you don't specify an IP address. Amazon EC2 selects one from the subnet range.28 --secondary-private-ip-address.0.0. You can't specify this parameter when also specifying -- secondary-private-ip-address-count.2.

the interface will become a member of the default security group. Required: No Example: -g sg-bba1bcd7 -g sg-6d495601 Common Options Option Description --region region The region. you must specify this option. see Tell the Tools Who aws_access_key_id You Are. --group security_group_id A security group to add to the network interface.. If no security group is specified. --aws-access-key Your access key ID. and the URL specified by the -U option. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. For more information. Default: The endpoint specified by the EC2_URL environment variable.<remainder of security token> 160 . Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set).com -O. For more information. If AWS_ACCESS_KEY isn't set.com if EC2_URL isn't set. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T.eu-west-1amazonaws. Default: The value of the AWS_ACCESS_KEY environment variable. Example: -U https://ec2. Type: String Default: None. This is only delegation_token required when you are using temporary security credentials. Example: -T AQoDYXdzEJr. Example: -O AKIAIOSFODNN7EXAMPLE -W. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description -g.. Overrides the default region. --security-token The delegation token to pass along to the AWS request. you must specify this option. Example: --region eu-west-1 -U. the region specified by the EC2_URL environment variable. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. or https://ec2. Default: The region specified by the EC2_URL environment variable. If AWS_SECRET_KEY isn't set. see Using Temporary Security Credentials.amazonaws. or us-east-1 if EC2_URL isn't set. --aws-secret-key Your secret access key. You can use this option multiple times to add multiple groups.

Deprecated Options We have deprecated the SOAP API for Amazon EC2. see SOAP Requests. in seconds. If you have the required permissions. Example: --connection-timeout 30 --request-timeout timeout The request timeout. Example: --request-timeout 45 -H. This is useful when piping the output from one command to the input of another. Default: The value of the EC2_CERT environment variable.0 onwards of the Amazon EC2 CLI tools.6. --cert) options are not supported. --help. This can assist us when helping you troubleshooting problems. For more information. --headers Includes column headers in the command output. --aws-access-key) and secret access key (-W. --aws-secret-key) instead. --hide-tags Omits tags for tagged resources. including the API request and response on the command line. --private-key The private key to use when constructing requests to Amazon EC2. -v. --cert ec2_cert The X. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?.509 certificate to use when constructing requests to Amazon EC2. without actually running the command. -h Displays usage information for the command. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description --connection-timeout timeout The connection timeout.509 certificate (-C.pem -C. it returns UnauthorizedOperation. --private-key) and X. --verbose Displays verbose output. the private key (-K. --auth-dry-run Checks whether you have the required permissions for the command. the command returns DryRunOperation. -D. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. From version 1. For more information.14. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Reads arguments from standard input. Option Description -K. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. .pem 161 . --show-empty-fields Shows empty columns as (nil). otherwise. Use your access key ID (-O. see Setting Up the Amazon EC2 CLI. --debug Displays internal debugging information. This is useful if you are building tools to talk directly to the Query API. in seconds.

0.0.0. and security group membership.0. 65) 162 .0.117.0.0.0. Examples Example 1 This example command creates a network interface in the specified subnet.2.0. For more information.117 PRIVATEIPADDRESS 10.2.17 Example 2 This example command creates a network interface address with a primary private IP address of 10.0. Amazon EC2 command line tools display errors on stderr.0. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.17 true GROUP sg-bba1bcd7 default PRIVATEIPADDRESS 10. Amazon Elastic Compute Cloud CLI Reference Output Output This command returns the ENI ID for the network interface that was created. 3) • Setting Up the CLI Tools (Windows) (p. Availability Zone.2. VPC ID.0. private IP addresses.117 --secondary-private-ip-address 10. Related Action • CreateNetworkInterface Related Commands • ec2-attach-network-interface (p. and two secondary private IP addresses: one secondary private IP address of 10.0.0. along with the subnet ID.0.0.0.118 and another secondary private IP address that is selected by Amazon EC2. PROMPT> ec2-create-network-interface -d "My ENI" -g sg-b1b508d8 --private-ip-address 10.117 true GROUP sg-82b3a1ee default PRIVATEIPADDRESS 10. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. PROMPT> ec2-create-network-interface -d "My ENI" -g sg-bba1bcd7 --private-ip-address 10.118 subnet-b1b508d8 NETWORKINTERFACE eni-f907b890 My ENI subnet-b1b508d8 vpc-a2b508cb ap-southeast-1a 013274050172 false pending 02:75:42:60:6c:05 10.118 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.17 subnet-fd04ff94 NETWORKINTERFACE eni-3b9f6552 My ENI subnet-fd04ff94 vpc-e604ff8f us-east-1b 089818748305 false pending 02:1a:80:41:52:9c 10.

409) • ec2-describe-network-interfaces (p. Type: String Valid values: cluster Default: cluster Required: Yes Example: -s cluster 163 . Amazon Elastic Compute Cloud CLI Reference ec2-create-placement-group • ec2-delete-network-interface (p. Type: String Default: None Required: Yes Constraints: Up to 255 ASCII characters. Syntax ec2-create-placement-group placement_group -s strategy Options Name Description placement_group A name for the placement group. The short version of this command is ec2addpgrp. see Cluster Instances in the Amazon EC2 User Guide for Linux Instances. 647) • ec2-reset-network-interface-attribute (p. For more information about placement groups and cluster instances. Example: XYZ-cluster -s strategy The placement strategy. 252) • ec2-describe-network-interface-attribute (p. Tip If you are using the AWS CLI. see create-placement-group instead. You must give the group a name that's unique within the scope of your account. 567) • ec2-modify-network-interface-attribute (p. 413) • ec2-detach-network-interface (p. 742) ec2-create-placement-group Description Creates a placement group that you launch cluster instances into.

--aws-access-key Your access key ID. Default: The region specified by the EC2_URL environment variable. --hide-tags Omits tags for tagged resources. Default: The value of the AWS_ACCESS_KEY environment variable. 164 . Example: -O AKIAIOSFODNN7EXAMPLE -W. Example: --connection-timeout 30 --request-timeout timeout The request timeout. or us-east-1 if EC2_URL isn't set. Example: -U https://ec2.<remainder of security token> --connection-timeout timeout The connection timeout. Default: The endpoint specified by the EC2_URL environment variable.com -O. If AWS_SECRET_KEY isn't set. For more information. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. see Using Temporary Security Credentials. For more information. Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region. Example: --request-timeout 45 -H.eu-west-1amazonaws. in seconds.com if EC2_URL isn't set. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. If AWS_ACCESS_KEY isn't set. This is only delegation_token required when you are using temporary security credentials. you must specify this option. --security-token The delegation token to pass along to the AWS request. see Tell the Tools Who aws_access_key_id You Are.. --aws-secret-key Your secret access key.. in seconds. --headers Includes column headers in the command output. Example: -T AQoDYXdzEJr. --show-empty-fields Shows empty columns as (nil). the region specified by the EC2_URL environment variable. Overrides the default region. Example: --region eu-west-1 -U. you must specify this option. and the URL specified by the -U option. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable.amazonaws. or https://ec2. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set).

ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. Deprecated Options We have deprecated the SOAP API for Amazon EC2. -D. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.6. --aws-access-key) and secret access key (-W. This is useful when piping the output from one command to the input of another. --cert ec2_cert The X. Default: The value of the EC2_CERT environment variable. .pem Output This command returns a table that contains the following information: • The PLACEMENTGROUP identifier • The placement group name • The placement strategy • The state of the placement group 165 . --auth-dry-run Checks whether you have the required permissions for the command. For more information.0 onwards of the Amazon EC2 CLI tools. --aws-secret-key) instead.509 certificate (-C. --private-key) and X. -h Displays usage information for the command. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. see Setting Up the Amazon EC2 CLI.509 certificate to use when constructing requests to Amazon EC2. --help. it returns UnauthorizedOperation. including the API request and response on the command line. This can assist us when helping you troubleshooting problems. the command returns DryRunOperation. This is useful if you are building tools to talk directly to the Query API. Reads arguments from standard input. For more information. Option Description -K. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. --private-key The private key to use when constructing requests to Amazon EC2. see SOAP Requests. the private key (-K. -v. otherwise. --cert) options are not supported. without actually running the command. --verbose Displays verbose output. From version 1.14.pem -C. If you have the required permissions. Use your access key ID (-O. Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information.

421) ec2-create-reserved-instances-listing Description Creates a listing for Amazon EC2 Reserved Instances that will be sold in the Reserved Instance Marketplace. 166 . PROMPT> ec2-create-placement-group XYZ-cluster -s cluster PLACEMENTGROUP XYZ-cluster cluster available Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Amazon Elastic Compute Cloud CLI Reference Examples Examples Example This example command creates a placement group named XYZ-cluster. Reserved Instances bought from third-party sellers through the Reserved Instance Marketplace work like any other Reserved Instances. Your Reserved Instance listings then become available for purchase. you must first register as a Seller in the Reserved Instance Marketplace. The Reserved Instance Marketplace matches sellers who want to resell Reserved Instance capacity that they no longer need with buyers who want to purchase additional capacity. You can submit one Reserved Instance listing at a time. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. For more information. and specify the upfront price you want to receive for them. Related Action • CreatePlacementGroup Related Commands • ec2-delete-placement-group (p. After completing the registration process. For more information. 3) • Setting Up the CLI Tools (Windows) (p. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. If you want to sell your Reserved Instances. you can create a Reserved Instance Marketplace listing of some or all of your Reserved Instances. see Reserved Instance Marketplace in the Amazon EC2 User Guide for Linux Instances. 255) • ec2-describe-placement-groups (p.

where MONTH is the number of months and PRICE is the numerical part of the price you want for the specified months of the term. see Ensuring Idempotency in the Amazon EC2 User Guide for Linux Instances. Type: String Default: None Required: No 167 . case-sensitive identifier you provide to ensure idempotency of your listings. This number should be less or equal to the instance count associated with the Reserved Instance ID specified in this command. INSTANCE Type: String Default: None Required: Yes --instance-count INSTANCE-COUNT The number of instances that are a part of a Reserved Instance account that will be listed in the Reserved Instance Marketplace.]] Options Name Description --reserved-instance RESERVED. The ID of the active Reserved Instance. Syntax ec2-create-reserved-instances-listing --reserved-instance RESERVED-INSTANCE --instance- count INSTANCE-COUNT [--client-token TOKEN] MONTH:PRICE [MONTH:PRICE[.. For example. 14:12.34. Type: String Default: None Required: Yes --client-token TOKEN Unique.34 means you want to sell 14 months at the price of $12. This helps avoid duplicate listings.. For more information. Type: Integer Default: Total number of Reserved Instances active for the account Required: Yes MONTH:PRICE The price and schedule entry. using the format MONTH:PRICE. see create-reserved-instances-listing instead. Amazon Elastic Compute Cloud CLI Reference Syntax Tip If you are using the AWS CLI.

Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set).eu-west-1amazonaws. This is only delegation_token required when you are using temporary security credentials. in seconds. --security-token The delegation token to pass along to the AWS request. or https://ec2. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable.. the region specified by the EC2_URL environment variable. Default: The region specified by the EC2_URL environment variable. Example: --connection-timeout 30 --request-timeout timeout The request timeout. Example: -T AQoDYXdzEJr. --aws-access-key Your access key ID. If AWS_ACCESS_KEY isn't set. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Example: --region eu-west-1 -U. 168 . and the URL specified by the -U option. see Using Temporary Security Credentials. in seconds.com if EC2_URL isn't set.amazonaws. --show-empty-fields Shows empty columns as (nil). Default: The value of the AWS_ACCESS_KEY environment variable. you must specify this option. Example: -U https://ec2. or us-east-1 if EC2_URL isn't set. Example: -O AKIAIOSFODNN7EXAMPLE -W. you must specify this option. Overrides the default region. --headers Includes column headers in the command output. --aws-secret-key Your secret access key. Default: The endpoint specified by the EC2_URL environment variable. If AWS_SECRET_KEY isn't set. Example: --request-timeout 45 -H.com -O.. --hide-tags Omits tags for tagged resources. For more information. see Tell the Tools Who aws_access_key_id You Are. For more information.<remainder of security token> --connection-timeout timeout The connection timeout.

the private key (-K. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --private-key) and X.pem Output The command returns a table that contains the following information: The listing information • The LISTING identifier • Reserved instance listing ID • Reserved instance ID • The create date • The update date 169 . --help.509 certificate to use when constructing requests to Amazon EC2. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. Deprecated Options We have deprecated the SOAP API for Amazon EC2. From version 1. otherwise. Default: The value of the EC2_CERT environment variable. For more information. -h Displays usage information for the command. This can assist us when helping you troubleshooting problems. --cert ec2_cert The X. -D. --auth-dry-run Checks whether you have the required permissions for the command. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable.pem -C. For more information. This is useful when piping the output from one command to the input of another. --aws-secret-key) instead. Reads arguments from standard input. --verbose Displays verbose output. --aws-access-key) and secret access key (-W. This is useful if you are building tools to talk directly to the Query API. --cert) options are not supported. including the API request and response on the command line. without actually running the command.14. see SOAP Requests. If you have the required permissions. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. see Setting Up the Amazon EC2 CLI. the command returns DryRunOperation.0 onwards of the Amazon EC2 CLI tools. Use your access key ID (-O. Option Description -K. -v.6. --private-key The private key to use when constructing requests to Amazon EC2. .509 certificate (-C. it returns UnauthorizedOperation. Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information.

2 false PRICE-SCHEDULE 1 $1. 440) 170 . The command looks like this: PROMPT> ec2-create-reserved-instances-listing --reserved-instance b847fa93-c736-4eae- bca1-3147example --instance-count 1 05:01.2 true Related Operations • ec2-cancel-reserved-instances-listing (p. which has 5 months remaining in its term.2 false PRICE-SCHEDULE 2 $1.2 false PRICE-SCHEDULE 3 $1. we set the upfront price at $1.20 Amazon EC2 returns output similar to the following: Type ReservedInstancesListingId ReservedInstancesId CreateDate UpdateDate Status StatusMessage LISTING 095c0e18-c9e6-4692-97e5-653e0example b847fa93-c736-4eae-bca1-e3147example Tue Aug 28 18:21:07 PDT 2012 Tue Aug 28 18:21:07 PDT 2012 active active INSTANCE-COUNT available 1 INSTANCE-COUNT sold 0 INSTANCE-COUNT cancelled 0 INSTANCE-COUNT pending 0 PRICE-SCHEDULE 5 $1.20. Amazon Elastic Compute Cloud CLI Reference Examples • Status • Status message One or more rows that contain instance count information • The INSTANCE-COUNT identifier • The instance count state • The instance count One or more rows that contain price schedule information • The PRICE-SCHEDULE identifier • The term • The price • Whether or not the schedule is active Amazon EC2 command line tools display errors on stderr.2 true PRICE-SCHEDULE 4 $1. 99) • ec2-describe-reserved-instances-listings (p. In this example. Examples Example This example command creates a Reserved Instance Marketplace listing from the existing Reserved Instance b847fa93-c736-4eae-bca1-e3147example.

0. Routing decisions are based on the most specific match.0. and the route table includes the following two routes: • 192.0. When determining how to route traffic. For more information. The route's target can be an Internet gateway or virtual private gateway attached to the VPC.0.2. Syntax ec2-create-route route_table_id -r cidr {-g gateway_id | -i instance_id | -n interface_id | -p vpc_peering_connection} Options Name Description route_table_id The ID of the route table for the route.0/24 (goes to some target A) • 192.0/0 -g. let's say the traffic is destined for 192. Type: String Default: None Required: Yes Example: -r 0. so we use that route to determine where to target the traffic. a VPC peering connection. Amazon Elastic Compute Cloud CLI Reference ec2-create-route ec2-create-route Description Creates a route in a route table within a VPC.3. Tip If you are using the AWS CLI. see create-route instead.0.0.0/28 (goes to some target B) Both routes apply to the traffic destined for 192.2. the second route in the list covers a smaller number of IP addresses and is therefore more specific. Type: String Default: None Required: Yes Example: rtb-5da34634 -r.2.3. --gateway gateway_id The ID of an Internet gateway or virtual private gateway attached to your VPC. we use the route with the most specific match. see Route Tables in the Amazon VPC User Guide. 171 . The short version of this command is ec2addrt.2. However. For example. or a NAT instance in the VPC. --cidr cidr The CIDR address block used for the destination match.

--network-interface The network interface associated with the route. --instance. or --network- interface. --instance. or --network- interface. or --vpc-peering- connection. --instance. --vpc-peering-connection. Example: -i i-a7c871e3 -n. Example: -p pcx-1a2b3c4d 172 . or --network- interface. --network-interface. interface_id Type: String Default: None Required: Conditional Condition: You must specify one of the following: --gateway. --vpc-peering-connection. The operation fails if you specify an instance ID unless exactly one network interface is attached. Example: -g igw-68a34601 -i. --instance instance_id The ID of a NAT instance in your VPC. --vpc-peering-connection. --vpc-peering-connection The VPC peering connection associated with the route. vpc_peering_connection Type: String Default: None Required: Conditional Condition: You must specify one of the following: --gateway. Type: String Default: None Required: Conditional Condition: You must specify one of the following: --gateway. Example: -n eni-5b729933 -p. Amazon Elastic Compute Cloud CLI Reference Options Name Description Type: String Default: None Required: Conditional Condition: You must specify one of the following: --gateway. --instance.

or https://ec2. Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region. Example: --request-timeout 45 -H. --aws-access-key Your access key ID. you must specify this option.. Default: The endpoint specified by the EC2_URL environment variable. --show-empty-fields Shows empty columns as (nil). This is only delegation_token required when you are using temporary security credentials. Example: -T AQoDYXdzEJr. If AWS_SECRET_KEY isn't set. --headers Includes column headers in the command output. Example: --connection-timeout 30 --request-timeout timeout The request timeout. Default: The value of the AWS_ACCESS_KEY environment variable. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. 173 . Example: --region eu-west-1 -U. --aws-secret-key Your secret access key. see Using Temporary Security Credentials. If AWS_ACCESS_KEY isn't set. you must specify this option. or us-east-1 if EC2_URL isn't set. in seconds.com -O. in seconds.eu-west-1amazonaws. see Tell the Tools Who aws_access_key_id You Are. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Example: -U https://ec2. the region specified by the EC2_URL environment variable.amazonaws. For more information.. --hide-tags Omits tags for tagged resources. Overrides the default region. and the URL specified by the -U option. --security-token The delegation token to pass along to the AWS request.com if EC2_URL isn't set. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Default: The region specified by the EC2_URL environment variable. Example: -O AKIAIOSFODNN7EXAMPLE -W. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T.<remainder of security token> --connection-timeout timeout The connection timeout. For more information.

--verbose Displays verbose output. If you have the required permissions. . --aws-access-key) and secret access key (-W. otherwise. the private key (-K. --auth-dry-run Checks whether you have the required permissions for the command.14.pem -C. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Option Description -K. including the API request and response on the command line. This is useful when piping the output from one command to the input of another. it returns UnauthorizedOperation. --private-key The private key to use when constructing requests to Amazon EC2. -h Displays usage information for the command. -v. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable.509 certificate to use when constructing requests to Amazon EC2. Default: The value of the EC2_CERT environment variable. Reads arguments from standard input. This is useful if you are building tools to talk directly to the Query API. For more information. From version 1. see Setting Up the Amazon EC2 CLI. --help. For more information. This can assist us when helping you troubleshooting problems. Deprecated Options We have deprecated the SOAP API for Amazon EC2. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. --private-key) and X. the command returns DryRunOperation. --aws-secret-key) instead. --cert ec2_cert The X. see SOAP Requests. Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information.6.0 onwards of the Amazon EC2 CLI tools. Use your access key ID (-O. without actually running the command.509 certificate (-C. -D. 174 .pem Output This command returns a table that contains the following information: • The ROUTE identifier • The ID of the target Amazon EC2 command line tools display errors on stderr. --cert) options are not supported.

708) 175 . 10) IAM Policies You can create an IAM policy to grant users permission to use this command.0.0.0. 258) • ec2-describe-route-tables (p. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.0.0.0/0 -g igw-eaad4883 ROUTE igw-eaad4883 0. 458) • ec2-replace-route (p. Related Action • CreateRoute Related Commands • ec2-delete-route (p.0. pcx-111aaa22.0.0.0.0.0/0 Example 2 This example command creates a route in the route table with the ID rtb-g8ff4ea2.0. The route sends all traffic (0. Amazon Elastic Compute Cloud CLI Reference Examples Examples Example 1 This example command creates a route in the route table with the ID rtb-e4ad488d. PROMPT> ec2-create-route rtb-e4ad488d -r 0.0.0.0. For more information.0. The route matches traffic for the CIDR block 10. PROMPT> ec2-create-route rtb-g8ff4ea2 -r 0. This route enables traffic to be directed to the peer VPC in the VPC peering connection. The route matches all traffic (0. 3) • Setting Up the CLI Tools (Windows) (p.0/0) and routes it to the Internet gateway with the ID igw-eaad4883.0/16 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.0.0/16 -p pcx-111aaa22 ROUTE pcx-111aaa22 10.0/16 and routes it to VPC peering connection. PROMPT> ec2-create-route rtb-g8ff4ea2 -r 10.0/0 -i i-1a2b3c4d ROUTE i-1a2b3c4d 0.0/0) to the NAT instance with the ID i-1a2b3c4d.0/0 Example 3 This example command creates a route in route table rtb-g8ff4ea2.0.0.

see create-route-table instead. see Tell the Tools Who aws_access_key_id You Are.eu-west-1amazonaws. Syntax ec2-create-route-table vpc_id Options Name Description vpc_id The ID of the VPC.amazonaws. After you create a route table. Type: String Default: None Required: Yes Example: vpc-9ea045f7 Common Options Option Description --region region The region. 176 . and the URL specified by the -U option. Tip If you are using the AWS CLI. --aws-access-key Your access key ID. The short version of this command is ec2addrtb. Amazon Elastic Compute Cloud CLI Reference ec2-create-route-table ec2-create-route-table Description Creates a route table for the specified VPC. Default: The endpoint specified by the EC2_URL environment variable. For more information about route tables.com -O. or us-east-1 if EC2_URL isn't set. Example: -U https://ec2.com if EC2_URL isn't set. For more information. you can add routes and associate the table with a subnet. Example: --region eu-west-1 -U. Default: The region specified by the EC2_URL environment variable. see Route Tables in the Amazon VPC User Guide. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. or https://ec2. the region specified by the EC2_URL environment variable. Overrides the default region.

Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). This can assist us when helping you troubleshooting problems. --help. This is useful when piping the output from one command to the input of another. This is only delegation_token required when you are using temporary security credentials. including the API request and response on the command line. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description Default: The value of the AWS_ACCESS_KEY environment variable. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. If you have the required permissions. see Using Temporary Security Credentials. --verbose Displays verbose output. the command returns DryRunOperation. If AWS_SECRET_KEY isn't set. in seconds. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. 177 . --aws-secret-key Your secret access key. This is useful if you are building tools to talk directly to the Query API. --headers Includes column headers in the command output. --auth-dry-run Checks whether you have the required permissions for the command. you must specify this option.. For more information. otherwise. Reads arguments from standard input. --hide-tags Omits tags for tagged resources. -v.<remainder of security token> --connection-timeout timeout The connection timeout. Example: -O AKIAIOSFODNN7EXAMPLE -W.. Example: -T AQoDYXdzEJr. in seconds. If AWS_ACCESS_KEY isn't set. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. -h Displays usage information for the command. Example: --request-timeout 45 -H. you must specify this option. --debug Displays internal debugging information. --show-empty-fields Shows empty columns as (nil). . -D. Example: --connection-timeout 30 --request-timeout timeout The request timeout. without actually running the command. it returns UnauthorizedOperation. --security-token The delegation token to pass along to the AWS request.

PROMPT> ec2-create-route-table vpc-9ea045f7 ROUTETABLE rtb-6aa34603 vpc-9ea045f7 ROUTE local active 172. Option Description -K.0 onwards of the Amazon EC2 CLI tools.pem Output This command returns a table that contains the following information: • The ROUTETABLE identifier • The ID of the route table • The ID of the VPC • Information about the default route for every new route table Amazon EC2 command line tools display errors on stderr. the private key (-K. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem -C. For more information. 3) • Setting Up the CLI Tools (Windows) (p. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. see SOAP Requests. Default: The value of the EC2_CERT environment variable. --private-key) and X.0. --aws-secret-key) instead. For more information. From version 1. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.6. 10) IAM Policies 178 .14. see Setting Up the Amazon EC2 CLI. Use your access key ID (-O.16.509 certificate to use when constructing requests to Amazon EC2. --cert ec2_cert The X.0/16 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Amazon Elastic Compute Cloud CLI Reference Output Deprecated Options We have deprecated the SOAP API for Amazon EC2. Examples Example This example command creates a route table for the VPC with the ID vpc-9ea045f7. --cert) options are not supported.509 certificate (-C. --private-key The private key to use when constructing requests to Amazon EC2. --aws-access-key) and secret access key (-W.

use the following command: umount -d device_name Where device_name is the device name (for example. and select Change Drive Letter and Path. see Amazon EBS encryption in the Amazon EC2 User Guide for Linux Instances. To unmount the volume in Windows. 713) ec2-create-snapshot Description Creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. you should unmount the volume from within the instance. Related Action • CreateRouteTable Related Commands • ec2-associate-route-table (p. issue the snapshot command. You can use snapshots for backups. For more information. right-click the volume to unmount. 54) • ec2-create-route (p. open Disk Management. 179 . For more information. your snapshot should be complete. The short version of this command is ec2addsnap. and then remount the volume to ensure a consistent and complete snapshot. 458) • ec2-disassociate-route-table (p. You can remount and use your volume while the snapshot status is pending. and to save data before shutting down an instance. To unmount the volume in Linux. However. If you can pause any file writes to the volume long enough to take a snapshot. to make copies of instance store volumes. Select the mount point to remove. 171) • ec2-delete-route-table (p. However. see Amazon Elastic Block Store in the Amazon EC2 User Guide for Linux Instances. This might exclude any data that has been cached by any applications or the operating system. you should stop the instance before taking the snapshot. Volumes that are created from encrypted snapshots are also automatically encrypted. Your encrypted volumes and any associated snapshots always remain protected. 588) • ec2-replace-route-table-association (p. Amazon Elastic Compute Cloud CLI Reference ec2-create-snapshot You can create an IAM policy to grant users permission to use this command. 262) • ec2-describe-route-tables (p. You can take a snapshot of an attached volume that is in use. When a snapshot is created from a volume with an AWS Marketplace product code. Snapshots that are taken from encrypted volumes are automatically encrypted. To create a snapshot for Amazon EBS volumes that serve as root devices. the product code is propagated to the snapshot. /dev/sdh). and then click Remove. For more information. snapshots only capture data that has been written to your Amazon EBS volume at the time the snapshot command is issued. if you can't pause all file writes to the volume.

com -O. Overrides the default region. For more information. --description description A description for the snapshot. see Tell the Tools Who aws_access_key_id You Are. Amazon Elastic Compute Cloud CLI Reference Syntax Tip If you are using the AWS CLI. Default: The region specified by the EC2_URL environment variable. Type: String Default: None Constraints: Up to 255 characters Required: No Example: -d "Daily backup" Common Options Option Description --region region The region. Example: --region eu-west-1 -U. or us-east-1 if EC2_URL isn't set. and the URL specified by the -U option. Type: String Default: None Required: Yes Example: vol-4d826724 -d. see create-snapshot instead. --aws-access-key Your access key ID. or https://ec2.eu-west-1amazonaws. the region specified by the EC2_URL environment variable. Example: -U https://ec2.amazonaws.com if EC2_URL isn't set. 180 . Default: The endpoint specified by the EC2_URL environment variable. Syntax ec2-create-snapshot volume_id [-d description] Options Name Description volume_id The ID of the Amazon EBS volume. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point.

<remainder of security token> --connection-timeout timeout The connection timeout. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description Default: The value of the AWS_ACCESS_KEY environment variable. This is useful when piping the output from one command to the input of another. otherwise. including the API request and response on the command line. Example: -T AQoDYXdzEJr.. This is only delegation_token required when you are using temporary security credentials. --aws-secret-key Your secret access key. --headers Includes column headers in the command output. you must specify this option. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. If AWS_SECRET_KEY isn't set. Example: --connection-timeout 30 --request-timeout timeout The request timeout. --hide-tags Omits tags for tagged resources. it returns UnauthorizedOperation. --help. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. For more information. -h Displays usage information for the command. Example: --request-timeout 45 -H. Reads arguments from standard input. in seconds. --show-empty-fields Shows empty columns as (nil).. . If AWS_ACCESS_KEY isn't set. -v. --security-token The delegation token to pass along to the AWS request. see Using Temporary Security Credentials. the command returns DryRunOperation. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). you must specify this option. If you have the required permissions. --debug Displays internal debugging information. 181 . without actually running the command. This is useful if you are building tools to talk directly to the Query API. --verbose Displays verbose output. -D. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Example: -O AKIAIOSFODNN7EXAMPLE -W. --auth-dry-run Checks whether you have the required permissions for the command. in seconds. This can assist us when helping you troubleshooting problems.

PROMPT> ec2-create-snapshot vol-1a2b3c4d --description "Daily Backup" SNAPSHOT snap-1a2b3c4d vol-1a2b3c4d pending YYYY-MM-DDTHH:MM:SS+0000 111122223333 30 Daily Backup Not Encrypted 182 .14. --cert) options are not supported. Snapshots created by the CopySnapshot action have an arbitrary volume ID that should not be used for any purpose. --aws-secret-key) instead. --private-key The private key to use when constructing requests to Amazon EC2.0 onwards of the Amazon EC2 CLI tools. Default: The value of the EC2_CERT environment variable. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. For more information. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --cert ec2_cert The X. Use your access key ID (-O. see Setting Up the Amazon EC2 CLI.6. the private key (-K. Amazon Elastic Compute Cloud CLI Reference Output Deprecated Options We have deprecated the SOAP API for Amazon EC2. Examples Example This example command creates a snapshot of the volume with the ID vol-1a2b3c4d.pem -C. see SOAP Requests.509 certificate (-C. Amazon EC2 command line tools display errors on stderr. • The state of the snapshot (pending. From version 1. error) • The time stamp when the snapshot initiated • The percentage of completion • The ID of the snapshot owner • The size of the volume • The description of the snapshot • The encryption status of the snapshot • The full ARN of the AWS Key Management Service (AWS KMS) master key that was used to protect the volume encryption key for the volume. Option Description -K. --aws-access-key) and secret access key (-W. For more information.pem Output This command returns a table that contains the following information: • The SNAPSHOT identifier • The ID of the snapshot • The ID of the volume. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --private-key) and X. completed.509 certificate to use when constructing requests to Amazon EC2.

The short version of this command is ec2addsds. Syntax ec2-create-spot-datafeed-subscription --bucket bucket [--prefix prefix] Options Name Description -b. You can create one data feed per account. see Amazon S3 Bucket Requirements in the Amazon EC2 User Guide for Linux Instances. see create-spot-datafeed-subscription instead. For more information. 468) ec2-create-spot-datafeed-subscription Description Creates a data feed for Spot Instances. 265) • ec2-describe-snapshots (p. 3) • Setting Up the CLI Tools (Windows) (p. Type: String Default: None 183 . For more information. Amazon Elastic Compute Cloud CLI Reference Related Topics Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. For more information. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. Tip If you are using the AWS CLI. enabling you to view Spot Instance usage logs. see Spot Instance Data Feed in the Amazon EC2 User Guide for Linux Instances. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. Related Action • CreateSnapshot Related Commands • ec2-delete-snapshot (p. --bucket bucket The Amazon S3 bucket in which to store the Spot Instance data feed.

eu-west-1amazonaws. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Example: -O AKIAIOSFODNN7EXAMPLE -W. you must specify this option. and the URL specified by the -U option. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description Constraints: Must be a valid bucket associated with your account. or https://ec2. Example: --region eu-west-1 -U. For more information. Example: -U https://ec2. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Required: Yes Example: -b myawsbucket -p. --aws-secret-key Your secret access key. or us-east-1 if EC2_URL isn't set. --prefix bucket A prefix for the data feed file names. --aws-access-key Your access key ID. Overrides the default region. you must specify this option. If AWS_SECRET_KEY isn't set. Default: The value of the AWS_ACCESS_KEY environment variable.com if EC2_URL isn't set.amazonaws. Default: The endpoint specified by the EC2_URL environment variable. see Tell the Tools Who aws_access_key_id You Are.com -O. the region specified by the EC2_URL environment variable. Default: The region specified by the EC2_URL environment variable. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY 184 . If AWS_ACCESS_KEY isn't set. Type: String Default: None Required: No Example: -p spotdata_ Common Options Option Description --region region The region.

For more information. --auth-dry-run Checks whether you have the required permissions for the command. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. --show-empty-fields Shows empty columns as (nil). the command returns DryRunOperation. --headers Includes column headers in the command output. -h Displays usage information for the command. in seconds. otherwise. From version 1. --verbose Displays verbose output. --security-token The delegation token to pass along to the AWS request. including the API request and response on the command line. see Setting Up the Amazon EC2 CLI. This is useful if you are building tools to talk directly to the Query API. Option Description -K. Example: --request-timeout 45 -H. it returns UnauthorizedOperation. . Example: -T AQoDYXdzEJr. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). --aws-secret-key) instead. Use your access key ID (-O. --private-key) and X. see Using Temporary Security Credentials.pem 185 .14.. --private-key The private key to use when constructing requests to Amazon EC2. --hide-tags Omits tags for tagged resources. This can assist us when helping you troubleshooting problems.0 onwards of the Amazon EC2 CLI tools. --cert) options are not supported. in seconds. -v. --help.<remainder of security token> --connection-timeout timeout The connection timeout. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -T.6. see SOAP Requests. This is useful when piping the output from one command to the input of another. the private key (-K. For more information. --debug Displays internal debugging information. If you have the required permissions. Deprecated Options We have deprecated the SOAP API for Amazon EC2. Example: --connection-timeout 30 --request-timeout timeout The request timeout.509 certificate (-C. --aws-access-key) and secret access key (-W.. Reads arguments from standard input. This is only delegation_token required when you are using temporary security credentials. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. -D. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. For more information. without actually running the command.

For more information. Examples Example This example command creates the data feed for the account.509 certificate to use when constructing requests to Amazon EC2. 475) 186 . Related Action • CreateSpotDatafeedSubscription Related Commands • ec2-delete-spot-datafeed-subscription (p. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --cert ec2_cert The X. 3) • Setting Up the CLI Tools (Windows) (p. 268) • ec2-describe-spot-datafeed-subscription (p. Default: The value of the EC2_CERT environment variable. PROMPT> ec2-create-spot-datafeed-subscription -b myawsbucket -p spotdata_ SPOTDATAFEEDSUBSCRIPTION 111122223333 myawsbucket spotdata_ Active Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.pem Output This command returns a table that contains the following information: • The SPOTDATAFEEDSUBSCRIPTION identifier • The AWS account ID of the owner • The Amazon S3 bucket where the data feed is located • The prefix for the data feed file names • The state (Active | Inactive) Amazon EC2 command line tools display errors on stderr. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. Amazon Elastic Compute Cloud CLI Reference Output Option Description -C.

you can't change its CIDR block. you provide the ID of the VPC and the CIDR block you want for the subnet. see AMI Basics in the Amazon EC2 User Guide for Linux Instances. the subnets' CIDR blocks must not overlap. For more information about subnets. For more information about Amazon EBS-backed AMIs. The subnet's CIDR block can be the same as the VPC's CIDR block (assuming you want only a single subnet in the VPC). Syntax ec2-create-subnet -c vpc_id -i cidr [ -z zone ] Options Name Description -c vpc_id The ID of the VPC. but no remaining IP addresses available. They're not available for use. If you add more than one subnet to a VPC. Type: String Default: None Required: Yes Example: -c vpc-1a2b3c4d -i cidr The CIDR block for the subnet. see Your VPC and Subnets in the Amazon VPC User Guide. see create-subnet instead. Amazon Elastic Compute Cloud CLI Reference ec2-create-subnet ec2-create-subnet Description Creates a subnet in an existing VPC. they're set up in a star topology with a logical router in the middle. Type: String Default: None Required: Yes 187 . After you create a subnet. or a subset of the VPC's CIDR block. the IP address doesn't change if you stop and restart the instance (unlike a similar instance launched outside a VPC. which gets a new IP address when restarted).536 IP addresses). Important We reserve both the first four IP addresses and the last IP address in each subnet's CIDR block. If you create more than one subnet in a VPC. It's therefore possible to have a subnet with no running instances (they're all stopped). When you create each subnet. The short version of this command is ec2addsubnet. The smallest subnet (and VPC) you can create uses a /28 netmask (16 IP addresses). If you launch an instance in a VPC using an Amazon EBS-backed AMI. Tip If you are using the AWS CLI. and the largest uses a /16 netmask (65.

For more information. Example: --region eu-west-1 -U. This is only delegation_token required when you are using temporary security credentials. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). see Using Temporary Security Credentials..1. Required: No Example: -z us-east-1a Common Options Option Description --region region The region. see Tell the Tools Who aws_access_key_id You Are.0. Example: -O AKIAIOSFODNN7EXAMPLE -W. or us-east-1 if EC2_URL isn't set. the region specified by the EC2_URL environment variable.amazonaws. --security-token The delegation token to pass along to the AWS request. Example: -U https://ec2. or https://ec2. For more information. --aws-access-key Your access key ID. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description Example: -i 10.com -O. and the URL specified by the -U option.0/24 -z zone The Availability Zone for the subnet. Overrides the default region.. Example: -T AQoDYXdzEJr. Default: The endpoint specified by the EC2_URL environment variable. you must specify this option. --aws-secret-key Your secret access key. you must specify this option. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. Default: The region specified by the EC2_URL environment variable. Type: String Default: Amazon EC2 selects one for you (recommended). Default: The value of the AWS_ACCESS_KEY environment variable. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. If AWS_SECRET_KEY isn't set. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable.com if EC2_URL isn't set.eu-west-1amazonaws.<remainder of security token> 188 . If AWS_ACCESS_KEY isn't set.

--help.509 certificate (-C. --verbose Displays verbose output. --show-empty-fields Shows empty columns as (nil). This is useful when piping the output from one command to the input of another. it returns UnauthorizedOperation. --cert) options are not supported. . including the API request and response on the command line. This is useful if you are building tools to talk directly to the Query API. in seconds. -h Displays usage information for the command. Default: The value of the EC2_CERT environment variable. the command returns DryRunOperation. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. Option Description -K. --private-key) and X.0 onwards of the Amazon EC2 CLI tools.pem -C. Example: --request-timeout 45 -H. Deprecated Options We have deprecated the SOAP API for Amazon EC2. This can assist us when helping you troubleshooting problems. For more information. the private key (-K. otherwise. see Setting Up the Amazon EC2 CLI. If you have the required permissions. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. without actually running the command. --hide-tags Omits tags for tagged resources. --headers Includes column headers in the command output. --aws-access-key) and secret access key (-W. Reads arguments from standard input. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. see SOAP Requests.14. From version 1. --private-key The private key to use when constructing requests to Amazon EC2. For more information. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --cert ec2_cert The X. --auth-dry-run Checks whether you have the required permissions for the command.6. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description --connection-timeout timeout The connection timeout. --aws-secret-key) instead.pem 189 . --debug Displays internal debugging information. -v. Use your access key ID (-O. Example: --connection-timeout 30 --request-timeout timeout The request timeout. in seconds. -D.509 certificate to use when constructing requests to Amazon EC2.

PROMPT> ec2-create-subnet -c vpc-1a2b3c4d -i 10.1. For more information. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. 493) 190 .0.1. Related Action • CreateSubnet Related Commands • ec2-delete-subnet (p.0/24 SUBNET subnet-9d4a7b6c pending vpc-1a2b3c4d 10.0/24 251 us-east-1a Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. 3) • Setting Up the CLI Tools (Windows) (p.1. Amazon Elastic Compute Cloud CLI Reference Output Output This command returns a table that contains the following information: • The SUBNET identifier • The ID of the subnet • The current state of the subnet (pending or available) • The ID of the VPC the subnet is in • The CIDR block assigned to the subnet • The number of IP addresses in the subnet that are available • The Availability Zone the subnet is in Amazon EC2 command line tools display errors on stderr.0/24 in the VPC with the ID vpc-1a2b3c4d. Examples Example This example command creates a subnet with CIDR block 10. 271) • ec2-describe-subnets (p. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.0.0.

Type: String Default: None Required: Yes Example: ami-1a2b3c4d --tag key or key=value The key and optional value of the tag. we set the value to an empty string.] Options Name Description resource_id The IDs of one or more resources to tag. and may not begin with aws:. Type: String Default: None Constraints: The maximum tag key length is 127 Unicode characters. Tag keys and values are case-sensitive. "key=value"). If you don't include a value. you might need to use a second set of quotation marks. Required: Yes Example: --tag "stack=Production" 191 . see create-tags instead. "`"key=value`"").] --tag key[=value] [--tag key[=value] . If you're using the command line tools on a Windows system.. Each resource can have a maximum of 10 tags. Each tag consists of a key and optional value. separated by an equals sign (=). For more information. Amazon Elastic Compute Cloud CLI Reference ec2-create-tags ec2-create-tags Description Adds or overwrites one or more tags for the specified resource or resources. Tag keys must be unique per resource.. Tip If you are using the AWS CLI. escaped with backticks (for example. see Tagging Your Resources in the Amazon EC2 User Guide for Linux Instances. If you're using Windows Powershell. The maximum tag value length is 255 Unicode characters. you might need to use quotation marks (for example. The short version of this command is ec2addtag.. Syntax ec2-create-tags resource_id [resource_id ..

you must specify this option.eu-west-1amazonaws. --show-empty-fields Shows empty columns as (nil). Default: The value of the AWS_ACCESS_KEY environment variable. see Using Temporary Security Credentials. Example: -U https://ec2. Example: -T AQoDYXdzEJr.amazonaws. in seconds. or us-east-1 if EC2_URL isn't set. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. Default: The endpoint specified by the EC2_URL environment variable. Example: --request-timeout 45 -H. --hide-tags Omits tags for tagged resources.. This is only delegation_token required when you are using temporary security credentials. --aws-secret-key Your secret access key. see Tell the Tools Who aws_access_key_id You Are.com -O. Overrides the default region. or https://ec2. you must specify this option.com if EC2_URL isn't set. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Example: --region eu-west-1 -U. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). If AWS_ACCESS_KEY isn't set. If AWS_SECRET_KEY isn't set. --aws-access-key Your access key ID. the region specified by the EC2_URL environment variable. --headers Includes column headers in the command output. in seconds.. and the URL specified by the -U option. Default: The region specified by the EC2_URL environment variable. For more information. 192 . aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Example: -O AKIAIOSFODNN7EXAMPLE -W. Example: --connection-timeout 30 --request-timeout timeout The request timeout. For more information. --security-token The delegation token to pass along to the AWS request. Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region.<remainder of security token> --connection-timeout timeout The connection timeout.

ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --aws-access-key) and secret access key (-W. . --verbose Displays verbose output. For more information. This can assist us when helping you troubleshooting problems.0 onwards of the Amazon EC2 CLI tools. see Setting Up the Amazon EC2 CLI. including the API request and response on the command line. --cert ec2_cert The X. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. the private key (-K. This is useful when piping the output from one command to the input of another. -v. --auth-dry-run Checks whether you have the required permissions for the command. see SOAP Requests.509 certificate (-C. it returns UnauthorizedOperation. Deprecated Options We have deprecated the SOAP API for Amazon EC2.pem Output This command returns a table that contains the following information: • The TAG identifier • The resource type identifier • The ID of the resource • The tag key • The tag value Amazon EC2 command line tools display errors on stderr. Use your access key ID (-O. For more information. without actually running the command. --cert) options are not supported. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. the command returns DryRunOperation. 193 . Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information.14. --help. --aws-secret-key) instead. Option Description -K. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Default: The value of the EC2_CERT environment variable.pem -C. -D. --private-key The private key to use when constructing requests to Amazon EC2. --private-key) and X. This is useful if you are building tools to talk directly to the Query API. Reads arguments from standard input. otherwise. -h Displays usage information for the command. From version 1. If you have the required permissions.509 certificate to use when constructing requests to Amazon EC2.6.

with no value (we set the value to an empty string). Related Action • CreateTags Related Commands • ec2-delete-tags (p. 274) • ec2-describe-tags (p. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. For more information. 499) ec2-create-volume Description Creates an Amazon EBS volume that can be attached to any instance in the same Availability Zone. The other tag consists of a key (stack) and value (Production). 194 . 3) • Setting Up the CLI Tools (Windows) (p. PROMPT> ec2-create-tags ami-1a2b3c4d --tag "stack=Test" TAG ami-1a2b3c4d image stack Test Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Amazon Elastic Compute Cloud CLI Reference Examples Examples Example 1 This example command adds (or overwrites) two tags for an AMI and an instance. One of the tags contains just a key (webserver). PROMPT> ec2-create-tags ami-1a2b3c4d i-7d3e5a2f --tag webserver --tag "stack=Production" TAG image ami-1a2b3c4d webserver TAG image ami-1a2b3c4d stack Production TAG instance i-7d3e5a2f webserver TAG instance i-7d3e5a2f stack Production Example 2 The following example changes the value of the stack tag for one of your AMIs from Production to Test. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.

Type: String Valid values: 1-1024 for standard volumes. Required: Conditional Condition: Required unless you're creating the volume from a snapshot. see create-volume instead. --size size The size of the volume. Volumes that are created from encrypted snapshots are also automatically encrypted. in GiBs. There is no way to create an encrypted volume from an unencrypted snapshot or vice versa. Amazon Elastic Compute Cloud CLI Reference Syntax You can create encrypted volumes with the --encrypted option. 1-16384 for gp2 volumes. and 4-16384 for io1 volumes. Constraints: If the volume type is io1. For more information. Example: --snapshot snap-78a54011 195 . Volumes that are created from encrypted snapshots are automatically encrypted. the default is the snapshot size. There is no way to directly create an unencrypted volume from an encrypted snapshot or vice versa. Default: If you're creating the volume from a snapshot and don't specify a volume size. Type: String Default: None Required: Conditional Condition: Required if you are creating a volume from a snapshot. Syntax ec2-create-volume [--size size | --snapshot snapshot_id [--size size]] --availability-zone zone [--type type [--iops iops]] [--encrypted] [--kms-key-id kms_key_id] Options Name Description -s. Any AWS Marketplace product codes from the snapshot are propagated to the volume. the minimum size of the volume is 4 GiB. For more information. The short version of this command is ec2addvol. see Amazon Elastic Block Store in the Amazon EC2 User Guide for Linux Instances. see Amazon EBS encryption in the Amazon EC2 User Guide for Linux Instances. Example: --size 80 --snapshot snapshot_id The snapshot from which to create the volume. Encrypted volumes may only be attached to instances that support Amazon EBS encryption. Tip If you are using the AWS CLI.

Amazon Elastic Compute Cloud CLI Reference Options Name Description -z. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption. Default: No Required: No 196 . Example: --iops 500 --encrypted Indicates whether the volume will be encrypted. not used with standard or gp2 volumes. see Amazon EBS Volume Types in the Amazon EC2 User Guide for Linux Instances. with a maximum ratio of 30 IOPS/GiB. 313) to list the Availability Zones that are currently available to you. Type: String Valid values: gp2 for General Purpose SSD volumes. --type type The volume type. --iops iops Only valid for Provisioned IOPS SSD volumes. Use ec2-describe-availability-zones (p. For more information. Volumes that are created from encrypted snapshots are automatically encrypted. Default: standard Required: No Example: --type io1 -i. Type: String Default: None Required: Yes Example: --availability-zone us-east-1a -t. --availability-zone zone The Availability Zone in which to create the volume. Default: None Required: Conditional Condition: Required when the volume type is io1. There is no way to create an encrypted volume from an unencrypted snapshot or vice versa. The number of I/O operations per second (IOPS) to provision for the volume. and standard for Magnetic volumes. io1 for Provisioned IOPS SSD volumes. Type: Integer Valid values: Range is 100 to 20000.

Example: -O AKIAIOSFODNN7EXAMPLE -W. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description -k. Example: --region eu-west-1 -U. see Tell the Tools Who aws_access_key_id You Are. --kms-key-id kms_key_id The full ARN of the AWS Key Management Service (AWS KMS) master key to use when creating the encrypted volume.eu-west-1amazonaws. the key namespace. and the URL specified by the -U option. and then the master key ID. --aws-access-key Your access key ID. For example. This parameter is only required if you want to use a non-default master key.com -O. if this parameter is not specified. you must specify this option. Required: No Common Options Option Description --region region The region.amazonaws. Example: -U https://ec2. For more information. followed by the region of the master key. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. or us-east-1 if EC2_URL isn't set. Overrides the default region. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY 197 . arn:aws:kms:us-east-1:012345678910:key/abcd1234- a123-456a-a12b-a123b4cd56ef. you must specify this option. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. or https://ec2. Default: The full ARN of the aws/ebs master key for your account in the region specified. If AWS_ACCESS_KEY isn't set. If AWS_SECRET_KEY isn't set. Default: The value of the AWS_ACCESS_KEY environment variable. --aws-secret-key Your secret access key. the AWS account ID of the master key owner.com if EC2_URL isn't set. the default master key is used. Default: The endpoint specified by the EC2_URL environment variable. The ARN contains the arn:aws:kms namespace. Default: The region specified by the EC2_URL environment variable. the region specified by the EC2_URL environment variable.

509 certificate (-C. --debug Displays internal debugging information. This is useful if you are building tools to talk directly to the Query API. --verbose Displays verbose output. see SOAP Requests.<remainder of security token> --connection-timeout timeout The connection timeout. --cert) options are not supported. From version 1. --auth-dry-run Checks whether you have the required permissions for the command. without actually running the command. -D. it returns UnauthorizedOperation. Reads arguments from standard input. --headers Includes column headers in the command output. see Setting Up the Amazon EC2 CLI. --aws-secret-key) instead. --security-token The delegation token to pass along to the AWS request. in seconds. -h Displays usage information for the command. --hide-tags Omits tags for tagged resources.. Option Description -K.0 onwards of the Amazon EC2 CLI tools. including the API request and response on the command line. Deprecated Options We have deprecated the SOAP API for Amazon EC2. . Example: --request-timeout 45 -H. Use your access key ID (-O. If you have the required permissions. For more information. --help. This is useful when piping the output from one command to the input of another. --private-key The private key to use when constructing requests to Amazon EC2. the private key (-K. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -T. --show-empty-fields Shows empty columns as (nil).6. Example: --connection-timeout 30 --request-timeout timeout The request timeout. Example: -T AQoDYXdzEJr.pem 198 . ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. otherwise. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.. This can assist us when helping you troubleshooting problems. in seconds. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. --private-key) and X. see Using Temporary Security Credentials. -v. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). For more information. the command returns DryRunOperation.14. For more information. --aws-access-key) and secret access key (-W. This is only delegation_token required when you are using temporary security credentials.

see Amazon EBS Volume Types in the Amazon EC2 User Guide for Linux Instances. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. this represents the number of IOPS that have been provisioned for the volume.509 certificate to use when constructing requests to Amazon EC2. 199 . Examples Example This example command creates a 60 GiB General Purpose SSD volume in the Availability Zone us- east-1b. This is only displayed if the --kms-key-id option was used to create the volume. deleted. this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. Amazon Elastic Compute Cloud CLI Reference Output Option Description -C. and bursting. I/O credits. deleting. Amazon EC2 command line tools display errors on stderr. • The encryption status of the volume (Encrypted for encrypted and Not Encrypted for unencrypted) • The full ARN of the AWS Key Management Service (AWS KMS) master key that was used to protect the volume encryption key for the volume. in-use. PROMPT> ec2-create-volume --size 60 --region us-east-1 --availability-zone us-east-1b -- type gp2 VOLUME vol-1a2b3c4d 60 us-east-1b creating YYYY-MM-DDTHH:MM:SS+0000 gp2 180 Not Encrypted Example This example command creates an encrypted 20 GiB Magnetic volume in the Availability Zone us- east-1a. --cert ec2_cert The X. For General Purpose SSD volumes. error) • The time stamp when volume creation was initiated • The Amazon EBS volume type • The number of I/O operations per second (IOPS) that the volume supports. if applicable • The Availability Zone in which the volume was created • The volume state (creating. Default: The value of the EC2_CERT environment variable. For more information on General Purpose SSD baseline performance.pem Output This command returns a table that contains the following information: • The VOLUME identifier • The ID of the volume • The size of the volume. available. For Provisioned IOPS SSD volumes. in GiBs • The snapshot from which the volume was created.

Amazon Elastic Compute Cloud CLI Reference Related Topics PROMPT> ec2-create-volume --size 20 --availability-zone us-east-1a --encrypted VOLUME vol-1a2b3c4d 20 us-east-1a creating YYYY-MM-DDTHH:MM:SS+0000 standard Encrypted Example This example command creates a new Provisioned IOPS SSD volume with 1. Related Action • CreateVolume Related Commands • ec2-attach-volume (p. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. 570) 200 .000 Provisioned IOPS SSD from a snapshot in the Availability Zone us-east-1a. 69) • ec2-delete-volume (p. 313) • ec2-describe-volumes (p. PROMPT> ec2-create-volume --type gp2 --availability-zone us-east-1b --encrypted --kms-key- id arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef VOLUME vol-1a2b3c4d 8 us-east-1b creating 2014-11-10T22:34:17+0000 gp2 24 Encrypted arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. 513) • ec2-detach-volume (p. PROMPT> ec2-create-volume --snapshot snap-5178cf30 --type io1 --iops 1000 --availability- zone us-east-1a VOLUME vol-1a2b3c4d 500 snap-5178cf30 us-east-1a creating YYYY-MM-DDTHH:MM:SS+0000 io1 1000 Not Encrypted Example This example request creates an 8 GiB encrypted General Purpose SSD volume in the Availability Zone us-east-1b with an AWS Key Management Service Customer Master Key. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. For more information. 278) • ec2-describe-availability-zones (p. 3) • Setting Up the CLI Tools (Windows) (p.

To help you decide how big to make your VPC.0. Dedicated tenancy instances run on single-tenant hardware. The short version of this command is ec2addvpc. For more information about DHCP options. Type: String Default: None Required: Yes Example: 10. Amazon Elastic Compute Cloud CLI Reference ec2-create-vpc ec2-create-vpc Description Creates a VPC with the CIDR block you specify. and the largest uses a /16 netmask (65. see DHCP Options Sets in the Amazon VPC User Guide. Type: String Valid values: default | dedicated Default: default Required: No Example: --tenancy dedicated 201 .0/16 --tenancy tenancy The supported tenancy options for instances launched into the VPC. see Your VPC and Subnets in the Amazon VPC User Guide. A value of default means instances can be launched with any tenancy. Syntax ec2-create-vpc cidr [--tenancy tenancy] Options Name Description cidr The CIDR block for the VPC. Tip If you are using the AWS CLI. By default.536 IP addresses).0. see create-vpc instead. The smallest VPC you can create uses a /28 netmask (16 IP addresses). each instance you launch in the VPC has the default DHCP options. which includes only a default DNS server that we provide (AmazonProvidedDNS). a value of dedicated means all instances launched into the VPC are launched as dedicated tenancy instances regardless of the tenancy assigned to the instance at launch.

see Using Temporary Security Credentials. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. Example: --connection-timeout 30 --request-timeout timeout The request timeout. or https://ec2. --aws-secret-key Your secret access key. This is only delegation_token required when you are using temporary security credentials. see Tell the Tools Who aws_access_key_id You Are. you must specify this option.amazonaws. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. If AWS_ACCESS_KEY isn't set. Default: The endpoint specified by the EC2_URL environment variable. Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region.<remainder of security token> --connection-timeout timeout The connection timeout. Default: The value of the AWS_ACCESS_KEY environment variable. Example: -T AQoDYXdzEJr.. For more information. --hide-tags Omits tags for tagged resources. and the URL specified by the -U option. you must specify this option. Default: The region specified by the EC2_URL environment variable. --headers Includes column headers in the command output. in seconds. --show-empty-fields Shows empty columns as (nil). Example: -O AKIAIOSFODNN7EXAMPLE -W.com -O.com if EC2_URL isn't set. the region specified by the EC2_URL environment variable. Example: --request-timeout 45 -H. --aws-access-key Your access key ID.eu-west-1amazonaws. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). For more information. Example: -U https://ec2. Overrides the default region. --security-token The delegation token to pass along to the AWS request.. in seconds. 202 . Example: --region eu-west-1 -U. or us-east-1 if EC2_URL isn't set. If AWS_SECRET_KEY isn't set.

Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information. Default: The value of the EC2_CERT environment variable. see Setting Up the Amazon EC2 CLI.509 certificate (-C. -D.0 onwards of the Amazon EC2 CLI tools. For more information. --private-key) and X. the private key (-K. --aws-access-key) and secret access key (-W. For more information. otherwise. This is useful when piping the output from one command to the input of another. --aws-secret-key) instead. This can assist us when helping you troubleshooting problems. the command returns DryRunOperation. see SOAP Requests. it returns UnauthorizedOperation. --cert ec2_cert The X. -v. --help.pem -C. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. From version 1. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.509 certificate to use when constructing requests to Amazon EC2. -h Displays usage information for the command. If you have the required permissions. Option Description -K. Reads arguments from standard input. --verbose Displays verbose output. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. .14. without actually running the command. including the API request and response on the command line. This is useful if you are building tools to talk directly to the Query API. --private-key The private key to use when constructing requests to Amazon EC2. 203 . Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Use your access key ID (-O.6.pem Output This command returns a table that contains the following information: • The VPC identifier • The ID of the VPC • The CIDR block of the VPC • The current state of the VPC (pending or available) • The ID of the DHCP options associated with the VPC (or default if none) • The supported tenancy options for instances launched into the VPC (default or dedicated). --auth-dry-run Checks whether you have the required permissions for the command. Deprecated Options We have deprecated the SOAP API for Amazon EC2. --cert) options are not supported.

0.0.0.0.0.0/16 dopt-1a2b3c4d default Example 2 This example command creates a VPC with the dedicated tenancy option. Examples Example 1 This example command creates a VPC with the CIDR block 10. Amazon Elastic Compute Cloud CLI Reference Examples Amazon EC2 command line tools display errors on stderr. You can also specify the VPC route tables that use the endpoint. You can specify a policy to attach to the endpoint that will control access to the service from your VPC. 51) • ec2-create-dhcp-options (p.0/16 --tenancy dedicated VPC vpc-1a2b3c4d pending 10.0. An endpoint enables you to create a private connection between your VPC and another AWS service in your account.0. PROMPT> ec2-create-vpc 10. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. For more information.0. PROMPT> ec2-create-vpc 10. Related Action • CreateVpc Related Commands • ec2-associate-dhcp-options (p. 123) • ec2-delete-vpc (p.0. 3) • Setting Up the CLI Tools (Windows) (p. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. 281) • ec2-describe-vpcs (p.0. 543) ec2-create-vpc-endpoint Description Creates a VPC endpoint for a specified AWS service.0/16 VPC vpc-1a2b3c4d pending 10.0/16.0/16 dopt-1a2b3c4d dedicated Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. 204 .

Type: String Default: None Required: Yes Example: -s com. Type: String Default: None Required: Yes Example: -c vpc-1a2b3c4d -s --service-name service_name The AWS service name. The document must be a valid JSON file. see create-vpc-endpoint instead. Amazon Elastic Compute Cloud CLI Reference Syntax Note Currently. Type: String Default: None Required: No 205 . Specify this parameter more than one time for multiple route tables. only endpoints to Amazon S3 are supported.us-east-1.json -r --route-table route_table The ID of a route table to associate with the endpoint.amazonaws.<region>. Syntax ec2-create-vpc-endpoint vpc --service-name service_name [--policy-document policy_document] [--route-table route_table] Options Name Description vpc The ID of the VPC in which the endpoint will be used. in the form com. Tip If you are using the AWS CLI. Required: No Example: -p my-endpoint-policy. we attach a policy that allows access to the service.amazonaws.s3 -p --policy-document A policy document to attach to the endpoint that controls policy_document access to the specified service. Type: String Default: If no policy is attached. The short version of this command is ec2cve.<service>.

Example: -O AKIAIOSFODNN7EXAMPLE -W. Example: --request-timeout 45 -H. This is only delegation_token required when you are using temporary security credentials. Example: --region eu-west-1 -U. Overrides the default region. Example: -T AQoDYXdzEJr. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set).com -O. If AWS_SECRET_KEY isn't set. For more information. in seconds. and the URL specified by the -U option. or us-east-1 if EC2_URL isn't set. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description Example: -r rtb-11aa22bb Common Options Option Description --region region The region. the region specified by the EC2_URL environment variable. --aws-secret-key Your secret access key. Example: -U https://ec2. --security-token The delegation token to pass along to the AWS request. Default: The endpoint specified by the EC2_URL environment variable. --headers Includes column headers in the command output. in seconds. --aws-access-key Your access key ID. 206 .amazonaws. If AWS_ACCESS_KEY isn't set. For more information. or https://ec2. Example: --connection-timeout 30 --request-timeout timeout The request timeout.<remainder of security token> --connection-timeout timeout The connection timeout. you must specify this option. see Using Temporary Security Credentials..com if EC2_URL isn't set. Default: The region specified by the EC2_URL environment variable.. you must specify this option. see Tell the Tools Who aws_access_key_id You Are.eu-west-1amazonaws. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Default: The value of the AWS_ACCESS_KEY environment variable.

From version 1. This is useful if you are building tools to talk directly to the Query API. the private key (-K. --cert ec2_cert The X. This is useful when piping the output from one command to the input of another. This can assist us when helping you troubleshooting problems. --hide-tags Omits tags for tagged resources. --cert) options are not supported. --private-key The private key to use when constructing requests to Amazon EC2. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable.0 onwards of the Amazon EC2 CLI tools. -D. -v. including the API request and response on the command line.509 certificate (-C. . without actually running the command. --help. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. the command returns DryRunOperation.509 certificate to use when constructing requests to Amazon EC2. Use your access key ID (-O. --debug Displays internal debugging information. Default: The value of the EC2_CERT environment variable. see SOAP Requests. otherwise. see Setting Up the Amazon EC2 CLI. Option Description -K.pem Output This command returns a table that contains the following information for each request: • The endpoint information: • The VPCENDPOINT identifier • The endpoint ID • The VPC ID 207 . Deprecated Options We have deprecated the SOAP API for Amazon EC2. --aws-access-key) and secret access key (-W. For more information. Amazon Elastic Compute Cloud CLI Reference Output Option Description --show-empty-fields Shows empty columns as (nil). --aws-secret-key) instead. --verbose Displays verbose output. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --private-key) and X.14. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. If you have the required permissions. For more information.pem -C. --auth-dry-run Checks whether you have the required permissions for the command. Reads arguments from standard input. it returns UnauthorizedOperation.6. -h Displays usage information for the command.

us-west-2.s3 available Fri Feb 20 16:54:29 SAST 2015 {"Version":"2008-10-17".amazonaws. 425) • ec2-describe-vpc-endpoints (p."Principal":"*".amazonaws.us-west-2. 670) 208 . and associates route table rtb-11aa22bb with the endpoint."Action":"*". 285) • ec2-describe-prefix-lists (p. For more information. 529) • ec2-describe-vpc-endpoint-services (p."Statement": [{"Sid":""."Resource":"*"}]} ROUTETABLE rtb-11aa22bb Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. PROMPT> ec2-create-vpc-endpoint vpc-1a2b3c4d -s com.s3 -r rtb-11aa22bb VPCENDPOINT vpce-123abcde vpc-1a2b3c4d com. Related Action • CreateVpcEndpoint Related Commands • ec2-delete-vpc-endpoints (p. 533) • ec2-modify-vpc-endpoint (p. 3) • Setting Up the CLI Tools (Windows) (p. Examples Example 1 This example creates an endpoint between VPC vpc-1a2b3c4d and Amazon S3. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. Amazon Elastic Compute Cloud CLI Reference Examples • The AWS service name • The state of the endpoint • A timestamp • The endpoint policy • The route table information: • The ROUTETABLE identifier • The route table ID Amazon EC2 command line tools display errors on stderr."Effect":"Allow". see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.

--peer-vpc vpc The ID of the VPC with which you are creating the peering connection. Syntax ec2-create-vpc-peering-connection -c vpc -p vpc [-o peer_owner_id] Options Name Description -c. The short version of this command is ec2addpcx. The requester VPC and peer VPC cannot have overlapping CIDR blocks. For more information. The VPC peering connection request expires after 7 days. see create-vpc-peering-connection instead. Amazon Elastic Compute Cloud CLI Reference ec2-create-vpc-peering-connection ec2-create-vpc-peering-connection Description Requests a VPC peering connection between two VPCs: a requester VPC that you own and a peer VPC with which to create the connection. An ec2-create-vpc-peering-connection request between VPCs with overlapping CIDR blocks results in the VPC peering connection having a status of failed. Tip If you are using the AWS CLI. Type: String Default: None Required: Yes Example: -c vpc-1a2b3c4d -p. Type: String Default: Your AWS account ID Required: Conditional 209 . --peer-owner-id peer_owner_id The AWS account ID of the owner of the peer VPC. The peer VPC can belong to another AWS account. after which it cannot be accepted or rejected. --vpc vpc The ID of the requester VPC. see VPC Peering in the Amazon VPC User Guide. Type: String Default: None Required: Yes Example: -p vpc-123abc45 -o. The owner of the peer VPC must accept the peering request to activate the peering connection.

Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). in seconds. Default: The region specified by the EC2_URL environment variable. the region specified by the EC2_URL environment variable. Default: The endpoint specified by the EC2_URL environment variable. and the URL specified by the -U option.com -O.. or https://ec2. Example: --request-timeout 45 210 . see Using Temporary Security Credentials. This is only delegation_token required when you are using temporary security credentials. Default: The value of the AWS_ACCESS_KEY environment variable. If AWS_ACCESS_KEY isn't set. you must specify this option. Overrides the default region. For more information.eu-west-1amazonaws.com if EC2_URL isn't set. --aws-secret-key Your secret access key. --aws-access-key Your access key ID. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. For more information. If AWS_SECRET_KEY isn't set.<remainder of security token> --connection-timeout timeout The connection timeout. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description Condition: Required if the peer VPC is not in the same account as the requester VPC. Example: -T AQoDYXdzEJr. Example: -U https://ec2. see Tell the Tools Who aws_access_key_id You Are. Example: -o 111122223333 Common Options Option Description --region region The region. --security-token The delegation token to pass along to the AWS request. in seconds. or us-east-1 if EC2_URL isn't set.. Example: -O AKIAIOSFODNN7EXAMPLE -W. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. you must specify this option.amazonaws. Example: --connection-timeout 30 --request-timeout timeout The request timeout. Example: --region eu-west-1 -U.

. --aws-access-key) and secret access key (-W. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --debug Displays internal debugging information.509 certificate (-C. This can assist us when helping you troubleshooting problems. -D. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. without actually running the command. including the API request and response on the command line. the command returns DryRunOperation. Deprecated Options We have deprecated the SOAP API for Amazon EC2.0 onwards of the Amazon EC2 CLI tools. This is useful when piping the output from one command to the input of another. If you have the required permissions. --private-key) and X. the private key (-K.509 certificate to use when constructing requests to Amazon EC2. --cert) options are not supported. --headers Includes column headers in the command output.6.14. --help. -v. --hide-tags Omits tags for tagged resources. For more information. --cert ec2_cert The X. --auth-dry-run Checks whether you have the required permissions for the command. it returns UnauthorizedOperation. Default: The value of the EC2_CERT environment variable. otherwise. Amazon Elastic Compute Cloud CLI Reference Output Option Description -H. Reads arguments from standard input. --verbose Displays verbose output. --private-key The private key to use when constructing requests to Amazon EC2. --show-empty-fields Shows empty columns as (nil). This is useful if you are building tools to talk directly to the Query API. -h Displays usage information for the command.pem Output This command returns a table that contains the following information for each peering connection request: • The VPC peering connection information • The VPCPEERINGCONNECTION identifier 211 . Option Description -K. see Setting Up the Amazon EC2 CLI. For more information.pem -C. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --aws-secret-key) instead. see SOAP Requests. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. Use your access key ID (-O. From version 1.

see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. PROMPT> ec2-create-vpc-peering-connection -c vpc-1a2b3c4d -p vpc-123abc45 -o 123456789012 VPCPEERINGCONNECTION pcx-111aaa111 Mon Feb 17 14:30:08 SAST 2014 initiating-request: Initiating Request to 111122223333 REQUESTERVPCINFO vpc-1a2b3c4d 10.1. 3) • Setting Up the CLI Tools (Windows) (p. and a VPC (vpc-123abc45) that belongs AWS account 123456789012. PROMPT> ec2-create-vpc-peering-connection -c vpc-1a2b3c4d -p vpc-11122233 VPCPEERINGCONNECTION pcx-111aaa111 Mon Feb 17 14:30:08 SAST 2014 initiating-request: Initiating Request to 444455556666 REQUESTERVPCINFO vpc-1a2b3c4d 10. Examples Example 1 This example requests a peering connection between your VPCs vpc-1a2b3c4d and vpc-11122233. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. 212 . For more information.1.0/28 444455556666 ACCEPTERVPCINFO vpc-11122233 444455556666 Example 2 This example requests a peering connection between your VPC (vpc-1a2b3c4d). Amazon Elastic Compute Cloud CLI Reference Examples • The VPC peering connection ID • The expiration date and time of the request • The status of the VPC peering connection request • The requester VPC information • The REQUESTERVPCINFO identifier • The VPC ID • The CIDR block • The AWS account ID • The peer VPC information • The ACCEPTERVPCINFO identifier • The VPC ID • The AWS account ID Amazon EC2 command line tools display errors on stderr.0/28 111122223333 ACCEPTERVPCINFO vpc-123abc45 123456789012 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.0.0.

however. the corresponding API action (CreateVpnConnection) returns only the native XML. Cisco or Juniper). The short version of this command is ec2addvpn. 693) • ec2-create-route (p. Tip If you are using the AWS CLI. you must reconfigure your customer gateway with the new information returned from this command. Syntax ec2-create-vpn-connection -t type --customer-gateway customer_gateway_id --vpn-gateway vpn_gateway_id [{--format format} | {--stylesheet your_stylesheet}] 213 . 708) ec2-create-vpn-connection Description Creates a VPN connection between an existing virtual private gateway and customer gateway. 536) • ec2-reject-vpc-peering-connection (p. you can transform the information into a different format based on the vendor that makes your customer gateway (for example. Amazon EC2 doesn't return an error. 171) • ec2-replace-route (p. If you decide to shut down your VPN connection for any reason and later create a new one. If you perform the operation more than once. you can specify xml as the value of the --format option. If you want to see the native XML. The output includes information that you need to give to your network administrator to configure your customer gateway.1. 34) • ec2-delete-vpc-peering-connection (p. Amazon Elastic Compute Cloud CLI Reference ec2-create-vpn-connection Related Action • CreateVpcPeeringConnection Related Commands • ec2-accept-vpc-peering-connection (p. 288) • ec2-describe-vpc-peering-connections (p. Whereas the ec2-create-vpn-connection command lets you choose a format for the configuration information. The underlying native format of this information is XML. This is an idempotent operation. you can set the --format option to generic. with the ec2- create-vpn-connection command. The only supported connection type is ipsec. and the information is formatted in a human readable format for your network administrator. see create-vpn-connection instead. If you use a vendor other than Cisco or Juniper. For more information about VPN connections. If you want to write your own stylesheet. you can use the --stylesheet option to specify that stylesheet and receive the output in your own format. see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon VPC User Guide.

1 | generic | xml Default: None Required: No Example: --format cisco-ios-isr --stylesheet your_stylesheet Includes customer gateway configuration information in the response. Type: String Default: None 214 . or in the native XML format (xml). in the format specified.2 | juniper-screenos-6. Amazon Elastic Compute Cloud CLI Reference Options Options Name Description -t type The type of VPN connection. customer_gateway_id Type: String Default: None Required: Yes Example: --customer-gateway cgw-b4dc3961 --vpn-gateway vpn_gateway_id The ID of the virtual private gateway. including a Cisco device (cisco-ios-isr) or Juniper device (juniper-junos-j). formatted according to the custom XSL stylesheet specified. Type: String Valid values: cisco-ios-isr | juniper-junos-j | juniper- screenos-6.1 --customer-gateway The ID of the customer gateway.1 Default: None Required: Yes Example: -t ipsec. Type: String Default: None Required: Yes Example: --vpn-gateway vgw-8db04f81 --format format Includes customer gateway configuration information in the response. The returned information can be formatted for various devices. in human readable format (generic). Type: String Valid values: ipsec.

or https://ec2. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY 215 .amazonaws. or us-east-1 if EC2_URL isn't set. you must specify this option. Default: The region specified by the EC2_URL environment variable. Overrides the default region. Default: The value of the AWS_ACCESS_KEY environment variable. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point.eu-west-1amazonaws. you must specify this value as true. Example: -U https://ec2. Example: -O AKIAIOSFODNN7EXAMPLE -W. Example: --region eu-west-1 -U. If you are creating a VPN connection for a device that does not support BGP. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. If AWS_ACCESS_KEY isn't set.com -O. For more information. Default: The endpoint specified by the EC2_URL environment variable. see Tell the Tools Who aws_access_key_id You Are. --aws-secret-key Your secret access key. you must specify this option. --aws-access-key Your access key ID.com if EC2_URL isn't set. the region specified by the EC2_URL environment variable. and the URL specified by the -U option. If AWS_SECRET_KEY isn't set. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description Required: No Example: --stylesheet c:\my_stylesheet.xsl --static-routes-only Indicates whether the VPN connection requires static routes. Type: Boolean Default: false Required: No Common Options Option Description --region region The region.

0 onwards of the Amazon EC2 CLI tools. the command returns DryRunOperation. --auth-dry-run Checks whether you have the required permissions for the command. This is useful when piping the output from one command to the input of another. From version 1. Reads arguments from standard input. For more information. . see Using Temporary Security Credentials. it returns UnauthorizedOperation. --debug Displays internal debugging information.pem 216 . see SOAP Requests. Example: -T AQoDYXdzEJr. Use your access key ID (-O. This is useful if you are building tools to talk directly to the Query API. If you have the required permissions. This can assist us when helping you troubleshooting problems. For more information. see Setting Up the Amazon EC2 CLI. --hide-tags Omits tags for tagged resources. Option Description -K.. Deprecated Options We have deprecated the SOAP API for Amazon EC2.509 certificate (-C. the private key (-K. Example: --request-timeout 45 -H. For more information. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable.6. otherwise. including the API request and response on the command line. --aws-access-key) and secret access key (-W. --private-key) and X. --cert) options are not supported. --security-token The delegation token to pass along to the AWS request. --private-key The private key to use when constructing requests to Amazon EC2.. This is only delegation_token required when you are using temporary security credentials.14. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Example: --connection-timeout 30 --request-timeout timeout The request timeout. in seconds. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. -D. --aws-secret-key) instead. --headers Includes column headers in the command output. --verbose Displays verbose output. --show-empty-fields Shows empty columns as (nil). in seconds.<remainder of security token> --connection-timeout timeout The connection timeout. -v. -h Displays usage information for the command. without actually running the command. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. --help. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -T.

see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. To see an example of the configuration information returned.pem Output This command returns a table that contains the following information: • The VPNCONNECTION identifier • The ID of the VPN connection • The current state of the VPN connection (pending. Because it's a long set of information. we haven't included the complete output here. Examples Example This example command creates a VPN connection between the virtual private gateway with the ID vgw-8db04f81 and the customer gateway with the ID cgw-b4dc3961. 3) • Setting Up the CLI Tools (Windows) (p.. The example specifies that the configuration information be formatted as needed for a Cisco customer gateway. available. deleting. see the Amazon VPC Network Administrator Guide..1) • The ID of the customer gateway • The ID of the virtual private gateway • The configuration information for the customer gateway Amazon EC2 command line tools display errors on stderr.Customer gateway configuration data in escaped XML format.. --cert ec2_cert The X. PROMPT> ec2-create-vpn-connection -t ipsec. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. Default: The value of the EC2_CERT environment variable. Amazon Elastic Compute Cloud CLI Reference Output Option Description -C. For more information.1 --customer-gateway cgw-b4dc3961 --vpn-gateway vgw-8db04f81 --format cisco-ios-isr VPNCONNECTION vpn-44a8938f pending ipsec. 217 ..1 cgw-b4dc3961 vgw-8db04f81 . deleted) • The type of VPN connection (ipsec.509 certificate to use when constructing requests to Amazon EC2.

The static route allows traffic to be routed from the virtual private gateway to the VPN customer gateway. Tip If you are using the AWS CLI. The short version of this command is ec2cvcr. 548) ec2-create-vpn-connection-route Description Creates a static route associated with a VPN connection between an existing virtual private gateway and a VPN customer gateway. 73) • ec2-create-subnet (p. 187) • ec2-create-vpc (p. Type: String Default: None Required: Yes --cidr cidr_block The CIDR block associated with the local subnet of the customer network. 291) • ec2-describe-vpn-connections (p. Type: String Default: None Required: Yes 218 . 201) • ec2-delete-vpn-connection (p. Amazon Elastic Compute Cloud CLI Reference ec2-create-vpn-connection-route Related Action • CreateVpnConnection Related Commands • ec2-attach-vpn-gateway (p. For more information about VPN connections. Syntax ec2-create-vpn-connection-route --vpn-connection vpn_connection_id --cidr cidr_block Options Name Description --vpn-connection vpn_connection_id The ID of the VPN connection. see create-vpn-connection-route instead. see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon VPC User Guide.

--hide-tags Omits tags for tagged resources. --show-empty-fields Shows empty columns as (nil).amazonaws. see Tell the Tools Who aws_access_key_id You Are. Example: -U https://ec2. This is only delegation_token required when you are using temporary security credentials. --aws-access-key Your access key ID. the region specified by the EC2_URL environment variable. For more information. Example: --connection-timeout 30 --request-timeout timeout The request timeout. or us-east-1 if EC2_URL isn't set. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. in seconds.eu-west-1amazonaws. If AWS_ACCESS_KEY isn't set. Default: The region specified by the EC2_URL environment variable. --headers Includes column headers in the command output. Example: --request-timeout 45 -H. and the URL specified by the -U option. Overrides the default region.. or https://ec2.<remainder of security token> --connection-timeout timeout The connection timeout.com if EC2_URL isn't set. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Example: -O AKIAIOSFODNN7EXAMPLE -W. in seconds. --aws-secret-key Your secret access key. you must specify this option. Default: The value of the AWS_ACCESS_KEY environment variable.. you must specify this option. Example: --region eu-west-1 -U. Example: -T AQoDYXdzEJr. If AWS_SECRET_KEY isn't set. 219 . For more information. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Default: The endpoint specified by the EC2_URL environment variable. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. --security-token The delegation token to pass along to the AWS request.com -O. Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region. see Using Temporary Security Credentials.

Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. For more information.0.pem -C. From version 1. This can assist us when helping you troubleshooting problems. Deprecated Options We have deprecated the SOAP API for Amazon EC2. see SOAP Requests. --private-key) and X. --auth-dry-run Checks whether you have the required permissions for the command. --aws-access-key) and secret access key (-W. --cert ec2_cert The X. the command returns DryRunOperation.14. --cert) options are not supported. Option Description -K. Reads arguments from standard input. If you have the required permissions. Default: The value of the EC2_CERT environment variable. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --help. This is useful if you are building tools to talk directly to the Query API. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --private-key The private key to use when constructing requests to Amazon EC2. . For more information. --verbose Displays verbose output. 220 . This is useful when piping the output from one command to the input of another. -v.12. Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information.pem Output The command returns true if the operation succeeds or an error if the operation does not succeed. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?.0/16. Examples Example This example command creates a static route to the VPN connection for the VPN connection with the ID vpn-83ad48ea to the destination CIDR block 11. Amazon EC2 command line tools display errors on stderr. Use your access key ID (-O. including the API request and response on the command line. without actually running the command. see Setting Up the Amazon EC2 CLI. -D.509 certificate (-C. otherwise. -h Displays usage information for the command.6.0 onwards of the Amazon EC2 CLI tools. the private key (-K.509 certificate to use when constructing requests to Amazon EC2. --aws-secret-key) instead. it returns UnauthorizedOperation.

3) • Setting Up the CLI Tools (Windows) (p. Syntax ec2-create-vpn-gateway -t type Options Name Description -t type The type of VPN connection this virtual private gateway supports. Type: String Valid values: ipsec. Related Action • CreateVpnConnectionRoute ec2-create-vpn-gateway Description Creates a virtual private gateway. Amazon Elastic Compute Cloud CLI Reference Related Topics PROMPT> ec2-create-vpn-connection-route --cidr "11. For more information about virtual private gateways. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.0/16" --vpn-connection vpn-83ad48ea RETURN true Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. see create-vpn-gateway instead. The short version of this command is ec2addvgw. You can create a virtual private gateway before creating the VPC itself.12. see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon VPC User Guide. For more information. Tip If you are using the AWS CLI. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.1 Default: None Required: Yes 221 . A virtual private gateway is the endpoint on the VPC side of your VPN connection.0.

If AWS_SECRET_KEY isn't set. or https://ec2. the region specified by the EC2_URL environment variable. 222 .1 Common Options Option Description --region region The region. For more information. and the URL specified by the -U option. see Using Temporary Security Credentials. --headers Includes column headers in the command output. or us-east-1 if EC2_URL isn't set. --security-token The delegation token to pass along to the AWS request. Example: --request-timeout 45 -H. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. Default: The endpoint specified by the EC2_URL environment variable. Overrides the default region. you must specify this option. Default: The value of the AWS_ACCESS_KEY environment variable.eu-west-1amazonaws. Example: --connection-timeout 30 --request-timeout timeout The request timeout. For more information. Example: -T AQoDYXdzEJr.<remainder of security token> --connection-timeout timeout The connection timeout... you must specify this option. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Default: The region specified by the EC2_URL environment variable.amazonaws. This is only delegation_token required when you are using temporary security credentials.com -O. in seconds.com if EC2_URL isn't set. see Tell the Tools Who aws_access_key_id You Are. --aws-access-key Your access key ID. If AWS_ACCESS_KEY isn't set. in seconds. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Amazon Elastic Compute Cloud CLI Reference Common Options Name Description Example: -t ipsec. Example: --region eu-west-1 -U. Example: -U https://ec2. --aws-secret-key Your secret access key. Example: -O AKIAIOSFODNN7EXAMPLE -W.

-v. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. the command returns DryRunOperation. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. it returns UnauthorizedOperation. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --help. see SOAP Requests. --aws-access-key) and secret access key (-W. From version 1. the private key (-K. --hide-tags Omits tags for tagged resources. -h Displays usage information for the command. --private-key) and X. --cert) options are not supported.509 certificate to use when constructing requests to Amazon EC2.pem -C. If you have the required permissions.0 onwards of the Amazon EC2 CLI tools. This can assist us when helping you troubleshooting problems. Amazon Elastic Compute Cloud CLI Reference Output Option Description --show-empty-fields Shows empty columns as (nil). For more information. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.14. --private-key The private key to use when constructing requests to Amazon EC2. Option Description -K. including the API request and response on the command line. --auth-dry-run Checks whether you have the required permissions for the command. For more information. This is useful when piping the output from one command to the input of another. -D. --aws-secret-key) instead.1) 223 .509 certificate (-C. Default: The value of the EC2_CERT environment variable. Reads arguments from standard input. --cert ec2_cert The X. Deprecated Options We have deprecated the SOAP API for Amazon EC2.6. . Use your access key ID (-O. --verbose Displays verbose output. deleted) • The type of VPN connection the virtual private gateway supports (ipsec. This is useful if you are building tools to talk directly to the Query API. --debug Displays internal debugging information. deleting.pem Output This command returns a table that contains the following information: • The VPNGATEWAY identifier • The ID of the virtual private gateway • The current state of the virtual private gateway (pending. available. see Setting Up the Amazon EC2 CLI. without actually running the command. otherwise.

For more information about VPN customer gateways. 224 . PROMPT> ec2-create-vpn-gateway -t ipsec. For more information. see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon VPC User Guide.1 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.1 VPNGATEWAY vgw-8db04f81 pending ipsec. Amazon Elastic Compute Cloud CLI Reference Examples • The Availability Zone for the virtual private gateway • Information about VPCs attached to the virtual private gateway (there are none attached when you first create a virtual private gateway) Amazon EC2 command line tools display errors on stderr. 297) • ec2-describe-vpn-gateways (p. 554) • ec2-detach-vpn-gateway (p. Examples Example This example command creates a virtual private gateway. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. 73) • ec2-delete-vpn-gateway (p. 574) ec2-delete-customer-gateway Description Deletes the specified customer gateway. 3) • Setting Up the CLI Tools (Windows) (p. Related Action • CreateVpnGateway Related Commands • ec2-attach-vpn-gateway (p. You must delete the VPN connection before you can delete the customer gateway. The short version of this command is ec2delcgw.

Default: The endpoint specified by the EC2_URL environment variable. --aws-access-key Your access key ID. Example: -O AKIAIOSFODNN7EXAMPLE -W. Type: String Default: None Required: Yes Example: cgw-b4dc3961 Common Options Option Description --region region The region. or us-east-1 if EC2_URL isn't set. For more information. If AWS_SECRET_KEY isn't set.eu-west-1amazonaws. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY 225 .amazonaws. the region specified by the EC2_URL environment variable. Amazon Elastic Compute Cloud CLI Reference Syntax Tip If you are using the AWS CLI. see delete-customer-gateway instead. Example: --region eu-west-1 -U. see Tell the Tools Who aws_access_key_id You Are. and the URL specified by the -U option.com if EC2_URL isn't set. Example: -U https://ec2. If AWS_ACCESS_KEY isn't set. --aws-secret-key Your secret access key. you must specify this option. Default: The region specified by the EC2_URL environment variable. Overrides the default region. Default: The value of the AWS_ACCESS_KEY environment variable. Syntax ec2-delete-customer-gateway customer_gateway_id Options Name Description customer_gateway_id The ID of the customer gateway. you must specify this option. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. or https://ec2. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable.com -O.

Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -T. --hide-tags Omits tags for tagged resources.pem 226 . Example: --request-timeout 45 -H. --aws-secret-key) instead.6. This is only delegation_token required when you are using temporary security credentials. --private-key) and X. Option Description -K. otherwise. This is useful if you are building tools to talk directly to the Query API. This can assist us when helping you troubleshooting problems. --aws-access-key) and secret access key (-W. --debug Displays internal debugging information. For more information. see SOAP Requests.14. -D. --headers Includes column headers in the command output.0 onwards of the Amazon EC2 CLI tools. . Example: -T AQoDYXdzEJr. --show-empty-fields Shows empty columns as (nil). see Using Temporary Security Credentials.. --auth-dry-run Checks whether you have the required permissions for the command. --security-token The delegation token to pass along to the AWS request. Reads arguments from standard input. in seconds. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --private-key The private key to use when constructing requests to Amazon EC2. -h Displays usage information for the command. -v. see Setting Up the Amazon EC2 CLI.<remainder of security token> --connection-timeout timeout The connection timeout. without actually running the command. in seconds. the command returns DryRunOperation. For more information. If you have the required permissions. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. Example: --connection-timeout 30 --request-timeout timeout The request timeout. --help. Deprecated Options We have deprecated the SOAP API for Amazon EC2. the private key (-K. This is useful when piping the output from one command to the input of another. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?..509 certificate (-C. For more information. it returns UnauthorizedOperation. including the API request and response on the command line. From version 1. --verbose Displays verbose output. Use your access key ID (-O. --cert) options are not supported. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set).

Examples Example This example command deletes the specified customer gateway. 119) • ec2-describe-customer-gateways (p. Amazon Elastic Compute Cloud CLI Reference Output Option Description -C. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.509 certificate to use when constructing requests to Amazon EC2. PROMPT> ec2-delete-customer-gateway cgw-b4dc3961 CUSTOMERGATEWAY cgw-b4dc3961 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. 331) 227 . --cert ec2_cert The X. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.pem Output This command returns a table that contains the following information: • The CUSTOMERGATEWAY identifier • The ID of the customer gateway Amazon EC2 command line tools display errors on stderr. Related Action • DeleteCustomerGateway Related Commands • ec2-create-customer-gateway (p. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. For more information. 3) • Setting Up the CLI Tools (Windows) (p. Default: The value of the EC2_CERT environment variable.

The short version of this command is ec2deldopt. Type: String Default: None Required: Yes Example: dopt-7a8b9c2d Common Options Option Description --region region The region. Example: -U https://ec2. the region specified by the EC2_URL environment variable. Tip If you are using the AWS CLI. 228 . see DHCP Options Sets in the Amazon VPC User Guide.com if EC2_URL isn't set. For more information about DHCP options sets. Syntax ec2-delete-dhcp-options dhcp_options_id Options Name Description dhcp_options_id The ID of the DHCP options set. or us-east-1 if EC2_URL isn't set. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. see delete-dhcp-options instead. Example: --region eu-west-1 -U. see Tell the Tools Who aws_access_key_id You Are. and the URL specified by the -U option. Default: The endpoint specified by the EC2_URL environment variable. or https://ec2.eu-west-1amazonaws.amazonaws. For more information. --aws-access-key Your access key ID. You can disassociate the set of DHCP options by associating either a new set of options or the default set of options with the VPC. Overrides the default region. You must disassociate the set of DHCP options before you can delete it.com -O. Default: The region specified by the EC2_URL environment variable. Amazon Elastic Compute Cloud CLI Reference ec2-delete-dhcp-options ec2-delete-dhcp-options Description Deletes the specified set of DHCP options.

--headers Includes column headers in the command output. -D. it returns UnauthorizedOperation. This is useful when piping the output from one command to the input of another. --auth-dry-run Checks whether you have the required permissions for the command. . --show-empty-fields Shows empty columns as (nil). Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). If AWS_ACCESS_KEY isn't set. Example: --request-timeout 45 -H. without actually running the command. including the API request and response on the command line. you must specify this option.<remainder of security token> --connection-timeout timeout The connection timeout. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. --help. see Using Temporary Security Credentials. -v. This can assist us when helping you troubleshooting problems. --hide-tags Omits tags for tagged resources. This is only delegation_token required when you are using temporary security credentials. in seconds. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. Example: -T AQoDYXdzEJr. Example: -O AKIAIOSFODNN7EXAMPLE -W. in seconds. 229 . --security-token The delegation token to pass along to the AWS request. --debug Displays internal debugging information. --verbose Displays verbose output. If AWS_SECRET_KEY isn't set. the command returns DryRunOperation. This is useful if you are building tools to talk directly to the Query API.. Reads arguments from standard input. --aws-secret-key Your secret access key. If you have the required permissions.. you must specify this option. -h Displays usage information for the command. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Example: --connection-timeout 30 --request-timeout timeout The request timeout. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description Default: The value of the AWS_ACCESS_KEY environment variable. otherwise. For more information.

Default: The value of the EC2_CERT environment variable. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. --private-key The private key to use when constructing requests to Amazon EC2. --private-key) and X. the private key (-K.pem Output This command returns a table that contains the following information: • The DHCPOPTIONS identifier • The ID of the DHCP options set Amazon EC2 command line tools display errors on stderr. see SOAP Requests. --cert ec2_cert The X. see Setting Up the Amazon EC2 CLI. Examples Example This example command deletes the specified set of DHCP options. Amazon Elastic Compute Cloud CLI Reference Output Deprecated Options We have deprecated the SOAP API for Amazon EC2.0 onwards of the Amazon EC2 CLI tools. --aws-access-key) and secret access key (-W. For more information. 230 . --aws-secret-key) instead.pem -C. From version 1. Option Description -K. For more information. Use your access key ID (-O. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable.14. 3) • Setting Up the CLI Tools (Windows) (p. For more information. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.509 certificate to use when constructing requests to Amazon EC2. --cert) options are not supported. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.6. PROMPT> ec2-delete-dhcp-options dopt-7a8b9c2d DHCPOPTIONS dopt-7a8b9c2d Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.509 certificate (-C. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.

see VM Import Manifest. For more information. --manifest-url url The URL for an existing import manifest file. see Clean Up After an Upload (p. Amazon Elastic Compute Cloud CLI Reference ec2-delete-disk-image Related Action • DeleteDhcpOptions Related Commands • ec2-associate-dhcp-options (p. Example: -t import-i-fh95npoc -u. 123) • ec2-describe-dhcp-options (p. --task task_id The Task ID of the conversion task that is no longer active. The short version of this command is ec2ddi. You can specify either the conversion task ID or the URL to the import manifest file in Amazon S3. Syntax ec2-delete-disk-image { -t task_id | -u url } -o owner_access_key_id -w owner_secret_access_key [--ignore-active-task] Options Name Description -t. 51) • ec2-create-dhcp-options (p. Type: String Default: None Required: Conditional 231 . For information about the import manifest. 812). Use this option to delete the uploaded disk image even if one or more active conversion tasks still reference the manifest. 336) ec2-delete-disk-image Description Deletes the specified partially or fully uploaded disk image for conversion from Amazon S3. Type: String Default: None Required: Conditional Condition: Either the task ID or the URL to the manifest is required.

Use this option at your own risk. This parameter value is not sent to Amazon EC2.com/mydisk-to-delete.vmdk -o. Using this option may cause active tasks to fail. Before you specify a value for this option.example. review and follow the guidance in Best Practices for Managing AWS Access Keys. review and follow the guidance in Best Practices for Managing AWS Access Keys. Amazon Elastic Compute Cloud CLI Reference Options Name Description Condition: Either the task ID or the URL to the manifest is required. Example: -u http://s3. --owner-sak The AWS secret access key of the owner of the bucket owner_secret_access_key containing the uploaded disk image to be deleted. This parameter value is not sent to Amazon EC2. Type: String Default: None Required: No Example: --ignore-active-task 232 . Type: String Default: None Required: Yes Example: -o AKIAIOSFODNN7EXAMPLE -w. Type: String Default: None Required: Yes Example: -w wJalrXUtnFEMI/K7MDENG/ bPxRfiCYEXAMPLEKEY --ignore-active-task Delete the uploaded disk image despite having an active task. --owner-akid The access key ID of the owner of the bucket containing the owner_access_key_id uploaded disk image to be deleted. Before you specify a value for this option.

Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region.eu-west-1amazonaws. Default: The value of the AWS_ACCESS_KEY environment variable.<remainder of security token> --connection-timeout timeout The connection timeout. and the URL specified by the -U option. Example: -T AQoDYXdzEJr. you must specify this option. For more information. Example: --request-timeout 45 -H.. --aws-secret-key Your secret access key. --headers Includes column headers in the command output. you must specify this option. or us-east-1 if EC2_URL isn't set. For more information.amazonaws. see Using Temporary Security Credentials. Overrides the default region. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Example: --connection-timeout 30 --request-timeout timeout The request timeout. in seconds. --hide-tags Omits tags for tagged resources. This is only delegation_token required when you are using temporary security credentials. --aws-access-key Your access key ID. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T.com -O. Example: --region eu-west-1 -U. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. --show-empty-fields Shows empty columns as (nil).. see Tell the Tools Who aws_access_key_id You Are. If AWS_ACCESS_KEY isn't set. If AWS_SECRET_KEY isn't set. or https://ec2. Example: -O AKIAIOSFODNN7EXAMPLE -W. Example: -U https://ec2. Default: The region specified by the EC2_URL environment variable. Default: The endpoint specified by the EC2_URL environment variable. in seconds. 233 .com if EC2_URL isn't set. the region specified by the EC2_URL environment variable. --security-token The delegation token to pass along to the AWS request.

-h Displays usage information for the command. This can assist us when helping you troubleshooting problems. --help. --auth-dry-run Checks whether you have the required permissions for the command. If you have the required permissions. -D. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. This is useful if you are building tools to talk directly to the Query API. --aws-secret-key) instead. --verbose Displays verbose output. Use your access key ID (-O. This is useful when piping the output from one command to the input of another. Deprecated Options We have deprecated the SOAP API for Amazon EC2. -v. it returns UnauthorizedOperation. Reads arguments from standard input.14. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. Option Description -K. without actually running the command. --cert) options are not supported. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem -C. 234 . otherwise. including the API request and response on the command line. --cert ec2_cert The X. the private key (-K. the command returns DryRunOperation.509 certificate (-C. Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information. .pem Output This command returns a table that contains the following information: • The ID of the task Amazon EC2 command line tools display errors on stderr. --aws-access-key) and secret access key (-W.509 certificate to use when constructing requests to Amazon EC2. --private-key The private key to use when constructing requests to Amazon EC2. From version 1. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. see SOAP Requests. see Setting Up the Amazon EC2 CLI. Default: The value of the EC2_CERT environment variable.0 onwards of the Amazon EC2 CLI tools. For more information. For more information. --private-key) and X.6.

default VPC] The name of the security group. Tip If you are using the AWS CLI. The short version of this command is ec2delgrp. 623) • ec2-resume-import (p. Type: String 235 . PROMPT> ec2-delete-disk-image -t import-i-fh95npoc -o AKIAIOSFODNN7EXAMPLE -w wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY DELETE-TASK import-i-fh95npoc Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. 3) • Setting Up the CLI Tools (Windows) (p. 749) ec2-delete-group Description Deletes the specified security group. see delete-security-group instead. Syntax ec2-delete-group { group_name | group_id } Options Name Description group_name [EC2-Classic. Important If you attempt to delete a security group that is associated with an instance. Amazon Elastic Compute Cloud CLI Reference Examples Examples Example This example command deletes the disk image with the ID import-i-fh95npoc. 611) • ec2-import-volume (p. the operation fails with InvalidGroup. 10) Related Commands • ec2-cancel-conversion-task (p.InUse for EC2-Classic or DependencyViolation for EC2-VPC. or is referenced by another security group. 92) • ec2-import-instance (p.

If AWS_ACCESS_KEY isn't set. Example: -O AKIAIOSFODNN7EXAMPLE 236 . see Tell the Tools Who aws_access_key_id You Are. for EC2-Classic or a default VPC. the region specified by the EC2_URL environment variable. Default: The endpoint specified by the EC2_URL environment variable. Default: The region specified by the EC2_URL environment variable.com -O.com if EC2_URL isn't set. Example: -U https://ec2. you can specify either group_name or group_id. you can specify either group_name or group_id.amazonaws. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. you must specify this option. Default: The value of the AWS_ACCESS_KEY environment variable. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description Default: None Required: Conditional Condition: For EC2-Classic and default VPCs. or us-east-1 if EC2_URL isn't set. and the URL specified by the -U option. Example: websrv group_id The ID of the security group. Type: String Default: None Required: Conditional Condition: Required for a nondefault VPC.eu-west-1amazonaws. --aws-access-key Your access key ID. Overrides the default region. For more information. Example: sg-32fa9d3e Common Options Option Description --region region The region. or https://ec2. Example: --region eu-west-1 -U.

. For more information. --headers Includes column headers in the command output. otherwise. without actually running the command. see Using Temporary Security Credentials. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?.. --aws-secret-key) instead. see SOAP Requests. For more information. --show-empty-fields Shows empty columns as (nil). For more information. If AWS_SECRET_KEY isn't set. including the API request and response on the command line. . This is useful when piping the output from one command to the input of another. --debug Displays internal debugging information. Use your access key ID (-O. --hide-tags Omits tags for tagged resources. Example: -T AQoDYXdzEJr. the private key (-K. Deprecated Options We have deprecated the SOAP API for Amazon EC2. --verbose Displays verbose output. --security-token The delegation token to pass along to the AWS request. --auth-dry-run Checks whether you have the required permissions for the command. Reads arguments from standard input. --aws-secret-key Your secret access key. -D. From version 1. --aws-access-key) and secret access key (-W. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Example: --connection-timeout 30 --request-timeout timeout The request timeout. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -W.0 onwards of the Amazon EC2 CLI tools. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. in seconds. it returns UnauthorizedOperation. -v. This can assist us when helping you troubleshooting problems. -h Displays usage information for the command. Example: --request-timeout 45 -H. in seconds. --cert) options are not supported. This is useful if you are building tools to talk directly to the Query API. --private-key) and X. 237 . --help.<remainder of security token> --connection-timeout timeout The connection timeout. the command returns DryRunOperation.509 certificate (-C. If you have the required permissions. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable.14. see Setting Up the Amazon EC2 CLI.6. This is only delegation_token required when you are using temporary security credentials. you must specify this option.

509 certificate to use when constructing requests to Amazon EC2.pem Output This command returns a table that contains the following information: • Success status (true or false) Amazon EC2 command line tools display errors on stderr. 238 . Examples Example 1 This example command deletes the specified security group for EC2-Classic. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem -C. PROMPT> ec2-delete-group sg-1a2b3c4d RETURN true Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. 3) • Setting Up the CLI Tools (Windows) (p. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Amazon Elastic Compute Cloud CLI Reference Output Option Description -K. Default: The value of the EC2_CERT environment variable. --cert ec2_cert The X. --private-key The private key to use when constructing requests to Amazon EC2. For more information. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. PROMPT> ec2-delete-group websrv RETURN true Example 2 This example command deletes the specified security group for EC2-VPC. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.

see the Amazon VPC User Guide. 76) • ec2-create-group (p. the region specified by the EC2_URL environment variable. 127) • ec2-describe-group (p. The short version of this command is ec2deligw. 753) ec2-delete-internet-gateway Description Deletes the specified Internet gateway. For more information about your VPC and Internet gateway. see delete-internet-gateway instead. Tip If you are using the AWS CLI. Type: String Default: None Required: Yes Example: igw-8db04f81 Common Options Option Description --region region The region. Amazon Elastic Compute Cloud CLI Reference ec2-delete-internet-gateway Related Action • DeleteSecurityGroup Related Commands • ec2-authorize (p. 345) • ec2-revoke (p. You must detach the Internet gateway from the VPC before you can delete it. 239 . and the URL specified by the -U option. Overrides the default region. Syntax ec2-delete-internet-gateway internet_gateway_id Options Name Description internet_gateway_id The ID of the Internet gateway.

com -O.<remainder of security token> --connection-timeout timeout The connection timeout. --aws-access-key Your access key ID. This can assist us when helping you troubleshooting problems. in seconds. see Using Temporary Security Credentials. --headers Includes column headers in the command output. --auth-dry-run Checks whether you have the required permissions for the command. --hide-tags Omits tags for tagged resources. For more information.amazonaws. --aws-secret-key Your secret access key. you must specify this option. -D.eu-west-1amazonaws. For more information. or us-east-1 if EC2_URL isn't set.. 240 . Example: --connection-timeout 30 --request-timeout timeout The request timeout. Example: --request-timeout 45 -H. in seconds. see Tell the Tools Who aws_access_key_id You Are. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). without actually running the command.. Default: The value of the AWS_ACCESS_KEY environment variable. If you have the required permissions. or https://ec2. Example: -U https://ec2. This is only delegation_token required when you are using temporary security credentials. If AWS_SECRET_KEY isn't set. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description Default: The region specified by the EC2_URL environment variable. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. --debug Displays internal debugging information. Default: The endpoint specified by the EC2_URL environment variable. Example: --region eu-west-1 -U. otherwise. --show-empty-fields Shows empty columns as (nil). the command returns DryRunOperation. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. it returns UnauthorizedOperation. Example: -O AKIAIOSFODNN7EXAMPLE -W.com if EC2_URL isn't set. you must specify this option. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. If AWS_ACCESS_KEY isn't set. --security-token The delegation token to pass along to the AWS request. Example: -T AQoDYXdzEJr.

0 onwards of the Amazon EC2 CLI tools. -h Displays usage information for the command. Examples Example This example command deletes the specified Internet gateway.pem -C. see SOAP Requests.509 certificate to use when constructing requests to Amazon EC2. Reads arguments from standard input. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. including the API request and response on the command line. This is useful when piping the output from one command to the input of another. For more information. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. . --verbose Displays verbose output.14. --cert) options are not supported. --private-key The private key to use when constructing requests to Amazon EC2. PROMPT> ec2-delete-internet-gateway igw-eaad4883 RETURN true 241 . This is useful if you are building tools to talk directly to the Query API. see Setting Up the Amazon EC2 CLI. --private-key) and X. --cert ec2_cert The X.6. Deprecated Options We have deprecated the SOAP API for Amazon EC2. --aws-secret-key) instead. From version 1. --aws-access-key) and secret access key (-W. For more information. --help. Amazon Elastic Compute Cloud CLI Reference Output Option Description -v. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. Option Description -K. Default: The value of the EC2_CERT environment variable.509 certificate (-C.pem Output This command returns a table that contains the following information: • Success status (true or false) Amazon EC2 command line tools display errors on stderr. Use your access key ID (-O. the private key (-K. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.

You must own the key pair. Amazon Elastic Compute Cloud CLI Reference Related Topics Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. see delete-key-pair instead. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. The short version of this command is ec2delkey. 62) • ec2-create-internet-gateway (p. 394) • ec2-detach-internet-gateway (p. 563) ec2-delete-keypair Description Deletes the specified key pair. Related Action • DeleteInternetGateway Related Commands • ec2-attach-internet-gateway (p. Tip If you are using the AWS CLI. Syntax ec2-delete-keypair key_pair Options Name Description key_pair The name of the key pair. Type: String Default: None Required: Yes Example: primary_keypair 242 . 142) • ec2-describe-internet-gateways (p. 3) • Setting Up the CLI Tools (Windows) (p. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. For more information. by removing the public key from Amazon EC2.

see Tell the Tools Who aws_access_key_id You Are. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Default: The value of the AWS_ACCESS_KEY environment variable. This is only delegation_token required when you are using temporary security credentials. Example: --request-timeout 45 -H. For more information. or us-east-1 if EC2_URL isn't set. --headers Includes column headers in the command output.com -O. --aws-secret-key Your secret access key. If AWS_ACCESS_KEY isn't set. Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region. see Using Temporary Security Credentials. For more information. Default: The endpoint specified by the EC2_URL environment variable. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. you must specify this option. --hide-tags Omits tags for tagged resources. in seconds. --show-empty-fields Shows empty columns as (nil). Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. Example: -U https://ec2.eu-west-1amazonaws. and the URL specified by the -U option. --security-token The delegation token to pass along to the AWS request. 243 . aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Example: -T AQoDYXdzEJr. the region specified by the EC2_URL environment variable.<remainder of security token> --connection-timeout timeout The connection timeout. Default: The region specified by the EC2_URL environment variable. --aws-access-key Your access key ID. Example: --region eu-west-1 -U. in seconds..amazonaws.. Overrides the default region. you must specify this option. or https://ec2.com if EC2_URL isn't set. Example: --connection-timeout 30 --request-timeout timeout The request timeout. If AWS_SECRET_KEY isn't set. Example: -O AKIAIOSFODNN7EXAMPLE -W.

509 certificate to use when constructing requests to Amazon EC2.509 certificate (-C. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. -h Displays usage information for the command.pem -C. If you have the required permissions. Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information. --private-key The private key to use when constructing requests to Amazon EC2. --help. For more information. including the API request and response on the command line. without actually running the command. This is useful if you are building tools to talk directly to the Query API. it returns UnauthorizedOperation. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. see Setting Up the Amazon EC2 CLI. --aws-secret-key) instead. Default: The value of the EC2_CERT environment variable. --private-key) and X. From version 1. otherwise. Reads arguments from standard input. --auth-dry-run Checks whether you have the required permissions for the command. 244 . Use your access key ID (-O. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. -v. --cert) options are not supported. Deprecated Options We have deprecated the SOAP API for Amazon EC2. see SOAP Requests. This is useful when piping the output from one command to the input of another. For more information.6. --verbose Displays verbose output. . -D. --cert ec2_cert The X. --aws-access-key) and secret access key (-W. the private key (-K. the command returns DryRunOperation.pem Output This command returns a table that contains the following information: • The KEYPAIR identifier • The name of the deleted key pair Amazon EC2 command line tools display errors on stderr.14.0 onwards of the Amazon EC2 CLI tools. This can assist us when helping you troubleshooting problems. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Option Description -K.

see delete-network-acl instead. For more information. 3) • Setting Up the CLI Tools (Windows) (p. 399) ec2-delete-network-acl Description Deletes the specified network ACL. Related Action • DeleteKeyPair Related Commands • ec2-create-keypair (p. PROMPT> ec2-delete-keypair my-key-pair KEYPAIR my-key-pair Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Syntax ec2-delete-network-acl acl_id Options Name Description acl_id The ID of the network ACL. Tip If you are using the AWS CLI. The short version of this command is ec2delnacl. see Network ACLs in the Amazon VPC User Guide. 245 . You can't delete the ACL if it's associated with any subnets. 145) • ec2-describe-keypairs (p. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. You can't delete the default network ACL. Amazon Elastic Compute Cloud CLI Reference Examples Examples Example This example command deletes the key pair named my-key-pair. For more information.

or https://ec2.. you must specify this option. Example: --connection-timeout 30 246 .. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. you must specify this option. Default: The endpoint specified by the EC2_URL environment variable. --aws-secret-key Your secret access key. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description Type: String Default: None Required: Yes Example: acl-2cb85d45 Common Options Option Description --region region The region. the region specified by the EC2_URL environment variable. Overrides the default region.amazonaws. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T.com if EC2_URL isn't set. For more information. If AWS_ACCESS_KEY isn't set.eu-west-1amazonaws. --aws-access-key Your access key ID. Default: The value of the AWS_ACCESS_KEY environment variable. Example: -T AQoDYXdzEJr. see Using Temporary Security Credentials. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. see Tell the Tools Who aws_access_key_id You Are. If AWS_SECRET_KEY isn't set. or us-east-1 if EC2_URL isn't set. Example: -O AKIAIOSFODNN7EXAMPLE -W. and the URL specified by the -U option. For more information.<remainder of security token> --connection-timeout timeout The connection timeout.com -O. Example: --region eu-west-1 -U. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Default: The region specified by the EC2_URL environment variable. Example: -U https://ec2. --security-token The delegation token to pass along to the AWS request. in seconds. This is only delegation_token required when you are using temporary security credentials.

--aws-access-key) and secret access key (-W. . Example: --request-timeout 45 -H. the command returns DryRunOperation. Use your access key ID (-O. --verbose Displays verbose output. otherwise. -D.509 certificate to use when constructing requests to Amazon EC2. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --headers Includes column headers in the command output. Deprecated Options We have deprecated the SOAP API for Amazon EC2. the private key (-K. For more information. This is useful if you are building tools to talk directly to the Query API. --cert ec2_cert The X. it returns UnauthorizedOperation. This can assist us when helping you troubleshooting problems. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --debug Displays internal debugging information.6. This is useful when piping the output from one command to the input of another. --auth-dry-run Checks whether you have the required permissions for the command. --help. Reads arguments from standard input. see Setting Up the Amazon EC2 CLI. Amazon Elastic Compute Cloud CLI Reference Output Option Description --request-timeout timeout The request timeout.pem -C. -v. If you have the required permissions.pem Output This command returns a table that contains the following information: 247 . --private-key The private key to use when constructing requests to Amazon EC2. in seconds. -h Displays usage information for the command. Default: The value of the EC2_CERT environment variable. Option Description -K. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --cert) options are not supported.0 onwards of the Amazon EC2 CLI tools. From version 1. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. including the API request and response on the command line. --show-empty-fields Shows empty columns as (nil). --aws-secret-key) instead. without actually running the command. For more information. --hide-tags Omits tags for tagged resources.14.509 certificate (-C. see SOAP Requests. --private-key) and X.

Syntax ec2-delete-network-acl-entry acl_id -n rule_number [--egress] 248 . 149) • ec2-describe-network-acls (p. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. see delete-network-acl-entry instead. The short version of this command is ec2delnae. Tip If you are using the AWS CLI. Amazon Elastic Compute Cloud CLI Reference Examples • Success status (true or false) Amazon EC2 command line tools display errors on stderr. Examples Example This example command deletes the specified network ACL. For more information. PROMPT> ec2-delete-network-acl acl-2cb85d45 RETURN true Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. 403) • ec2-replace-network-acl-association (p. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. see Network ACLs in the Amazon VPC User Guide. 3) • Setting Up the CLI Tools (Windows) (p. Related Action • DeleteNetworkAcl Related Commands • ec2-create-network-acl (p. 700) ec2-delete-network-acl-entry Description Deletes the specified ingress or egress entry (rule) from the specified network ACL. For more information.

Example: -O AKIAIOSFODNN7EXAMPLE 249 . If AWS_ACCESS_KEY isn't set. Default: The endpoint specified by the EC2_URL environment variable. Amazon Elastic Compute Cloud CLI Reference Options Options Name Description acl_id The ID of the network ACL.amazonaws.eu-west-1amazonaws. and the URL specified by the -U option. Example: -U https://ec2. the region specified by the EC2_URL environment variable. or us-east-1 if EC2_URL isn't set. Default: If not specified. you must specify this option.com if EC2_URL isn't set. or https://ec2. For more information. Required: No Common Options Option Description --region region The region.com -O. --rule-number rule_number The rule number of the entry to delete. Default: The value of the AWS_ACCESS_KEY environment variable. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Type: Number Default: None Required: Yes Example: 100 --egress Indicates that the rule is an egress rule. Example: --region eu-west-1 -U. Default: The region specified by the EC2_URL environment variable. Type: String Default: None Required: Yes Example: acl-5fb85d36 -n. see Tell the Tools Who aws_access_key_id You Are. --aws-access-key Your access key ID. the rule is an ingress rule. Overrides the default region.

-v. --private-key) and X.14. For more information. otherwise. Example: --request-timeout 45 -H. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -W. If you have the required permissions. From version 1. it returns UnauthorizedOperation. the private key (-K. see SOAP Requests. --cert) options are not supported. Use your access key ID (-O. --debug Displays internal debugging information. --help. If AWS_SECRET_KEY isn't set.. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. This is useful when piping the output from one command to the input of another. Deprecated Options We have deprecated the SOAP API for Amazon EC2. without actually running the command. Example: --connection-timeout 30 --request-timeout timeout The request timeout. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. -h Displays usage information for the command. see Using Temporary Security Credentials.509 certificate (-C. --aws-access-key) and secret access key (-W. the command returns DryRunOperation. For more information. This is useful if you are building tools to talk directly to the Query API. --hide-tags Omits tags for tagged resources. --security-token The delegation token to pass along to the AWS request. . --show-empty-fields Shows empty columns as (nil).. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). --aws-secret-key) instead.<remainder of security token> --connection-timeout timeout The connection timeout. you must specify this option. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. For more information. see Setting Up the Amazon EC2 CLI. in seconds. --verbose Displays verbose output. Example: -T AQoDYXdzEJr.6. --aws-secret-key Your secret access key.0 onwards of the Amazon EC2 CLI tools. -D. Reads arguments from standard input. --headers Includes column headers in the command output. in seconds. This is only delegation_token required when you are using temporary security credentials. This can assist us when helping you troubleshooting problems. --auth-dry-run Checks whether you have the required permissions for the command. 250 . including the API request and response on the command line.

PROMPT> ec2-delete-network-acl-entry acl-2cb85d45 -n 100 RETURN true Example 2 This example command deletes the egress entry with rule number 200 from the network ACL with the ID acl-2cb85d45. Amazon Elastic Compute Cloud CLI Reference Output Option Description -K.pem Output This command returns a table that contains the following information: • Success status (true or false) Amazon EC2 command line tools display errors on stderr. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable.pem -C. --cert ec2_cert The X. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Default: The value of the EC2_CERT environment variable. 3) • Setting Up the CLI Tools (Windows) (p. PROMPT> ec2-delete-network-acl-entry acl-2cb85d45 -n 200 --egress RETURN true Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. For more information. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. --private-key The private key to use when constructing requests to Amazon EC2. Examples Example 1 This example command deletes ingress rule number 100 from the specified network ACL. 251 . see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.509 certificate to use when constructing requests to Amazon EC2.

the region specified by the EC2_URL environment variable. 153) • ec2-describe-network-acls (p. You must detach the network interface before you can delete it. Type: String Default: None Required: Yes Example: eni-3a9f6553 Common Options Option Description --region region The region. Amazon Elastic Compute Cloud CLI Reference ec2-delete-network-interface Related Action • DeleteNetworkAclEntry Related Commands • ec2-create-network-acl-entry (p. or us-east-1 if EC2_URL isn't set. 703) ec2-delete-network-interface Description Deletes the specified network interface. Example: --region eu-west-1 252 . Default: The region specified by the EC2_URL environment variable. Syntax ec2-delete-network-interface interface_id Options Name Description interface_id The ID of the network interface. and the URL specified by the -U option. see delete-network-interface instead. 403) • ec2-replace-network-acl-entry (p. Overrides the default region. Tip If you are using the AWS CLI. The short version of this command is ec2delnic.

otherwise. --debug Displays internal debugging information. or https://ec2. Example: --request-timeout 45 -H.. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. see Using Temporary Security Credentials.com -O. This is useful if you are building tools to talk directly to the Query API. This is only delegation_token required when you are using temporary security credentials. If you have the required permissions. Default: The endpoint specified by the EC2_URL environment variable. --verbose Displays verbose output. you must specify this option. If AWS_ACCESS_KEY isn't set. Default: The value of the AWS_ACCESS_KEY environment variable. without actually running the command. --security-token The delegation token to pass along to the AWS request. --aws-access-key Your access key ID. For more information. -D. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -U. -v. 253 . including the API request and response on the command line. Example: --connection-timeout 30 --request-timeout timeout The request timeout. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. --aws-secret-key Your secret access key. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. --auth-dry-run Checks whether you have the required permissions for the command. Example: -U https://ec2. the command returns DryRunOperation. in seconds. you must specify this option. For more information. --hide-tags Omits tags for tagged resources. --show-empty-fields Shows empty columns as (nil). Example: -T AQoDYXdzEJr. see Tell the Tools Who aws_access_key_id You Are. --headers Includes column headers in the command output. in seconds.<remainder of security token> --connection-timeout timeout The connection timeout.eu-west-1amazonaws.com if EC2_URL isn't set. This can assist us when helping you troubleshooting problems.amazonaws. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Example: -O AKIAIOSFODNN7EXAMPLE -W. it returns UnauthorizedOperation. If AWS_SECRET_KEY isn't set..

Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Default: The value of the EC2_CERT environment variable. This is useful when piping the output from one command to the input of another.509 certificate (-C. --aws-secret-key) instead.509 certificate to use when constructing requests to Amazon EC2. see Setting Up the Amazon EC2 CLI. see SOAP Requests. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --private-key) and X. PROMPT> ec2-delete-network-interface eni-3a9f6553 NETWORKINTERFACE eni-3a9f6553 254 . Reads arguments from standard input.pem -C.0 onwards of the Amazon EC2 CLI tools. Examples Example This example command deletes the specified network interface. Option Description -K.6. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --help. --cert ec2_cert The X. --cert) options are not supported. For more information.pem Output This command returns a table that contains the following information: • The NETWORKINTERFACE identifier • The ID of the network interface that you deleted Amazon EC2 command line tools display errors on stderr. Deprecated Options We have deprecated the SOAP API for Amazon EC2. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. --private-key The private key to use when constructing requests to Amazon EC2. -h Displays usage information for the command. the private key (-K. From version 1. Use your access key ID (-O. --aws-access-key) and secret access key (-W.14. For more information. Amazon Elastic Compute Cloud CLI Reference Output Option Description .

10) IAM Policies You can create an IAM policy to grant users permission to use this command. For more information. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. Amazon Elastic Compute Cloud CLI Reference Related Topics Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Related Action • DeleteNetworkInterface Related Commands • ec2-attach-network-interface (p. Type: String 255 . Syntax ec2-delete-placement-group placement_group Options Name Description placement_group The name of the placement group. 742) ec2-delete-placement-group Description Deletes the specified placement group. Tip If you are using the AWS CLI. You must terminate all instances in a placement group before you can delete the placement group. 3) • Setting Up the CLI Tools (Windows) (p. The short version of this command is ec2delpgrp. 409) • ec2-describe-network-interfaces (p. 647) • ec2-reset-network-interface-attribute (p. see delete-placement-group instead. 413) • ec2-detach-network-interface (p. 65) • ec2-create-network-interface (p. see Cluster Instances in the Amazon EC2 User Guide for Linux Instances. For more information about placement groups and cluster instances. 158) • ec2-describe-network-interface-attribute (p. 567) • ec2-modify-network-interface-attribute (p.

Default: The region specified by the EC2_URL environment variable. If AWS_ACCESS_KEY isn't set. --aws-access-key Your access key ID. Example: -U https://ec2. in seconds. This is only delegation_token required when you are using temporary security credentials. Example: --region eu-west-1 -U. you must specify this option. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Default: The endpoint specified by the EC2_URL environment variable. --aws-secret-key Your secret access key. Example: --connection-timeout 30 256 . and the URL specified by the -U option. Default: The value of the AWS_ACCESS_KEY environment variable. For more information. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point.com if EC2_URL isn't set. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Amazon Elastic Compute Cloud CLI Reference Common Options Name Description Default: None Required: Yes Example: XYZ-cluster Common Options Option Description --region region The region. Example: -O AKIAIOSFODNN7EXAMPLE -W.. or https://ec2. If AWS_SECRET_KEY isn't set. --security-token The delegation token to pass along to the AWS request.amazonaws. Overrides the default region. Example: -T AQoDYXdzEJr. you must specify this option. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. see Using Temporary Security Credentials. see Tell the Tools Who aws_access_key_id You Are..<remainder of security token> --connection-timeout timeout The connection timeout. or us-east-1 if EC2_URL isn't set. the region specified by the EC2_URL environment variable.com -O.eu-west-1amazonaws. For more information.

--headers Includes column headers in the command output. Use your access key ID (-O. Default: The value of the EC2_CERT environment variable.pem -C.6. This can assist us when helping you troubleshooting problems. see Setting Up the Amazon EC2 CLI. the command returns DryRunOperation.14. Deprecated Options We have deprecated the SOAP API for Amazon EC2. see SOAP Requests. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --cert) options are not supported. . Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --aws-access-key) and secret access key (-W. -h Displays usage information for the command. For more information. without actually running the command.509 certificate (-C. --hide-tags Omits tags for tagged resources. --debug Displays internal debugging information. the private key (-K.pem Output This command returns the following information: 257 . Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. This is useful if you are building tools to talk directly to the Query API. Amazon Elastic Compute Cloud CLI Reference Output Option Description --request-timeout timeout The request timeout. --cert ec2_cert The X. Reads arguments from standard input. --aws-secret-key) instead. Example: --request-timeout 45 -H. --help. --private-key The private key to use when constructing requests to Amazon EC2. From version 1. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. including the API request and response on the command line. in seconds. it returns UnauthorizedOperation. --auth-dry-run Checks whether you have the required permissions for the command.509 certificate to use when constructing requests to Amazon EC2.0 onwards of the Amazon EC2 CLI tools. For more information. --verbose Displays verbose output. --show-empty-fields Shows empty columns as (nil). --private-key) and X. This is useful when piping the output from one command to the input of another. If you have the required permissions. Option Description -K. -v. -D. otherwise.

163) • ec2-describe-placement-groups (p. 3) • Setting Up the CLI Tools (Windows) (p. see Route Tables in the Amazon VPC User Guide. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. PROMPT> ec2-delete-placement-group XYZ-cluster PLACEMENTGROUP XYZ-cluster deleted Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Amazon Elastic Compute Cloud CLI Reference Examples • The PLACEMENTGROUP identifier • The name of the placement group • The status of the placement group (deleted) Examples Example This example command deletes the placement group named XYZ-cluster. For more information. 421) ec2-delete-route Description Deletes the specified route from the specified route table. The short version of this command is ec2delrt. Related Action • DeletePlacementGroup Related Commands • ec2-create-placement-group (p. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. Tip If you are using the AWS CLI. Syntax ec2-delete-route route_table_id -r cidr 258 . For more information. see delete-route instead.

0. --cidr cidr The CIDR range for the route. --aws-access-key Your access key ID.0. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Amazon Elastic Compute Cloud CLI Reference Options Options Name Description route_table_id The ID of the route table. you must specify this option. If AWS_ACCESS_KEY isn't set. or https://ec2. see Tell the Tools Who aws_access_key_id You Are. the region specified by the EC2_URL environment variable. Default: The region specified by the EC2_URL environment variable.amazonaws. 259 . or us-east-1 if EC2_URL isn't set. If AWS_SECRET_KEY isn't set. Example: -U https://ec2. Example: --region eu-west-1 -U.0/0 Common Options Option Description --region region The region. you must specify this option. Default: The endpoint specified by the EC2_URL environment variable. For more information. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. The value you specify must match the CIDR for the route exactly. and the URL specified by the -U option. Example: -O AKIAIOSFODNN7EXAMPLE -W. --aws-secret-key Your secret access key. Overrides the default region.com -O. Type: String Default: None Required: Yes Example: 0.com if EC2_URL isn't set. Type: String Default: None Required: Yes Example: rtb-5da34634 -r.eu-west-1amazonaws. Default: The value of the AWS_ACCESS_KEY environment variable.

Amazon Elastic Compute Cloud CLI Reference Common Options Option Description Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T.0 onwards of the Amazon EC2 CLI tools. --verbose Displays verbose output. --aws-access-key) and secret access key (-W. --private-key The private key to use when constructing requests to Amazon EC2.509 certificate (-C.. 260 . For more information. the command returns DryRunOperation. --help. -D. --cert) options are not supported. Example: --connection-timeout 30 --request-timeout timeout The request timeout. the private key (-K.14. For more information.6. --debug Displays internal debugging information.. in seconds. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set).<remainder of security token> --connection-timeout timeout The connection timeout. -h Displays usage information for the command. Example: --request-timeout 45 -H. --show-empty-fields Shows empty columns as (nil). see Using Temporary Security Credentials. Use your access key ID (-O. This is only delegation_token required when you are using temporary security credentials. without actually running the command. Example: -T AQoDYXdzEJr. --headers Includes column headers in the command output. Reads arguments from standard input. For more information. see SOAP Requests. it returns UnauthorizedOperation. see Setting Up the Amazon EC2 CLI. --hide-tags Omits tags for tagged resources. Option Description -K. This can assist us when helping you troubleshooting problems. otherwise. --aws-secret-key) instead. From version 1. This is useful if you are building tools to talk directly to the Query API. . ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. -v. --private-key) and X. --auth-dry-run Checks whether you have the required permissions for the command. If you have the required permissions. including the API request and response on the command line. This is useful when piping the output from one command to the input of another. Deprecated Options We have deprecated the SOAP API for Amazon EC2. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. in seconds. --security-token The delegation token to pass along to the AWS request.

458) • ec2-replace-route (p.0/24 from the specified route table. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.16. Examples Example This example command deletes the route with the destination CIDR 172. 171) • ec2-describe-route-tables (p. 708) 261 .1. Related Action • DeleteRoute Related Commands • ec2-create-route (p.0/24 RETURN true Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.pem Output This command returns a table that contains the following information: • Success status (true or false) Amazon EC2 command line tools display errors on stderr.1. For more information. 3) • Setting Up the CLI Tools (Windows) (p. --cert ec2_cert The X. Amazon Elastic Compute Cloud CLI Reference Output Option Description Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. PROMPT> ec2-delete-route rtb-e4ad488d -r 172.pem -C.509 certificate to use when constructing requests to Amazon EC2.16. Default: The value of the EC2_CERT environment variable.

the region specified by the EC2_URL environment variable. Example: -U https://ec2. 262 . The short version of this command is ec2delrtb. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Amazon Elastic Compute Cloud CLI Reference ec2-delete-route-table ec2-delete-route-table Description Deletes the specified route table. or https://ec2. see Tell the Tools Who aws_access_key_id You Are.amazonaws. and the URL specified by the -U option. For more information. Type: String Default: None Required: Yes Example: rtb-7aa34613 Common Options Option Description --region region The region.com -O. Tip If you are using the AWS CLI. For more information. --aws-access-key Your access key ID. Overrides the default region. Default: The region specified by the EC2_URL environment variable.com if EC2_URL isn't set. see Route Tables in the Amazon VPC User Guide.eu-west-1amazonaws. You can't delete the main route table. Default: The endpoint specified by the EC2_URL environment variable. You must disassociate the route table from any subnets before you can delete it. see delete-route-table instead. Example: --region eu-west-1 -U. or us-east-1 if EC2_URL isn't set. Syntax ec2-delete-route-table route_table_id Options Name Description route_table_id The ID of the route table.

you must specify this option. --help. . --show-empty-fields Shows empty columns as (nil). in seconds. This is only delegation_token required when you are using temporary security credentials. Example: -T AQoDYXdzEJr. including the API request and response on the command line. -h Displays usage information for the command. Reads arguments from standard input. This is useful if you are building tools to talk directly to the Query API. the command returns DryRunOperation. --debug Displays internal debugging information. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable.. This is useful when piping the output from one command to the input of another. -v. it returns UnauthorizedOperation. Example: --connection-timeout 30 --request-timeout timeout The request timeout. --auth-dry-run Checks whether you have the required permissions for the command. without actually running the command.<remainder of security token> --connection-timeout timeout The connection timeout. --hide-tags Omits tags for tagged resources. If AWS_ACCESS_KEY isn't set. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description Default: The value of the AWS_ACCESS_KEY environment variable. you must specify this option. If AWS_SECRET_KEY isn't set. --headers Includes column headers in the command output. For more information. otherwise. see Using Temporary Security Credentials. If you have the required permissions. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. -D. in seconds. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. Example: -O AKIAIOSFODNN7EXAMPLE -W. --aws-secret-key Your secret access key. 263 . --verbose Displays verbose output. --security-token The delegation token to pass along to the AWS request. Example: --request-timeout 45 -H.. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). This can assist us when helping you troubleshooting problems.

see Setting Up the Amazon EC2 CLI. From version 1. --cert) options are not supported. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --aws-access-key) and secret access key (-W.14. see SOAP Requests. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. Option Description -K. 264 . For more information.pem -C.6. PROMPT> ec2-delete-route-table rtb-7aa34613 RETURN true Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Amazon Elastic Compute Cloud CLI Reference Output Deprecated Options We have deprecated the SOAP API for Amazon EC2. For more information. --private-key The private key to use when constructing requests to Amazon EC2.pem Output This command returns a table that contains the following information: • Success status (true or false) Amazon EC2 command line tools display errors on stderr. --aws-secret-key) instead. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.509 certificate (-C.0 onwards of the Amazon EC2 CLI tools. Examples Example This example command deletes the specified route table. Default: The value of the EC2_CERT environment variable. Use your access key ID (-O. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. --private-key) and X. 3) • Setting Up the CLI Tools (Windows) (p. --cert ec2_cert The X. the private key (-K.509 certificate to use when constructing requests to Amazon EC2. For more information. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.

176) • ec2-describe-route-tables (p. When you delete a snapshot. Note You cannot delete a snapshot of the root device of an Amazon EBS volume used by a registered AMI. the snapshots are incremental. see Deregistering Your AMI in the Amazon EC2 User Guide for Linux Instances. only the data not needed for any other snapshot is removed. 54) • ec2-create-route-table (p. You must first de-register the AMI before you can delete the snapshot. 458) • ec2-disassociate-route-table (p. Amazon Elastic Compute Cloud CLI Reference ec2-delete-snapshot Related Action • DeleteRouteTable Related Commands • ec2-associate-route-table (p. see delete-snapshot instead. all active snapshots will have access to all the information needed to restore the volume. 713) ec2-delete-snapshot Description Deletes the specified snapshot. Type: String Default: None Required: Yes Example: snap-78a54011 265 . So regardless of which prior snapshots have been deleted. Tip If you are using the AWS CLI. Syntax ec2-delete-snapshot snapshot_id Options Name Description snapshot_id The ID of the Amazon EBS snapshot. 588) • ec2-replace-route-table-association (p. For more information. The short version of this command is ec2delsnap. and only the blocks on the device that have changed since your last snapshot are saved in the new snapshot. When you make periodic snapshots of a volume.

Example: --region eu-west-1 -U. you must specify this option. Example: -O AKIAIOSFODNN7EXAMPLE -W. Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region. or us-east-1 if EC2_URL isn't set. Default: The value of the AWS_ACCESS_KEY environment variable. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. If AWS_SECRET_KEY isn't set. For more information. in seconds. Example: -U https://ec2. Example: --connection-timeout 30 --request-timeout timeout The request timeout. see Tell the Tools Who aws_access_key_id You Are. or https://ec2. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). Default: The region specified by the EC2_URL environment variable. --security-token The delegation token to pass along to the AWS request.. see Using Temporary Security Credentials. For more information. in seconds.<remainder of security token> --connection-timeout timeout The connection timeout. If AWS_ACCESS_KEY isn't set.com -O.amazonaws. 266 . --aws-access-key Your access key ID. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable.. and the URL specified by the -U option. you must specify this option. --hide-tags Omits tags for tagged resources.com if EC2_URL isn't set. This is only delegation_token required when you are using temporary security credentials. Example: --request-timeout 45 -H. Example: -T AQoDYXdzEJr.eu-west-1amazonaws. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. Default: The endpoint specified by the EC2_URL environment variable. Overrides the default region. --headers Includes column headers in the command output. --aws-secret-key Your secret access key. --show-empty-fields Shows empty columns as (nil). the region specified by the EC2_URL environment variable.

-h Displays usage information for the command. the command returns DryRunOperation.14. --private-key The private key to use when constructing requests to Amazon EC2.509 certificate (-C. This is useful when piping the output from one command to the input of another. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --private-key) and X. --cert ec2_cert The X. see Setting Up the Amazon EC2 CLI. otherwise. -D. Default: The value of the EC2_CERT environment variable.pem -C. --aws-secret-key) instead. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. 267 . --auth-dry-run Checks whether you have the required permissions for the command.pem Output This command returns a table that contains the following information: • The SNAPSHOT identifier • The ID of the snapshot Amazon EC2 command line tools display errors on stderr.509 certificate to use when constructing requests to Amazon EC2. From version 1. This can assist us when helping you troubleshooting problems. --verbose Displays verbose output. --cert) options are not supported. If you have the required permissions. Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information. This is useful if you are building tools to talk directly to the Query API. see SOAP Requests. --help. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.0 onwards of the Amazon EC2 CLI tools. For more information. without actually running the command. the private key (-K. it returns UnauthorizedOperation. Reads arguments from standard input.6. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. --aws-access-key) and secret access key (-W. Deprecated Options We have deprecated the SOAP API for Amazon EC2. . -v. Use your access key ID (-O. For more information. Option Description -K. including the API request and response on the command line.

179) • ec2-describe-snapshots (p. see Spot Instance Data Feed in the Amazon EC2 User Guide for Linux Instances. Related Action • DeleteSnapshot Related Commands • ec2-create-snapshot (p. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. 468) ec2-delete-spot-datafeed-subscription Description Deletes the data feed for Spot Instances. The short version of this command is ec2delsds. Amazon Elastic Compute Cloud CLI Reference Examples Examples Example This example command deletes the snapshot with the ID snap-1a2b3c4d. 268 . For more information. 3) • Setting Up the CLI Tools (Windows) (p. PROMPT> ec2-delete-snapshot snap-1a2b3c4d SNAPSHOT snap-1a2b3c4d Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. see delete-spot-datafeed-subscription instead. Syntax ec2-delete-spot-datafeed-subscription Options This command has no options. Tip If you are using the AWS CLI. For more information.

amazonaws. or https://ec2. you must specify this option. Example: -O AKIAIOSFODNN7EXAMPLE -W. see Using Temporary Security Credentials.. This is only delegation_token required when you are using temporary security credentials. the region specified by the EC2_URL environment variable. --show-empty-fields Shows empty columns as (nil). Example: --connection-timeout 30 --request-timeout timeout The request timeout.eu-west-1amazonaws.<remainder of security token> --connection-timeout timeout The connection timeout. --headers Includes column headers in the command output. and the URL specified by the -U option. Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region. or us-east-1 if EC2_URL isn't set. Example: -T AQoDYXdzEJr.. --hide-tags Omits tags for tagged resources.com if EC2_URL isn't set. If AWS_SECRET_KEY isn't set. see Tell the Tools Who aws_access_key_id You Are. 269 . --security-token The delegation token to pass along to the AWS request. Overrides the default region. you must specify this option. in seconds. Example: --region eu-west-1 -U. Example: --request-timeout 45 -H. --aws-access-key Your access key ID. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Default: The value of the AWS_ACCESS_KEY environment variable. Example: -U https://ec2. For more information.com -O. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. --aws-secret-key Your secret access key. Default: The endpoint specified by the EC2_URL environment variable. For more information. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. If AWS_ACCESS_KEY isn't set. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). in seconds. Default: The region specified by the EC2_URL environment variable.

without actually running the command.0 onwards of the Amazon EC2 CLI tools. . -v.pem Output This command returns no output. This is useful when piping the output from one command to the input of another. This can assist us when helping you troubleshooting problems. --private-key) and X. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem -C. For more information. see Setting Up the Amazon EC2 CLI. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. the command returns DryRunOperation. -h Displays usage information for the command. For more information. Deprecated Options We have deprecated the SOAP API for Amazon EC2. including the API request and response on the command line. Default: The value of the EC2_CERT environment variable. Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information.509 certificate (-C. otherwise. --private-key The private key to use when constructing requests to Amazon EC2. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. This is useful if you are building tools to talk directly to the Query API. see SOAP Requests. --auth-dry-run Checks whether you have the required permissions for the command. Use your access key ID (-O.6. -D.509 certificate to use when constructing requests to Amazon EC2. it returns UnauthorizedOperation. --verbose Displays verbose output. the private key (-K. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.14. --aws-secret-key) instead. If you have the required permissions. Amazon EC2 command line tools display errors on stderr. 270 . --cert) options are not supported. --cert ec2_cert The X. Option Description -K. --aws-access-key) and secret access key (-W. --help. Reads arguments from standard input. Examples Example This example command deletes the data feed for the account. From version 1.

Related Action • DeleteSpotDatafeedSubscription Related Commands • ec2-create-spot-datafeed-subscription (p. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. 3) • Setting Up the CLI Tools (Windows) (p. see delete-subnet instead. Tip If you are using the AWS CLI. Syntax ec2-delete-subnet subnet_id Options Name Description subnet_id The ID of the subnet. You must terminate all running instances in the subnet before you can delete the subnet. The short version of this command is ec2delsubnet. 183) • ec2-describe-spot-datafeed-subscription (p. Amazon Elastic Compute Cloud CLI Reference Related Topics PROMPT> ec2-delete-spot-datafeed-subscription - Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Type: String Default: None Required: Yes 271 . 475) ec2-delete-subnet Description Deletes the specified subnet. For more information. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.

Default: The value of the AWS_ACCESS_KEY environment variable. This is only delegation_token required when you are using temporary security credentials.com -O. see Using Temporary Security Credentials. or https://ec2. Overrides the default region. --security-token The delegation token to pass along to the AWS request. see Tell the Tools Who aws_access_key_id You Are. Example: -O AKIAIOSFODNN7EXAMPLE -W. Example: --connection-timeout 30 --request-timeout timeout The request timeout. or us-east-1 if EC2_URL isn't set. For more information. Example: -T AQoDYXdzEJr. in seconds.com if EC2_URL isn't set. For more information. in seconds. Default: The region specified by the EC2_URL environment variable. Amazon Elastic Compute Cloud CLI Reference Common Options Name Description Example: subnet-9d4a7b6c Common Options Option Description --region region The region.. --headers Includes column headers in the command output. If AWS_ACCESS_KEY isn't set. --aws-access-key Your access key ID. If AWS_SECRET_KEY isn't set. Example: -U https://ec2.. Default: The endpoint specified by the EC2_URL environment variable. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. and the URL specified by the -U option.eu-west-1amazonaws. the region specified by the EC2_URL environment variable. you must specify this option. 272 . Example: --request-timeout 45 -H. Example: --region eu-west-1 -U. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable.<remainder of security token> --connection-timeout timeout The connection timeout. you must specify this option. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point.amazonaws. --aws-secret-key Your secret access key. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set).

see Setting Up the Amazon EC2 CLI. otherwise. -h Displays usage information for the command.509 certificate (-C. --hide-tags Omits tags for tagged resources. it returns UnauthorizedOperation. Option Description -K. --debug Displays internal debugging information. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Amazon Elastic Compute Cloud CLI Reference Output Option Description --show-empty-fields Shows empty columns as (nil). Deprecated Options We have deprecated the SOAP API for Amazon EC2. --private-key) and X.6. --auth-dry-run Checks whether you have the required permissions for the command. Default: The value of the EC2_CERT environment variable. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --cert ec2_cert The X. For more information. This is useful if you are building tools to talk directly to the Query API. . -v. From version 1. --cert) options are not supported. Use your access key ID (-O. see SOAP Requests. Reads arguments from standard input.14. the command returns DryRunOperation. If you have the required permissions. --private-key The private key to use when constructing requests to Amazon EC2.pem Output This command returns a table that contains the following information: • The SUBNET identifier • The ID of the subnet Amazon EC2 command line tools display errors on stderr. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. --help.0 onwards of the Amazon EC2 CLI tools. This is useful when piping the output from one command to the input of another. without actually running the command.509 certificate to use when constructing requests to Amazon EC2. --aws-access-key) and secret access key (-W. the private key (-K. including the API request and response on the command line. This can assist us when helping you troubleshooting problems. -D.pem -C. 273 . --aws-secret-key) instead. --verbose Displays verbose output. For more information.

.] 274 . 493) ec2-delete-tags Description Deletes the specified set of tags from the specified set of resources.. For more information. Amazon Elastic Compute Cloud CLI Reference Examples Examples Example This example command deletes the specified subnet. 187) • ec2-describe-subnets (p.. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. 3) • Setting Up the CLI Tools (Windows) (p. ] --tag key[=value] [--tag key[=value] . PROMPT> ec2-delete-subnet subnet-9d4a7b6c SUBNET subnet-9d4a7b6c Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Related Action • DeleteSubnet Related Commands • ec2-create-subnet (p. Syntax ec2-delete-tags resource_id [resource_id . see Tagging Your Resources in the Amazon EC2 User Guide for Linux Instances. This command is designed to follow the ec2-describe-tags command. Tip If you are using the AWS CLI. see delete-tags instead. For more information about tags. The short version of this command is ec2deltag.. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.

For more information. Default: The region specified by the EC2_URL environment variable. you must specify this option.eu-west-1amazonaws. Example: -U https://ec2.com if EC2_URL isn't set. and the URL specified by the -U option. see Tell the Tools Who aws_access_key_id You Are. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Type: String Default: None Required: Yes Example: --tag "stack=Production" Common Options Option Description --region region The region. Type: String Default: None Required: Yes Example: i-1a2b3c4d --tag key or key=value The key and optional value of the tag. or https://ec2. Amazon Elastic Compute Cloud CLI Reference Options Options Name Description resource_id One or more resource IDs. If AWS_ACCESS_KEY isn't set. Overrides the default region. You can specify more than one tag to remove. Example: -O AKIAIOSFODNN7EXAMPLE 275 . separated by an equals sign (=).com -O. Default: The endpoint specified by the EC2_URL environment variable.amazonaws. --aws-access-key Your access key ID. Default: The value of the AWS_ACCESS_KEY environment variable. or us-east-1 if EC2_URL isn't set. Example: --region eu-west-1 -U. the region specified by the EC2_URL environment variable.

This can assist us when helping you troubleshooting problems.6. This is useful if you are building tools to talk directly to the Query API. --aws-secret-key Your secret access key. --security-token The delegation token to pass along to the AWS request. Example: -T AQoDYXdzEJr.. If you have the required permissions. For more information. This is only delegation_token required when you are using temporary security credentials. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -W. For more information. --show-empty-fields Shows empty columns as (nil). including the API request and response on the command line. 276 . Example: --request-timeout 45 -H. the command returns DryRunOperation. --help.0 onwards of the Amazon EC2 CLI tools.. otherwise. it returns UnauthorizedOperation. see Using Temporary Security Credentials. --aws-access-key) and secret access key (-W. see Setting Up the Amazon EC2 CLI. From version 1. --auth-dry-run Checks whether you have the required permissions for the command. If AWS_SECRET_KEY isn't set. in seconds. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. you must specify this option. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set).14. -v.509 certificate (-C. . --private-key) and X. in seconds. --headers Includes column headers in the command output. the private key (-K. --hide-tags Omits tags for tagged resources. --debug Displays internal debugging information. --cert) options are not supported. This is useful when piping the output from one command to the input of another. --aws-secret-key) instead. Use your access key ID (-O. Deprecated Options We have deprecated the SOAP API for Amazon EC2. Example: --connection-timeout 30 --request-timeout timeout The request timeout. Reads arguments from standard input.<remainder of security token> --connection-timeout timeout The connection timeout. see SOAP Requests. -h Displays usage information for the command. --verbose Displays verbose output. without actually running the command. For more information. -D. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?.

509 certificate to use when constructing requests to Amazon EC2. First. delete the tags. 277 . Amazon Elastic Compute Cloud CLI Reference Output Option Description -K. --private-key The private key to use when constructing requests to Amazon EC2. --cert ec2_cert The X. If you specify a value for the key. The following example specifies the empty string as the value for the tag to delete (notice the equals sign after Owner). PROMPT> ec2-describe-tags --filter "resource-id=ami-1a2b3c4d" TAG ami-1a2b3c4d image webserver TAG ami-1a2b3c4d image stack Production Next. get a list of the tags using the following command. PROMPT> ec2-delete-tags ami-1a2b3c4d --tag webserver --tag "stack=Production" It's optional to specify the value for any tag with a value. the tag is deleted only if the tag's value matches the one you specified. Examples Example 1 This example deletes the tags for the AMI with the ID ami-1a2b3c4d. Default: The value of the EC2_CERT environment variable.pem -C. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. If you specify the empty string as the value. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. the tag is deleted only if the tag's value is the empty string. PROMPT> ec2-delete-tags snap-4dfg39a --tag "Owner=" Example 2 This example command deletes the stack tag from two particular instances. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem Output This command returns a table that contains the following information for tags that were deleted: • The TAG identifier • The resource type identifier • The ID of the resource • The tag key • The tag value Amazon EC2 command line tools display errors on stderr.

The volume must be in the available state (not attached to an instance). The short version of this command is ec2delvol. Related Action • DeleteTags Related Commands • ec2-create-tags (p. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. PROMPT> ec2-delete-tags i-5f4e3d2a i-4d5h8a9b i-1d3d4fae --tag Purpose Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. 191) • ec2-describe-tags (p. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. 499) ec2-delete-volume Description Deletes the specified Amazon EBS volume. regardless of the tag value. see Amazon Elastic Block Store in the Amazon EC2 User Guide for Linux Instances. see delete-volume instead. This example command deletes all tags for the specified resources that have a key of Purpose. For more information. Tip If you are using the AWS CLI. 3) • Setting Up the CLI Tools (Windows) (p. For more information. Syntax ec2-delete-volume volume_id 278 . Note The volume remains in the deleting state for several minutes after you run this command. Amazon Elastic Compute Cloud CLI Reference Related Topics PROMPT> ec2-delete-tags i-5f4e3d2a i-12345678 --tag stack Example 3 You can specify a tag key without a corresponding tag value if you want to delete the tag regardless of its value.

Default: The value of the AWS_ACCESS_KEY environment variable. the region specified by the EC2_URL environment variable. Example: -T AQoDYXdzEJr. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable.com if EC2_URL isn't set.<remainder of security token> 279 . Overrides the default region. you must specify this option.. or us-east-1 if EC2_URL isn't set. or https://ec2. Default: The region specified by the EC2_URL environment variable. Default: The endpoint specified by the EC2_URL environment variable. --aws-secret-key Your secret access key.amazonaws. Example: -O AKIAIOSFODNN7EXAMPLE -W. see Tell the Tools Who aws_access_key_id You Are. If AWS_ACCESS_KEY isn't set. This is only delegation_token required when you are using temporary security credentials. Amazon Elastic Compute Cloud CLI Reference Options Options Name Description volume_id The ID of the volume. Example: --region eu-west-1 -U. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point.com -O. --security-token The delegation token to pass along to the AWS request. For more information. If AWS_SECRET_KEY isn't set. and the URL specified by the -U option. Type: String Default: None Required: Yes Example: vol-4282672b Common Options Option Description --region region The region. see Using Temporary Security Credentials. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T.eu-west-1amazonaws. For more information.. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). you must specify this option. --aws-access-key Your access key ID. Example: -U https://ec2.

--cert) options are not supported. --aws-access-key) and secret access key (-W. This is useful if you are building tools to talk directly to the Query API. Reads arguments from standard input. --private-key The private key to use when constructing requests to Amazon EC2. otherwise. including the API request and response on the command line.pem -C. see Setting Up the Amazon EC2 CLI. --cert ec2_cert The X. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. the private key (-K. --show-empty-fields Shows empty columns as (nil). --headers Includes column headers in the command output. -D. it returns UnauthorizedOperation. Deprecated Options We have deprecated the SOAP API for Amazon EC2. For more information. in seconds. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable.509 certificate to use when constructing requests to Amazon EC2. --auth-dry-run Checks whether you have the required permissions for the command. For more information. . From version 1. Example: --request-timeout 45 -H. Option Description -K. This is useful when piping the output from one command to the input of another. -h Displays usage information for the command. Use your access key ID (-O. --aws-secret-key) instead.0 onwards of the Amazon EC2 CLI tools. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description --connection-timeout timeout The connection timeout. This can assist us when helping you troubleshooting problems. If you have the required permissions. Default: The value of the EC2_CERT environment variable. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. in seconds. Example: --connection-timeout 30 --request-timeout timeout The request timeout.14. -v. --private-key) and X. --help. --debug Displays internal debugging information. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. see SOAP Requests.509 certificate (-C. without actually running the command. --verbose Displays verbose output. the command returns DryRunOperation.pem 280 .6. --hide-tags Omits tags for tagged resources.

and so on. delete all security groups associated with the VPC (except the default one). 10) IAM Policies You can create an IAM policy to grant users permission to use this command. PROMPT> ec2-delete-volume vol-1a2b3c4d VOLUME vol-1a2b3c4d Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. Related Action • DeleteVolume Related Commands • ec2-attach-volume (p. For more information. 570) ec2-delete-vpc Description Deletes the specified VPC. 3) • Setting Up the CLI Tools (Windows) (p. you must terminate all instances running in the VPC. 69) • ec2-create-volume (p. delete all route tables associated with the VPC (except the default one). see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. 513) • ec2-detach-volume (p. You must detach or delete all gateways and resources that are associated with the VPC before you can delete it. Amazon Elastic Compute Cloud CLI Reference Output Output This command returns a table that contains the following information: • The VOLUME identifier • The ID of the volume that was deleted Amazon EC2 command line tools display errors on stderr. Examples Example This example command deletes the volume with the ID vol-1a2b3c4d. For example. 194) • ec2-describe-volumes (p. 281 .

com if EC2_URL isn't set. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. you must specify this option. If AWS_SECRET_KEY isn't set. --aws-secret-key Your secret access key. you must specify this option. or https://ec2. Overrides the default region. Type: String Default: None Required: Yes Example: vpc-1a2b3c4d Common Options Option Description --region region The region. the region specified by the EC2_URL environment variable.eu-west-1amazonaws. Example: -O AKIAIOSFODNN7EXAMPLE -W.amazonaws. and the URL specified by the -U option.com -O. If AWS_ACCESS_KEY isn't set. For more information. Default: The region specified by the EC2_URL environment variable. or us-east-1 if EC2_URL isn't set. Default: The value of the AWS_ACCESS_KEY environment variable. Example: --region eu-west-1 -U. --aws-access-key Your access key ID. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY 282 . Example: -U https://ec2. Default: The endpoint specified by the EC2_URL environment variable. see Tell the Tools Who aws_access_key_id You Are. Syntax ec2-delete-vpc vpc_id Options Name Description vpc_id The ID of the VPC. Tip If you are using the AWS CLI. Amazon Elastic Compute Cloud CLI Reference Syntax The short version of this command is ec2delvpc. see delete-vpc instead.

--headers Includes column headers in the command output. --show-empty-fields Shows empty columns as (nil). Reads arguments from standard input. see Setting Up the Amazon EC2 CLI. --help. it returns UnauthorizedOperation.0 onwards of the Amazon EC2 CLI tools. in seconds. see Using Temporary Security Credentials. --verbose Displays verbose output. This is useful if you are building tools to talk directly to the Query API. Use your access key ID (-O. --hide-tags Omits tags for tagged resources. --security-token The delegation token to pass along to the AWS request. --cert) options are not supported. -D. Example: --request-timeout 45 -H. the command returns DryRunOperation. --auth-dry-run Checks whether you have the required permissions for the command. --private-key) and X.6. Deprecated Options We have deprecated the SOAP API for Amazon EC2. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.509 certificate (-C. From version 1. otherwise.pem 283 . see SOAP Requests. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. without actually running the command..14. -h Displays usage information for the command. For more information. the private key (-K. For more information. This can assist us when helping you troubleshooting problems. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). If you have the required permissions. Example: --connection-timeout 30 --request-timeout timeout The request timeout. This is useful when piping the output from one command to the input of another.. . Example: -T AQoDYXdzEJr. For more information. -v.<remainder of security token> --connection-timeout timeout The connection timeout. Option Description -K. This is only delegation_token required when you are using temporary security credentials. including the API request and response on the command line. --private-key The private key to use when constructing requests to Amazon EC2. in seconds. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -T. --aws-access-key) and secret access key (-W. --aws-secret-key) instead. --debug Displays internal debugging information.

Related Action • DeleteVpc Related Commands • ec2-create-vpc (p. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. For more information. 543) 284 . Examples Example This example command deletes the specified VPC.509 certificate to use when constructing requests to Amazon EC2. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. 201) • ec2-describe-vpcs (p. --cert ec2_cert The X. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. Amazon Elastic Compute Cloud CLI Reference Output Option Description -C. PROMPT> ec2-delete-vpc vpc-1a2b3c4d VPC vpc-1a2b3c4d Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.pem Output This command returns a table that contains the following information: • The VPC identifier • The ID of the VPC Amazon EC2 command line tools display errors on stderr. 3) • Setting Up the CLI Tools (Windows) (p. Default: The value of the EC2_CERT environment variable.

Example: --region eu-west-1 -U. Default: The endpoint specified by the EC2_URL environment variable. Default: The value of the AWS_ACCESS_KEY environment variable.amazonaws. you must specify this option. or https://ec2. 285 . Overrides the default region. The short version of this command is ec2delvpce. Deleting the endpoint also deletes the endpoint routes in the route tables that were associated with the endpoint. see Tell the Tools Who aws_access_key_id You Are. --aws-access-key Your access key ID. or us-east-1 if EC2_URL isn't set.com if EC2_URL isn't set. If AWS_ACCESS_KEY isn't set. the region specified by the EC2_URL environment variable.eu-west-1amazonaws. Tip If you are using the AWS CLI. Syntax ec2-delete-vpc-endpoints vpce Options Name Description vpce One or more endpoint IDs. Default: The region specified by the EC2_URL environment variable. and the URL specified by the -U option.com -O. see delete-vpc-endpoints instead. Type: String Default: None Required: Yes Example: vpce-111bbb22 Common Options Option Description --region region The region. Amazon Elastic Compute Cloud CLI Reference ec2-delete-vpc-endpoints ec2-delete-vpc-endpoints Description Deletes one or more specified VPC endpoints. Example: -U https://ec2. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. For more information.

it returns UnauthorizedOperation. --verbose Displays verbose output. From version 1. the private key (-K. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. This is useful when piping the output from one command to the input of another. --auth-dry-run Checks whether you have the required permissions for the command. --aws-secret-key) instead. you must specify this option. Reads arguments from standard input. -v. Deprecated Options We have deprecated the SOAP API for Amazon EC2. --cert) options are not supported. see SOAP Requests. If you have the required permissions. This can assist us when helping you troubleshooting problems. --help. see Setting Up the Amazon EC2 CLI. the command returns DryRunOperation. --private-key) and X. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). --debug Displays internal debugging information.14. 286 . Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. Use your access key ID (-O. without actually running the command.6. Example: --request-timeout 45 -H. . --aws-secret-key Your secret access key. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. This is useful if you are building tools to talk directly to the Query API. --hide-tags Omits tags for tagged resources. --headers Includes column headers in the command output. If AWS_SECRET_KEY isn't set. --security-token The delegation token to pass along to the AWS request.0 onwards of the Amazon EC2 CLI tools. For more information. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description Example: -O AKIAIOSFODNN7EXAMPLE -W. This is only delegation_token required when you are using temporary security credentials. -D. Example: --connection-timeout 30 --request-timeout timeout The request timeout. Example: -T AQoDYXdzEJr. --show-empty-fields Shows empty columns as (nil). including the API request and response on the command line. in seconds. --aws-access-key) and secret access key (-W.509 certificate (-C.. otherwise. -h Displays usage information for the command. see Using Temporary Security Credentials.<remainder of security token> --connection-timeout timeout The connection timeout. in seconds. For more information. For more information..

--cert ec2_cert The X. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. 3) • Setting Up the CLI Tools (Windows) (p.509 certificate to use when constructing requests to Amazon EC2.pem Output This command returns no output. For more information. Amazon Elastic Compute Cloud CLI Reference Output Option Description -K. Examples Example 1 This example deletes endpoints vpce-aa22bb33 and vpce-1a2b3c4d. Related Action • DeleteVpcEndpoints Related Commands • ec2-create-vpc-endpoint (p. 533) 287 .pem -C. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. 425) • ec2-describe-vpc-endpoints (p. --private-key The private key to use when constructing requests to Amazon EC2. 529) • ec2-describe-vpc-endpoint-services (p. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. Default: The value of the EC2_CERT environment variable. PROMPT> ec2-delete-vpc-endpoints vpce-aa22bb33 vpce-1a2b3c4d Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. 204) • ec2-describe-prefix-lists (p. Amazon EC2 command line tools display errors on stderr. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable.

Syntax ec2-delete-vpc-peering-connection vcp_peering_connection Options Name Description vpc_peering_connection The VPC peering connection ID. Either the owner of the requester VPC or the owner of the peer VPC can delete the VPC peering connection if it's in the active state. Default: The endpoint specified by the EC2_URL environment variable. 288 .amazonaws. 670) ec2-delete-vpc-peering-connection Description Deletes a VPC peering connection.com if EC2_URL isn't set. Overrides the default region. Default: The region specified by the EC2_URL environment variable. The short version of this command is ec2delpcx. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Example: --region eu-west-1 -U. Tip If you are using the AWS CLI. or us-east-1 if EC2_URL isn't set. use the ec2-reject-vpc- peering-connection (p. see delete-vpc-peering-connection instead. and the URL specified by the -U option. Amazon Elastic Compute Cloud CLI Reference ec2-delete-vpc-peering-connection • ec2-modify-vpc-endpoint (p. The owner of the requester VPC can delete a VPC peering connection in the pending-acceptance state. Type: String Default: None Required: Yes Example: pcx-1a2b3c4d Common Options Option Description --region region The region. or https://ec2. Note To reject a VPC peering connection request that's pending your approval. the region specified by the EC2_URL environment variable. 693) command.

Example: -T AQoDYXdzEJr. --security-token The delegation token to pass along to the AWS request. -h Displays usage information for the command. This is useful when piping the output from one command to the input of another. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. --headers Includes column headers in the command output. If you have the required permissions. Example: -O AKIAIOSFODNN7EXAMPLE -W. in seconds. see Tell the Tools Who aws_access_key_id You Are. --auth-dry-run Checks whether you have the required permissions for the command. This is useful if you are building tools to talk directly to the Query API. Default: The value of the AWS_ACCESS_KEY environment variable. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). --verbose Displays verbose output. it returns UnauthorizedOperation. Example: --request-timeout 45 -H. in seconds. For more information. without actually running the command.. This is only delegation_token required when you are using temporary security credentials.eu-west-1amazonaws. --aws-secret-key Your secret access key. . see Using Temporary Security Credentials. Example: --connection-timeout 30 --request-timeout timeout The request timeout. you must specify this option. otherwise. you must specify this option. This can assist us when helping you troubleshooting problems. 289 . If AWS_ACCESS_KEY isn't set. --help. If AWS_SECRET_KEY isn't set. --aws-access-key Your access key ID. --show-empty-fields Shows empty columns as (nil). --debug Displays internal debugging information. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description Example: -U https://ec2. -v.<remainder of security token> --connection-timeout timeout The connection timeout. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. the command returns DryRunOperation. --hide-tags Omits tags for tagged resources. -D.com -O. including the API request and response on the command line. Reads arguments from standard input. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. For more information..

the private key (-K. see Setting Up the Amazon EC2 CLI. Amazon Elastic Compute Cloud CLI Reference Output Deprecated Options We have deprecated the SOAP API for Amazon EC2. --cert ec2_cert The X. For more information. Option Description -K. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --private-key The private key to use when constructing requests to Amazon EC2. Use your access key ID (-O. Default: The value of the EC2_CERT environment variable.0 onwards of the Amazon EC2 CLI tools.509 certificate to use when constructing requests to Amazon EC2. For more information.pem -C. From version 1. PROMPT> ec2-delete-vpc-peering-connection pcx-1a2b3c4d RETURN true Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.pem Output The command returns true if the operation succeeds. Related Action • DeleteVpcPeeringConnection 290 . --aws-access-key) and secret access key (-W. 3) • Setting Up the CLI Tools (Windows) (p. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. see SOAP Requests. or an error if the operation does not succeed.6. --cert) options are not supported.14. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Amazon EC2 command line tools display errors on stderr. For more information. Examples Example 1 This example deletes the specified VPC peering connection. --aws-secret-key) instead. --private-key) and X.509 certificate (-C. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.

Tip If you are using the AWS CLI. we recommend that you detach the virtual private gateway from the VPC and delete the VPC before deleting the VPN connection. you must reconfigure the customer gateway using the new configuration information returned with the new VPN connection ID. without needing to delete the VPC or virtual private gateway. If you're deleting the VPC and its associated components. If you create a new VPN connection. see delete-vpn-connection instead. 34) • ec2-describe-vpc-peering-connections (p. For more information about VPN connections. Amazon Elastic Compute Cloud CLI Reference ec2-delete-vpn-connection Related Commands • ec2-accept-vpc-peering-connection (p. 209) • ec2-reject-vpc-peering-connection (p. see Adding a Hardware Virtual Private Gateway to Your VPC in the Amazon VPC User Guide. 171) • ec2-replace-route (p. In that situation. 536) • ec2-create-vpc-peering-connection (p. 693) • ec2-create-route (p. Another reason to delete the VPN connection is if you believe that the tunnel credentials for your VPN connection have been compromised. you can delete the VPN connection and create a new one that has new keys. The short version of this command is ec2delvpn. Type: String Default: None Required: Yes Example: vpn-44a8938f 291 . 708) ec2-delete-vpn-connection Description Deletes the specified VPN connection. Syntax ec2-delete-vpn-connection vpn_connection_id Options Name Description vpn_connection_id The ID of the VPN connection.

--url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. --security-token The delegation token to pass along to the AWS request. For more information. Example: --request-timeout 45 -H. This is only delegation_token required when you are using temporary security credentials. Example: -T AQoDYXdzEJr. --show-empty-fields Shows empty columns as (nil). Example: -U https://ec2. --aws-secret-key Your secret access key. --hide-tags Omits tags for tagged resources.com if EC2_URL isn't set. you must specify this option. see Using Temporary Security Credentials. For more information. Default: The region specified by the EC2_URL environment variable. see Tell the Tools Who aws_access_key_id You Are. 292 . in seconds. If AWS_SECRET_KEY isn't set. If AWS_ACCESS_KEY isn't set. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. or us-east-1 if EC2_URL isn't set.com -O. --headers Includes column headers in the command output.. Example: --connection-timeout 30 --request-timeout timeout The request timeout. Default: The value of the AWS_ACCESS_KEY environment variable.amazonaws. or https://ec2.eu-west-1amazonaws. --aws-access-key Your access key ID. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). you must specify this option. the region specified by the EC2_URL environment variable. Overrides the default region. and the URL specified by the -U option. Default: The endpoint specified by the EC2_URL environment variable. Example: -O AKIAIOSFODNN7EXAMPLE -W. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. in seconds.<remainder of security token> --connection-timeout timeout The connection timeout. Example: --region eu-west-1 -U. Amazon Elastic Compute Cloud CLI Reference Common Options Common Options Option Description --region region The region..

see Setting Up the Amazon EC2 CLI. 293 . From version 1. --cert) options are not supported. -D. see SOAP Requests. the private key (-K. including the API request and response on the command line. -v. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. the command returns DryRunOperation. Reads arguments from standard input. --private-key The private key to use when constructing requests to Amazon EC2. --aws-access-key) and secret access key (-W.509 certificate to use when constructing requests to Amazon EC2. without actually running the command. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. otherwise. For more information. --private-key) and X.509 certificate (-C. --verbose Displays verbose output. Default: The value of the EC2_CERT environment variable. Use your access key ID (-O. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable.6. . For more information. --aws-secret-key) instead. --cert ec2_cert The X. Amazon Elastic Compute Cloud CLI Reference Output Option Description --debug Displays internal debugging information. Option Description -K.14. -h Displays usage information for the command. --auth-dry-run Checks whether you have the required permissions for the command. --help. it returns UnauthorizedOperation.pem Output This command returns a table that contains the following information: • The VPNCONNECTION identifier • The ID of the VPN connection Amazon EC2 command line tools display errors on stderr.0 onwards of the Amazon EC2 CLI tools.pem -C. Deprecated Options We have deprecated the SOAP API for Amazon EC2. If you have the required permissions. This is useful when piping the output from one command to the input of another. This is useful if you are building tools to talk directly to the Query API. This can assist us when helping you troubleshooting problems.

For more information. Related Action • DeleteVpnConnection Related Commands • ec2-create-vpn-connection (p. 548) • ec2-detach-vpn-gateway (p. 3) • Setting Up the CLI Tools (Windows) (p. 213) • ec2-delete-vpc (p. see delete-vpn-connection-route instead. 281) • ec2-describe-vpn-connections (p. PROMPT> ec2-delete-vpn-connection vpn-44a8938f VPNCONNECTION vpn-44a8938f Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. Syntax ec2-delete-vpn-connection-route --vpn-connection vpn_connection_id --cidr cidr_block 294 . The static route allows traffic to be routed from the virtual private gateway to the VPN customer gateway. Amazon Elastic Compute Cloud CLI Reference Examples Examples Example This example command deletes the specified VPN connection. The short version of this command is ec2dvcr. 10) IAM Policies You can create an IAM policy to grant users permission to use this command. 574) ec2-delete-vpn-connection-route Description Deletes the specified static route associated with a VPN connection between an existing virtual private gateway and a VPN customer gateway. Tip If you are using the AWS CLI.

Default: The region specified by the EC2_URL environment variable. Example: --region eu-west-1 -U. see Tell the Tools Who aws_access_key_id You Are. or https://ec2. Overrides the default region. Amazon Elastic Compute Cloud CLI Reference Options Options Name Description --vpn-connection vpn_connection_id The ID of the VPN connection.com -O.com if EC2_URL isn't set. Example: -O AKIAIOSFODNN7EXAMPLE -W. Default: The endpoint specified by the EC2_URL environment variable. the region specified by the EC2_URL environment variable. --aws-access-key Your access key ID. If AWS_ACCESS_KEY isn't set. and the URL specified by the -U option. For more information. Type: String Default: None Required: Yes --cidr cidr_block The CIDR block associated with the local subnet of the customer network. Example: -U https://ec2.eu-west-1amazonaws.amazonaws. or us-east-1 if EC2_URL isn't set. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. you must specify this option. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. Default: The value of the AWS_ACCESS_KEY environment variable. you must specify this option. Type: String Default: None Required: Yes Common Options Option Description --region region The region. --aws-secret-key Your secret access key. If AWS_SECRET_KEY isn't set. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY 295 .

. This is useful when piping the output from one command to the input of another. This is useful if you are building tools to talk directly to the Query API. --private-key The private key to use when constructing requests to Amazon EC2. Reads arguments from standard input. without actually running the command. Deprecated Options We have deprecated the SOAP API for Amazon EC2. --cert) options are not supported. Use your access key ID (-O. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Example: --connection-timeout 30 --request-timeout timeout The request timeout. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). see Using Temporary Security Credentials. the command returns DryRunOperation. it returns UnauthorizedOperation. If you have the required permissions. --debug Displays internal debugging information. --verbose Displays verbose output. Example: -T AQoDYXdzEJr. --auth-dry-run Checks whether you have the required permissions for the command.pem 296 . including the API request and response on the command line. --aws-access-key) and secret access key (-W. the private key (-K. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable. --hide-tags Omits tags for tagged resources. Example: --request-timeout 45 -H. For more information. . For more information. otherwise. --show-empty-fields Shows empty columns as (nil).6. see SOAP Requests.14. --security-token The delegation token to pass along to the AWS request.<remainder of security token> --connection-timeout timeout The connection timeout. see Setting Up the Amazon EC2 CLI.. --aws-secret-key) instead. This is only delegation_token required when you are using temporary security credentials. --help.509 certificate (-C. in seconds. in seconds. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?.0 onwards of the Amazon EC2 CLI tools. For more information. --headers Includes column headers in the command output. -D. --private-key) and X. From version 1. -h Displays usage information for the command. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -T. -v. Option Description -K. This can assist us when helping you troubleshooting problems.

Note that you don't need to delete the virtual private gateway if you plan to delete and recreate the VPN connection between your VPC and your network.12.509 certificate to use when constructing requests to Amazon EC2. For more information. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. Amazon EC2 command line tools display errors on stderr. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. Amazon Elastic Compute Cloud CLI Reference Output Option Description -C. 3) • Setting Up the CLI Tools (Windows) (p.0/16" --vpn-connection vpn-83ad48ea RETURN true Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p.0/16 associated with the VPN connection with the ID vpn-83ad48ea. We recommend that before you delete a virtual private gateway.pem Output The command returns true if the operation succeeds or an error if the operation does not succeed. --cert ec2_cert The X. PROMPT> ec2-delete-vpn-connection-route--cidr "11.0. Related Action • DeleteVpnConnectionRoute ec2-delete-vpn-gateway Description Deletes the specified virtual private gateway. Default: The value of the EC2_CERT environment variable. Examples Example This example command deletes a static route to the destination CIDR block 11. 297 . you detach it from the VPC and delete the VPN connection.0. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.12. The short version of this command is ec2delvgw.

eu-west-1amazonaws. If AWS_ACCESS_KEY isn't set.com -O. Example: -U https://ec2. or https://ec2.amazonaws. Overrides the default region. If AWS_SECRET_KEY isn't set. Default: The region specified by the EC2_URL environment variable. Syntax ec2-delete-vpn-gateway vpn_gateway_id Options Name Description vpn_gateway_id The ID of the virtual private gateway. Amazon Elastic Compute Cloud CLI Reference Syntax Tip If you are using the AWS CLI. or us-east-1 if EC2_URL isn't set. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY 298 . Default: The endpoint specified by the EC2_URL environment variable. --aws-access-key Your access key ID. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. For more information. see Tell the Tools Who aws_access_key_id You Are. the region specified by the EC2_URL environment variable. see delete-vpn-gateway instead. Default: The value of the AWS_ACCESS_KEY environment variable.com if EC2_URL isn't set. Example: --region eu-west-1 -U. --aws-secret-key Your secret access key. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. you must specify this option. Type: String Default: None Required: Yes Example: vgw-8db04f81 Common Options Option Description --region region The region. Example: -O AKIAIOSFODNN7EXAMPLE -W. and the URL specified by the -U option. you must specify this option.

otherwise. This is useful if you are building tools to talk directly to the Query API. -h Displays usage information for the command. From version 1. --security-token The delegation token to pass along to the AWS request. Example: --request-timeout 45 -H.pem 299 . --auth-dry-run Checks whether you have the required permissions for the command. see Setting Up the Amazon EC2 CLI. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). the command returns DryRunOperation.6. --aws-access-key) and secret access key (-W. in seconds. --verbose Displays verbose output. . Reads arguments from standard input.509 certificate (-C. see Using Temporary Security Credentials. Example: -T AQoDYXdzEJr. Use your access key ID (-O. it returns UnauthorizedOperation. This is only delegation_token required when you are using temporary security credentials. Deprecated Options We have deprecated the SOAP API for Amazon EC2. without actually running the command. For more information. ec2_private_key Default: The value of the EC2_PRIVATE_KEY environment variable.14. For more information. the private key (-K.. For more information. --debug Displays internal debugging information. If you have the required permissions.0 onwards of the Amazon EC2 CLI tools. see SOAP Requests. This can assist us when helping you troubleshooting problems. Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE. --private-key) and X. --help. --headers Includes column headers in the command output. Option Description -K.. --aws-secret-key) instead. --hide-tags Omits tags for tagged resources. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. This is useful when piping the output from one command to the input of another. -v. --show-empty-fields Shows empty columns as (nil). including the API request and response on the command line. --cert) options are not supported. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description -T. in seconds.<remainder of security token> --connection-timeout timeout The connection timeout. --private-key The private key to use when constructing requests to Amazon EC2. -D. Example: --connection-timeout 30 --request-timeout timeout The request timeout.

Amazon Elastic Compute Cloud CLI Reference Output Option Description -C. PROMPT> ec2-delete-vpn-gateway vgw-8db04f81 VPNGATEWAY vgw-8db04f81 Related Topics Setting Up • Setting Up the CLI Tools (Linux and Mac OS X) (p. 3) • Setting Up the CLI Tools (Windows) (p. Default: The value of the EC2_CERT environment variable. Examples Example This example command deletes the specified virtual private gateway. --cert ec2_cert The X. Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem Output This command returns a table that contains the following information: • The VPNGATEWAY identifier • The ID of the virtual private gateway Amazon EC2 command line tools display errors on stderr. For more information. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. Related Action • DeleteVpnGateway Related Commands • ec2-create-vpn-gateway (p. 221) • ec2-delete-vpn-connection (p. 554) 300 .509 certificate to use when constructing requests to Amazon EC2. 291) • ec2-describe-vpn-gateways (p. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.

Default: The region specified by the EC2_URL environment variable. see deregister-image instead. 301 . use ec2-delete-bundle for instance store-backed AMIs. --aws-access-key Your access key ID. Tip If you are using the AWS CLI. it can't be used to launch new instances. After you deregister an AMI. The short version of this command is ec2dereg. To delete the AMI.amazonaws. or us-east-1 if EC2_URL isn't set. Syntax ec2-deregister ami_id Options Name Description ami_id The ID of the AMI. For more information. or ec2-delete-snapshot (p. Example: --region eu-west-1 -U. 265) for Amazon EBS-backed AMIs. Overrides the default region. or https://ec2. Example: -U https://ec2. Note This command does not delete the AMI.com -O. Type: String Default: None Required: Yes Example: ami-4fa54026 Common Options Option Description --region region The region. --url url The uniform resource locator (URL) of the Amazon EC2 web service entry point. see Tell the Tools Who aws_access_key_id You Are. and the URL specified by the -U option. the region specified by the EC2_URL environment variable. Default: The endpoint specified by the EC2_URL environment variable. Amazon Elastic Compute Cloud CLI Reference ec2-deregister ec2-deregister Description Deregisters the specified AMI.com if EC2_URL isn't set.eu-west-1amazonaws.

it returns UnauthorizedOperation. Reads arguments from standard input. Example: -O AKIAIOSFODNN7EXAMPLE -W. This can assist us when helping you troubleshooting problems. -D. see Using Temporary Security Credentials. -v. --headers Includes column headers in the command output. --verbose Displays verbose output. -h Displays usage information for the command. This is useful if you are building tools to talk directly to the Query API. Example: --request-timeout 45 -H. --debug Displays internal debugging information. If AWS_SECRET_KEY isn't set. Example: ec2-describe-instances | grep stopped | cut -f 2 | ec2-start-instances - -?. --hide-tags Omits tags for tagged resources. the command returns DryRunOperation. including the API request and response on the command line. in seconds. --auth-dry-run Checks whether you have the required permissions for the command. in seconds. --aws-secret-key Your secret access key. This is only delegation_token required when you are using temporary security credentials. Example: -T AQoDYXdzEJr. If AWS_ACCESS_KEY isn't set. --show-empty-fields Shows empty columns as (nil).. aws_secret_access_key Default: The value of the AWS_SECRET_KEY environment variable. Default: The value of the AWS_DELEGATION_TOKEN environment variable (if set). otherwise. Example: --connection-timeout 30 --request-timeout timeout The request timeout. you must specify this option. This is useful when piping the output from one command to the input of another. Amazon Elastic Compute Cloud CLI Reference Common Options Option Description Default: The value of the AWS_ACCESS_KEY environment variable. If you have the required permissions.. Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -T. without actually running the command. .<remainder of security token> --connection-timeout timeout The connection timeout. you must specify this option. --security-token The delegation token to pass along to the AWS request. --help. 302 . For more information.

14. From version 1. Use your access key ID (-O. Option Description -K. see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide for Linux Instances. For more information. --aws-secret-key) instead.6. Default: The value of the EC2_CERT environment variable.0 onwards of the Amazon EC2 CLI tools. the private key (-K. --cert ec2_cert The X. see SOAP Requests. 3) • Setting Up the CLI Tools (Windows) (p. 10) IAM Policies You can create an IAM policy to grant users permission to use this command.509 certificate to use when constructing requests to Amazon EC2. Amazon Elastic Compute Cloud CLI Reference Output Deprecated Options We have deprecated the SOAP API for Amazon EC2. 303 . Examples Example This example command deregisters the specified AMI. For more information.pe