\n'
'\nValues for the following can be set in the AWS CLI'
' config file using the "aws configure set" command: --service-role, --log-uri,'
' and InstanceProfile and KeyName arguments under --ec2-attributes.')
CLUSTER_NAME = (
'The name of the cluster. If not provided, the default is "Development Cluster".
')
LOG_URI = (
'Specifies the location in Amazon S3 to which log files '
'are periodically written. If a value is not provided, '
'logs files are not written to Amazon S3 from the master node '
'and are lost if the master node terminates.
')
SERVICE_ROLE = (
'Specifies an IAM service role, which Amazon EMR requires to call other AWS services '
'on your behalf during cluster operation. This parameter '
'is usually specified when a customized service role is used. '
'To specify the default service role, as well as the default instance '
'profile, use the --use-default-roles
parameter. '
'If the role and instance profile do not already exist, use the '
'aws emr create-default-roles
command to create them.
')
AUTOSCALING_ROLE = (
'Specify --auto-scaling-role EMR_AutoScaling_DefaultRole
'
' if an automatic scaling policy is specified for an instance group'
' using the --instance-groups
parameter. This default'
' IAM role allows the automatic scaling feature'
' to launch and terminate Amazon EC2 instances during scaling operations.
')
USE_DEFAULT_ROLES = (
'Specifies that the cluster should use the default'
' service role (EMR_DefaultRole) and instance profile (EMR_EC2_DefaultRole)'
' for permissions to access other AWS services.
'
'Make sure that the role and instance profile exist first. To create them,'
' use the create-default-roles
command.
')
AMI_VERSION = (
'Applies only to Amazon EMR release versions earlier than 4.0. Use'
' --release-label
for 4.0 and later. Specifies'
' the version of Amazon Linux Amazon Machine Image (AMI)'
' to use when launching Amazon EC2 instances in the cluster.'
' For example, --ami-version 3.1.0
.')
RELEASE_LABEL = (
'
Specifies the Amazon EMR release version, which determines'
' the versions of application software that are installed on the cluster.'
' For example, --release-label emr-5.15.0
installs'
' the application versions and features available in that version.'
' For details about application versions and features available'
' in each release, see the Amazon EMR Release Guide:
'
'https://docs.aws.amazon.com/emr/ReleaseGuide
'
'Use --release-label
only for Amazon EMR release version 4.0'
' and later. Use --ami-version
for earlier versions.'
' You cannot specify both a release label and AMI version.
')
CONFIGURATIONS = (
'Specifies a JSON file that contains configuration classifications,'
' which you can use to customize applications that Amazon EMR installs'
' when cluster instances launch. Applies only to Amazon EMR 4.0 and later.'
' The file referenced can either be stored locally (for example,'
' --configurations file://configurations.json
)'
' or stored in Amazon S3 (for example, --configurations'
' https://s3.amazonaws.com/myBucket/configurations.json
).'
' Each classification usually corresponds to the xml configuration'
' file for an application, such as yarn-site
for YARN. For a list of'
' available configuration classifications and example JSON, see'
' the following topic in the Amazon EMR Release Guide:
'
'https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-configure-apps.html
')
INSTANCE_GROUPS = (
'Specifies the number and type of Amazon EC2 instances'
' to create for each node type in a cluster, using uniform instance groups.'
' You can specify either --instance-groups
or'
' --instance-fleets
but not both.'
' For more information, see the following topic in the EMR Management Guide:
'
'https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html
'
'You can specify arguments individually using multiple'
' InstanceGroupType
argument blocks, one for the MASTER
'
' instance group, one for a CORE
instance group,'
' and optional, multiple TASK
instance groups.
'
'If you specify inline JSON structures, enclose the entire'
' InstanceGroupType
argument block in single quotation marks.'
'
Each InstanceGroupType
block takes the following inline arguments.'
' Optional arguments are shown in [square brackets].
'
'[Name]
- An optional friendly name for the instance group.'
'InstanceGroupType
- MASTER
, CORE
, or TASK
.'
'InstanceType
- The type of EC2 instance, for'
' example m4.large
,'
' to use for all nodes in the instance group.'
'InstanceCount
- The number of EC2 instances to provision in the instance group.'
'[BidPrice]
- If specified, indicates that the instance group uses Spot Instances.'
' This is the maximum price you are willing to pay for Spot Instances. Specify OnDemandPrice'
' to set the amount equal to the On-Demand price, or specify an amount in USD.'
'[EbsConfiguration]
- Specifies additional Amazon EBS storage volumes attached'
' to EC2 instances using an inline JSON structure.'
'[AutoScalingPolicy]
- Specifies an automatic scaling policy for the'
' instance group using an inline JSON structure.')
INSTANCE_FLEETS = (
'Applies only to Amazon EMR release version 5.0 and later. Specifies'
' the number and type of Amazon EC2 instances to create'
' for each node type in a cluster, using instance fleets.'
' You can specify either --instance-fleets
or'
' --instance-groups
but not both.'
' For more information and examples, see the following topic in the Amazon EMR Management Guide:
'
'https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html
'
'You can specify arguments individually using multiple'
' InstanceFleetType
argument blocks, one for the MASTER
'
' instance fleet, one for a CORE
instance fleet,'
' and an optional TASK
instance fleet.
'
'The following arguments can be specified for each instance fleet. Optional arguments are shown in [square brackets].
'
'[Name]
- An optional friendly name for the instance fleet.'
'InstanceFleetType
- MASTER
, CORE
, or TASK
.'
'TargetOnDemandCapacity
- The target capacity of On-Demand units'
' for the instance fleet, which determines how many On-Demand Instances to provision.'
' The WeightedCapacity
specified for an instance type within'
' InstanceTypeConfigs
counts toward this total when an instance type'
' with the On-Demand purchasing option launches.'
'TargetSpotCapacity
- The target capacity of Spot units'
' for the instance fleet, which determines how many Spot Instances to provision.'
' The WeightedCapacity
specified for an instance type within'
' InstanceTypeConfigs
counts toward this total when an instance'
' type with the Spot purchasing option launches.'
'[LaunchSpecifications]
- When TargetSpotCapacity
is specified,'
' specifies the block duration and timeout action for Spot Instances.'
'InstanceTypeConfigs
- Specifies up to five EC2 instance types to'
' use in the instance fleet, including details such as Spot price and Amazon EBS configuration.')
INSTANCE_TYPE = (
'Shortcut parameter as an alternative to --instance-groups
.'
' Specifies the type of Amazon EC2 instance to use in a cluster.'
' If used without the --instance-count
parameter,'
' the cluster consists of a single master node running on the EC2 instance type'
' specified. When used together with --instance-count
,'
' one instance is used for the master node, and the remainder'
' are used for the core node type.
')
INSTANCE_COUNT = (
'Shortcut parameter as an alternative to --instance-groups
'
' when used together with --instance-type
. Specifies the'
' number of Amazon EC2 instances to create for a cluster.'
' One instance is used for the master node, and the remainder'
' are used for the core node type.
')
ADDITIONAL_INFO = (
'Specifies additional information during cluster creation.
')
EC2_ATTRIBUTES = (
'Configures cluster and Amazon EC2 instance configurations. Accepts'
' the following arguments:
'
'KeyName
- Specifies the name of the AWS EC2 key pair that will be used for'
' SSH connections to the master node and other instances on the cluster.'
'AvailabilityZone
- Specifies the availability zone in which to launch'
' the cluster. For example, us-west-1b
.'
'SubnetId
- Specifies the VPC subnet in which to create the cluster.'
'InstanceProfile
- An IAM role that allows EC2 instances to'
' access other AWS services, such as Amazon S3, that'
' are required for operations.'
'EmrManagedMasterSecurityGroup
- The security group ID of the Amazon EC2'
' security group for the master node.'
'EmrManagedSlaveSecurityGroup
- The security group ID of the Amazon EC2'
' security group for the slave nodes.'
'ServiceAccessSecurityGroup
- The security group ID of the Amazon EC2 '
'security group for Amazon EMR access to clusters in VPC private subnets.'
'AdditionalMasterSecurityGroups
- A list of additional Amazon EC2'
' security group IDs for the master node.'
'AdditionalSlaveSecurityGroups
- A list of additional Amazon EC2'
' security group IDs for the slave nodes.')
AUTO_TERMINATE = (
'Specifies whether the cluster should terminate after'
' completing all the steps. Auto termination is off by default.
')
TERMINATION_PROTECTED = (
'Specifies whether to lock the cluster to prevent the'
' Amazon EC2 instances from being terminated by API call,'
' user intervention, or an error.
')
SCALE_DOWN_BEHAVIOR = (
'Specifies the way that individual Amazon EC2 instances terminate'
' when an automatic scale-in activity occurs or an instance group is resized.
'
'Accepted values:
'
'TERMINATE_AT_TASK_COMPLETION
- Specifies that Amazon EMR'
' blacklists and drains tasks from nodes before terminating the instance.'
'TERMINATE_AT_INSTANCE_HOUR
- Specifies that Amazon EMR'
' terminate EC2 instances at the instance-hour boundary, regardless of when'
' the request to terminate was submitted.'
)
VISIBILITY = (
'Specifies whether the cluster is visible to all IAM users of'
' the AWS account associated with the cluster. If set to'
' --visible-to-all-users
, all IAM users of that AWS account'
' can view it. If they have the proper policy permissions set, they can '
' also manage the cluster. If it is set to --no-visible-to-all-users
,'
' only the IAM user that created the cluster can view and manage it. '
' Clusters are visible by default.
')
DEBUGGING = (
'Specifies that the debugging tool is enabled for the cluster,'
' which allows you to browse log files using the Amazon EMR console.'
' Turning debugging on requires that you specify --log-uri
'
' because log files must be stored in Amazon S3 so that'
' Amazon EMR can index them for viewing in the console.
')
TAGS = (
'A list of tags to associate with a cluster, which apply to'
' each Amazon EC2 instance in the cluster. Tags are key-value pairs that'
' consist of a required key string'
' with a maximum of 128 characters, and an optional value string'
' with a maximum of 256 characters.
'
'You can specify tags in key=value
format or you can add a'
' tag without a value using only the key name, for example key
.'
' Use a space to separate multiple tags.
')
BOOTSTRAP_ACTIONS = (
'Specifies a list of bootstrap actions to run on each EC2 instance when'
' a cluster is created. Bootstrap actions run on each instance'
' immediately after Amazon EMR provisions the EC2 instance and'
' before Amazon EMR installs specified applications.
'
'You can specify a bootstrap action as an inline JSON structure'
' enclosed in single quotation marks, or you can use a shorthand'
' syntax, specifying multiple bootstrap actions, each separated'
' by a space. When using the shorthand syntax, each bootstrap'
' action takes the following parameters, separated by'
' commas with no trailing space. Optional parameters'
' are shown in [square brackets].
'
'Path
- The path and file name of the script'
' to run, which must be accessible to each instance in the cluster.'
' For example, Path=s3://mybucket/myscript.sh
.'
'[Name]
- A friendly name to help you identify'
' the bootstrap action. For example, Name=BootstrapAction1
'
'[Args]
- A comma-separated list of arguments'
' to pass to the bootstrap action script. Arguments can be'
' either a list of values (Args=arg1,arg2,arg3
)'
' or a list of key-value pairs, as well as optional values,'
' enclosed in square brackets (Args=[arg1,arg2=arg2value,arg3])
.')
APPLICATIONS = (
'Specifies the applications to install on the cluster.'
' Available applications and their respective versions vary'
' by Amazon EMR release. For more information, see the'
' Amazon EMR Release Guide:
'
'https://docs.aws.amazon.com/emr/latest/ReleaseGuide/
'
'When using versions of Amazon EMR earlier than 4.0,'
' some applications take optional arguments for configuration.'
' Arguments should either be a comma-separated list of values'
' (Args=arg1,arg2,arg3
) or a bracket-enclosed list of values'
' and key-value pairs (Args=[arg1,arg2=arg3,arg4]
).
')
EMR_FS = (
'Specifies EMRFS configuration options, such as consistent view'
' and Amazon S3 encryption parameters.
'
'When you use Amazon EMR release version 4.8.0 or later, we recommend'
' that you use the --configurations
option together'
' with the emrfs-site
configuration classification'
' to configure EMRFS, and use security configurations'
' to configure encryption for EMRFS data in Amazon S3 instead.'
' For more information, see the following topic in the Amazon EMR Management Guide:
'
'https://docs.aws.amazon.com/emr/latest/ManagementGuide/emrfs-configure-consistent-view.html
')
RESTORE_FROM_HBASE = (
'Applies only when using Amazon EMR release versions earlier than 4.0.'
' Launches a new HBase cluster and populates it with'
' data from a previous backup of an HBase cluster. HBase'
' must be installed using the --applications
option.
')
STEPS = (
'Specifies a list of steps to be executed by the cluster. Steps run'
' only on the master node after applications are installed'
' and are used to submit work to a cluster. A step can be'
' specified using the shorthand syntax, by referencing a JSON file'
' or by specifying an inline JSON structure. Args
supplied with steps'
' should be a comma-separated list of values (Args=arg1,arg2,arg3
) or'
' a bracket-enclosed list of values and key-value'
' pairs (Args=[arg1,arg2=value,arg4
).
')
INSTALL_APPLICATIONS = (
'The applications to be installed.'
' Takes the following parameters: '
'Name
and Args
.
')
EBS_ROOT_VOLUME_SIZE = (
'Applies only to Amazon EMR release version 4.0 and earlier. Specifies the size,'
' in GiB, of the EBS root device volume of the Amazon Linux AMI'
' that is used for each EC2 instance in the cluster.
')
SECURITY_CONFIG = (
'Specifies the name of a security configuration to use for the cluster.'
' A security configuration defines data encryption settings and'
' other security options. For more information, see'
' the following topic in the Amazon EMR Management Guide:
'
'https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-encryption-enable-security-configuration.html
'
'Use list-security-configurations
to get a list of available'
' security configurations in the active account.
')
CUSTOM_AMI_ID = (
'Applies only to Amazon EMR release version 5.7.0 and later.'
' Specifies the AMI ID of a custom AMI to use'
' when Amazon EMR provisions EC2 instances. A custom'
' AMI can be used to encrypt the Amazon EBS root volume. It'
' can also be used instead of bootstrap actions to customize'
' cluster node configurations. For more information, see'
' the following topic in the Amazon EMR Management Guide:
'
'https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-custom-ami.html
')
REPO_UPGRADE_ON_BOOT = (
'Applies only when a --custom-ami-id
is'
' specified. On first boot, by default, Amazon Linux AMIs'
' connect to package repositories to install security updates'
' before other services start. You can set this parameter'
' using --rep-upgrade-on-boot NONE
to'
' disable these updates. CAUTION: This creates additional'
' security risks.
')
KERBEROS_ATTRIBUTES = (
'Specifies required cluster attributes for Kerberos when Kerberos authentication'
' is enabled in the specified --security-configuration
.'
' Takes the following arguments:
'
' Realm
- Specifies the name of the Kerberos'
' realm to which all nodes in a cluster belong. For example,'
' Realm=EC2.INTERNAL
.'
' KdcAdminPassword
- Specifies the password used within the cluster'
' for the kadmin service, which maintains Kerberos principals, password'
' policies, and keytabs for the cluster.'
' CrossRealmTrustPrincipalPassword
- Required when establishing a cross-realm trust'
' with a KDC in a different realm. This is the cross-realm principal password,'
' which must be identical across realms.'
' ADDomainJoinUser
- Required when establishing trust with an Active Directory'
' domain. This is the User logon name of an AD account with sufficient privileges to join resouces to the domain.'
' ADDomainJoinPassword
- The AD password for ADDomainJoinUser
.')
# end create-cluster options help descriptions
LIST_CLUSTERS_CLUSTER_STATES = (
'Specifies that only clusters in the states specified are'
' listed. Alternatively, you can use the shorthand'
' form for single states or a group of states.
'
'Takes the following state values:
'
'STARTING
'
'BOOTSTRAPPING
'
'RUNNING
'
'WAITING
'
'TERMINATING
'
'TERMINATED
'
'TERMINATED_WITH_ERRORS
')
LIST_CLUSTERS_STATE_FILTERS = (
'Shortcut options for --cluster-states. The'
' following shortcut options can be specified:
'
'--active
- list only clusters that'
' are STARTING
,BOOTSTRAPPING
,'
' RUNNING
, WAITING
, or TERMINATING
. '
'--terminated
- list only clusters that are TERMINATED
. '
'--failed
- list only clusters that are TERMINATED_WITH_ERRORS
.')
LIST_CLUSTERS_CREATED_AFTER = (
'List only those clusters created after the date and time'
' specified in the format yyyy-mm-ddThh:mm:ss. For example,'
' --created-after 2017-07-04T00:01:30.
')
LIST_CLUSTERS_CREATED_BEFORE = (
'List only those clusters created after the date and time'
' specified in the format yyyy-mm-ddThh:mm:ss. For example,'
' --created-after 2017-07-04T00:01:30.
')
EMR_MANAGED_MASTER_SECURITY_GROUP = (
'The identifier of the Amazon EC2 security group '
'for the master node.
')
EMR_MANAGED_SLAVE_SECURITY_GROUP = (
'The identifier of the Amazon EC2 security group '
'for the slave nodes.
')
SERVICE_ACCESS_SECURITY_GROUP = (
'The identifier of the Amazon EC2 security group '
'for Amazon EMR to access clusters in VPC private subnets.
')
ADDITIONAL_MASTER_SECURITY_GROUPS = (
' A list of additional Amazon EC2 security group IDs for '
'the master node
')
ADDITIONAL_SLAVE_SECURITY_GROUPS = (
'A list of additional Amazon EC2 security group IDs for '
'the slave nodes.
')
AVAILABLE_ONLY_FOR_AMI_VERSIONS = (
'This command is only available when using Amazon EMR versions'
'earlier than 4.0.')
STEP_CONCURRENCY_LEVEL = (
'This command specifies the step concurrency level of the cluster.'
'Default is 1 which is non-concurrent.'
)
MANAGED_SCALING_POLICY = (
'Managed scaling policy for an Amazon EMR cluster. The policy '
'specifies the limits for resources that can be added or terminated '
'from a cluster. You can specify the ComputeLimits which include '
'the MaximumCapacityUnits, MinimumCapacityUnits, '
'MaximumOnDemandCapacityUnits and UnitType. For an '
'InstanceFleet cluster, the UnitType must be InstanceFleetUnits. For '
'InstanceGroup clusters, the UnitType can be either VCPU or Instances.
'
)
awscli-1.18.69/awscli/customizations/emr/steputils.py 0000644 0000000 0000000 00000020442 13664010074 022671 0 ustar root root 0000000 0000000 # Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from awscli.customizations.emr import emrutils
from awscli.customizations.emr import constants
from awscli.customizations.emr import exceptions
def build_step_config_list(parsed_step_list, region, release_label):
step_config_list = []
for step in parsed_step_list:
step_type = step.get('Type')
if step_type is None:
step_type = constants.CUSTOM_JAR
step_type = step_type.lower()
step_config = {}
if step_type == constants.CUSTOM_JAR:
step_config = build_custom_jar_step(parsed_step=step)
elif step_type == constants.STREAMING:
step_config = build_streaming_step(
parsed_step=step, release_label=release_label)
elif step_type == constants.HIVE:
step_config = build_hive_step(
parsed_step=step, region=region,
release_label=release_label)
elif step_type == constants.PIG:
step_config = build_pig_step(
parsed_step=step, region=region,
release_label=release_label)
elif step_type == constants.IMPALA:
step_config = build_impala_step(
parsed_step=step, region=region,
release_label=release_label)
elif step_type == constants.SPARK:
step_config = build_spark_step(
parsed_step=step, region=region,
release_label=release_label)
else:
raise exceptions.UnknownStepTypeError(step_type=step_type)
step_config_list.append(step_config)
return step_config_list
def build_custom_jar_step(parsed_step):
name = _apply_default_value(
arg=parsed_step.get('Name'),
value=constants.DEFAULT_CUSTOM_JAR_STEP_NAME)
action_on_failure = _apply_default_value(
arg=parsed_step.get('ActionOnFailure'),
value=constants.DEFAULT_FAILURE_ACTION)
emrutils.check_required_field(
structure=constants.CUSTOM_JAR_STEP_CONFIG,
name='Jar',
value=parsed_step.get('Jar'))
return emrutils.build_step(
jar=parsed_step.get('Jar'),
args=parsed_step.get('Args'),
name=name,
action_on_failure=action_on_failure,
main_class=parsed_step.get('MainClass'),
properties=emrutils.parse_key_value_string(
parsed_step.get('Properties')))
def build_streaming_step(parsed_step, release_label):
name = _apply_default_value(
arg=parsed_step.get('Name'),
value=constants.DEFAULT_STREAMING_STEP_NAME)
action_on_failure = _apply_default_value(
arg=parsed_step.get('ActionOnFailure'),
value=constants.DEFAULT_FAILURE_ACTION)
args = parsed_step.get('Args')
emrutils.check_required_field(
structure=constants.STREAMING_STEP_CONFIG,
name='Args',
value=args)
emrutils.check_empty_string_list(name='Args', value=args)
args_list = []
if release_label:
jar = constants.COMMAND_RUNNER
args_list.append(constants.HADOOP_STREAMING_COMMAND)
else:
jar = constants.HADOOP_STREAMING_PATH
args_list += args
return emrutils.build_step(
jar=jar,
args=args_list,
name=name,
action_on_failure=action_on_failure)
def build_hive_step(parsed_step, release_label, region=None):
args = parsed_step.get('Args')
emrutils.check_required_field(
structure=constants.HIVE_STEP_CONFIG, name='Args', value=args)
emrutils.check_empty_string_list(name='Args', value=args)
name = _apply_default_value(
arg=parsed_step.get('Name'),
value=constants.DEFAULT_HIVE_STEP_NAME)
action_on_failure = \
_apply_default_value(
arg=parsed_step.get('ActionOnFailure'),
value=constants.DEFAULT_FAILURE_ACTION)
return emrutils.build_step(
jar=_get_runner_jar(release_label, region),
args=_build_hive_args(args, release_label, region),
name=name,
action_on_failure=action_on_failure)
def _build_hive_args(args, release_label, region):
args_list = []
if release_label:
args_list.append(constants.HIVE_SCRIPT_COMMAND)
else:
args_list.append(emrutils.build_s3_link(
relative_path=constants.HIVE_SCRIPT_PATH, region=region))
args_list.append(constants.RUN_HIVE_SCRIPT)
if not release_label:
args_list.append(constants.HIVE_VERSIONS)
args_list.append(constants.LATEST)
args_list.append(constants.ARGS)
args_list += args
return args_list
def build_pig_step(parsed_step, release_label, region=None):
args = parsed_step.get('Args')
emrutils.check_required_field(
structure=constants.PIG_STEP_CONFIG, name='Args', value=args)
emrutils.check_empty_string_list(name='Args', value=args)
name = _apply_default_value(
arg=parsed_step.get('Name'),
value=constants.DEFAULT_PIG_STEP_NAME)
action_on_failure = _apply_default_value(
arg=parsed_step.get('ActionOnFailure'),
value=constants.DEFAULT_FAILURE_ACTION)
return emrutils.build_step(
jar=_get_runner_jar(release_label, region),
args=_build_pig_args(args, release_label, region),
name=name,
action_on_failure=action_on_failure)
def _build_pig_args(args, release_label, region):
args_list = []
if release_label:
args_list.append(constants.PIG_SCRIPT_COMMAND)
else:
args_list.append(emrutils.build_s3_link(
relative_path=constants.PIG_SCRIPT_PATH, region=region))
args_list.append(constants.RUN_PIG_SCRIPT)
if not release_label:
args_list.append(constants.PIG_VERSIONS)
args_list.append(constants.LATEST)
args_list.append(constants.ARGS)
args_list += args
return args_list
def build_impala_step(parsed_step, release_label, region=None):
if release_label:
raise exceptions.UnknownStepTypeError(step_type=constants.IMPALA)
name = _apply_default_value(
arg=parsed_step.get('Name'),
value=constants.DEFAULT_IMPALA_STEP_NAME)
action_on_failure = _apply_default_value(
arg=parsed_step.get('ActionOnFailure'),
value=constants.DEFAULT_FAILURE_ACTION)
args_list = [
emrutils.build_s3_link(
relative_path=constants.IMPALA_INSTALL_PATH, region=region),
constants.RUN_IMPALA_SCRIPT]
args = parsed_step.get('Args')
emrutils.check_required_field(
structure=constants.IMPALA_STEP_CONFIG, name='Args', value=args)
args_list += args
return emrutils.build_step(
jar=emrutils.get_script_runner(region),
args=args_list,
name=name,
action_on_failure=action_on_failure)
def build_spark_step(parsed_step, release_label, region=None):
name = _apply_default_value(
arg=parsed_step.get('Name'),
value=constants.DEFAULT_SPARK_STEP_NAME)
action_on_failure = _apply_default_value(
arg=parsed_step.get('ActionOnFailure'),
value=constants.DEFAULT_FAILURE_ACTION)
args = parsed_step.get('Args')
emrutils.check_required_field(
structure=constants.SPARK_STEP_CONFIG, name='Args', value=args)
return emrutils.build_step(
jar=_get_runner_jar(release_label, region),
args=_build_spark_args(args, release_label, region),
name=name,
action_on_failure=action_on_failure)
def _build_spark_args(args, release_label, region):
args_list = []
if release_label:
args_list.append(constants.SPARK_SUBMIT_COMMAND)
else:
args_list.append(constants.SPARK_SUBMIT_PATH)
args_list += args
return args_list
def _apply_default_value(arg, value):
if arg is None:
arg = value
return arg
def _get_runner_jar(release_label, region):
return constants.COMMAND_RUNNER if release_label \
else emrutils.get_script_runner(region)
awscli-1.18.69/awscli/customizations/toplevelbool.py 0000644 0000000 0000000 00000013422 13664010074 022560 0 ustar root root 0000000 0000000 # language governing permissions and limitations under the License.
"""
Top Level Boolean Parameters
----------------------------
This customization will take a parameter that has
a structure of a single boolean element and allow the argument
to be specified without a value.
Instead of having to say::
--ebs-optimized '{"Value": true}'
--ebs-optimized '{"Value": false}'
You can instead say `--ebs-optimized/--no-ebs-optimized`.
"""
import logging
from functools import partial
from awscli.argprocess import detect_shape_structure
from awscli import arguments
from awscli.customizations.utils import validate_mutually_exclusive_handler
LOG = logging.getLogger(__name__)
# This sentinel object is used to distinguish when
# a parameter is not specified vs. specified with no value
# (a value of None).
_NOT_SPECIFIED = object()
def register_bool_params(event_handler):
event_handler.register('building-argument-table.ec2.*',
partial(pull_up_bool,
event_handler=event_handler))
def _qualifies_for_simplification(arg_model):
if detect_shape_structure(arg_model) == 'structure(scalar)':
members = arg_model.members
if (len(members) == 1 and
list(members.keys())[0] == 'Value' and
list(members.values())[0].type_name == 'boolean'):
return True
return False
def pull_up_bool(argument_table, event_handler, **kwargs):
# List of tuples of (positive_bool, negative_bool)
# This is used to validate that we don't specify
# an --option and a --no-option.
boolean_pairs = []
event_handler.register(
'operation-args-parsed.ec2.*',
partial(validate_boolean_mutex_groups,
boolean_pairs=boolean_pairs))
for key, value in list(argument_table.items()):
if hasattr(value, 'argument_model'):
arg_model = value.argument_model
if _qualifies_for_simplification(arg_model):
# Swap out the existing CLIArgument for two args:
# one that supports --option and --option
# and another arg of --no-option.
new_arg = PositiveBooleanArgument(
value.name, arg_model, value._operation_model,
value._event_emitter,
group_name=value.name,
serialized_name=value._serialized_name)
argument_table[value.name] = new_arg
negative_name = 'no-%s' % value.name
negative_arg = NegativeBooleanParameter(
negative_name, arg_model, value._operation_model,
value._event_emitter,
action='store_true', dest='no_%s' % new_arg.py_name,
group_name=value.name,
serialized_name=value._serialized_name)
argument_table[negative_name] = negative_arg
# If we've pulled up a structure(scalar) arg
# into a pair of top level boolean args, we need
# to validate that a user only provides the argument
# once. They can't say --option/--no-option, nor
# can they say --option --option Value=false.
boolean_pairs.append((new_arg, negative_arg))
def validate_boolean_mutex_groups(boolean_pairs, parsed_args, **kwargs):
# Validate we didn't pass in an --option and a --no-option.
for positive, negative in boolean_pairs:
if getattr(parsed_args, positive.py_name) is not _NOT_SPECIFIED and \
getattr(parsed_args, negative.py_name) is not _NOT_SPECIFIED:
raise ValueError(
'Cannot specify both the "%s" option and '
'the "%s" option.' % (positive.cli_name, negative.cli_name))
class PositiveBooleanArgument(arguments.CLIArgument):
def __init__(self, name, argument_model, operation_model,
event_emitter, serialized_name, group_name):
super(PositiveBooleanArgument, self).__init__(
name, argument_model, operation_model, event_emitter,
serialized_name=serialized_name)
self._group_name = group_name
@property
def group_name(self):
return self._group_name
def add_to_parser(self, parser):
# We need to support three forms:
# --option-name
# --option-name Value=(true|false)
parser.add_argument(self.cli_name,
help=self.documentation,
action='store',
default=_NOT_SPECIFIED,
nargs='?')
def add_to_params(self, parameters, value):
if value is _NOT_SPECIFIED:
return
elif value is None:
# Then this means that the user explicitly
# specified this arg with no value,
# e.g. --boolean-parameter
# which means we should add a true value
# to the parameters dict.
parameters[self._serialized_name] = {'Value': True}
else:
# Otherwise the arg was specified with a value.
parameters[self._serialized_name] = self._unpack_argument(
value)
class NegativeBooleanParameter(arguments.BooleanArgument):
def __init__(self, name, argument_model, operation_model,
event_emitter, serialized_name, action='store_true',
dest=None, group_name=None):
super(NegativeBooleanParameter, self).__init__(
name, argument_model, operation_model, event_emitter,
default=_NOT_SPECIFIED, serialized_name=serialized_name)
self._group_name = group_name
def add_to_params(self, parameters, value):
if value is not _NOT_SPECIFIED and value:
parameters[self._serialized_name] = {'Value': False}
awscli-1.18.69/awscli/customizations/s3events.py 0000644 0000000 0000000 00000006730 13664010074 021630 0 ustar root root 0000000 0000000 # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
"""Add S3 specific event streaming output arg."""
from awscli.arguments import CustomArgument
STREAM_HELP_TEXT = 'Filename where the records will be saved'
class DocSectionNotFoundError(Exception):
pass
def register_event_stream_arg(event_handlers):
event_handlers.register(
'building-argument-table.s3api.select-object-content',
add_event_stream_output_arg)
event_handlers.register_last(
'doc-output.s3api.select-object-content',
replace_event_stream_docs
)
def add_event_stream_output_arg(argument_table, operation_model,
session, **kwargs):
argument_table['outfile'] = S3SelectStreamOutputArgument(
name='outfile', help_text=STREAM_HELP_TEXT,
cli_type_name='string', positional_arg=True,
stream_key=operation_model.output_shape.serialization['payload'],
session=session)
def replace_event_stream_docs(help_command, **kwargs):
doc = help_command.doc
current = ''
while current != '======\nOutput\n======':
try:
current = doc.pop_write()
except IndexError:
# This should never happen, but in the rare case that it does
# we should be raising something with a helpful error message.
raise DocSectionNotFoundError(
'Could not find the "output" section for the command: %s'
% help_command)
doc.write('======\nOutput\n======\n')
doc.write("This command generates no output. The selected "
"object content is written to the specified outfile.\n")
class S3SelectStreamOutputArgument(CustomArgument):
_DOCUMENT_AS_REQUIRED = True
def __init__(self, stream_key, session, **kwargs):
super(S3SelectStreamOutputArgument, self).__init__(**kwargs)
# This is the key in the response body where we can find the
# streamed contents.
self._stream_key = stream_key
self._output_file = None
self._session = session
def add_to_params(self, parameters, value):
self._output_file = value
self._session.register('after-call.s3.SelectObjectContent',
self.save_file)
def save_file(self, parsed, **kwargs):
# This method is hooked into after-call which fires
# before the error checking happens in the client.
# Therefore if the stream_key is not in the parsed
# response we immediately return and let the default
# error handling happen.
if self._stream_key not in parsed:
return
event_stream = parsed[self._stream_key]
with open(self._output_file, 'wb') as fp:
for event in event_stream:
if 'Records' in event:
fp.write(event['Records']['Payload'])
# We don't want to include the streaming param in
# the returned response, it's not JSON serializable.
del parsed[self._stream_key]
awscli-1.18.69/awscli/customizations/assumerole.py 0000644 0000000 0000000 00000003473 13664010074 022236 0 ustar root root 0000000 0000000 import os
import logging
from botocore.exceptions import ProfileNotFound
from botocore.credentials import JSONFileCache
LOG = logging.getLogger(__name__)
CACHE_DIR = os.path.expanduser(os.path.join('~', '.aws', 'cli', 'cache'))
def register_assume_role_provider(event_handlers):
event_handlers.register('session-initialized',
inject_assume_role_provider_cache,
unique_id='inject_assume_role_cred_provider_cache')
def inject_assume_role_provider_cache(session, **kwargs):
try:
cred_chain = session.get_component('credential_provider')
except ProfileNotFound:
# If a user has provided a profile that does not exist,
# trying to retrieve components/config on the session
# will raise ProfileNotFound. Sometimes this is invalid:
#
# "ec2 describe-instances --profile unknown"
#
# and sometimes this is perfectly valid:
#
# "configure set region us-west-2 --profile brand-new-profile"
#
# Because we can't know (and don't want to know) whether
# the customer is trying to do something valid, we just
# immediately return. If it's invalid something else
# up the stack will raise ProfileNotFound, otherwise
# the configure (and other) commands will work as expected.
LOG.debug("ProfileNotFound caught when trying to inject "
"assume-role cred provider cache. Not configuring "
"JSONFileCache for assume-role.")
return
assume_role_provider = cred_chain.get_provider('assume-role')
assume_role_provider.cache = JSONFileCache(CACHE_DIR)
web_identity_provider = cred_chain.get_provider(
'assume-role-with-web-identity'
)
web_identity_provider.cache = JSONFileCache(CACHE_DIR)
awscli-1.18.69/awscli/customizations/removals.py 0000644 0000000 0000000 00000005303 13664010074 021701 0 ustar root root 0000000 0000000 # Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
"""
Remove deprecated commands
--------------------------
This customization removes commands that are either deprecated or not
yet fully supported.
"""
import logging
from functools import partial
LOG = logging.getLogger(__name__)
def register_removals(event_handler):
cmd_remover = CommandRemover(event_handler)
cmd_remover.remove(on_event='building-command-table.ses',
remove_commands=['delete-verified-email-address',
'list-verified-email-addresses',
'verify-email-address'])
cmd_remover.remove(on_event='building-command-table.ec2',
remove_commands=['import-instance', 'import-volume'])
cmd_remover.remove(on_event='building-command-table.emr',
remove_commands=['run-job-flow', 'describe-job-flows',
'add-job-flow-steps',
'terminate-job-flows',
'list-bootstrap-actions',
'list-instance-groups',
'set-termination-protection',
'set-visible-to-all-users'])
cmd_remover.remove(on_event='building-command-table.kinesis',
remove_commands=['subscribe-to-shard'])
class CommandRemover(object):
def __init__(self, events):
self._events = events
def remove(self, on_event, remove_commands):
self._events.register(on_event,
self._create_remover(remove_commands))
def _create_remover(self, commands_to_remove):
return partial(_remove_commands, commands_to_remove=commands_to_remove)
def _remove_commands(command_table, commands_to_remove, **kwargs):
# Hooked up to building-command-table.
for command in commands_to_remove:
try:
LOG.debug("Removing operation: %s", command)
del command_table[command]
except KeyError:
LOG.warning("Attempting to delete command that does not exist: %s",
command)
awscli-1.18.69/awscli/__main__.py 0000644 0000000 0000000 00000001227 13664010074 016477 0 ustar root root 0000000 0000000 # Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import sys
from awscli.clidriver import main
if __name__ == "__main__":
sys.exit(main())
awscli-1.18.69/awscli/topics/ 0000755 0000000 0000000 00000000000 13664010277 015711 5 ustar root root 0000000 0000000 awscli-1.18.69/awscli/topics/config-vars.rst 0000644 0000000 0000000 00000054171 13664010076 020666 0 ustar root root 0000000 0000000 :title: AWS CLI Configuration Variables
:description: Configuration Variables for the AWS CLI
:category: General
:related command: configure, configure get, configure set
:related topic: s3-config
Configuration values for the AWS CLI can come from several sources:
* As a command line option
* As an environment variable
* As a value in the AWS CLI config file
* As a value in the AWS Shared Credential file
Some options are only available in the AWS CLI config. This topic guide covers
all the configuration variables available in the AWS CLI.
Note that if you are just looking to get the minimum required configuration to
run the AWS CLI, we recommend running ``aws configure``, which will prompt you
for the necessary configuration values.
Config File Format
==================
The AWS CLI config file, which defaults to ``~/.aws/config`` has the following
format::
[default]
aws_access_key_id=foo
aws_secret_access_key=bar
region=us-west-2
The ``default`` section refers to the configuration values for the default
profile. You can create profiles, which represent logical groups of
configuration. Profiles that aren't the default profile are specified by
creating a section titled "profile profilename"::
[profile testing]
aws_access_key_id=foo
aws_secret_access_key=bar
region=us-west-2
Nested Values
-------------
Some service specific configuration, discussed in more detail below, has a
single top level key, with nested sub values. These sub values are denoted by
indentation::
[profile testing]
aws_access_key_id = foo
aws_secret_access_key = bar
region = us-west-2
s3 =
max_concurrent_requests=10
max_queue_size=1000
General Options
===============
The AWS CLI has a few general options:
==================== =========== ===================== ===================== ============================
Variable Option Config Entry Environment Variable Description
==================== =========== ===================== ===================== ============================
profile --profile N/A AWS_PROFILE Default profile name
-------------------- ----------- --------------------- --------------------- ----------------------------
region --region region AWS_DEFAULT_REGION Default AWS Region
-------------------- ----------- --------------------- --------------------- ----------------------------
output --output output AWS_DEFAULT_OUTPUT Default output style
-------------------- ----------- --------------------- --------------------- ----------------------------
cli_timestamp_format N/A cli_timestamp_format N/A Output format of timestamps
-------------------- ----------- --------------------- --------------------- ----------------------------
cli_follow_urlparam N/A cli_follow_urlparam N/A Fetch URL url parameters
-------------------- ----------- --------------------- --------------------- ----------------------------
ca_bundle --ca-bundle ca_bundle AWS_CA_BUNDLE CA Certificate Bundle
-------------------- ----------- --------------------- --------------------- ----------------------------
parameter_validation N/A parameter_validation N/A Toggles parameter validation
-------------------- ----------- --------------------- --------------------- ----------------------------
tcp_keepalive N/A tcp_keepalive N/A Toggles TCP Keep-Alive
-------------------- ----------- --------------------- --------------------- ----------------------------
max_attempts N/A max_attempts AWS_MAX_ATTEMPTS Number of total requests
-------------------- ----------- --------------------- --------------------- ----------------------------
retry_mode N/A retry_mode AWS_RETRY_MODE Type of retries performed
==================== =========== ===================== ===================== ============================
The third column, Config Entry, is the value you would specify in the AWS CLI
config file. By default, this location is ``~/.aws/config``. If you need to
change this value, you can set the ``AWS_CONFIG_FILE`` environment variable
to change this location.
The valid values of the ``output`` configuration variable are:
* json
* table
* text
``cli_timestamp_format`` controls the format of timestamps displayed by the AWS CLI.
The valid values of the ``cli_timestamp_format`` configuration variable are:
* none - Display the timestamp exactly as received from the HTTP response.
* iso8601 - Reformat timestamp using iso8601 in the UTC timezone.
``cli_follow_urlparam`` controls whether or not the CLI will attempt to follow
URL links in parameters that start with either prefix ``https://`` or
``http://``. The valid values of the ``cli_follow_urlparam`` configuration
variable are:
* true - This is the default value. With this configured the CLI will follow
any string parameters that start with ``https://`` or ``http://`` will be
fetched, and the downloaded content will be used as the parameter instead.
* false - The CLI will not treat strings prefixed with ``https://`` or
``http://`` any differently than normal string parameters.
``parameter_validation`` controls whether parameter validation should occur
when serializing requests. The default is True. You can disable parameter
validation for performance reasons. Otherwise, it's recommended to leave
parameter validation enabled.
The ``max_attempts`` and ``retry_mode`` are explained in the
"Retry Configuration" section below.
When you specify a profile, either using ``--profile profile-name`` or by
setting a value for the ``AWS_PROFILE`` environment variable, profile
name you provide is used to find the corresponding section in the AWS CLI
config file. For example, specifying ``--profile development`` will instruct
the AWS CLI to look for a section in the AWS CLI config file of
``[profile development]``.
Precedence
----------
The above configuration values have the following precedence:
* Command line options
* Environment variables
* Configuration file
Credentials
===========
Credentials can be specified in several ways:
* Environment variables
* The AWS Shared Credential File
* The AWS CLI config file
============================= ============================= ================================= ==============================
Variable Creds/Config Entry Environment Variable Description
============================= ============================= ================================= ==============================
access_key aws_access_key_id AWS_ACCESS_KEY_ID AWS Access Key
----------------------------- ----------------------------- --------------------------------- ------------------------------
secret_key aws_secret_access_key AWS_SECRET_ACCESS_KEY AWS Secret Key
----------------------------- ----------------------------- --------------------------------- ------------------------------
token aws_session_token AWS_SESSION_TOKEN AWS Token (temp credentials)
----------------------------- ----------------------------- --------------------------------- ------------------------------
metadata_service_timeout metadata_service_timeout AWS_METADATA_SERVICE_TIMEOUT EC2 metadata creds timeout
----------------------------- ----------------------------- --------------------------------- ------------------------------
metadata_service_num_attempts metadata_service_num_attempts AWS_METADATA_SERVICE_NUM_ATTEMPTS EC2 metadata creds retry count
============================= ============================= ================================= ==============================
The second column specifies the name that you can specify in either the AWS CLI
config file or the AWS Shared credentials file (``~/.aws/credentials``).
The Shared Credentials File
---------------------------
The shared credentials file has a default location of
``~/.aws/credentials``. You can change the location of the shared
credentials file by setting the ``AWS_SHARED_CREDENTIALS_FILE``
environment variable.
This file is an INI formatted file with section names
corresponding to profiles. With each section, the three configuration
variables shown above can be specified: ``aws_access_key_id``,
``aws_secret_access_key``, ``aws_session_token``. **These are the only
supported values in the shared credential file.** Also note that the
section names are different than the AWS CLI config file (``~/.aws/config``).
In the AWS CLI config file, you create a new profile by creating a section of
``[profile profile-name]``, for example::
[profile development]
aws_access_key_id=foo
aws_secret_access_key=bar
In the shared credentials file, profiles are not prefixed with ``profile``,
for example::
[development]
aws_access_key_id=foo
aws_secret_access_key=bar
Precedence
----------
Credentials from environment variables have precedence over credentials from
the shared credentials and AWS CLI config file. Credentials specified in the
shared credentials file have precedence over credentials in the AWS CLI config
file. If ``AWS_PROFILE`` environment variable is set and the
``AWS_ACCESS_KEY_ID`` and ``AWS_SECRET_ACCESS_KEY`` environment variables are
set, then the credentials provided by ``AWS_ACCESS_KEY_ID`` and
``AWS_SECRET_ACCESS_KEY`` will override the credentials located in the
profile provided by ``AWS_PROFILE``.
Using AWS IAM Roles
-------------------
If you are on an Amazon EC2 instance that was launched with an IAM role, the
AWS CLI will automatically retrieve credentials for you. You do not need
to configure any credentials.
Additionally, you can specify a role for the AWS CLI to assume, and the AWS
CLI will automatically make the corresponding ``AssumeRole`` calls for you.
Note that configuration variables for using IAM roles can only be in the AWS
CLI config file.
You can specify the following configuration values for configuring an IAM role
in the AWS CLI config file:
* ``role_arn`` - The ARN of the role you want to assume.
* ``source_profile`` - The AWS CLI profile that contains credentials /
configuration the CLI should use for the initial ``assume-role`` call. This
profile may be another profile configured to use ``assume-role``, though
if static credentials are present in the profile they will take precedence.
This parameter cannot be provided alongside ``credential_source``.
* ``credential_source`` - The credential provider to use to get credentials for
the initial ``assume-role`` call. This parameter cannot be provided
alongside ``source_profile``. Valid values are:
* ``Environment`` to pull source credentials from environment variables.
* ``Ec2InstanceMetadata`` to use the EC2 instance role as source credentials.
* ``EcsContainer`` to use the ECS container credentials as the source
credentials.
* ``external_id`` - A unique identifier that is used by third parties to assume
a role in their customers' accounts. This maps to the ``ExternalId``
parameter in the ``AssumeRole`` operation. This is an optional parameter.
* ``mfa_serial`` - The identification number of the MFA device to use when
assuming a role. This is an optional parameter. Specify this value if the
trust policy of the role being assumed includes a condition that requires MFA
authentication. The value is either the serial number for a hardware device
(such as GAHT12345678) or an Amazon Resource Name (ARN) for a virtual device
(such as arn:aws:iam::123456789012:mfa/user).
* ``role_session_name`` - The name applied to this assume-role session. This
value affects the assumed role user ARN (such as
arn:aws:sts::123456789012:assumed-role/role_name/role_session_name). This
maps to the ``RoleSessionName`` parameter in the ``AssumeRole`` operation.
This is an optional parameter. If you do not provide this value, a
session name will be automatically generated.
* ``duration_seconds`` - The duration, in seconds, of the role session.
The value can range from 900 seconds (15 minutes) up to the maximum
session duration setting for the role. This is an optional parameter
and by default, the value is set to 3600 seconds.
If you do not have MFA authentication required, then you only need to specify a
``role_arn`` and either a ``source_profile`` or a ``credential_source``.
When you specify a profile that has IAM role configuration, the AWS CLI
will make an ``AssumeRole`` call to retrieve temporary credentials. These
credentials are then stored (in ``~/.aws/cli/cache``). Subsequent AWS CLI
commands will use the cached temporary credentials until they expire, in which
case the AWS CLI will automatically refresh credentials.
If you specify an ``mfa_serial``, then the first time an ``AssumeRole`` call is
made, you will be prompted to enter the MFA code. Subsequent commands will use
the cached temporary credentials. However, when the temporary credentials
expire, you will be re-prompted for another MFA code.
Example configuration using ``source_profile``::
# In ~/.aws/credentials:
[development]
aws_access_key_id=foo
aws_secret_access_key=bar
# In ~/.aws/config
[profile crossaccount]
role_arn=arn:aws:iam:...
source_profile=development
Example configuration using ``credential_source`` to use the instance role as
the source credentials for the assume role call::
# In ~/.aws/config
[profile crossaccount]
role_arn=arn:aws:iam:...
credential_source=Ec2InstanceMetadata
Assume Role With Web Identity
--------------------------------------
Within the ``~/.aws/config`` file, you can also configure a profile to indicate
that the AWS CLI should assume a role. When you do this, the AWS CLI will
automatically make the corresponding ``AssumeRoleWithWebIdentity`` calls to AWS
STS on your behalf.
When you specify a profile that has IAM role configuration, the AWS CLI will
make an ``AssumeRoleWithWebIdentity`` call to retrieve temporary credentials.
These credentials are then stored (in ``~/.aws/cli/cache``). Subsequent AWS
CLI commands will use the cached temporary credentials until they expire, in
which case the AWS CLI will automatically refresh credentials.
You can specify the following configuration values for configuring an
assume role with web identity profile in the shared config:
* ``role_arn`` - The ARN of the role you want to assume.
* ``web_identity_token_file`` - The path to a file which contains an OAuth 2.0
access token or OpenID Connect ID token that is provided by the identity
provider. The contents of this file will be loaded and passed as the
``WebIdentityToken`` argument to the ``AssumeRoleWithWebIdentity`` operation.
* ``role_session_name`` - The name applied to this assume-role session. This
value affects the assumed role user ARN (such as
arn:aws:sts::123456789012:assumed-role/role_name/role_session_name). This
maps to the ``RoleSessionName`` parameter in the
``AssumeRoleWithWebIdentity`` operation. This is an optional parameter. If
you do not provide this value, a session name will be automatically
generated.
Below is an example configuration for the minimal amount of configuration
needed to configure an assume role with web identity profile::
# In ~/.aws/config
[profile web-identity]
role_arn=arn:aws:iam:...
web_identity_token_file=/path/to/a/token
This provider can also be configured via the environment:
``AWS_ROLE_ARN``
The ARN of the role you want to assume.
``AWS_WEB_IDENTITY_TOKEN_FILE``
The path to the web identity token file.
``AWS_ROLE_SESSION_NAME``
The name applied to this assume-role session.
.. note::
These environment variables currently only apply to the assume role with
web identity provider and do not apply to the general assume role provider
configuration.
Sourcing Credentials From External Processes
--------------------------------------------
.. warning::
The following describes a method of sourcing credentials from an external
process. This can potentially be dangerous, so proceed with caution. Other
credential providers should be preferred if at all possible. If using
this option, you should make sure that the config file is as locked down
as possible using security best practices for your operating system.
Ensure that your custom credential tool does not write any secret
information to StdErr because the SDKs and CLI can capture and log such
information, potentially exposing it to unauthorized users.
If you have a method of sourcing credentials that isn't built in to the AWS
CLI, you can integrate it by using ``credential_process`` in the config file.
The AWS CLI will call that command exactly as given and then read json data
from stdout. The process must write credentials to stdout in the following
format::
{
"Version": 1,
"AccessKeyId": "",
"SecretAccessKey": "",
"SessionToken": "",
"Expiration": ""
}
The ``Version`` key must be set to ``1``. This value may be bumped over time
as the payload structure evolves.
The ``Expiration`` key is an ISO8601 formatted timestamp. If the ``Expiration``
key is not returned in stdout, the credentials are long term credentials that
do not refresh. Otherwise the credentials are considered refreshable
credentials and will be refreshed automatically. NOTE: Unlike with assume role
credentials, the AWS CLI will NOT cache process credentials. If caching is
needed, it must be implemented in the external process.
The process can return a non-zero RC to indicate that an error occurred while
retrieving credentials.
Some process providers may need additional information in order to retrieve the
appropriate credentials. This can be done via command line arguments. NOTE:
command line options may be visible to process running on the same machine.
Example configuration::
[profile dev]
credential_process = /opt/bin/awscreds-custom
Example configuration with parameters::
[profile dev]
credential_process = /opt/bin/awscreds-custom --username monty
Service Specific Configuration
==============================
API Versions
------------
The API version to use for a service can be set using the ``api_versions``
key. To specify an API version, set the API version to the name of the service
as a sub value for ``api_versions``.
Example configuration::
[profile development]
aws_access_key_id=foo
aws_secret_access_key=bar
api_versions =
ec2 = 2015-03-01
cloudfront = 2015-09-17
By setting an API version for a service, it ensures that the interface for
that service's commands is representative of the specified API version.
In the example configuration, the ``ec2`` CLI commands will be representative
of Amazon EC2's ``2015-03-01`` API version and the ``cloudfront`` CLI commands
will be representative of Amazon CloudFront's ``2015-09-17`` API version.
AWS STS
-------
To set STS endpoint resolution logic, use the ``AWS_STS_REGIONAL_ENDPOINTS``
environment variable or ``sts_regional_endpoints`` configuration file option.
By default, this configuration option is set to ``legacy``. Valid values are:
* ``regional``
Uses the STS endpoint that corresponds to the configured region. For
example if the client is configured to use ``us-west-2``, all calls
to STS will be make to the ``sts.us-west-2.amazonaws.com`` regional
endpoint instead of the global ``sts.amazonaws.com`` endpoint.
* ``legacy``
Uses the global STS endpoint, ``sts.amazonaws.com``, for the following
configured regions:
* ``ap-northeast-1``
* ``ap-south-1``
* ``ap-southeast-1``
* ``ap-southeast-2``
* ``aws-global``
* ``ca-central-1``
* ``eu-central-1``
* ``eu-north-1``
* ``eu-west-1``
* ``eu-west-2``
* ``eu-west-3``
* ``sa-east-1``
* ``us-east-1``
* ``us-east-2``
* ``us-west-1``
* ``us-west-2``
All other regions will use their respective regional endpoint.
Retry Configuration
-------------------
These configuration variables control how the AWS CLI retries requests.
``max_attempts``
An integer representing the maximum number attempts that will be made for
a single request, including the initial attempt. For example,
setting this value to 5 will result in a request being retried up to
4 times. If not provided, the number of retries will default to whatever
is modeled, which is typically 5 total attempts in the ``legacy`` retry mode,
and 3 in the ``standard`` and ``adaptive`` retry modes.
``retry_mode``
A string representing the type of retries the AWS CLI will perform. Value
values are:
* ``legacy`` - The pre-existing retry behavior. This is default value if
no retry mode is provided.
* ``standard`` - A standardized set of retry rules across the AWS SDKs.
This includes a standard set of errors that are retried as well as
support for retry quotas, which limit the number of unsuccessful retries
an SDK can make. This mode will default the maximum number of attempts
to 3 unless a ``max_attempts`` is explicitly provided.
* ``adaptive`` - An experimental retry mode that includes all the
functionality of ``standard`` mode along with automatic client side
throttling. This is a provisional mode that may change behavior in
the future.
Amazon S3
---------
There are a number of configuration variables specific to the S3 commands. See
:doc:`s3-config` (``aws help topics s3-config``) for more details.
OS Specific Configuration
=========================
Locale
------
If you have data stored in AWS that uses a particular encoding, you should make
sure that your systems are configured to accept that encoding. For instance, if
you have unicode characters as part of a key on EC2 you will need to make sure
that your locale is set to a unicode-compatible locale. How you configure your
locale will depend on your operating system and your specific IT requirements.
One option for UNIX systems is the ``LC_ALL`` environment variable. Setting
``LC_ALL=en_US.UTF-8``, for instance, would give you a United States English
locale which is compatible with unicode.
awscli-1.18.69/awscli/topics/s3-config.rst 0000644 0000000 0000000 00000025667 13664010076 020250 0 ustar root root 0000000 0000000 :title: AWS CLI S3 Configuration
:description: Advanced configuration for AWS S3 Commands
:category: S3
:related command: s3 cp, s3 sync, s3 mv, s3 rm
The ``aws s3`` transfer commands, which include the ``cp``, ``sync``, ``mv``,
and ``rm`` commands, have additional configuration values you can use to
control S3 transfers. This topic guide discusses these parameters as well as
best practices and guidelines for setting these values.
Before discussing the specifics of these values, note that these values are
entirely optional. You should be able to use the ``aws s3`` transfer commands
without having to configure any of these values. These configuration values
are provided in the case where you need to modify one of these values, either
for performance reasons or to account for the specific environment where these
``aws s3`` commands are being run.
Configuration Values
====================
These are the configuration values you can set specifically for the ``aws s3``
command set:
* ``max_concurrent_requests`` - The maximum number of concurrent requests.
* ``max_queue_size`` - The maximum number of tasks in the task queue.
* ``multipart_threshold`` - The size threshold the CLI uses for multipart
transfers of individual files.
* ``multipart_chunksize`` - When using multipart transfers, this is the chunk
size that the CLI uses for multipart transfers of individual files.
* ``max_bandwidth`` - The maximum bandwidth that will be consumed for uploading
and downloading data to and from Amazon S3.
These are the configuration values that can be set for both ``aws s3``
and ``aws s3api``:
* ``use_accelerate_endpoint`` - Use the Amazon S3 Accelerate endpoint for
all ``s3`` and ``s3api`` commands. You **must** first enable S3 Accelerate
on your bucket before attempting to use the endpoint. This is mutually
exclusive with the ``use_dualstack_endpoint`` option.
* ``use_dualstack_endpoint`` - Use the Amazon S3 dual IPv4 / IPv6 endpoint for
all ``s3 `` and ``s3api`` commands. This is mutually exclusive with the
``use_accelerate_endpoint`` option.
* ``addressing_style`` - Specifies which addressing style to use. This controls
if the bucket name is in the hostname or part of the URL. Value values are:
``path``, ``virtual``, and ``auto``. The default value is ``auto``.
* ``payload_signing_enabled`` - Refers to whether or not to SHA256 sign sigv4
payloads. By default, this is disabled for streaming uploads (UploadPart
and PutObject) when using https.
These values must be set under the top level ``s3`` key in the AWS Config File,
which has a default location of ``~/.aws/config``. Below is an example
configuration::
[profile development]
aws_access_key_id=foo
aws_secret_access_key=bar
s3 =
max_concurrent_requests = 20
max_queue_size = 10000
multipart_threshold = 64MB
multipart_chunksize = 16MB
max_bandwidth = 50MB/s
use_accelerate_endpoint = true
addressing_style = path
Note that all the S3 configuration values are indented and nested under the top
level ``s3`` key.
You can also set these values programmatically using the ``aws configure set``
command. For example, to set the above values for the default profile, you
could instead run these commands::
$ aws configure set default.s3.max_concurrent_requests 20
$ aws configure set default.s3.max_queue_size 10000
$ aws configure set default.s3.multipart_threshold 64MB
$ aws configure set default.s3.multipart_chunksize 16MB
$ aws configure set default.s3.max_bandwidth 50MB/s
$ aws configure set default.s3.use_accelerate_endpoint true
$ aws configure set default.s3.addressing_style path
max_concurrent_requests
-----------------------
**Default** - ``10``
The ``aws s3`` transfer commands are multithreaded. At any given time,
multiple requests to Amazon S3 are in flight. For example, if you are
uploading a directory via ``aws s3 cp localdir s3://bucket/ --recursive``, the
AWS CLI could be uploading the local files ``localdir/file1``,
``localdir/file2``, and ``localdir/file3`` in parallel. The
``max_concurrent_requests`` specifies the maximum number of transfer commands
that are allowed at any given time.
You may need to change this value for a few reasons:
* Decreasing this value - On some environments, the default of 10 concurrent
requests can overwhelm a system. This may cause connection timeouts or
slow the responsiveness of the system. Lowering this value will make the
S3 transfer commands less resource intensive. The tradeoff is that
S3 transfers may take longer to complete. Lowering this value may be
necessary if using a tool such as ``trickle`` to limit bandwidth.
* Increasing this value - In some scenarios, you may want the S3 transfers
to complete as quickly as possible, using as much network bandwidth
as necessary. In this scenario, the default number of concurrent requests
may not be sufficient to utilize all the network bandwidth available.
Increasing this value may improve the time it takes to complete an
S3 transfer.
max_queue_size
--------------
**Default** - ``1000``
The AWS CLI internally uses a producer consumer model, where we queue up S3
tasks that are then executed by consumers, which in this case utilize a bound
thread pool, controlled by ``max_concurrent_requests``. A task generally maps
to a single S3 operation. For example, as task could be a ``PutObjectTask``,
or a ``GetObjectTask``, or an ``UploadPartTask``. The enqueuing rate can be
much faster than the rate at which consumers are executing tasks. To avoid
unbounded growth, the task queue size is capped to a specific size. This
configuration value changes the value of that maximum number.
You generally will not need to change this value. This value also corresponds
to the number of tasks we are aware of that need to be executed. This means
that by default we can only see 1000 tasks ahead. Until the S3 command knows
the total number of tasks executed, the progress line will show a total of
``...``. Increasing this value means that we will be able to more quickly know
the total number of tasks needed, assuming that the enqueuing rate is quicker
than the rate of task consumption. The tradeoff is that a larger max queue
size will require more memory.
multipart_threshold
-------------------
**Default** - ``8MB``
When uploading, downloading, or copying a file, the S3 commands
will switch to multipart operations if the file reaches a given
size threshold. The ``multipart_threshold`` controls this value.
You can specify this value in one of two ways:
* The file size in bytes. For example, ``1048576``.
* The file size with a size suffix. You can use ``KB``, ``MB``, ``GB``,
``TB``. For example: ``10MB``, ``1GB``. Note that S3 imposes
constraints on valid values that can be used for multipart
operations.
multipart_chunksize
-------------------
**Default** - ``8MB``
**Minimum For Uploads** - ``5MB``
Once the S3 commands have decided to use multipart operations, the
file is divided into chunks. This configuration option specifies what
the chunk size (also referred to as the part size) should be. This
value can specified using the same semantics as ``multipart_threshold``,
that is either as the number of bytes as an integer, or using a size
suffix.
max_bandwidth
-------------
**Default** - None
This controls the maximum bandwidth that the S3 commands will
utilize when streaming content data to and from S3. Thus, this value only
applies for uploads and downloads. It does not apply to copies nor deletes
because those data transfers take place server side. The value is
in terms of **bytes** per second. The value can be specified as:
* An integer. For example, ``1048576`` would set the maximum bandwidth usage
to 1 MB per second.
* A rate suffix. You can specify rate suffixes using: ``KB/s``, ``MB/s``,
``GB/s``, etc. For example: ``300KB/s``, ``10MB/s``.
In general, it is recommended to first use ``max_concurrent_requests`` to lower
transfers to the desired bandwidth consumption. The ``max_bandwidth`` setting
should then be used to further limit bandwidth consumption if setting
``max_concurrent_requests`` is unable to lower bandwidth consumption to the
desired rate. This is recommended because ``max_concurrent_requests`` controls
how many threads are currently running. So if a high ``max_concurrent_requests``
value is set and a low ``max_bandwidth`` value is set, it may result in
threads having to wait unnecessarily which can lead to excess resource
consumption and connection timeouts.
use_accelerate_endpoint
-----------------------
**Default** - ``false``
If set to ``true``, will direct all Amazon S3 requests to the S3 Accelerate
endpoint: ``s3-accelerate.amazonaws.com``. To use this endpoint, your bucket
must be enabled to use S3 Accelerate. All request will be sent using the
virtual style of bucket addressing: ``my-bucket.s3-accelerate.amazonaws.com``.
Any ``ListBuckets``, ``CreateBucket``, and ``DeleteBucket`` requests will not
be sent to the Accelerate endpoint as the endpoint does not support those
operations. This behavior can also be set if ``--endpoint-url`` parameter
is set to ``https://s3-accelerate.amazonaws.com`` or
``http://s3-accelerate.amazonaws.com`` for any ``s3`` or ``s3api`` command. This
option is mutually exclusive with the ``use_dualstack_endpoint`` option.
use_dualstack_endpoint
----------------------
**Default** - ``false``
If set to ``true``, will direct all Amazon S3 requests to the dual IPv4 / IPv6
endpoint for the configured region. This option is mutually exclusive with
the ``use_accelerate_endpoint`` option.
addressing_style
----------------
**Default** - ``auto``
There's two styles of constructing an S3 endpoint. The first is with
the bucket included as part of the hostname. This corresponds to the
addressing style of ``virtual``. The second is with the bucket included
as part of the path of the URI, corresponding to the addressing style
of ``path``. The default value in the CLI is to use ``auto``, which
will attempt to use ``virtual`` where possible, but will fall back to
``path`` style if necessary. For example, if your bucket name is not
DNS compatible, the bucket name cannot be part of the hostname and
must be in the path. With ``auto``, the CLI will detect this condition
and automatically switch to ``path`` style for you. If you set the
addressing style to ``path``, you must ensure that the AWS region you
configured in the AWS CLI matches the same region of your bucket.
payload_signing_enabled
-----------------------
If set to ``true``, s3 payloads will receive additional content validation in
the form of a SHA256 checksum which will be calculated for you and included in
the request signature. If set to ``false``, the checksum will not be calculated.
Disabling this can be useful to save the performance overhead that the
checksum calculation would otherwise cause.
By default, this is disabled for streaming uploads (UploadPart and PutObject),
but only if a ContentMD5 is present (it is generated by default) and the
endpoint uses HTTPS.
awscli-1.18.69/awscli/topics/return-codes.rst 0000644 0000000 0000000 00000003657 13664010076 021065 0 ustar root root 0000000 0000000 :title: AWS CLI Return Codes
:description: Describes the various return codes of the AWS CLI
:category: General
:related command: s3, s3 cp, s3 sync, s3 mv, s3 rm
These are the following return codes returned at the end of execution
of a CLI command:
* ``0`` -- Command was successful. There were no errors thrown by either
the CLI or by the service the request was made to.
* ``1`` -- Limited to ``s3`` commands, at least one or more s3 transfers
failed for the command executed.
* ``2`` -- The meaning of this return code depends on the command being run.
The primary meaning is that the command entered on the command
line failed to be parsed. Parsing failures can be caused by,
but are not limited to, missing any required subcommands or arguments
or using any unknown commands or arguments.
Note that this return code meaning is applicable to all CLI commands.
The other meaning is only applicable to ``s3`` commands.
It can mean at least one or more files marked
for transfer were skipped during the transfer process. However, all
other files marked for transfer were successfully transferred.
Files that are skipped during the transfer process include:
files that do not exist, files that are character special devices,
block special device, FIFO's, or sockets, and files that the user cannot
read from.
* ``130`` -- The process received a SIGINT (Ctrl-C).
* ``255`` -- Command failed. There were errors thrown by either the CLI or
by the service the request was made to.
To determine the return code of a command, run the following right after
running a CLI command. Note that this will work only on POSIX systems::
$ echo $?
Output (if successful)::
0
On Windows PowerShell, the return code can be determined by running::
> echo $lastexitcode
Output (if successful)::
0
On Windows Command Prompt, the return code can be determined by running::
> echo %errorlevel%
Output (if successful)::
0
awscli-1.18.69/awscli/topics/s3-faq.rst 0000644 0000000 0000000 00000004727 13664010076 017544 0 ustar root root 0000000 0000000 :title: AWS CLI S3 FAQ
:description: Frequented Asked Questions for Amazon S3 in the AWS CLI
:category: S3
:related command: s3 cp, s3 sync, s3 mv, s3 rm
S3 FAQ
======
Below are common questions regarding the use of Amazon S3 in the AWS CLI.
Q: Does the AWS CLI validate checksums?
---------------------------------------
The AWS CLI will perform checksum validation for uploading and downloading
files in specific scenarios.
Upload
~~~~~~
The AWS CLI will calculate and auto-populate the ``Content-MD5`` header for
both standard and multipart uploads. If the checksum that S3 calculates does
not match the ``Content-MD5`` provided, S3 will not store the object and
instead will return an error message back the AWS CLI. The AWS CLI will retry
this error up to 5 times before giving up. On the case that any files fail to
transfer successfully to S3, the AWS CLI will exit with a non zero RC.
See ``aws help return-codes`` for more information.
If the upload request is signed with Signature Version 4, then the AWS CLI uses the
``x-amz-content-sha256`` header as a checksum instead of ``Content-MD5``.
The AWS CLI will use Signature Version 4 for S3 in several cases:
* You're using an AWS region that only supports Signature Version 4. This
includes ``eu-central-1`` and ``ap-northeast-2``.
* You explicitly opt in and set ``signature_version = s3v4`` in your
``~/.aws/config`` file.
Note that the AWS CLI will add a ``Content-MD5`` header for both
the high level ``aws s3`` commands that perform uploads
(``aws s3 cp``, ``aws s3 sync``) as well as the low level ``s3api``
commands including ``aws s3api put-object`` and ``aws s3api upload-part``.
Download
~~~~~~~~
The AWS CLI will attempt to verify the checksum of downloads when possible,
based on the ``ETag`` header returned from a ``GetObject`` request that's
performed whenever the AWS CLI downloads objects from S3. If the calculated
MD5 checksum does not match the expected checksum, the file is deleted
and the download is retried. This process is retried up to 3 times.
If a downloads fails, the AWS CLI will exit with a non zero RC.
See ``aws help return-codes`` for more information.
There are several conditions where the CLI is *not* able to verify
checksums on downloads:
* If the object was uploaded via multipart uploads
* If the object was uploaded using server side encryption with KMS
* If the object was uploaded using a customer provided encryption key
* If the object is downloaded using range ``GetObject`` requests
awscli-1.18.69/awscli/topics/topic-tags.json 0000644 0000000 0000000 00000003051 13664010076 020652 0 ustar root root 0000000 0000000 {
"config-vars": {
"category": [
"General"
],
"description": [
"Configuration Variables for the AWS CLI"
],
"related command": [
"configure",
"configure get",
"configure set"
],
"related topic": [
"s3-config"
],
"title": [
"AWS CLI Configuration Variables"
]
},
"return-codes": {
"category": [
"General"
],
"description": [
"Describes the various return codes of the AWS CLI"
],
"related command": [
"s3",
"s3 cp",
"s3 sync",
"s3 mv",
"s3 rm"
],
"title": [
"AWS CLI Return Codes"
]
},
"s3-config": {
"category": [
"S3"
],
"description": [
"Advanced configuration for AWS S3 Commands"
],
"related command": [
"s3 cp",
"s3 sync",
"s3 mv",
"s3 rm"
],
"title": [
"AWS CLI S3 Configuration"
]
},
"s3-faq": {
"category": [
"S3"
],
"description": [
"Frequented Asked Questions for Amazon S3 in the AWS CLI"
],
"related command": [
"s3 cp",
"s3 sync",
"s3 mv",
"s3 rm"
],
"title": [
"AWS CLI S3 FAQ"
]
}
} awscli-1.18.69/awscli/argparser.py 0000644 0000000 0000000 00000016203 13664010074 016745 0 ustar root root 0000000 0000000 # Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import argparse
import sys
from awscli.compat import six
from difflib import get_close_matches
HELP_BLURB = (
"To see help text, you can run:\n"
"\n"
" aws help\n"
" aws help\n"
" aws help\n"
)
USAGE = (
"aws [options] [ ...] [parameters]\n"
"%s" % HELP_BLURB
)
class CommandAction(argparse.Action):
"""Custom action for CLI command arguments
Allows the choices for the argument to be mutable. The choices
are dynamically retrieved from the keys of the referenced command
table
"""
def __init__(self, option_strings, dest, command_table, **kwargs):
self.command_table = command_table
super(CommandAction, self).__init__(
option_strings, dest, choices=self.choices, **kwargs
)
def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, values)
@property
def choices(self):
return list(self.command_table.keys())
@choices.setter
def choices(self, val):
# argparse.Action will always try to set this value upon
# instantiation, but this value should be dynamically
# generated from the command table keys. So make this a
# NOOP if argparse.Action tries to set this value.
pass
class CLIArgParser(argparse.ArgumentParser):
Formatter = argparse.RawTextHelpFormatter
# When displaying invalid choice error messages,
# this controls how many options to show per line.
ChoicesPerLine = 2
def _check_value(self, action, value):
"""
It's probably not a great idea to override a "hidden" method
but the default behavior is pretty ugly and there doesn't
seem to be any other way to change it.
"""
# converted value must be one of the choices (if specified)
if action.choices is not None and value not in action.choices:
msg = ['Invalid choice, valid choices are:\n']
for i in range(len(action.choices))[::self.ChoicesPerLine]:
current = []
for choice in action.choices[i:i+self.ChoicesPerLine]:
current.append('%-40s' % choice)
msg.append(' | '.join(current))
possible = get_close_matches(value, action.choices, cutoff=0.8)
if possible:
extra = ['\n\nInvalid choice: %r, maybe you meant:\n' % value]
for word in possible:
extra.append(' * %s' % word)
msg.extend(extra)
raise argparse.ArgumentError(action, '\n'.join(msg))
def parse_known_args(self, args, namespace=None):
parsed, remaining = super(CLIArgParser, self).parse_known_args(args, namespace)
terminal_encoding = getattr(sys.stdin, 'encoding', 'utf-8')
if terminal_encoding is None:
# In some cases, sys.stdin won't have an encoding set,
# (e.g if it's set to a StringIO). In this case we just
# default to utf-8.
terminal_encoding = 'utf-8'
for arg, value in vars(parsed).items():
if isinstance(value, six.binary_type):
setattr(parsed, arg, value.decode(terminal_encoding))
elif isinstance(value, list):
encoded = []
for v in value:
if isinstance(v, six.binary_type):
encoded.append(v.decode(terminal_encoding))
else:
encoded.append(v)
setattr(parsed, arg, encoded)
return parsed, remaining
class MainArgParser(CLIArgParser):
Formatter = argparse.RawTextHelpFormatter
def __init__(self, command_table, version_string,
description, argument_table, prog=None):
super(MainArgParser, self).__init__(
formatter_class=self.Formatter,
add_help=False,
conflict_handler='resolve',
description=description,
usage=USAGE,
prog=prog)
self._build(command_table, version_string, argument_table)
def _create_choice_help(self, choices):
help_str = ''
for choice in sorted(choices):
help_str += '* %s\n' % choice
return help_str
def _build(self, command_table, version_string, argument_table):
for argument_name in argument_table:
argument = argument_table[argument_name]
argument.add_to_parser(self)
self.add_argument('--version', action="version",
version=version_string,
help='Display the version of this tool')
self.add_argument('command', action=CommandAction,
command_table=command_table)
class ServiceArgParser(CLIArgParser):
def __init__(self, operations_table, service_name):
super(ServiceArgParser, self).__init__(
formatter_class=argparse.RawTextHelpFormatter,
add_help=False,
conflict_handler='resolve',
usage=USAGE)
self._build(operations_table)
self._service_name = service_name
def _build(self, operations_table):
self.add_argument('operation', action=CommandAction,
command_table=operations_table)
class ArgTableArgParser(CLIArgParser):
"""CLI arg parser based on an argument table."""
def __init__(self, argument_table, command_table=None):
# command_table is an optional subcommand_table. If it's passed
# in, then we'll update the argparse to parse a 'subcommand' argument
# and populate the choices field with the command table keys.
super(ArgTableArgParser, self).__init__(
formatter_class=self.Formatter,
add_help=False,
usage=USAGE,
conflict_handler='resolve')
if command_table is None:
command_table = {}
self._build(argument_table, command_table)
def _build(self, argument_table, command_table):
for arg_name in argument_table:
argument = argument_table[arg_name]
argument.add_to_parser(self)
if command_table:
self.add_argument('subcommand', action=CommandAction,
command_table=command_table, nargs='?')
def parse_known_args(self, args, namespace=None):
if len(args) == 1 and args[0] == 'help':
namespace = argparse.Namespace()
namespace.help = 'help'
return namespace, []
else:
return super(ArgTableArgParser, self).parse_known_args(
args, namespace)
awscli-1.18.69/awscli/examples/ 0000755 0000000 0000000 00000000000 13664010277 016226 5 ustar root root 0000000 0000000 awscli-1.18.69/awscli/examples/iot-data/ 0000755 0000000 0000000 00000000000 13664010277 017730 5 ustar root root 0000000 0000000 awscli-1.18.69/awscli/examples/iot-data/update-thing-shadow.rst 0000644 0000000 0000000 00000001715 13664010076 024337 0 ustar root root 0000000 0000000 **To update a thing shadow**
The following ``update-thing-shadow`` example modifies the current state of the device shadow for the specified thing and saves it to the file ``output.txt``. ::
aws iot-data update-thing-shadow \
--thing-name MyRPi \
--payload "{"state":{"reported":{"moisture":"okay"}}}" \
"output.txt"
The command produces no output on the display, but the following shows the contents of ``output.txt``::
{
"state": {
"reported": {
"moisture": "okay"
}
},
"metadata": {
"reported": {
"moisture": {
"timestamp": 1560270036
}
}
},
"version": 2,
"timestamp": 1560270036
}
For more information, see `Device Shadow Service Data Flow `__ in the *AWS IoT Developers Guide*.
awscli-1.18.69/awscli/examples/iot-data/get-thing-shadow.rst 0000644 0000000 0000000 00000001413 13664010076 023627 0 ustar root root 0000000 0000000 **To get a thing shadow document**
The following ``get-thing-shadow`` example gets the thing shadow document for the specified IoT thing. ::
aws iot-data get-thing-shadow \
--thing-name MyRPi \
output.txt
The command produces no output on the display, but the following shows the contents of ``output.txt``::
{
"state":{
"reported":{
"moisture":"low"
}
},
"metadata":{
"reported":{
"moisture":{
"timestamp":1560269319
}
}
},
"version":1,"timestamp":1560269405
}
For more information, see `Device Shadow Service Data Flow `__ in the *AWS IoT Developers Guide*.
awscli-1.18.69/awscli/examples/iot-data/delete-thing-shadow.rst 0000644 0000000 0000000 00000001161 13664010076 024312 0 ustar root root 0000000 0000000 **To delete a device's shadow document**
The following ``delete-thing-shadow`` example deletes the entire shadow document for the device named ``MyRPi``. ::
aws iot-data delete-thing-shadow \
--thing-name MyRPi \
"output.txt"
The command produces no output on the display, but ``output.txt`` contains information that confirms the version and timestamp of the shadow document that you deleted. ::
{"version":2,"timestamp":1560270384}
For more information, see `Using Shadows `__ in the *AWS IoT Developers Guide*.
awscli-1.18.69/awscli/examples/codestar/ 0000755 0000000 0000000 00000000000 13664010277 020032 5 ustar root root 0000000 0000000 awscli-1.18.69/awscli/examples/codestar/tag-project.rst 0000755 0000000 0000000 00000000550 13664010074 023001 0 ustar root root 0000000 0000000 **To attach a tag to a project**
The following ``tag-project`` example adds a tag named ``Department`` and a value of ``Marketing`` to the specified project. ::
aws codestar tag-project \
--id my-project \
--tags Department=Marketing
Output::
{
"tags": {
"Department": "Marketing"
}
}
awscli-1.18.69/awscli/examples/codestar/delete-user-profile.rst 0000755 0000000 0000000 00000000514 13664010074 024436 0 ustar root root 0000000 0000000 **To delete a user profile**
The following ``delete-user-profile`` example deletes the user profile for the user with the specified ARN. ::
aws codestar delete-user-profile \
--user-arn arn:aws:iam::123456789012:user/intern
Output::
{
"userArn": "arn:aws:iam::123456789012:user/intern"
}
awscli-1.18.69/awscli/examples/codestar/create-project.rst 0000755 0000000 0000000 00000003104 13664010074 023467 0 ustar root root 0000000 0000000 **To create a project**
The following ``create-project`` example uses a JSON input file to create a CodeStar project. ::
aws codestar create-project \
--cli-input-json file://create-project.json
Contents of ``create-project.json``::
{
"name": "Custom Project",
"id": "custom-project",
"sourceCode": [
{
"source": {
"s3": {
"bucketName": "codestar-artifacts",
"bucketKey": "nodejs-function.zip"
}
},
"destination": {
"codeCommit": {
"name": "codestar-custom-project"
}
}
}
],
"toolchain": {
"source": {
"s3": {
"bucketName": "codestar-artifacts",
"bucketKey": "toolchain.yml"
}
},
"roleArn": "arn:aws:iam::123456789012:role/service-role/aws-codestar-service-role",
"stackParameters": {
"ProjectId": "custom-project"
}
}
}
Output::
{
"id": "my-project",
"arn": "arn:aws:codestar:us-east-2:123456789012:project/custom-project"
}
For a tutorial that includes sample code and templates for a custom project, see `Create a Project in AWS CodeStar with the AWS CLI`__ in the *AWS CodeStar User Guide*.
awscli-1.18.69/awscli/examples/codestar/list-projects.rst 0000755 0000000 0000000 00000001057 13664010074 023367 0 ustar root root 0000000 0000000 **To view projects**
The following ``list-projects`` example retrieves a list of projects in the current Region. ::
aws codestar list-projects
Output::
{
"projects": [
{
"projectId": "intern-projects",
"projectArn": "arn:aws:codestar:us-west-2:123456789012:project/intern-projects"
},
{
"projectId": "my-project",
"projectArn": "arn:aws:codestar:us-west-2:123456789012:project/my-project"
}
]
}
awscli-1.18.69/awscli/examples/codestar/list-user-profiles.rst 0000755 0000000 0000000 00000001314 13664010074 024331 0 ustar root root 0000000 0000000 **To view a list of user profiles**
The following ``list-user-profiles`` example retrieves a list of all user profiles in the current Region. ::
aws codestar list-user-profiles
Output::
{
"userProfiles": [
{
"userArn": "arn:aws:iam::123456789012:user/admin",
"displayName": "me",
"emailAddress": "me@example.com",
"sshPublicKey": ""
},
{
"userArn": "arn:aws:iam::123456789012:user/intern",
"displayName": "Intern",
"emailAddress": "intern@example.com",
"sshPublicKey": "intern"
}
]
}
awscli-1.18.69/awscli/examples/codestar/list-resources.rst 0000755 0000000 0000000 00000004626 13664010074 023555 0 ustar root root 0000000 0000000 **To view resources**
The following ``list-resources`` example retrieves a list of resources for the specified project. ::
aws codestar list-resources \
--id my-project
Output::
{
"resources": [
{
"id": "arn:aws:execute-api:us-east-2:123456789012:r3wxmplbv8"
},
{
"id": "arn:aws:codedeploy:us-east-2:123456789012:application:awscodestar-my-project-lambda-ServerlessDeploymentApplication-PF0LXMPL1KA0"
},
{
"id": "arn:aws:s3:::aws-codestar-us-east-2-123456789012-my-project-pipe"
},
{
"id": "arn:aws:lambda:us-east-2:123456789012:function:awscodestar-my-project-lambda-GetHelloWorld-16W3LVXMPLNNS"
},
{
"id": "arn:aws:cloudformation:us-east-2:123456789012:stack/awscodestar-my-project-lambda/b4904ea0-fc20-xmpl-bec6-029123b1cc42"
},
{
"id": "arn:aws:cloudformation:us-east-2:123456789012:stack/awscodestar-my-project/1b133f30-fc20-xmpl-a93a-0688c4290cb8"
},
{
"id": "arn:aws:iam::123456789012:role/CodeStarWorker-my-project-ToolChain"
},
{
"id": "arn:aws:iam::123456789012:policy/CodeStar_my-project_PermissionsBoundary"
},
{
"id": "arn:aws:s3:::aws-codestar-us-east-2-123456789012-my-project-app"
},
{
"id": "arn:aws:codepipeline:us-east-2:123456789012:my-project-Pipeline"
},
{
"id": "arn:aws:codedeploy:us-east-2:123456789012:deploymentgroup:my-project/awscodestar-my-project-lambda-GetHelloWorldDeploymentGroup-P7YWXMPLT0QB"
},
{
"id": "arn:aws:iam::123456789012:role/CodeStar-my-project-Execution"
},
{
"id": "arn:aws:iam::123456789012:role/CodeStarWorker-my-project-CodeDeploy"
},
{
"id": "arn:aws:codebuild:us-east-2:123456789012:project/my-project"
},
{
"id": "arn:aws:iam::123456789012:role/CodeStarWorker-my-project-CloudFormation"
},
{
"id": "arn:aws:codecommit:us-east-2:123456789012:Go-project"
}
]
}
awscli-1.18.69/awscli/examples/codestar/describe-project.rst 0000755 0000000 0000000 00000001007 13664010074 024004 0 ustar root root 0000000 0000000 **To view a project**
The following ``describe-project`` example retrieves details about the specified project. ::
aws codestar describe-project \
--id my-project
Output::
{
"name": "my project",
"id": "my-project",
"arn": "arn:aws:codestar:us-west-2:123456789012:project/my-project",
"description": "My first CodeStar project.",
"createdTimeStamp": 1572547510.128,
"status": {
"state": "CreateComplete"
}
}
awscli-1.18.69/awscli/examples/codestar/update-user-profile.rst 0000755 0000000 0000000 00000001065 13664010074 024460 0 ustar root root 0000000 0000000 **To modify a user profile**
The following ``update-user-profile`` example adds the specified SHH key to the specified user. ::
aws codestar update-user-profile \
--ssh-public-key intern \
--user-arn arn:aws:iam::123456789012:user/intern
Output::
{
"userArn": "arn:aws:iam::123456789012:user/intern",
"displayName": "Intern",
"emailAddress": "intern@example.com",
"sshPublicKey": "intern",
"createdTimestamp": 1572552308.607,
"lastModifiedTimestamp": 1572553495.47
}
awscli-1.18.69/awscli/examples/codestar/list-team-members.rst 0000755 0000000 0000000 00000001233 13664010074 024110 0 ustar root root 0000000 0000000 **To view a list of team members**
The following ``list-team-members`` example retrieves a list of users associated with the specified project. ::
aws codestar list-team-members \
--project-id my-project
Output::
{
"teamMembers": [
{
"userArn": "arn:aws:iam::123456789012:user/admin",
"projectRole": "Owner",
"remoteAccessAllowed": false
},
{
"userArn": "arn:aws:iam::123456789012:user/intern",
"projectRole": "Contributor",
"remoteAccessAllowed": false
}
]
}
awscli-1.18.69/awscli/examples/codestar/associate-team-member.rst 0000755 0000000 0000000 00000000564 13664010074 024733 0 ustar root root 0000000 0000000 **To add a team member to a project**
The following ``associate-team-member`` example makes the ``intern`` user a viewer on the project with the specified ID. ::
aws codestar associate-team-member \
--project-id my-project \
--user-arn arn:aws:iam::123456789012:user/intern \
--project-role Viewer
This command produces no output.
awscli-1.18.69/awscli/examples/codestar/delete-project.rst 0000755 0000000 0000000 00000000435 13664010074 023472 0 ustar root root 0000000 0000000 **To delete a project**
The following ``delete-project`` example deletes the specified project. ::
aws codestar delete-project \
--project-id my-project
Output::
{
"projectArn": "arn:aws:codestar:us-east-2:123456789012:project/my-project"
}
awscli-1.18.69/awscli/examples/codestar/create-user-profile.rst 0000755 0000000 0000000 00000001152 13664010074 024436 0 ustar root root 0000000 0000000 **To create a user profile**
The following ``create-user-profile`` example creates a user profile for the IAM user with the specified ARN. ::
aws codestar create-user-profile \
--user-arn arn:aws:iam::123456789012:user/intern \
--display-name Intern \
--email-address intern@example.com
Output::
{
"userArn": "arn:aws:iam::123456789012:user/intern",
"displayName": "Intern",
"emailAddress": "intern@example.com",
"sshPublicKey": "",
"createdTimestamp": 1572552308.607,
"lastModifiedTimestamp": 1572552308.607
}
awscli-1.18.69/awscli/examples/codestar/list-tags-for-project.rst 0000755 0000000 0000000 00000000522 13664010074 024720 0 ustar root root 0000000 0000000 **To view tags for a project**
The following ``list-tags-for-project`` example retrieves the tags attached to the specified project. ::
aws codestar list-tags-for-project \
--id my-project
Output::
{
"tags": {
"Department": "Marketing",
"Team": "Website"
}
}
awscli-1.18.69/awscli/examples/codestar/untag-project.rst 0000755 0000000 0000000 00000000422 13664010074 023342 0 ustar root root 0000000 0000000 **To remove a tag from a project**
The following ``untag-project`` example removes any tag with a key name of ``Team`` from the specifiec project. ::
aws codestar untag-project \
--id my-project \
--tags Team
This command produces no output.
awscli-1.18.69/awscli/examples/codestar/update-team-member.rst 0000755 0000000 0000000 00000001055 13664010074 024236 0 ustar root root 0000000 0000000 **To modify a team member**
The following ``update-team-member`` example makes the specified user a contributor on a project and grants them remote access to project resources. ::
aws codestar update-team-member \
--project-id my-project \
--user-arn arn:aws:iam::123456789012:user/intern \
--project-role Contributor -\
--remote-access-allowed
Output::
{
"userArn": "arn:aws:iam::123456789012:user/intern",
"projectRole": "Contributor",
"remoteAccessAllowed": true
}
awscli-1.18.69/awscli/examples/codestar/describe-user-profile.rst 0000755 0000000 0000000 00000001060 13664010074 024751 0 ustar root root 0000000 0000000 **To view a user profile**
The following ``describe-user-profile`` example retrieves details about the user profile for the user with the specified ARN. ::
aws codestar describe-user-profile \
--user-arn arn:aws:iam::123456789012:user/intern
Output::
{
"userArn": "arn:aws:iam::123456789012:user/intern",
"displayName": "Intern",
"emailAddress": "intern@example.com",
"sshPublicKey": "intern",
"createdTimestamp": 1572552308.607,
"lastModifiedTimestamp": 1572553495.47
}
awscli-1.18.69/awscli/examples/codestar/disassociate-team-member.rst 0000755 0000000 0000000 00000000517 13664010074 025431 0 ustar root root 0000000 0000000 **To remove a team member**
The following ``disassociate-team-member`` example removes the user with the specified ARN from the project ``my-project``. ::
aws codestar disassociate-team-member \
--project-id my-project \
--user-arn arn:aws:iam::123456789012:user/intern
This command produces no output.
awscli-1.18.69/awscli/examples/codestar/update-project.rst 0000755 0000000 0000000 00000000414 13664010074 023507 0 ustar root root 0000000 0000000 **To update a project**
The following ``update-project`` example adds a description to the specified project. ::
aws codestar update-project \
--id my-project \
--description "My first CodeStar project"
This command produces no output.
awscli-1.18.69/awscli/examples/datapipeline/ 0000755 0000000 0000000 00000000000 13664010277 020665 5 ustar root root 0000000 0000000 awscli-1.18.69/awscli/examples/datapipeline/get-pipeline-definition.rst 0000644 0000000 0000000 00000005435 13664010074 026131 0 ustar root root 0000000 0000000 **To get a pipeline definition**
This example gets the pipeline definition for the specified pipeline::
aws datapipeline get-pipeline-definition --pipeline-id df-00627471SOVYZEXAMPLE
The following is example output::
{
"parameters": [
{
"type": "AWS::S3::ObjectKey",
"id": "myS3OutputLoc",
"description": "S3 output folder"
},
{
"default": "s3://us-east-1.elasticmapreduce.samples/pig-apache-logs/data",
"type": "AWS::S3::ObjectKey",
"id": "myS3InputLoc",
"description": "S3 input folder"
},
{
"default": "grep -rc \"GET\" ${INPUT1_STAGING_DIR}/* > ${OUTPUT1_STAGING_DIR}/output.txt",
"type": "String",
"id": "myShellCmd",
"description": "Shell command to run"
}
],
"objects": [
{
"type": "Ec2Resource",
"terminateAfter": "20 Minutes",
"instanceType": "t1.micro",
"id": "EC2ResourceObj",
"name": "EC2ResourceObj"
},
{
"name": "Default",
"failureAndRerunMode": "CASCADE",
"resourceRole": "DataPipelineDefaultResourceRole",
"schedule": {
"ref": "DefaultSchedule"
},
"role": "DataPipelineDefaultRole",
"scheduleType": "cron",
"id": "Default"
},
{
"directoryPath": "#{myS3OutputLoc}/#{format(@scheduledStartTime, 'YYYY-MM-dd-HH-mm-ss')}",
"type": "S3DataNode",
"id": "S3OutputLocation",
"name": "S3OutputLocation"
},
{
"directoryPath": "#{myS3InputLoc}",
"type": "S3DataNode",
"id": "S3InputLocation",
"name": "S3InputLocation"
},
{
"startAt": "FIRST_ACTIVATION_DATE_TIME",
"name": "Every 15 minutes",
"period": "15 minutes",
"occurrences": "4",
"type": "Schedule",
"id": "DefaultSchedule"
},
{
"name": "ShellCommandActivityObj",
"command": "#{myShellCmd}",
"output": {
"ref": "S3OutputLocation"
},
"input": {
"ref": "S3InputLocation"
},
"stage": "true",
"type": "ShellCommandActivity",
"id": "ShellCommandActivityObj",
"runsOn": {
"ref": "EC2ResourceObj"
}
}
],
"values": {
"myS3OutputLoc": "s3://my-s3-bucket/",
"myS3InputLoc": "s3://us-east-1.elasticmapreduce.samples/pig-apache-logs/data",
"myShellCmd": "grep -rc \"GET\" ${INPUT1_STAGING_DIR}/* > ${OUTPUT1_STAGING_DIR}/output.txt"
}
}
awscli-1.18.69/awscli/examples/datapipeline/add-tags.rst 0000644 0000000 0000000 00000001233 13664010074 023075 0 ustar root root 0000000 0000000 **To add a tag to a pipeline**
This example adds the specified tag to the specified pipeline::
aws datapipeline add-tags --pipeline-id df-00627471SOVYZEXAMPLE --tags key=environment,value=production key=owner,value=sales
To view the tags, use the describe-pipelines command. For example, the tags added in the example command appear as follows in the output for describe-pipelines::
{
...
"tags": [
{
"value": "production",
"key": "environment"
},
{
"value": "sales",
"key": "owner"
}
]
...
}
awscli-1.18.69/awscli/examples/datapipeline/list-pipelines.rst 0000644 0000000 0000000 00000001102 13664010074 024345 0 ustar root root 0000000 0000000 **To list your pipelines**
This example lists your pipelines::
aws datapipeline list-pipelines
The following is example output::
{
"pipelineIdList": [
{
"id": "df-00627471SOVYZEXAMPLE",
"name": "my-pipeline"
},
{
"id": "df-09028963KNVMREXAMPLE",
"name": "ImportDDB"
},
{
"id": "df-0870198233ZYVEXAMPLE",
"name": "CrossRegionDDB"
},
{
"id": "df-00189603TB4MZEXAMPLE",
"name": "CopyRedshift"
}
]
}
awscli-1.18.69/awscli/examples/datapipeline/deactivate-pipeline.rst 0000644 0000000 0000000 00000000546 13664010074 025333 0 ustar root root 0000000 0000000 **To deactivate a pipeline**
This example deactivates the specified pipeline::
aws datapipeline deactivate-pipeline --pipeline-id df-00627471SOVYZEXAMPLE
To deactivate the pipeline only after all running activities finish, use the following command::
aws datapipeline deactivate-pipeline --pipeline-id df-00627471SOVYZEXAMPLE --no-cancel-active
awscli-1.18.69/awscli/examples/datapipeline/delete-pipeline.rst 0000644 0000000 0000000 00000000223 13664010074 024454 0 ustar root root 0000000 0000000 **To delete a pipeline**
This example deletes the specified pipeline::
aws datapipeline delete-pipeline --pipeline-id df-00627471SOVYZEXAMPLE
awscli-1.18.69/awscli/examples/datapipeline/create-pipeline.rst 0000644 0000000 0000000 00000000357 13664010074 024465 0 ustar root root 0000000 0000000 **To create a pipeline**
This example creates a pipeline::
aws datapipeline create-pipeline --name my-pipeline --unique-id my-pipeline-token
The following is example output::
{
"pipelineId": "df-00627471SOVYZEXAMPLE"
}
awscli-1.18.69/awscli/examples/datapipeline/list-runs.rst 0000644 0000000 0000000 00000002733 13664010074 023357 0 ustar root root 0000000 0000000 **Example 1: To list your pipeline runs**
The following ``list-runs`` example lists the runs for the specified pipeline. ::
aws datapipeline list-runs --pipeline-id df-00627471SOVYZEXAMPLE
Output::
Name Scheduled Start Status ID Started Ended
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1. EC2ResourceObj 2015-04-12T17:33:02 CREATING @EC2ResourceObj_2015-04-12T17:33:02 2015-04-12T17:33:10
2. S3InputLocation 2015-04-12T17:33:02 FINISHED @S3InputLocation_2015-04-12T17:33:02 2015-04-12T17:33:09 2015-04-12T17:33:09
3. S3OutputLocation 2015-04-12T17:33:02 WAITING_ON_DEPENDENCIES @S3OutputLocation_2015-04-12T17:33:02 2015-04-12T17:33:09
4. ShellCommandActivityObj 2015-04-12T17:33:02 WAITING_FOR_RUNNER @ShellCommandActivityObj_2015-04-12T17:33:02 2015-04-12T17:33:09
**Example 2: To list the pipeline runs between the specified dates**
The following ``list-runs`` example uses the ``--start-interval`` to specify the dates to include in the output. ::
aws datapipeline list-runs --pipeline-id df-01434553B58A2SHZUKO5 --start-interval 2017-10-07T00:00:00,2017-10-08T00:00:00
awscli-1.18.69/awscli/examples/datapipeline/activate-pipeline.rst 0000644 0000000 0000000 00000000540 13664010074 025014 0 ustar root root 0000000 0000000 **To activate a pipeline**
This example activates the specified pipeline::
aws datapipeline activate-pipeline --pipeline-id df-00627471SOVYZEXAMPLE
To activate the pipeline at a specific date and time, use the following command::
aws datapipeline activate-pipeline --pipeline-id df-00627471SOVYZEXAMPLE --start-timestamp 2015-04-07T00:00:00Z
awscli-1.18.69/awscli/examples/datapipeline/remove-tags.rst 0000644 0000000 0000000 00000000310 13664010074 023635 0 ustar root root 0000000 0000000 **To remove a tag from a pipeline**
This example removes the specified tag from the specified pipeline::
aws datapipeline remove-tags --pipeline-id df-00627471SOVYZEXAMPLE --tag-keys environment
awscli-1.18.69/awscli/examples/datapipeline/put-pipeline-definition.rst 0000644 0000000 0000000 00000000602 13664010074 026151 0 ustar root root 0000000 0000000 **To upload a pipeline definition**
This example uploads the specified pipeline definition to the specified pipeline::
aws datapipeline put-pipeline-definition --pipeline-id df-00627471SOVYZEXAMPLE --pipeline-definition file://my-pipeline-definition.json
The following is example output::
{
"validationErrors": [],
"errored": false,
"validationWarnings": []
}
awscli-1.18.69/awscli/examples/datapipeline/describe-pipelines.rst 0000644 0000000 0000000 00000003042 13664010074 025157 0 ustar root root 0000000 0000000 **To describe your pipelines**
This example describes the specified pipeline::
aws datapipeline describe-pipelines --pipeline-ids df-00627471SOVYZEXAMPLE
The following is example output::
{
"pipelineDescriptionList": [
{
"fields": [
{
"stringValue": "PENDING",
"key": "@pipelineState"
},
{
"stringValue": "my-pipeline",
"key": "name"
},
{
"stringValue": "2015-04-07T16:05:58",
"key": "@creationTime"
},
{
"stringValue": "df-00627471SOVYZEXAMPLE",
"key": "@id"
},
{
"stringValue": "123456789012",
"key": "pipelineCreator"
},
{
"stringValue": "PIPELINE",
"key": "@sphere"
},
{
"stringValue": "123456789012",
"key": "@userId"
},
{
"stringValue": "123456789012",
"key": "@accountId"
},
{
"stringValue": "my-pipeline-token",
"key": "uniqueId"
}
],
"pipelineId": "df-00627471SOVYZEXAMPLE",
"name": "my-pipeline",
"tags": []
}
]
}
awscli-1.18.69/awscli/examples/ec2/ 0000755 0000000 0000000 00000000000 13664010277 016677 5 ustar root root 0000000 0000000 awscli-1.18.69/awscli/examples/ec2/delete-traffic-mirror-filter-rule.rst 0000644 0000000 0000000 00000001106 13664010074 026040 0 ustar root root 0000000 0000000 **To delete a traffic mirror filter rule**
The following ``delete-traffic-mirror-filter-rule`` example deletes the specified traffic mirror filter rule. ::
aws ec2 delete-traffic-mirror-filter-rule \
--traffic-mirror-filter-rule-id tmfr-081f71283bEXAMPLE
Output::
{
"TrafficMirrorFilterRuleId": "tmfr-081f71283bEXAMPLE"
}
For more information, see `Modify Your Traffic Mirror Filter Rules `__ in the *AWS Traffic Mirroring Guide*.
awscli-1.18.69/awscli/examples/ec2/delete-route-table.rst 0000644 0000000 0000000 00000000304 13664010074 023104 0 ustar root root 0000000 0000000 **To delete a route table**
This example deletes the specified route table. If the command succeeds, no output is returned.
Command::
aws ec2 delete-route-table --route-table-id rtb-22574640
awscli-1.18.69/awscli/examples/ec2/describe-instance-status.rst 0000644 0000000 0000000 00000002022 13664010074 024323 0 ustar root root 0000000 0000000 **To describe the status of an instance**
This example describes the current status of the specified instance.
Command::
aws ec2 describe-instance-status --instance-id i-1234567890abcdef0
Output::
{
"InstanceStatuses": [
{
"InstanceId": "i-1234567890abcdef0",
"InstanceState": {
"Code": 16,
"Name": "running"
},
"AvailabilityZone": "us-east-1d",
"SystemStatus": {
"Status": "ok",
"Details": [
{
"Status": "passed",
"Name": "reachability"
}
]
},
"InstanceStatus": {
"Status": "ok",
"Details": [
{
"Status": "passed",
"Name": "reachability"
}
]
}
}
]
}
awscli-1.18.69/awscli/examples/ec2/delete-vpc-endpoint-service-configurations.rst 0000644 0000000 0000000 00000000405 13664010074 027757 0 ustar root root 0000000 0000000 **To delete an endpoint service configuration**
This example deletes the specified endpoint service configuration.
Command::
aws ec2 delete-vpc-endpoint-service-configurations --service-ids vpce-svc-03d5ebb7d9579a2b3
Output::
{
"Unsuccessful": []
} awscli-1.18.69/awscli/examples/ec2/delete-key-pair.rst 0000644 0000000 0000000 00000000571 13664010074 022410 0 ustar root root 0000000 0000000 **To delete a key pair**
This example deletes the key pair named ``MyKeyPair``. If the command succeeds, no output is returned.
Command::
aws ec2 delete-key-pair --key-name MyKeyPair
For more information, see `Using Key Pairs`_ in the *AWS Command Line Interface User Guide*.
.. _`Using Key Pairs`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-keypairs.html
awscli-1.18.69/awscli/examples/ec2/replace-iam-instance-profile-association.rst 0000644 0000000 0000000 00000001411 13664010074 027352 0 ustar root root 0000000 0000000 **To replace an IAM instance profile for an instance**
This example replaces the IAM instance profile represented by the association ``iip-assoc-060bae234aac2e7fa`` with the IAM instance profile named ``AdminRole``. ::
aws ec2 replace-iam-instance-profile-association \
--iam-instance-profile Name=AdminRole \
--association-id iip-assoc-060bae234aac2e7fa
Output::
{
"IamInstanceProfileAssociation": {
"InstanceId": "i-087711ddaf98f9489",
"State": "associating",
"AssociationId": "iip-assoc-0b215292fab192820",
"IamInstanceProfile": {
"Id": "AIPAJLNLDX3AMYZNWYYAY",
"Arn": "arn:aws:iam::123456789012:instance-profile/AdminRole"
}
}
}
awscli-1.18.69/awscli/examples/ec2/modify-subnet-attribute.rst 0000644 0000000 0000000 00000001536 13664010074 024217 0 ustar root root 0000000 0000000 **To change a subnet's public IPv4 addressing behavior**
This example modifies subnet-1a2b3c4d to specify that all instances launched into this subnet are assigned a public IPv4 address. If the command succeeds, no output is returned.
Command::
aws ec2 modify-subnet-attribute --subnet-id subnet-1a2b3c4d --map-public-ip-on-launch
**To change a subnet's IPv6 addressing behavior**
This example modifies subnet-1a2b3c4d to specify that all instances launched into this subnet are assigned an IPv6 address from the range of the subnet.
Command::
aws ec2 modify-subnet-attribute --subnet-id subnet-1a2b3c4d --assign-ipv6-address-on-creation
For more information, see `IP Addressing in Your VPC`_ in the *AWS Virtual Private Cloud User Guide*.
.. _`IP Addressing in Your VPC`: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-ip-addressing.html awscli-1.18.69/awscli/examples/ec2/create-snapshot.rst 0000644 0000000 0000000 00000002774 13664010074 022536 0 ustar root root 0000000 0000000 **To create a snapshot**
This example command creates a snapshot of the volume with a volume ID of ``vol-1234567890abcdef0`` and a short description to identify the snapshot.
Command::
aws ec2 create-snapshot --volume-id vol-1234567890abcdef0 --description "This is my root volume snapshot"
Output::
{
"Description": "This is my root volume snapshot",
"Tags": [],
"Encrypted": false,
"VolumeId": "vol-1234567890abcdef0",
"State": "pending",
"VolumeSize": 8,
"StartTime": "2018-02-28T21:06:01.000Z",
"Progress": "",
"OwnerId": "012345678910",
"SnapshotId": "snap-066877671789bd71b"
}
**To create a snapshot with tags**
This example command creates a snapshot and applies two tags: purpose=prod and costcenter=123.
Command::
aws ec2 create-snapshot --volume-id vol-1234567890abcdef0 --description 'Prod backup' --tag-specifications 'ResourceType=snapshot,Tags=[{Key=purpose,Value=prod},{Key=costcenter,Value=123}]'
Output::
{
"Description": "Prod backup",
"Tags": [
{
"Value": "prod",
"Key": "purpose"
},
{
"Value": "123",
"Key": "costcenter"
}
],
"Encrypted": false,
"VolumeId": "vol-1234567890abcdef0",
"State": "pending",
"VolumeSize": 8,
"StartTime": "2018-02-28T21:06:06.000Z",
"Progress": "",
"OwnerId": "012345678910",
"SnapshotId": "snap-09ed24a70bc19bbe4"
}
awscli-1.18.69/awscli/examples/ec2/describe-local-gateway-route-table-vpc-associations.rst 0000755 0000000 0000000 00000001414 13664010074 031442 0 ustar root root 0000000 0000000 **To describe the associations between VPCs and local gateway route tables**
The following ``describe-local-gateway-route-table-vpc-associations`` example displays details for the specified association between VPCs and local gateway route tables. ::
aws ec2 describe-local-gateway-route-table-vpc-associations \
--local-gateway-route-table-vpc-association-id lgw-vpc-assoc-0e0f27af15EXAMPLE
Output::
{
"LocalGatewayRouteTableVpcAssociation": {
"LocalGatewayRouteTableVpcAssociationId": "lgw-vpc-assoc-0e0f27af1EXAMPLE",
"LocalGatewayRouteTableId": "lgw-rtb-059615ef7dEXAMPLE",
"LocalGatewayId": "lgw-09b493aa7cEXAMPLE",
"VpcId": "vpc-0efe9bde08EXAMPLE",
"State": "associated"
}
}
awscli-1.18.69/awscli/examples/ec2/describe-reserved-instances-listings.rst 0000755 0000000 0000000 00000000527 13664010074 026647 0 ustar root root 0000000 0000000 **To describe a Reserved Instance listing**
The following ``describe-reserved-instances-listings`` example retrieves information about the specified Reserved Instance listing. ::
aws ec2 describe-reserved-instances-listings \
--reserved-instances-listing-id 5ec28771-05ff-4b9b-aa31-9e57dexample
This command produces no output.
awscli-1.18.69/awscli/examples/ec2/modify-identity-id-format.rst 0000755 0000000 0000000 00000002176 13664010074 024433 0 ustar root root 0000000 0000000 **To enable an IAM role to use longer IDs for a resource**
The following ``modify-identity-id-format`` example enables the IAM role ``EC2Role`` in your AWS account to use long ID format for the ``instance`` resource type. ::
aws ec2 modify-identity-id-format \
--principal-arn arn:aws:iam::123456789012:role/EC2Role \
--resource instance \
--use-long-ids
**To enable an IAM user to use longer IDs for a resource**
The following ``modify-identity-id-format`` example enables the IAM user ``AdminUser`` in your AWS account to use the longer ID format for the ``volume`` resource type. ::
aws ec2 modify-identity-id-format \
--principal-arn arn:aws:iam::123456789012:user/AdminUser \
--resource volume \
--use-long-ids
The following ``modify-identity-id-format`` example enables the IAM user ``AdminUser`` in your AWS account to use the longer ID format for all supported resource types that are within their opt-in period. ::
aws ec2 modify-identity-id-format \
--principal-arn arn:aws:iam::123456789012:user/AdminUser \
--resource all-current \
--use-long-ids
awscli-1.18.69/awscli/examples/ec2/describe-export-tasks.rst 0000644 0000000 0000000 00000001447 13664010074 023654 0 ustar root root 0000000 0000000 **To list details about an instance export task**
This example describes the export task with ID export-i-fh8sjjsq.
Command::
aws ec2 describe-export-tasks --export-task-ids export-i-fh8sjjsq
Output::
{
"ExportTasks": [
{
"State": "active",
"InstanceExportDetails": {
"InstanceId": "i-1234567890abcdef0",
"TargetEnvironment": "vmware"
},
"ExportToS3Task": {
"S3Bucket": "myexportbucket",
"S3Key": "RHEL5export-i-fh8sjjsq.ova",
"DiskImageFormat": "vmdk",
"ContainerFormat": "ova"
},
"Description": "RHEL5 instance",
"ExportTaskId": "export-i-fh8sjjsq"
}
]
}
awscli-1.18.69/awscli/examples/ec2/describe-fpga-images.rst 0000644 0000000 0000000 00000001656 13664010074 023372 0 ustar root root 0000000 0000000 **To describe Amazon FPGA images**
This example describes AFIs that are owned by account ``123456789012``.
Command::
aws ec2 describe-fpga-images --filters Name=owner-id,Values=123456789012
Output::
{
"FpgaImages": [
{
"UpdateTime": "2017-12-22T12:09:14.000Z",
"Name": "my-afi",
"PciId": {
"SubsystemVendorId": "0xfedd",
"VendorId": "0x1d0f",
"DeviceId": "0xf000",
"SubsystemId": "0x1d51"
},
"FpgaImageGlobalId": "agfi-123cb27b5e84a0abc",
"Public": false,
"State": {
"Code": "available"
},
"ShellVersion": "0x071417d3",
"OwnerId": "123456789012",
"FpgaImageId": "afi-0d123e123bfc85abc",
"CreateTime": "2017-12-22T11:43:33.000Z",
"Description": "my-afi"
}
]
} awscli-1.18.69/awscli/examples/ec2/describe-import-snapshot-tasks.rst 0000755 0000000 0000000 00000003521 13664010074 025500 0 ustar root root 0000000 0000000 **To monitor an import snapshot task**
The following ``describe-import-snapshot-tasks`` example checks the status of the specified import snapshot task. ::
aws ec2 describe-import-snapshot-tasks \
--import-task-ids import-snap-1234567890abcdef0
Output for an import snapshot task that is in progress::
{
"ImportSnapshotTasks": [
{
"Description": "My server VMDK",
"ImportTaskId": "import-snap-1234567890abcdef0",
"SnapshotTaskDetail": {
"Description": "My server VMDK",
"DiskImageSize": "705638400.0",
"Format": "VMDK",
"Progress": "42",
"Status": "active",
"StatusMessage": "downloading/converting",
"UserBucket": {
"S3Bucket": "my-import-bucket",
"S3Key": "vms/my-server-vm.vmdk"
}
}
}
]
}
Output for an import snapshot task that is completed. The ID of the resulting snapshot is provided by ``SnapshotId``. ::
{
"ImportSnapshotTasks": [
{
"Description": "My server VMDK",
"ImportTaskId": "import-snap-1234567890abcdef0",
"SnapshotTaskDetail": {
"Description": "My server VMDK",
"DiskImageSize": "705638400.0",
"Format": "VMDK",
"SnapshotId": "snap-1234567890abcdef0"
"Status": "completed",
"UserBucket": {
"S3Bucket": "my-import-bucket",
"S3Key": "vms/my-server-vm.vmdk"
}
}
}
]
}
awscli-1.18.69/awscli/examples/ec2/create-volume.rst 0000644 0000000 0000000 00000006461 13664010074 022203 0 ustar root root 0000000 0000000 **To create an empty General Purpose SSD (gp2) volume**
The following ``create-volume`` example creates an 80 GiB General Purpose SSD (gp2) volume in the specified Availability Zone. Note that the current Region must be ``us-east-1``, or you can add the ``--region`` parameter to specify the Region for the command. ::
aws ec2 create-volume \
--volume-type gp2 \
--size 80 \
--availability-zone us-east-1a
Output::
{
"AvailabilityZone": "us-east-1a",
"Tags": [],
"Encrypted": false,
"VolumeType": "gp2",
"VolumeId": "vol-1234567890abcdef0",
"State": "creating",
"Iops": 240,
"SnapshotId": "",
"CreateTime": "YYYY-MM-DDTHH:MM:SS.000Z",
"Size": 80
}
If you do not specify a volume type, the default volume type is ``gp2``. ::
aws ec2 create-volume \
--size 80 \
--availability-zone us-east-1a
**Example 2: To create a Provisioned IOPS SSD (io1) volume from a snapshot**
The following ``create-volume`` example creates a Provisioned IOPS SSD (io1) volume with 1000 provisioned IOPS in the specified Availability Zone using the specified snapshot. ::
aws ec2 create-volume \
--volume-type io1 \
--iops 1000 \
--snapshot-id snap-066877671789bd71b \
--availability-zone us-east-1a
Output::
{
"AvailabilityZone": "us-east-1a",
"Tags": [],
"Encrypted": false,
"VolumeType": "io1",
"VolumeId": "vol-1234567890abcdef0",
"State": "creating",
"Iops": 1000,
"SnapshotId": "snap-066877671789bd71b",
"CreateTime": "YYYY-MM-DDTHH:MM:SS.000Z",
"Size": 500
}
**Example 3: To create an encrypted volume**
The following ``create-volume`` example creates an encrypted volume using the default CMK for EBS encryption. If encryption by default is disabled, you must specify the ``--encrypted`` parameter as follows. ::
aws ec2 create-volume \
--size 80 \
--encrypted \
--availability-zone us-east-1a
Output::
{
"AvailabilityZone": "us-east-1a",
"Tags": [],
"Encrypted": true,
"VolumeType": "gp2",
"VolumeId": "vol-1234567890abcdef0",
"State": "creating",
"Iops": 240,
"SnapshotId": "",
"CreateTime": "YYYY-MM-DDTHH:MM:SS.000Z",
"Size": 80
}
If encryption by default is enabled, the following example command creates an encrypted volume, even without the ``--encrypted`` parameter. ::
aws ec2 create-volume \
--size 80 \
--availability-zone us-east-1a
If you use the ``--kms-key-id`` parameter to specify a customer managed CMK, you must specify the ``--encrypted`` parameter even if encryption by default is enabled. ::
aws ec2 create-volume \
--volume-type gp2 \
--size 80 \
--encrypted \
--kms-key-id 0ea3fef3-80a7-4778-9d8c-1c0c6EXAMPLE \
--availability-zone us-east-1a
**Example 4: To create a volume with tags**
The following ``create-volume`` example creates a volume and adds two tags. ::
aws ec2 create-volume \
--availability-zone us-east-1a \
--volume-type gp2 \
--size 80 \
--tag-specifications 'ResourceType=volume,Tags=[{Key=purpose,Value=production},{Key=cost-center,Value=cc123}]'
awscli-1.18.69/awscli/examples/ec2/release-address.rst 0000644 0000000 0000000 00000000762 13664010074 022474 0 ustar root root 0000000 0000000 **To release an Elastic IP addresses for EC2-Classic**
This example releases an Elastic IP address for use with instances in EC2-Classic. If the command succeeds, no output is returned.
Command::
aws ec2 release-address --public-ip 198.51.100.0
**To release an Elastic IP address for EC2-VPC**
This example releases an Elastic IP address for use with instances in a VPC. If the command succeeds, no output is returned.
Command::
aws ec2 release-address --allocation-id eipalloc-64d5890a
awscli-1.18.69/awscli/examples/ec2/describe-vpc-endpoints.rst 0000644 0000000 0000000 00000006002 13664010074 023771 0 ustar root root 0000000 0000000 **To describe your VPC endpoints**
The following ``describe-vpc-endpoints`` example displays details for all of your endpoints. ::
aws ec2 describe-vpc-endpoints
Output::
{
"VpcEndpoints": [
{
"PolicyDocument": "{\"Version\":\"2008-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"*\",\"Resource\":\"*\"}]}",
"VpcId": "vpc-aabb1122",
"NetworkInterfaceIds": [],
"SubnetIds": [],
"PrivateDnsEnabled": true,
"State": "available",
"ServiceName": "com.amazonaws.us-east-1.dynamodb",
"RouteTableIds": [
"rtb-3d560345"
],
"Groups": [],
"VpcEndpointId": "vpce-032a826a",
"VpcEndpointType": "Gateway",
"CreationTimestamp": "2017-09-05T20:41:28Z",
"DnsEntries": [],
"OwnerId": "123456789012"
},
{
"PolicyDocument": "{\n \"Statement\": [\n {\n \"Action\": \"*\", \n \"Effect\": \"Allow\", \n \"Principal\": \"*\", \n \"Resource\": \"*\"\n }\n ]\n}",
"VpcId": "vpc-1a2b3c4d",
"NetworkInterfaceIds": [
"eni-2ec2b084",
"eni-1b4a65cf"
],
"SubnetIds": [
"subnet-d6fcaa8d",
"subnet-7b16de0c"
],
"PrivateDnsEnabled": false,
"State": "available",
"ServiceName": "com.amazonaws.us-east-1.elasticloadbalancing",
"RouteTableIds": [],
"Groups": [
{
"GroupName": "default",
"GroupId": "sg-54e8bf31"
}
],
"VpcEndpointId": "vpce-0f89a33420c1931d7",
"VpcEndpointType": "Interface",
"CreationTimestamp": "2017-09-05T17:55:27.583Z",
"DnsEntries": [
{
"HostedZoneId": "Z7HUB22UULQXV",
"DnsName": "vpce-0f89a33420c1931d7-bluzidnv.elasticloadbalancing.us-east-1.vpce.amazonaws.com"
},
{
"HostedZoneId": "Z7HUB22UULQXV",
"DnsName": "vpce-0f89a33420c1931d7-bluzidnv-us-east-1b.elasticloadbalancing.us-east-1.vpce.amazonaws.com"
},
{
"HostedZoneId": "Z7HUB22UULQXV",
"DnsName": "vpce-0f89a33420c1931d7-bluzidnv-us-east-1a.elasticloadbalancing.us-east-1.vpce.amazonaws.com"
}
],
"OwnerId": "123456789012"
}
]
}
For more information, see `Modifying a Gateway Endpoint `__ in the *AWS VPC User Guide*.
awscli-1.18.69/awscli/examples/ec2/get-ebs-encryption-by-default.rst 0000644 0000000 0000000 00000001017 13664010074 025173 0 ustar root root 0000000 0000000 **To describe whether EBS encryption by default is enabled**
The following ``get-ebs-encryption-by-default`` example indicates whether EBS encryption by default is enabled for your AWS account in the current Region. ::
aws ec2 get-ebs-encryption-by-default
The following output indicates that EBS encryption by default is disabled. ::
{
"EbsEncryptionByDefault": false
}
The following output indicates that EBS encryption by default is enabled. ::
{
"EbsEncryptionByDefault": true
}
awscli-1.18.69/awscli/examples/ec2/describe-stale-security-groups.rst 0000644 0000000 0000000 00000004051 13664010074 025474 0 ustar root root 0000000 0000000 **To describe stale security groups**
This example describes stale security group rules for ``vpc-11223344``. The response shows that sg-5fa68d3a in your account has a stale ingress SSH rule that references ``sg-279ab042`` in the peer VPC, and that ``sg-fe6fba9a`` in your account has a stale egress SSH rule that references ``sg-ef6fba8b`` in the peer VPC.
Command::
aws ec2 describe-stale-security-groups --vpc-id vpc-11223344
Output::
{
"StaleSecurityGroupSet": [
{
"VpcId": "vpc-11223344",
"StaleIpPermissionsEgress": [
{
"ToPort": 22,
"FromPort": 22,
"UserIdGroupPairs": [
{
"VpcId": "vpc-7a20e51f",
"GroupId": "sg-ef6fba8b",
"VpcPeeringConnectionId": "pcx-b04deed9",
"PeeringStatus": "active"
}
],
"IpProtocol": "tcp"
}
],
"GroupName": "MySG1",
"StaleIpPermissions": [],
"GroupId": "sg-fe6fba9a",
"Description": MySG1"
},
{
"VpcId": "vpc-11223344",
"StaleIpPermissionsEgress": [],
"GroupName": "MySG2",
"StaleIpPermissions": [
{
"ToPort": 22,
"FromPort": 22,
"UserIdGroupPairs": [
{
"VpcId": "vpc-7a20e51f",
"GroupId": "sg-279ab042",
"Description": "Access from pcx-b04deed9",
"VpcPeeringConnectionId": "pcx-b04deed9",
"PeeringStatus": "active"
}
],
"IpProtocol": "tcp"
}
],
"GroupId": "sg-5fa68d3a",
"Description": "MySG2"
}
]
} awscli-1.18.69/awscli/examples/ec2/describe-capacity-reservations.rst 0000644 0000000 0000000 00000005530 13664010074 025524 0 ustar root root 0000000 0000000 **Example 1: To describe one or more of your capacity reservations**
The following ``describe-capacity-reservations`` example displays details about all of your capacity reservations in the current AWS Region. ::
aws ec2 describe-capacity-reservations
Output::
{
"CapacityReservations": [
{
"CapacityReservationId": "cr-1234abcd56EXAMPLE ",
"EndDateType": "unlimited",
"AvailabilityZone": "eu-west-1a",
"InstanceMatchCriteria": "open",
"Tags": [],
"EphemeralStorage": false,
"CreateDate": "2019-08-16T09:03:18.000Z",
"AvailableInstanceCount": 1,
"InstancePlatform": "Linux/UNIX",
"TotalInstanceCount": 1,
"State": "active",
"Tenancy": "default",
"EbsOptimized": true,
"InstanceType": "a1.medium"
},
{
"CapacityReservationId": "cr-abcdEXAMPLE9876ef ",
"EndDateType": "unlimited",
"AvailabilityZone": "eu-west-1a",
"InstanceMatchCriteria": "open",
"Tags": [],
"EphemeralStorage": false,
"CreateDate": "2019-08-07T11:34:19.000Z",
"AvailableInstanceCount": 3,
"InstancePlatform": "Linux/UNIX",
"TotalInstanceCount": 3,
"State": "cancelled",
"Tenancy": "default",
"EbsOptimized": true,
"InstanceType": "m5.large"
}
]
}
**Example 2: To describe one or more of your capacity reservations**
The following ``describe-capacity-reservations`` example displays details about the specified capacity reservation. ::
aws ec2 describe-capacity-reservations \
--capacity-reserveration-id cr-1234abcd56EXAMPLE
Output::
{
"CapacityReservations": [
{
"CapacityReservationId": "cr-1234abcd56EXAMPLE",
"EndDateType": "unlimited",
"AvailabilityZone": "eu-west-1a",
"InstanceMatchCriteria": "open",
"Tags": [],
"EphemeralStorage": false,
"CreateDate": "2019-08-16T09:03:18.000Z",
"AvailableInstanceCount": 1,
"InstancePlatform": "Linux/UNIX",
"TotalInstanceCount": 1,
"State": "active",
"Tenancy": "default",
"EbsOptimized": true,
"InstanceType": "a1.medium"
}
]
}
For more information, see `Viewing a Capacity Reservation `__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*.
awscli-1.18.69/awscli/examples/ec2/monitor-instances.rst 0000644 0000000 0000000 00000000623 13664010074 023101 0 ustar root root 0000000 0000000 **To enable detailed monitoring for an instance**
This example command enables detailed monitoring for the specified instance.
Command::
aws ec2 monitor-instances --instance-ids i-1234567890abcdef0
Output::
{
"InstanceMonitorings": [
{
"InstanceId": "i-1234567890abcdef0",
"Monitoring": {
"State": "pending"
}
}
]
}
awscli-1.18.69/awscli/examples/ec2/describe-vpc-classic-link-dns-support.rst 0000644 0000000 0000000 00000000640 13664010074 026640 0 ustar root root 0000000 0000000 **To describe ClassicLink DNS support for your VPCs**
This example describes the ClassicLink DNS support status of all of your VPCs.
Command::
aws ec2 describe-vpc-classic-link-dns-support
Output::
{
"Vpcs": [
{
"VpcId": "vpc-88888888",
"ClassicLinkDnsSupported": true
},
{
"VpcId": "vpc-1a2b3c4d",
"ClassicLinkDnsSupported": false
}
]
} awscli-1.18.69/awscli/examples/ec2/export-client-vpn-client-configuration.rst 0000644 0000000 0000000 00000003576 13664010074 027156 0 ustar root root 0000000 0000000 **To export the client configuration**
The following ``export-client-vpn-client-configuration`` example exports the client configuration for the specified Client VPN endpoint. In this example, the output is returned in text format to make it easier to read. ::
aws ec2 export-client-vpn-client-configuration \
--client-vpn-endpoint-id cvpn-endpoint-123456789123abcde \
--output text
Output::
client
dev tun
proto udp
remote cvpn-endpoint-123456789123abcde.prod.clientvpn.ap-south-1.amazonaws.com 443
remote-random-hostname
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-GCM
verb 3
-----BEGIN CERTIFICATE-----
MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC
VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6
b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd
BgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcN
MTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYD
VQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25z
b2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFt
YXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ
21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9T
rDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpE
Ibb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4
nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0Fkb
FFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTb
NYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE=
-----END CERTIFICATE-----
reneg-sec 0
For more information, see `Client VPN Endpoints `__ in the *AWS Client VPN Administrator Guide*.
awscli-1.18.69/awscli/examples/ec2/describe-export-image-tasks.rst 0000755 0000000 0000000 00000002352 13664010074 024733 0 ustar root root 0000000 0000000 **To monitor an export image task**
The following ``describe-export-image-tasks`` example checks the status of the specified export image task. ::
aws ec2 describe-export-image-tasks \
--export-image-task-id export-ami-1234567890abcdef0
Output for an export image task that is in progress::
{
"ExportImageTasks": [
{
"ExportImageTaskId": "export-ami-1234567890abcdef0"
"Progress": "21",
"S3ExportLocation": {
"S3Bucket": "my-export-bucket",
"S3Prefix": "exports/"
},
"Status": "active",
"StatusMessage": "updating"
}
]
}
Output for an export image task that is completed. The resulting image file in Amazon S3 is ``my-export-bucket/exports/export-ami-1234567890abcdef0.vmdk``. ::
{
"ExportImageTasks": [
{
"ExportImageTaskId": "export-ami-1234567890abcdef0"
"S3ExportLocation": {
"S3Bucket": "my-export-bucket",
"S3Prefix": "exports/"
},
"Status": "completed"
}
]
}
awscli-1.18.69/awscli/examples/ec2/unassign-ipv6-addresses.rst 0000644 0000000 0000000 00000000662 13664010074 024114 0 ustar root root 0000000 0000000 **To unassign an IPv6 address from a network interface**
This example unassigns the specified IPv6 address from the specified network interface.
Command::
aws ec2 unassign-ipv6-addresses --ipv6-addresses 2001:db8:1234:1a00:3304:8879:34cf:4071 --network-interface-id eni-23c49b68
Output::
{
"NetworkInterfaceId": "eni-23c49b68",
"UnassignedIpv6Addresses": [
"2001:db8:1234:1a00:3304:8879:34cf:4071"
]
}
awscli-1.18.69/awscli/examples/ec2/reset-network-interface-attribute.rst 0000755 0000000 0000000 00000000523 13664010074 026177 0 ustar root root 0000000 0000000 **To reset a network interface attribute**
The following ``reset-network-interface-attribute`` example resets the value of the source/destination checking attribute to ``true``. ::
aws ec2 reset-network-interface-attribute \
--network-interface-id eni-686ea200 \
--source-dest-check
This command produces no output.
awscli-1.18.69/awscli/examples/ec2/describe-client-vpn-routes.rst 0000644 0000000 0000000 00000002405 13664010074 024601 0 ustar root root 0000000 0000000 **To describe the routes for a Client VPN endpoint**
The following ``describe-client-vpn-routes`` example displays details about the routes for the specified Client VPN endpoint. ::
aws ec2 describe-client-vpn-routes \
--client-vpn-endpoint-id cvpn-endpoint-123456789123abcde
Output::
{
"Routes": [
{
"ClientVpnEndpointId": "cvpn-endpoint-123456789123abcde",
"DestinationCidr": "10.0.0.0/16",
"TargetSubnet": "subnet-0123456789abcabca",
"Type": "Nat",
"Origin": "associate",
"Status": {
"Code": "active"
},
"Description": "Default Route"
},
{
"ClientVpnEndpointId": "cvpn-endpoint-123456789123abcde",
"DestinationCidr": "0.0.0.0/0",
"TargetSubnet": "subnet-0123456789abcabca",
"Type": "Nat",
"Origin": "add-route",
"Status": {
"Code": "active"
}
}
]
}
For more information, see `Routes `__ in the *AWS Client VPN Administrator Guide*.
awscli-1.18.69/awscli/examples/ec2/describe-spot-fleet-request-history.rst 0000644 0000000 0000000 00000003242 13664010074 026452 0 ustar root root 0000000 0000000 **To describe Spot fleet history**
This example command returns the history for the specified Spot fleet starting at the specified time.
Command::
aws ec2 describe-spot-fleet-request-history --spot-fleet-request-id sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE --start-time 2015-05-26T00:00:00Z
The following example output shows the successful launches of two Spot Instances for the Spot fleet.
Output::
{
"HistoryRecords": [
{
"Timestamp": "2015-05-26T23:17:20.697Z",
"EventInformation": {
"EventSubType": "submitted"
},
"EventType": "fleetRequestChange"
},
{
"Timestamp": "2015-05-26T23:17:20.873Z",
"EventInformation": {
"EventSubType": "active"
},
"EventType": "fleetRequestChange"
},
{
"Timestamp": "2015-05-26T23:21:21.712Z",
"EventInformation": {
"InstanceId": "i-1234567890abcdef0",
"EventSubType": "launched"
},
"EventType": "instanceChange"
},
{
"Timestamp": "2015-05-26T23:21:21.816Z",
"EventInformation": {
"InstanceId": "i-1234567890abcdef1",
"EventSubType": "launched"
},
"EventType": "instanceChange"
}
],
"SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE",
"NextToken": "CpHNsscimcV5oH7bSbub03CI2Qms5+ypNpNm+53MNlR0YcXAkp0xFlfKf91yVxSExmbtma3awYxMFzNA663ZskT0AHtJ6TCb2Z8bQC2EnZgyELbymtWPfpZ1ZbauVg+P+TfGlWxWWB/Vr5dk5d4LfdgA/DRAHUrYgxzrEXAMPLE=",
"StartTime": "2015-05-26T00:00:00Z"
}
awscli-1.18.69/awscli/examples/ec2/delete-volume.rst 0000644 0000000 0000000 00000000360 13664010074 022172 0 ustar root root 0000000 0000000 **To delete a volume**
This example command deletes an available volume with the volume ID of ``vol-049df61146c4d7901``. If the command succeeds, no output is returned.
Command::
aws ec2 delete-volume --volume-id vol-049df61146c4d7901
awscli-1.18.69/awscli/examples/ec2/deregister-image.rst 0000644 0000000 0000000 00000000265 13664010074 022644 0 ustar root root 0000000 0000000 **To deregister an AMI**
This example deregisters the specified AMI. If the command succeeds, no output is returned.
Command::
aws ec2 deregister-image --image-id ami-4fa54026
awscli-1.18.69/awscli/examples/ec2/create-network-interface-permission.rst 0000644 0000000 0000000 00000001203 13664010074 026476 0 ustar root root 0000000 0000000 **To create a network interface permission**
This example grants permission to account ``123456789012`` to attach network interface ``eni-1a2b3c4d`` to an instance.
Command::
aws ec2 create-network-interface-permission --network-interface-id eni-1a2b3c4d --aws-account-id 123456789012 --permission INSTANCE-ATTACH
Output::
{
"InterfacePermission": {
"PermissionState": {
"State": "GRANTED"
},
"NetworkInterfacePermissionId": "eni-perm-06fd19020ede149ea",
"NetworkInterfaceId": "eni-1a2b3c4d",
"Permission": "INSTANCE-ATTACH",
"AwsAccountId": "123456789012"
}
} awscli-1.18.69/awscli/examples/ec2/create-local-gateway-route.rst 0000755 0000000 0000000 00000001221 13664010074 024551 0 ustar root root 0000000 0000000 **To create a static route for a local gateway route table**
The following ``create-local-gateway-route`` example creates the specified route in the specified local gateway route table. ::
aws ec2 create-local-gateway-route \
--destination-cidr-block 0.0.0.0/0 \
--local-gateway-route-table-id lgw-rtb-059615ef7dEXAMPLE
Output::
{
"Route": {
"DestinationCidrBlock": "0.0.0.0/0",
"LocalGatewayVirtualInterfaceGroupId": "lgw-vif-grp-07145b276bEXAMPLE",
"Type": "static",
"State": "deleted",
"LocalGatewayRouteTableId": "lgw-rtb-059615ef7dEXAMPLE"
}
}
awscli-1.18.69/awscli/examples/ec2/detach-volume.rst 0000644 0000000 0000000 00000000657 13664010074 022171 0 ustar root root 0000000 0000000 **To detach a volume from an instance**
This example command detaches the volume (``vol-049df61146c4d7901``) from the instance it is attached to.
Command::
aws ec2 detach-volume --volume-id vol-1234567890abcdef0
Output::
{
"AttachTime": "2014-02-27T19:23:06.000Z",
"InstanceId": "i-1234567890abcdef0",
"VolumeId": "vol-049df61146c4d7901",
"State": "detaching",
"Device": "/dev/sdb"
} awscli-1.18.69/awscli/examples/ec2/delete-route.rst 0000644 0000000 0000000 00000000364 13664010074 022025 0 ustar root root 0000000 0000000 **To delete a route**
This example deletes the specified route from the specified route table. If the command succeeds, no output is returned.
Command::
aws ec2 delete-route --route-table-id rtb-22574640 --destination-cidr-block 0.0.0.0/0
awscli-1.18.69/awscli/examples/ec2/import-client-vpn-client-certificate-revocation-list.rst 0000644 0000000 0000000 00000001307 13664010074 031670 0 ustar root root 0000000 0000000 **To import a client certificate revocation list**
The following ``import-client-vpn-client-certificate-revocation-list`` example imports a client certificate revocation list to the Client VPN endpoint by specifying the location of the file on the local computer. ::
aws ec2 import-client-vpn-client-certificate-revocation-list \
--certificate-revocation-list file:///path/to/crl.pem \
--client-vpn-endpoint-id cvpn-endpoint-123456789123abcde
Output::
{
"Return": true
}
For more information, see `Client Certificate Revocation Lists `__ in the *AWS Client VPN Administrator Guide*.
awscli-1.18.69/awscli/examples/ec2/delete-client-vpn-route.rst 0000644 0000000 0000000 00000001201 13664010074 024071 0 ustar root root 0000000 0000000 **To delete a route for a Client VPN endpoint**
The following ``delete-client-vpn-route`` example deletes the ``0.0.0.0/0`` route for the specified subnet of a Client VPN endpoint. ::
aws ec2 delete-client-vpn-route \
--client-vpn-endpoint-id cvpn-endpoint-123456789123abcde \
--destination-cidr-block 0.0.0.0/0 \
--target-vpc-subnet-id subnet-0123456789abcabca
Output::
{
"Status": {
"Code": "deleting"
}
}
For more information, see `Routes `__ in the *AWS Client VPN Administrator Guide*.
awscli-1.18.69/awscli/examples/ec2/revoke-client-vpn-ingress.rst 0000644 0000000 0000000 00000001146 13664010074 024446 0 ustar root root 0000000 0000000 **To revoke an authorization rule for a Client VPN endpoint**
The following ``revoke-client-vpn-ingress`` example revokes a rule for internet access (``0.0.0.0/0``) for all groups. ::
aws ec2 revoke-client-vpn-ingress \
--client-vpn-endpoint-id cvpn-endpoint-123456789123abcde \
--target-network-cidr 0.0.0.0/0 --revoke-all-groups
Output::
{
"Status": {
"Code": "revoking"
}
}
For more information, see `Authorization Rules `__ in the *AWS Client VPN Administrator Guide*.
awscli-1.18.69/awscli/examples/ec2/create-spot-datafeed-subscription.rst 0000644 0000000 0000000 00000000635 13664010074 026133 0 ustar root root 0000000 0000000 **To create a Spot Instance datafeed**
This example command creates a Spot Instance data feed for the account.
Command::
aws ec2 create-spot-datafeed-subscription --bucket --prefix spotdata
Output::
{
"SpotDatafeedSubscription": {
"OwnerId": "",
"Prefix": "spotdata",
"Bucket": "",
"State": "Active"
}
}
awscli-1.18.69/awscli/examples/ec2/deregister-transit-gateway-multicast-group-source.rst 0000755 0000000 0000000 00000001652 13664010074 031344 0 ustar root root 0000000 0000000 **To deregister a source from the transit gateway multicast group**
This example deregisters the specified network interface group source from the multicast group. ::
aws ec2 register-transit-gateway-multicast-group-sources \
--transit-gateway-multicast-domain-id tgw-mcast-domain-0c4905cef79d6e597 \
--group-ip-address 224.0.1.0 \
--network-interface-ids eni-07f290fc3c090cbae
Output::
{
"DeregisteredMulticastGroupSources": {
"TransitGatewayMulticastDomainId": "tgw-mcast-domain-0c4905cef79d6e597",
"DeregisteredNetworkInterfaceIds": [
"eni-07f290fc3c090cbae"
],
"GroupIpAddress": "224.0.1.0"
}
}
For more information, see `Deregister Sources from a Multicast Group `__ in the *AWS Transit Gateways User Guide*.
awscli-1.18.69/awscli/examples/ec2/delete-network-interface-permission.rst 0000644 0000000 0000000 00000000413 13664010074 026477 0 ustar root root 0000000 0000000 **To delete a network interface permission**
This example deletes the specified network interface permission.
Command::
aws ec2 delete-network-interface-permission --network-interface-permission-id eni-perm-06fd19020ede149ea
Output::
{
"Return": true
} awscli-1.18.69/awscli/examples/ec2/create-default-vpc.rst 0000644 0000000 0000000 00000000641 13664010074 023100 0 ustar root root 0000000 0000000 **To create a default VPC**
This example creates a default VPC.
Command::
aws ec2 create-default-vpc
Output::
{
"Vpc": {
"VpcId": "vpc-8eaae5ea",
"InstanceTenancy": "default",
"Tags": [],
"Ipv6CidrBlockAssociationSet": [],
"State": "pending",
"DhcpOptionsId": "dopt-af0c32c6",
"CidrBlock": "172.31.0.0/16",
"IsDefault": true
}
} awscli-1.18.69/awscli/examples/ec2/get-host-reservation-purchase-preview.rst 0000644 0000000 0000000 00000001334 13664010074 027005 0 ustar root root 0000000 0000000 **To get a purchase preview for a Dedicated Host Reservation**
This example provides a preview of the costs for a specified Dedicated Host Reservation for the specified Dedicated Host in your account.
Command::
aws ec2 get-host-reservation-purchase-preview --offering-id hro-03f707bf363b6b324 --host-id-set h-013abcd2a00cbd123
Output::
{
"TotalHourlyPrice": "1.499",
"Purchase": [
{
"HourlyPrice": "1.499",
"InstanceFamily": "m4",
"PaymentOption": "NoUpfront",
"HostIdSet": [
"h-013abcd2a00cbd123"
],
"UpfrontPrice": "0.000",
"Duration": 31536000
}
],
"TotalUpfrontPrice": "0.000"
} awscli-1.18.69/awscli/examples/ec2/describe-snapshots.rst 0000644 0000000 0000000 00000003766 13664010074 023240 0 ustar root root 0000000 0000000 **Example 1: To describe a snapshot**
The following ``describe-snapshots`` example describes the specified snapshot. ::
aws ec2 describe-snapshots \
--snapshot-ids snap-1234567890abcdef0
Output::
{
"Snapshots": [
{
"Description": "This is my snapshot",
"Encrypted": false,
"VolumeId": "vol-049df61146c4d7901",
"State": "completed",
"VolumeSize": 8,
"StartTime": "2014-02-28T21:28:32.000Z",
"Progress": "100%",
"OwnerId": "012345678910",
"SnapshotId": "snap-1234567890abcdef0"
}
]
}
**Example 2: To describe snapshots using filters**
The following ``describe-snapshots`` example describes all snapshots owned by the specified AWS account that are in the ``pending`` state. ::
aws ec2 describe-snapshots \
--owner-ids 012345678910 \
--filters Name=status,Values=pending
Output::
{
"Snapshots": [
{
"Description": "This is my copied snapshot",
"Encrypted": true,
"VolumeId": "vol-1234567890abcdef0",
"State": "pending",
"VolumeSize": 8,
"StartTime": "2014-02-28T21:37:27.000Z",
"Progress": "87%",
"OwnerId": "012345678910",
"SnapshotId": "snap-066877671789bd71b"
}
]
}
**Example 3: To describe tagged snapshots and filter the output**
The following ``describe-snapshots`` example describes all snapshots that have the tag ``Group=Prod``. The output is filtered to display only the snapshot IDs and the time the snapshot was started. ::
aws ec2 describe-snapshots \
--filters Name=tag:Group,Values=Prod \
--query "Snapshots[*].{ID:SnapshotId,Time:StartTime}"
Output::
[
{
"ID": "snap-1234567890abcdef0",
"Time": "2014-08-04T12:48:18.000Z"
}
]
awscli-1.18.69/awscli/examples/ec2/modify-ebs-default-kms-key-id.rst 0000644 0000000 0000000 00000000636 13664010074 025061 0 ustar root root 0000000 0000000 **To set your default CMK for EBS encryption**
The following ``modify-ebs-default-kms-key-id`` example sets the specified CMK as the default CMK for EBS encryption for your AWS account in the current Region. ::
aws ec2 modify-ebs-default-kms-key-id \
--kms-key-id alias/my-cmk
Output::
{
"KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/0ea3fef3-80a7-4778-9d8c-1c0c6EXAMPLE"
}
awscli-1.18.69/awscli/examples/ec2/delete-queued-reserved-instances.rst 0000755 0000000 0000000 00000001004 13664010074 025754 0 ustar root root 0000000 0000000 **To delete a queued purchase**
The following ``delete-queued-reserved-instances`` example deletes the specified Reserved Instance, which was queued for purchase. ::
aws ec2 delete-queued-reserved-instances \
--reserved-instances-ids af9f760e-6f91-4559-85f7-4980eexample
Output::
{
"SuccessfulQueuedPurchaseDeletions": [
{
"ReservedInstancesId": "af9f760e-6f91-4559-85f7-4980eexample"
}
],
"FailedQueuedPurchaseDeletions": []
}
awscli-1.18.69/awscli/examples/ec2/replace-route-table-association.rst 0000644 0000000 0000000 00000000535 13664010074 025575 0 ustar root root 0000000 0000000 **To replace the route table associated with a subnet**
This example associates the specified route table with the subnet for the specified route table association.
Command::
aws ec2 replace-route-table-association --association-id rtbassoc-781d0d1a --route-table-id rtb-22574640
Output::
{
"NewAssociationId": "rtbassoc-3a1f0f58"
} awscli-1.18.69/awscli/examples/ec2/modify-transit-gateway-vpc-attachment.rst 0000644 0000000 0000000 00000002166 13664010074 026755 0 ustar root root 0000000 0000000 **To modify a transit gateway VPC attachment**
The following ``modify-transit-gateway-vpc-attachment`` example adds a subnet to the specified transit gateway VPC attachment. ::
aws ec2 modify-transit-gateway-vpc-attachment \
--transit-gateway-attachment-id tgw-attach-09fbd47ddfEXAMPLE \
--add-subnet-ids subnet-0e51f45802EXAMPLE
Output::
{
"TransitGatewayVpcAttachment": {
"TransitGatewayAttachmentId": "tgw-attach-09fbd47ddfEXAMPLE",
"TransitGatewayId": "tgw-0560315ccfEXAMPLE",
"VpcId": "vpc-5eccc927",
"VpcOwnerId": "111122223333",
"State": "modifying",
"SubnetIds": [
"subnet-0e51f45802EXAMPLE",
"subnet-1EXAMPLE"
],
"CreationTime": "2019-08-08T16:47:38.000Z",
"Options": {
"DnsSupport": "enable",
"Ipv6Support": "disable"
}
}
}
For more information, see `Transit Gateway Attachments to a VPC `__ in the *AWS Transit Gateways Guide*.
awscli-1.18.69/awscli/examples/ec2/modify-fpga-image-attribute.rst 0000644 0000000 0000000 00000001003 13664010074 024701 0 ustar root root 0000000 0000000 **To modify the attributes of an Amazon FPGA image**
This example adds load permissions for account ID ``123456789012`` for the specified AFI.
Command::
aws ec2 modify-fpga-image-attribute --attribute loadPermission --fpga-image-id afi-0d123e123bfc85abc --load-permission Add=[{UserId=123456789012}]
Output::
{
"FpgaImageAttribute": {
"FpgaImageId": "afi-0d123e123bfc85abc",
"LoadPermissions": [
{
"UserId": "123456789012"
}
]
}
}
awscli-1.18.69/awscli/examples/ec2/export-image.rst 0000755 0000000 0000000 00000001365 13664010074 022035 0 ustar root root 0000000 0000000 **To export a VM from an AMI**
The following ``export-image`` example exports the specified AMI to the specified bucket in the specified format. ::
aws ec2 export-image \
--image-id ami-1234567890abcdef0 \
--disk-image-format VMDK \
--s3-export-location S3Bucket=my-export-bucket,S3Prefix=exports/
Output::
{
"DiskImageFormat": "vmdk",
"ExportImageTaskId": "export-ami-1234567890abcdef0"
"ImageId": "ami-1234567890abcdef0",
"RoleName": "vmimport",
"Progress": "0",
"S3ExportLocation": {
"S3Bucket": "my-export-bucket",
"S3Prefix": "exports/"
},
"Status": "active",
"StatusMessage": "validating"
}
awscli-1.18.69/awscli/examples/ec2/get-transit-gateway-multicast-domain-associations.rst 0000755 0000000 0000000 00000004374 13664010074 031304 0 ustar root root 0000000 0000000 **To view the information about the transit gateway multicast domain associations**
This example returns the associations for the specified transit gateway multicast domain. ::
aws ec2 get-transit-gateway-multicast-domain-associations \
--transit-gateway-multicast-domain-id tgw-mcast-domain-0c4905cef7EXAMPLE
Output::
{
"MulticastDomainAssociations": [
{
"TransitGatewayAttachmentId": "tgw-attach-028c1dd0f8EXAMPLE",
"ResourceId": "vpc-01128d2c24EXAMPLE",
"ResourceType": "vpc",
"Subnet": {
"SubnetId": "subnet-000de86e3bEXAMPLE",
"State": "associated"
}
},
{
"TransitGatewayAttachmentId": "tgw-attach-070e571cd1EXAMPLE",
"ResourceId": "vpc-7EXAMPLE",
"ResourceType": "vpc",
"Subnet": {
"SubnetId": "subnet-4EXAMPLE",
"State": "associated"
}
},
{
"TransitGatewayAttachmentId": "tgw-attach-070e571cd1EXAMPLE",
"ResourceId": "vpc-7EXAMPLE",
"ResourceType": "vpc",
"Subnet": {
"SubnetId": "subnet-5EXAMPLE",
"State": "associated"
}
},
{
"TransitGatewayAttachmentId": "tgw-attach-070e571cd1EXAMPLE",
"ResourceId": "vpc-7EXAMPLE",
"ResourceType": "vpc",
"Subnet": {
"SubnetId": "subnet-aEXAMPLE",
"State": "associated"
}
},
{
"TransitGatewayAttachmentId": "tgw-attach-070e571cd1EXAMPLE",
"ResourceId": "vpc-7EXAMPLE",
"ResourceType": "vpc",
"Subnet": {
"SubnetId": "subnet-fEXAMPLE",
"State": "associated"
}
}
]
}
For more information, see 'View Your Transit Gateway Multicast Domain Associations '__ in the *AWS Transit Gateways User Guide*.
awscli-1.18.69/awscli/examples/ec2/describe-iam-instance-profile-associations.rst 0000644 0000000 0000000 00000001646 13664010074 027714 0 ustar root root 0000000 0000000 **To describe IAM instance profile associations**
This example describes all of your IAM instance profile associations.
Command::
aws ec2 describe-iam-instance-profile-associations
Output::
{
"IamInstanceProfileAssociations": [
{
"InstanceId": "i-09eb09efa73ec1dee",
"State": "associated",
"AssociationId": "iip-assoc-0db249b1f25fa24b8",
"IamInstanceProfile": {
"Id": "AIPAJVQN4F5WVLGCJDRGM",
"Arn": "arn:aws:iam::123456789012:instance-profile/admin-role"
}
},
{
"InstanceId": "i-0402909a2f4dffd14",
"State": "associating",
"AssociationId": "iip-assoc-0d1ec06278d29f44a",
"IamInstanceProfile": {
"Id": "AGJAJVQN4F5WVLGCJABCM",
"Arn": "arn:aws:iam::123456789012:instance-profile/user1-role"
}
}
]
}
awscli-1.18.69/awscli/examples/ec2/describe-network-interface-permissions.rst 0000644 0000000 0000000 00000001057 13664010074 027205 0 ustar root root 0000000 0000000 **To describe your network interface permissions**
This example describes all of your network interface permissions.
Command::
aws ec2 describe-network-interface-permissions
Output::
{
"NetworkInterfacePermissions": [
{
"PermissionState": {
"State": "GRANTED"
},
"NetworkInterfacePermissionId": "eni-perm-06fd19020ede149ea",
"NetworkInterfaceId": "eni-b909511a",
"Permission": "INSTANCE-ATTACH",
"AwsAccountId": "123456789012"
}
]
} awscli-1.18.69/awscli/examples/ec2/associate-transit-gateway-multicast-domain.rst 0000755 0000000 0000000 00000002305 13664010074 027773 0 ustar root root 0000000 0000000 **To associate a transit gateway with a multicast domain**
This example returns the route table propagations for the specified route table. ::
aws ec2 associate-transit-gateway-multicast-domain \
--transit-gateway-multicast-domain-id tgw-mcast-domain-0c4905cef79d6e597 \
--transit-gateway-attachment-id tgw-attach-028c1dd0f8f5cbe8e \
--subnet-id subnet-000de86e3b49c932a \
--transit-gateway-multicast-domain-id tgw-mcast-domain-0c4905cef7EXAMPLE
Output::
{
"Associations": {
"TransitGatewayMulticastDomainId": "tgw-mcast-domain-0c4905cef79d6e597",
"TransitGatewayAttachmentId": "tgw-attach-028c1dd0f8f5cbe8e",
"ResourceId": "vpc-01128d2c240c09bd5",
"ResourceType": "vpc",
"Subnets": [
{
"SubnetId": "subnet-000de86e3b49c932a",
"State": "associating"
}
]
}
}
For more information, see 'Associate VPC Attachments and Subnets with a Transit Gateway Multicast Domain '__ in the *AWS Transit Gateways User Guide*.
awscli-1.18.69/awscli/examples/ec2/describe-instance-credit-specifications.rst 0000644 0000000 0000000 00000000645 13664010074 027264 0 ustar root root 0000000 0000000 **To describe the credit option for CPU usage of one or more instances**
This example describes the current credit option for CPU usage of the specified instance.
Command::
aws ec2 describe-instance-credit-specifications --instance-id i-1234567890abcdef0
Output::
{
"InstanceCreditSpecifications": [
{
"InstanceId": "i-1234567890abcdef0",
"CpuCredits": "unlimited"
}
]
} awscli-1.18.69/awscli/examples/ec2/purchase-scheduled-instances.rst 0000644 0000000 0000000 00000002411 13664010074 025157 0 ustar root root 0000000 0000000 **To purchase a Scheduled Instance**
This example purchases a Scheduled Instance.
Command::
aws ec2 purchase-scheduled-instances --purchase-requests file://purchase-request.json
Purchase-request.json::
[
{
"PurchaseToken": "eyJ2IjoiMSIsInMiOjEsImMiOi...",
"InstanceCount": 1
}
]
Output::
{
"ScheduledInstanceSet": [
{
"AvailabilityZone": "us-west-2b",
"ScheduledInstanceId": "sci-1234-1234-1234-1234-123456789012",
"HourlyPrice": "0.095",
"CreateDate": "2016-01-25T21:43:38.612Z",
"Recurrence": {
"OccurrenceDaySet": [
1
],
"Interval": 1,
"Frequency": "Weekly",
"OccurrenceRelativeToEnd": false,
"OccurrenceUnit": ""
},
"Platform": "Linux/UNIX",
"TermEndDate": "2017-01-31T09:00:00Z",
"InstanceCount": 1,
"SlotDurationInHours": 32,
"TermStartDate": "2016-01-31T09:00:00Z",
"NetworkPlatform": "EC2-VPC",
"TotalScheduledInstanceHours": 1696,
"NextSlotStartTime": "2016-01-31T09:00:00Z",
"InstanceType": "c4.large"
}
]
}
awscli-1.18.69/awscli/examples/ec2/register-transit-gateway-multicast-group-members.rst 0000755 0000000 0000000 00000001653 13664010074 031166 0 ustar root root 0000000 0000000 **To view the information about the transit gateway multicast domain associations**
This example returns the associations for the specified transit gateway multicast domain. ::
aws ec2 register-transit-gateway-multicast-group-members \
--transit-gateway-multicast-domain-id tgw-mcast-domain-0c4905cef79d6e597 \
--group-ip-address 224.0.1.0 \
--network-interface-ids eni-0e246d32695012e81
Output::
{
"RegisteredMulticastGroupMembers": {
"TransitGatewayMulticastDomainId": "tgw-mcast-domain-0c4905cef79d6e597",
"RegisteredNetworkInterfaceIds": [
"eni-0e246d32695012e81"
],
"GroupIpAddress": "224.0.1.0"
}
}
For more information, see `Register Members with a Multicast Group `__ in the *AWS Transit Gateways User Guide*.
awscli-1.18.69/awscli/examples/ec2/cancel-import-task.rst 0000755 0000000 0000000 00000000553 13664010074 023127 0 ustar root root 0000000 0000000 **To cancel an import task**
The following ``cancel-import-task`` example cancels the specified import image task. ::
aws ec2 cancel-import-task \
--import-task-id import-ami-1234567890abcdef0
Output::
{
"ImportTaskId": "import-ami-1234567890abcdef0",
"PreviousState": "active",
"State": "deleting"
}
awscli-1.18.69/awscli/examples/ec2/disable-vpc-classic-link.rst 0000644 0000000 0000000 00000000303 13664010074 024163 0 ustar root root 0000000 0000000 **To disable ClassicLink for a VPC**
This example disables ClassicLink for vpc-8888888.
Command::
aws ec2 disable-vpc-classic-link --vpc-id vpc-88888888
Output::
{
"Return": true
} awscli-1.18.69/awscli/examples/ec2/describe-moving-addresses.rst 0000644 0000000 0000000 00000000725 13664010074 024460 0 ustar root root 0000000 0000000 **To describe your moving addresses**
This example describes all of your moving Elastic IP addresses.
Command::
aws ec2 describe-moving-addresses
Output::
{
"MovingAddressStatuses": [
{
"PublicIp": "198.51.100.0",
"MoveStatus": "MovingToVpc"
}
]
}
This example describes all addresses that are moving to the EC2-VPC platform.
Command::
aws ec2 describe-moving-addresses --filters Name=moving-status,Values=MovingToVpc awscli-1.18.69/awscli/examples/ec2/describe-spot-price-history.rst 0000644 0000000 0000000 00000004111 13664010074 024763 0 ustar root root 0000000 0000000 **To describe Spot price history**
This example command returns the Spot Price history for m1.xlarge instances for a particular day in January.
Command::
aws ec2 describe-spot-price-history --instance-types m1.xlarge --start-time 2014-01-06T07:08:09 --end-time 2014-01-06T08:09:10
Output::
{
"SpotPriceHistory": [
{
"Timestamp": "2014-01-06T07:10:55.000Z",
"ProductDescription": "SUSE Linux",
"InstanceType": "m1.xlarge",
"SpotPrice": "0.087000",
"AvailabilityZone": "us-west-1b"
},
{
"Timestamp": "2014-01-06T07:10:55.000Z",
"ProductDescription": "SUSE Linux",
"InstanceType": "m1.xlarge",
"SpotPrice": "0.087000",
"AvailabilityZone": "us-west-1c"
},
{
"Timestamp": "2014-01-06T05:42:36.000Z",
"ProductDescription": "SUSE Linux (Amazon VPC)",
"InstanceType": "m1.xlarge",
"SpotPrice": "0.087000",
"AvailabilityZone": "us-west-1a"
},
...
}
**To describe Spot price history for Linux/UNIX Amazon VPC**
This example command returns the Spot Price history for m1.xlarge, Linux/UNIX Amazon VPC instances for a particular day in January.
Command::
aws ec2 describe-spot-price-history --instance-types m1.xlarge --product-description "Linux/UNIX (Amazon VPC)" --start-time 2014-01-06T07:08:09 --end-time 2014-01-06T08:09:10
Output::
{
"SpotPriceHistory": [
{
"Timestamp": "2014-01-06T04:32:53.000Z",
"ProductDescription": "Linux/UNIX (Amazon VPC)",
"InstanceType": "m1.xlarge",
"SpotPrice": "0.080000",
"AvailabilityZone": "us-west-1a"
},
{
"Timestamp": "2014-01-05T11:28:26.000Z",
"ProductDescription": "Linux/UNIX (Amazon VPC)",
"InstanceType": "m1.xlarge",
"SpotPrice": "0.080000",
"AvailabilityZone": "us-west-1c"
}
]
} awscli-1.18.69/awscli/examples/ec2/delete-subnet.rst 0000644 0000000 0000000 00000000263 13664010074 022165 0 ustar root root 0000000 0000000 **To delete a subnet**
This example deletes the specified subnet. If the command succeeds, no output is returned.
Command::
aws ec2 delete-subnet --subnet-id subnet-9d4a7b6c
awscli-1.18.69/awscli/examples/ec2/replace-transit-gateway-route.rst 0000644 0000000 0000000 00000002035 13664010074 025314 0 ustar root root 0000000 0000000 **To replace the specified route in the specified transit gateway route table**
The following ``replace-transit-gateway-route`` example replaces the route in the specified transit gateway route table. ::
aws ec2 replace-transit-gateway-route \
--destination-cidr-block 10.0.2.0/24 \
--transit-gateway-attachment-id tgw-attach-09b52ccdb5EXAMPLE \
--transit-gateway-route-table-id tgw-rtb-0a823edbdeEXAMPLE
Output::
{
"Route": {
"DestinationCidrBlock": "10.0.2.0/24",
"TransitGatewayAttachments": [
{
"ResourceId": "vpc-4EXAMPLE",
"TransitGatewayAttachmentId": "tgw-attach-09b52ccdb5EXAMPLE",
"ResourceType": "vpc"
}
],
"Type": "static",
"State": "active"
}
}
For more information, see `Transit Gateway Route Tables `__ in the *AWS Transit Gateways Guide*.
awscli-1.18.69/awscli/examples/ec2/create-subnet.rst 0000644 0000000 0000000 00000005355 13664010074 022175 0 ustar root root 0000000 0000000 **Example 1: To create a subnet with an IPv4 CIDR block**
The following ``create-subnet`` example creates a subnet in the specified VPC with the specified IPv4 CIDR block. We recommend that you let us select an Availability Zone for you. Alternatively, you can use the ``--availability-zone`` option to specify the Availability Zone. ::
aws ec2 create-subnet \
--vpc-id vpc-081ec835f3EXAMPLE \
--cidr-block 10.0.1.0/24
Output::
{
"Subnet": {
"AvailabilityZone": "us-east-2c",
"AvailabilityZoneId": "use2-az3",
"AvailableIpAddressCount": 251,
"CidrBlock": "10.0.1.0/24",
"DefaultForAz": false,
"MapPublicIpOnLaunch": false,
"State": "pending",
"SubnetId": "subnet-0e3f5cac72EXAMPLE",
"VpcId": "vpc-081ec835f3EXAMPLE",
"OwnerId": "111122223333",
"AssignIpv6AddressOnCreation": false,
"Ipv6CidrBlockAssociationSet": [],
"SubnetArn": "arn:aws:ec2:us-east-2:111122223333:subnet/subnet-0e3f5cac72375030d"
}
}
For more information, see `Creating a Subnet in Your VPC `__ in the *AWS VPC User Guide*
**Example 2: To create a subnet with an IPv6 CIDR block**
The following ``create-subnet`` example creates a subnet in the specified VPC with the specified IPv4 and IPv6 CIDR blocks (from the ranges of the VPC). ::
aws ec2 create-subnet \
--vpc-id vpc-07e8ffd50fEXAMPLE \
--cidr-block 10.0.0.0/24 \
--ipv6-cidr-block 2600:1f16:115:200::/64
Output::
{
"Subnet": {
"AvailabilityZone": "us-east-2b",
"AvailabilityZoneId": "use2-az2",
"AvailableIpAddressCount": 251,
"CidrBlock": "10.0.0.0/24",
"DefaultForAz": false,
"MapPublicIpOnLaunch": false,
"State": "pending",
"SubnetId": "subnet-02bf4c428bEXAMPLE",
"VpcId": "vpc-07e8ffd50EXAMPLE",
"OwnerId": "1111222233333",
"AssignIpv6AddressOnCreation": false,
"Ipv6CidrBlockAssociationSet": [
{
"AssociationId": "subnet-cidr-assoc-002afb9f3cEXAMPLE",
"Ipv6CidrBlock": "2600:1f16:115:200::/64",
"Ipv6CidrBlockState": {
"State": "associating"
}
}
],
"SubnetArn": "arn:aws:ec2:us-east-2:111122223333:subnet/subnet-02bf4c428bEXAMPLE"
}
}
For more information, see `Creating a Subnet in Your VPC `__ in the *AWS VPC User Guide*.
awscli-1.18.69/awscli/examples/ec2/detach-internet-gateway.rst 0000644 0000000 0000000 00000000425 13664010074 024142 0 ustar root root 0000000 0000000 **To detach an Internet gateway from your VPC**
This example detaches the specified Internet gateway from the specified VPC. If the command succeeds, no output is returned.
Command::
aws ec2 detach-internet-gateway --internet-gateway-id igw-c0a643a9 --vpc-id vpc-a01106c2
awscli-1.18.69/awscli/examples/ec2/describe-id-format.rst 0000755 0000000 0000000 00000001644 13664010074 023074 0 ustar root root 0000000 0000000 **Example 1: To describe the ID format of a resource**
The following ``describe-id-format`` example describes the ID format for security groups. ::
aws ec2 describe-id-format \
--resource security-group
In the following example output, the ``Deadline`` value indicates that the deadline for this resource type to permanently switch from the short ID format to the long ID format expired at 00:00 UTC on August 15, 2018. ::
{
"Statuses": [
{
"Deadline": "2018-08-15T00:00:00.000Z",
"Resource": "security-group",
"UseLongIds": true
}
]
}
**Example 2: To describe the ID format for all resources**
The following ``describe-id-format`` example describes the ID format for all resource types. All resource types that supported the short ID format were switched to use the long ID format. ::
aws ec2 describe-id-format
awscli-1.18.69/awscli/examples/ec2/start-instances.rst 0000644 0000000 0000000 00000001410 13664010074 022542 0 ustar root root 0000000 0000000 **To start an Amazon EC2 instance**
This example starts the specified Amazon EBS-backed instance.
Command::
aws ec2 start-instances --instance-ids i-1234567890abcdef0
Output::
{
"StartingInstances": [
{
"InstanceId": "i-1234567890abcdef0",
"CurrentState": {
"Code": 0,
"Name": "pending"
},
"PreviousState": {
"Code": 80,
"Name": "stopped"
}
}
]
}
For more information, see `Stop and Start Your Instance`_ in the *Amazon Elastic Compute Cloud User Guide*.
.. _`Stop and Start Your Instance`: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html
awscli-1.18.69/awscli/examples/ec2/describe-addresses.rst 0000644 0000000 0000000 00000010061 13664010074 023155 0 ustar root root 0000000 0000000 **Example 1: To retrieve details about all of your Elastic IP addresses**
The following ``describe addresses`` example displays details about your Elastic IP addresses. ::
aws ec2 describe-addresses
Output::
{
"Addresses": [
{
"InstanceId": "i-1234567890abcdef0",
"PublicIp": "198.51.100.0",
"PublicIpv4Pool": "amazon",
"Domain": "standard"
},
{
"Domain": "vpc",
"PublicIpv4Pool": "amazon",
"InstanceId": "i-1234567890abcdef0",
"NetworkInterfaceId": "eni-12345678",
"AssociationId": "eipassoc-12345678",
"NetworkInterfaceOwnerId": "123456789012",
"PublicIp": "203.0.113.0",
"AllocationId": "eipalloc-12345678",
"PrivateIpAddress": "10.0.1.241"
}
]
}
**Example 2: To retrieve details your Elastic IP addresses for EC2-VPC**
The following ``describe-addresses`` example displays details about your Elastic IP addresses for use with instances in a VPC. ::
aws ec2 describe-addresses \
--filters "Name=domain,Values=vpc"
Output::
{
"Addresses": [
{
"Domain": "vpc",
"PublicIpv4Pool": "amazon",
"InstanceId": "i-1234567890abcdef0",
"NetworkInterfaceId": "eni-12345678",
"AssociationId": "eipassoc-12345678",
"NetworkInterfaceOwnerId": "123456789012",
"PublicIp": "203.0.113.0",
"AllocationId": "eipalloc-12345678",
"PrivateIpAddress": "10.0.1.241"
}
]
}
**Example 3: To retrieve details about an Elastic IP address specified by allocation ID**
The following ``describe-addresses`` example displays details about the Elastic IP address with the specified allocation ID, which is associated with an instance in EC2-VPC. ::
aws ec2 describe-addresses \
--allocation-ids eipalloc-282d9641
Output::
{
"Addresses": [
{
"Domain": "vpc",
"PublicIpv4Pool": "amazon",
"InstanceId": "i-1234567890abcdef0",
"NetworkInterfaceId": "eni-1a2b3c4d",
"AssociationId": "eipassoc-123abc12",
"NetworkInterfaceOwnerId": "1234567891012",
"PublicIp": "203.0.113.25",
"AllocationId": "eipalloc-282d9641",
"PrivateIpAddress": "10.251.50.12"
}
]
}
**Example 4: To retrieve details about an Elastic IP address specified by its VPC private IP address**
The following ``describe-addresses`` example displays details about the Elastic IP address associated with a particular private IP address in EC2-VPC. ::
aws ec2 describe-addresses \
--filters "Name=private-ip-address,Values=10.251.50.12"
**Example 5: To retrieve details about Elastic IP addresses in EC2-Classic**
TThe following ``describe-addresses`` example displays details about your Elastic IP addresses for use in EC2-Classic. ::
aws ec2 describe-addresses \
--filters "Name=domain,Values=standard"
Output::
{
"Addresses": [
{
"InstanceId": "i-1234567890abcdef0",
"PublicIp": "203.0.110.25",
"PublicIpv4Pool": "amazon",
"Domain": "standard"
}
]
}
**Example 6: To retrieve details about an Elastic IP addresses specified by its public IP address**
The following ``describe-addresses`` example displays details about the Elastic IP address with the value ``203.0.110.25``, which is associated with an instance in EC2-Classic. ::
aws ec2 describe-addresses \
--public-ips 203.0.110.25
Output::
{
"Addresses": [
{
"InstanceId": "i-1234567890abcdef0",
"PublicIp": "203.0.110.25",
"PublicIpv4Pool": "amazon",
"Domain": "standard"
}
]
}
awscli-1.18.69/awscli/examples/ec2/modify-vpn-tunnel-certificate.rst 0000644 0000000 0000000 00000003216 13664010074 025301 0 ustar root root 0000000 0000000 **To rotate a VPN tunnel certificate**
The following ``modify-vpn-tunnel-certificate`` example rotates the certificate for the specified tunnel for a VPN connection ::
aws ec2 modify-vpn-tunnel-certificate \
--vpn-tunnel-outside-ip-address 203.0.113.17 \
--vpn-connection-id vpn-12345678901234567
Output::
{
"VpnConnection": {
"CustomerGatewayConfiguration": ...configuration information...,
"CustomerGatewayId": "cgw-aabbccddee1122334",
"Category": "VPN",
"State": "modifying",
"Type": "ipsec.1",
"VpnConnectionId": "vpn-12345678901234567",
"VpnGatewayId": "vgw-11223344556677889",
"Options": {
"StaticRoutesOnly": false
},
"VgwTelemetry": [
{
"AcceptedRouteCount": 0,
"LastStatusChange": "2019-09-11T17:27:14.000Z",
"OutsideIpAddress": "203.0.113.17",
"Status": "DOWN",
"StatusMessage": "IPSEC IS DOWN",
"CertificateArn": "arn:aws:acm:us-east-1:123456789101:certificate/c544d8ce-20b8-4fff-98b0-example"
},
{
"AcceptedRouteCount": 0,
"LastStatusChange": "2019-09-11T17:26:47.000Z",
"OutsideIpAddress": "203.0.114.18",
"Status": "DOWN",
"StatusMessage": "IPSEC IS DOWN",
"CertificateArn": "arn:aws:acm:us-east-1:123456789101:certificate/5ab64566-761b-4ad3-b259-example"
}
]
}
}
awscli-1.18.69/awscli/examples/ec2/delete-vpc-endpoint-connection-notifications.rst 0000644 0000000 0000000 00000000435 13664010074 030300 0 ustar root root 0000000 0000000 **To delete an endpoint connection notification**
This example deletes the specified endpoint connection notification.
Command::
aws ec2 delete-vpc-endpoint-connection-notifications --connection-notification-ids vpce-nfn-008776de7e03f5abc
Output::
{
"Unsuccessful": []
} awscli-1.18.69/awscli/examples/ec2/search-transit-gateway-routes.rst 0000644 0000000 0000000 00000003024 13664010074 025330 0 ustar root root 0000000 0000000 **To search for routes in the specified transit gateway route table**
The following ``search-transit-gateway-routes`` example returns all the routes that are of type ``static`` in the specified route table. ::
aws ec2 search-transit-gateway-routes \
--transit-gateway-route-table-id tgw-rtb-0a823edbdeEXAMPLE \
--filters "Name=type,Values=static"
Output::
{
"Routes": [
{
"DestinationCidrBlock": "10.0.2.0/24",
"TransitGatewayAttachments": [
{
"ResourceId": "vpc-4EXAMPLE",
"TransitGatewayAttachmentId": "tgw-attach-09b52ccdb5EXAMPLE",
"ResourceType": "vpc"
}
],
"Type": "static",
"State": "active"
},
{
"DestinationCidrBlock": "10.1.0.0/24",
"TransitGatewayAttachments": [
{
"ResourceId": "vpc-4EXAMPLE",
"TransitGatewayAttachmentId": "tgw-attach-09b52ccdb5EXAMPLE",
"ResourceType": "vpc"
}
],
"Type": "static",
"State": "active"
}
],
"AdditionalRoutesAvailable": false
}
For more information, see `View Transit Gateway Route Tables `__ in the *AWS Transit Gateways Guide*.
awscli-1.18.69/awscli/examples/ec2/describe-vpc-endpoint-service-permissions.rst 0000644 0000000 0000000 00000000611 13664010074 027615 0 ustar root root 0000000 0000000 **To describe endpoint service permissions**
This example describes the permissions for the specified endpoint service.
Command::
aws ec2 describe-vpc-endpoint-service-permissions --service-id vpce-svc-03d5ebb7d9579a2b3
Output::
{
"AllowedPrincipals": [
{
"PrincipalType": "Account",
"Principal": "arn:aws:iam::123456789012:root"
}
]
} awscli-1.18.69/awscli/examples/ec2/disassociate-client-vpn-target-network.rst 0000644 0000000 0000000 00000001401 13664010074 027123 0 ustar root root 0000000 0000000 **To disassociate a network from a Client VPN endpoint**
The following ``disassociate-client-vpn-target-network`` example disassociates the target network that's associated with the ``cvpn-assoc-12312312312312312`` association ID for the specified Client VPN endpoint. ::
aws ec2 disassociate-client-vpn-target-network \
--client-vpn-endpoint-id cvpn-endpoint-123456789123abcde \
--association-id cvpn-assoc-12312312312312312
Output::
{
"AssociationId": "cvpn-assoc-12312312312312312",
"Status": {
"Code": "disassociating"
}
}
For more information, see `Target Networks `__ in the *AWS Client VPN Administrator Guide*.
awscli-1.18.69/awscli/examples/ec2/reboot-instances.rst 0000644 0000000 0000000 00000000634 13664010074 022706 0 ustar root root 0000000 0000000 **To reboot an Amazon EC2 instance**
This example reboots the specified instance. If the command succeeds, no output is returned.
Command::
aws ec2 reboot-instances --instance-ids i-1234567890abcdef5
For more information, see `Reboot Your Instance`_ in the *Amazon Elastic Compute Cloud User Guide*.
.. _`Reboot Your Instance`: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-reboot.html
awscli-1.18.69/awscli/examples/ec2/delete-vpn-connection-route.rst 0000644 0000000 0000000 00000000460 13664010074 024760 0 ustar root root 0000000 0000000 **To delete a static route from a VPN connection**
This example deletes the specified static route from the specified VPN connection. If the command succeeds, no output is returned.
Command::
aws ec2 delete-vpn-connection-route --vpn-connection-id vpn-40f41529 --destination-cidr-block 11.12.0.0/16
awscli-1.18.69/awscli/examples/ec2/describe-instance-attribute.rst 0000644 0000000 0000000 00000003237 13664010074 025014 0 ustar root root 0000000 0000000 **To describe the instance type**
This example describes the instance type of the specified instance.
Command::
aws ec2 describe-instance-attribute --instance-id i-1234567890abcdef0 --attribute instanceType
Output::
{
"InstanceId": "i-1234567890abcdef0"
"InstanceType": {
"Value": "t1.micro"
}
}
**To describe the disableApiTermination attribute**
This example describes the ``disableApiTermination`` attribute of the specified instance.
Command::
aws ec2 describe-instance-attribute --instance-id i-1234567890abcdef0 --attribute disableApiTermination
Output::
{
"InstanceId": "i-1234567890abcdef0"
"DisableApiTermination": {
"Value": "false"
}
}
**To describe the block device mapping for an instance**
This example describes the ``blockDeviceMapping`` attribute of the specified instance.
Command::
aws ec2 describe-instance-attribute --instance-id i-1234567890abcdef0 --attribute blockDeviceMapping
Output::
{
"InstanceId": "i-1234567890abcdef0"
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Ebs": {
"Status": "attached",
"DeleteOnTermination": true,
"VolumeId": "vol-049df61146c4d7901",
"AttachTime": "2013-05-17T22:42:34.000Z"
}
},
{
"DeviceName": "/dev/sdf",
"Ebs": {
"Status": "attached",
"DeleteOnTermination": false,
"VolumeId": "vol-049df61146c4d7901",
"AttachTime": "2013-09-10T23:07:00.000Z"
}
}
],
}
awscli-1.18.69/awscli/examples/ec2/describe-image-attribute.rst 0000644 0000000 0000000 00000001273 13664010074 024270 0 ustar root root 0000000 0000000 **To describe the launch permissions for an AMI**
This example describes the launch permissions for the specified AMI.
Command::
aws ec2 describe-image-attribute --image-id ami-5731123e --attribute launchPermission
Output::
{
"LaunchPermissions": [
{
"UserId": "123456789012"
}
],
"ImageId": "ami-5731123e",
}
**To describe the product codes for an AMI**
This example describes the product codes for the specified AMI. Note that this AMI has no product codes.
Command::
aws ec2 describe-image-attribute --image-id ami-5731123e --attribute productCodes
Output::
{
"ProductCodes": [],
"ImageId": "ami-5731123e",
} awscli-1.18.69/awscli/examples/ec2/describe-images.rst 0000644 0000000 0000000 00000005156 13664010074 022456 0 ustar root root 0000000 0000000 **Example 1: To describe a specific AMI**
The following ``describe-images`` example describes the specified AMI. ::
aws ec2 describe-images \
--region us-east-1 \
--image-ids ami-1234567890EXAMPLE
Output::
{
"Images": [
{
"VirtualizationType": "hvm",
"Description": "Provided by Red Hat, Inc.",
"PlatformDetails": "Red Hat Enterprise Linux",
"EnaSupport": true,
"Hypervisor": "xen",
"State": "available",
"SriovNetSupport": "simple",
"ImageId": "ami-1234567890EXAMPLE",
"UsageOperation": "RunInstances:0010",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Ebs": {
"SnapshotId": "snap-111222333444aaabb",
"DeleteOnTermination": true,
"VolumeType": "gp2",
"VolumeSize": 10,
"Encrypted": false
}
}
],
"Architecture": "x86_64",
"ImageLocation": "123456789012/RHEL-8.0.0_HVM-20190618-x86_64-1-Hourly2-GP2",
"RootDeviceType": "ebs",
"OwnerId": "123456789012",
"RootDeviceName": "/dev/sda1",
"CreationDate": "2019-05-10T13:17:12.000Z",
"Public": true,
"ImageType": "machine",
"Name": "RHEL-8.0.0_HVM-20190618-x86_64-1-Hourly2-GP2"
}
]
}
For more information, see `Amazon Machine Images (AMI) `__ in the *Amazon Elastic Compute Cloud User Guide*.
**Example 2: To describe Windows AMIs from Amazon that are backed by Amazon EBS**
The following ``describe-images`` example describes Windows AMIs provided by Amazon that are backed by Amazon EBS. ::
aws ec2 describe-images \
--owners amazon \
--filters "Name=platform,Values=windows" "Name=root-device-type,Values=ebs"
**Example 3: To describe tagged AMIs**
The following ``describe-images`` example describes all AMIs that have the tag ``Custom=Linux1``. The output is filtered to display only the AMI IDs. ::
aws ec2 describe-images \
--filters "Name=tag:Custom,Values=Linux1" \
--query 'Images[*].{ID:ImageId}'
Output::
[
{
"ID": "ami-1a2b3c4d"
},
{
"ID": "ami-ab12cd34"
}
]
awscli-1.18.69/awscli/examples/ec2/modify-volume-attribute.rst 0000644 0000000 0000000 00000000445 13664010074 024224 0 ustar root root 0000000 0000000 **To modify a volume attribute**
This example sets the ``autoEnableIo`` attribute of the volume with the ID ``vol-1234567890abcdef0`` to ``true``. If the command succeeds, no output is returned.
Command::
aws ec2 modify-volume-attribute --volume-id vol-1234567890abcdef0 --auto-enable-io
awscli-1.18.69/awscli/examples/ec2/describe-tags.rst 0000755 0000000 0000000 00000006767 13664010074 022163 0 ustar root root 0000000 0000000 **Example 1: To describe all tags for a single resource**
The following ``describe-tags`` example describes the tags for the specified instance. ::
aws ec2 describe-tags \
--filters "Name=resource-id,Values=i-1234567890abcdef8"
Output::
{
"Tags": [
{
"ResourceType": "instance",
"ResourceId": "i-1234567890abcdef8",
"Value": "Test",
"Key": "Stack"
},
{
"ResourceType": "instance",
"ResourceId": "i-1234567890abcdef8",
"Value": "Beta Server",
"Key": "Name"
}
]
}
**Example 2: To describe all tags for a resource type**
The following ``describe-tags`` example describes the tags for your volumes. ::
aws ec2 describe-tags \
--filters "Name=resource-type,Values=volume"
Output::
{
"Tags": [
{
"ResourceType": "volume",
"ResourceId": "vol-1234567890abcdef0",
"Value": "Project1",
"Key": "Purpose"
},
{
"ResourceType": "volume",
"ResourceId": "vol-049df61146c4d7901",
"Value": "Logs",
"Key": "Purpose"
}
]
}
**Example 3: To describe all your tags**
The following ``describe-tags`` example describes the tags for all your resources. ::
aws ec2 describe-tags
**Example 4: To describe the tags for your resources based on a tag key**
The following ``describe-tags`` example describes the tags for your resources that have a tag with the key ``Stack``. ::
aws ec2 describe-tags \
--filters Name=key,Values=Stack
Output::
{
"Tags": [
{
"ResourceType": "volume",
"ResourceId": "vol-027552a73f021f3b",
"Value": "Production",
"Key": "Stack"
},
{
"ResourceType": "instance",
"ResourceId": "i-1234567890abcdef8",
"Value": "Test",
"Key": "Stack"
}
]
}
**Example 5: To describe the tags for your resources based on a tag key and tag value**
The following ``describe-tags`` example describes the tags for your resources that have the tag ``Stack=Test``. ::
aws ec2 describe-tags \
--filters Name=key,Values=Stack Name=value,Values=Test
Output::
{
"Tags": [
{
"ResourceType": "image",
"ResourceId": "ami-3ac336533f021f3bd",
"Value": "Test",
"Key": "Stack"
},
{
"ResourceType": "instance",
"ResourceId": "i-1234567890abcdef8",
"Value": "Test",
"Key": "Stack"
}
]
}
The following ``describe-tags`` example uses alternate syntax to describe resources with the tag ``Stack=Test``. ::
aws ec2 describe-tags \
--filters "Name=tag:Stack,Values=Test"
The following ``describe-tags`` example describes the tags for all your instances that have a tag with the key ``Purpose`` and no value. ::
aws ec2 describe-tags \
--filters "Name=resource-type,Values=instance" "Name=key,Values=Purpose" "Name=value,Values="
Output::
{
"Tags": [
{
"ResourceType": "instance",
"ResourceId": "i-1234567890abcdef5",
"Value": null,
"Key": "Purpose"
}
]
}
awscli-1.18.69/awscli/examples/ec2/describe-instance-types.rst 0000755 0000000 0000000 00000006032 13664010074 024154 0 ustar root root 0000000 0000000 **Example 1: To describe an instance type**
The following ``describe-instance-types`` example displays details for the specified instance type. ::
aws ec2 describe-instance-types \
--instance-types t2.micro
Output::
{
"InstanceTypes": [
{
"InstanceType": "t2.micro",
"CurrentGeneration": true,
"FreeTierEligible": true,
"SupportedUsageClasses": [
"on-demand",
"spot"
],
"SupportedRootDeviceTypes": [
"ebs"
],
"BareMetal": false,
"Hypervisor": "xen",
"ProcessorInfo": {
"SupportedArchitectures": [
"i386",
"x86_64"
],
"SustainedClockSpeedInGhz": 2.5
},
"VCpuInfo": {
"DefaultVCpus": 1,
"DefaultCores": 1,
"DefaultThreadsPerCore": 1,
"ValidCores": [
1
],
"ValidThreadsPerCore": [
1
]
},
"MemoryInfo": {
"SizeInMiB": 1024
},
"InstanceStorageSupported": false,
"EbsInfo": {
"EbsOptimizedSupport": "unsupported",
"EncryptionSupport": "supported"
},
"NetworkInfo": {
"NetworkPerformance": "Low to Moderate",
"MaximumNetworkInterfaces": 2,
"Ipv4AddressesPerInterface": 2,
"Ipv6AddressesPerInterface": 2,
"Ipv6Supported": true,
"EnaSupport": "unsupported"
},
"PlacementGroupInfo": {
"SupportedStrategies": [
"partition",
"spread"
]
},
"HibernationSupported": false,
"BurstablePerformanceSupported": true,
"DedicatedHostsSupported": false,
"AutoRecoverySupported": true
}
]
}
**Example 2: To filter the available instance types**
You can specify a filter to scope the results to instance types that have a specific characteristic. The following ``describe-instance-types`` example lists the instance types that support hibernation. ::
aws ec2 describe-instance-types --filters Name=hibernation-supported,Values=true --query InstanceTypes[].InstanceType
Output::
[
"m5.8xlarge",
"r3.large",
"c3.8xlarge",
"r5.large",
"m4.4xlarge",
"c4.large",
"m5.xlarge",
"m4.xlarge",
"c3.large",
"c4.8xlarge",
"c4.4xlarge",
"c5.xlarge",
"c5.12xlarge",
"r5.4xlarge",
"c5.4xlarge"
]
awscli-1.18.69/awscli/examples/ec2/create-vpn-connection.rst 0000644 0000000 0000000 00000004655 13664010074 023637 0 ustar root root 0000000 0000000 **To create a VPN connection with dynamic routing**
This example creates a VPN connection between the specified virtual private gateway and the specified customer gateway. The output includes the configuration information that your network administrator needs, in XML format.
Command::
aws ec2 create-vpn-connection --type ipsec.1 --customer-gateway-id cgw-0e11f167 --vpn-gateway-id vgw-9a4cacf3
Output::
{
"VpnConnection": {
"VpnConnectionId": "vpn-1a2b3c4d"
"CustomerGatewayConfiguration": "...configuration information...",
"State": "available",
"VpnGatewayId": "vgw-9a4cacf3",
"CustomerGatewayId": "cgw-0e11f167"
}
}
**To create a VPN connection with static routing**
This example creates a VPN connection between the specified virtual private gateway and the specified customer gateway. The options specify static routing. The output includes the configuration information that your network administrator needs, in XML format.
Command::
aws ec2 create-vpn-connection --type ipsec.1 --customer-gateway-id cgw-1a1a1a1a --vpn-gateway-id vgw-9a4cacf3 --options "{\"StaticRoutesOnly\":true}"
Output::
{
"VpnConnection": {
"VpnConnectionId": "vpn-11aa33cc"
"CustomerGatewayConfiguration": "...configuration information...",
"State": "pending",
"VpnGatewayId": "vgw-9a4cacf3",
"CustomerGatewayId": "cgw-1a1a1a1a",
"Options": {
"StaticRoutesOnly": true
}
}
}
**To create a VPN connection and specify your own inside CIDR and pre-shared key**
This example creates a VPN connection and specifies the inside IP address CIDR block and a custom pre-shared key for each tunnel. The specified values are returned in the ``CustomerGatewayConfiguration`` information.
Command::
aws ec2 create-vpn-connection --type ipsec.1 --customer-gateway-id cgw-b4de3fdd --vpn-gateway-id vgw-f211f09b --options "{"StaticRoutesOnly":false,"TunnelOptions":[{"TunnelInsideCidr":"169.254.12.0/30","PreSharedKey":"ExamplePreSharedKey1"},{"TunnelInsideCidr":"169.254.13.0/30","PreSharedKey":"ExamplePreSharedKey2"}]}"
Output::
{
"VpnConnection": {
"VpnConnectionId": "vpn-40f41529"
"CustomerGatewayConfiguration": "...configuration information...",
"State": "pending",
"VpnGatewayId": "vgw-f211f09b",
"CustomerGatewayId": "cgw-b4de3fdd"
}
}
awscli-1.18.69/awscli/examples/ec2/describe-vpn-gateways.rst 0000644 0000000 0000000 00000001502 13664010074 023625 0 ustar root root 0000000 0000000 **To describe your virtual private gateways**
This example describes your virtual private gateways.
Command::
aws ec2 describe-vpn-gateways
Output::
{
"VpnGateways": [
{
"State": "available",
"Type": "ipsec.1",
"VpnGatewayId": "vgw-f211f09b",
"VpcAttachments": [
{
"State": "attached",
"VpcId": "vpc-98eb5ef5"
}
]
},
{
"State": "available",
"Type": "ipsec.1",
"VpnGatewayId": "vgw-9a4cacf3",
"VpcAttachments": [
{
"State": "attaching",
"VpcId": "vpc-a01106c2"
}
]
}
]
} awscli-1.18.69/awscli/examples/ec2/describe-vpc-endpoint-services.rst 0000644 0000000 0000000 00000012763 13664010074 025442 0 ustar root root 0000000 0000000 **To describe VPC endpoint services**
This example describes all available endpoint services for the region.
Command::
aws ec2 describe-vpc-endpoint-services
Output::
{
"ServiceDetails": [
{
"ServiceType": [
{
"ServiceType": "Gateway"
}
],
"AcceptanceRequired": false,
"ServiceName": "com.amazonaws.us-east-1.dynamodb",
"VpcEndpointPolicySupported": true,
"Owner": "amazon",
"AvailabilityZones": [
"us-east-1a",
"us-east-1b",
"us-east-1c",
"us-east-1d",
"us-east-1e",
"us-east-1f"
],
"BaseEndpointDnsNames": [
"dynamodb.us-east-1.amazonaws.com"
]
},
{
"ServiceType": [
{
"ServiceType": "Interface"
}
],
"PrivateDnsName": "ec2.us-east-1.amazonaws.com",
"ServiceName": "com.amazonaws.us-east-1.ec2",
"VpcEndpointPolicySupported": false,
"Owner": "amazon",
"AvailabilityZones": [
"us-east-1a",
"us-east-1b",
"us-east-1c",
"us-east-1d",
"us-east-1e",
"us-east-1f"
],
"AcceptanceRequired": false,
"BaseEndpointDnsNames": [
"ec2.us-east-1.vpce.amazonaws.com"
]
},
{
"ServiceType": [
{
"ServiceType": "Interface"
}
],
"PrivateDnsName": "ec2messages.us-east-1.amazonaws.com",
"ServiceName": "com.amazonaws.us-east-1.ec2messages",
"VpcEndpointPolicySupported": false,
"Owner": "amazon",
"AvailabilityZones": [
"us-east-1a",
"us-east-1b",
"us-east-1c",
"us-east-1d",
"us-east-1e",
"us-east-1f"
],
"AcceptanceRequired": false,
"BaseEndpointDnsNames": [
"ec2messages.us-east-1.vpce.amazonaws.com"
]
},
{
"ServiceType": [
{
"ServiceType": "Interface"
}
],
"PrivateDnsName": "elasticloadbalancing.us-east-1.amazonaws.com",
"ServiceName": "com.amazonaws.us-east-1.elasticloadbalancing",
"VpcEndpointPolicySupported": false,
"Owner": "amazon",
"AvailabilityZones": [
"us-east-1a",
"us-east-1b",
"us-east-1c",
"us-east-1d",
"us-east-1e",
"us-east-1f"
],
"AcceptanceRequired": false,
"BaseEndpointDnsNames": [
"elasticloadbalancing.us-east-1.vpce.amazonaws.com"
]
},
{
"ServiceType": [
{
"ServiceType": "Interface"
}
],
"PrivateDnsName": "kinesis.us-east-1.amazonaws.com",
"ServiceName": "com.amazonaws.us-east-1.kinesis-streams",
"VpcEndpointPolicySupported": false,
"Owner": "amazon",
"AvailabilityZones": [
"us-east-1a",
"us-east-1b",
"us-east-1c",
"us-east-1d",
"us-east-1e",
"us-east-1f"
],
"AcceptanceRequired": false,
"BaseEndpointDnsNames": [
"kinesis.us-east-1.vpce.amazonaws.com"
]
},
{
"ServiceType": [
{
"ServiceType": "Gateway"
}
],
"AcceptanceRequired": false,
"ServiceName": "com.amazonaws.us-east-1.s3",
"VpcEndpointPolicySupported": true,
"Owner": "amazon",
"AvailabilityZones": [
"us-east-1a",
"us-east-1b",
"us-east-1c",
"us-east-1d",
"us-east-1e",
"us-east-1f"
],
"BaseEndpointDnsNames": [
"s3.us-east-1.amazonaws.com"
]
},
{
"ServiceType": [
{
"ServiceType": "Interface"
}
],
"PrivateDnsName": "ssm.us-east-1.amazonaws.com",
"ServiceName": "com.amazonaws.us-east-1.ssm",
"VpcEndpointPolicySupported": true,
"Owner": "amazon",
"AvailabilityZones": [
"us-east-1a",
"us-east-1b",
"us-east-1c",
"us-east-1d",
"us-east-1e"
],
"AcceptanceRequired": false,
"BaseEndpointDnsNames": [
"ssm.us-east-1.vpce.amazonaws.com"
]
}
],
"ServiceNames": [
"com.amazonaws.us-east-1.dynamodb",
"com.amazonaws.us-east-1.ec2",
"com.amazonaws.us-east-1.ec2messages",
"com.amazonaws.us-east-1.elasticloadbalancing",
"com.amazonaws.us-east-1.kinesis-streams",
"com.amazonaws.us-east-1.s3",
"com.amazonaws.us-east-1.ssm"
]
} awscli-1.18.69/awscli/examples/ec2/modify-vpc-endpoint-connection-notification.rst 0000644 0000000 0000000 00000000627 13664010074 030145 0 ustar root root 0000000 0000000 **To modify an endpoint connection notification**
This example changes the SNS topic for the specified endpoint connection notification.
Command::
aws ec2 modify-vpc-endpoint-connection-notification --connection-notification-id vpce-nfn-008776de7e03f5abc --connection-events Accept Reject --connection-notification-arn arn:aws:sns:us-east-2:123456789012:mytopic
Output::
{
"ReturnValue": true
} awscli-1.18.69/awscli/examples/ec2/describe-vpn-connections.rst 0000644 0000000 0000000 00000003135 13664010074 024327 0 ustar root root 0000000 0000000 **To describe your VPN connections**
This example describes your VPN connections.
Command::
aws ec2 describe-vpn-connections
Output::
{
"VpnConnections": {
"VpnConnectionId": "vpn-40f41529",
"Tags": [
{
"Value": "MyBGPVPN",
"Key": "Name"
}
],
"CustomerGatewayConfiguration": "...configuration information...",
"Routes": [],
"State": "available",
"VpnGatewayId": "vgw-9a4cacf3",
"CustomerGatewayId": "cgw-0e11f167",
"Type": "ipsec.1",
"Options": {
"StaticRoutesOnly": false
},
"Category": "VPN",
"VgwTelemetry": [
{
"Status": "DOWN",
"AcceptedRouteCount": 0,
"OutsideIpAddress": "72.21.209.192",
"LastStatusChange": "2013-02-04T20:19:34.000Z",
"StatusMessage": "IPSEC IS DOWN"
},
{
"Status": "DOWN",
"AcceptedRouteCount": 0,
"OutsideIpAddress": "72.21.209.224",
"LastStatusChange": "2013-02-04T20:19:34.000Z",
"StatusMessage": "IPSEC IS DOWN"
}
]
}
}
**To describe your available VPN connections**
This example describes your VPN connections with a state of ``available``.
Command::
aws ec2 describe-vpn-connections --filters "Name=state,Values=available"
awscli-1.18.69/awscli/examples/ec2/describe-availability-zones.rst 0000755 0000000 0000000 00000004340 13664010074 025014 0 ustar root root 0000000 0000000 **To describe your Availability Zones**
The following example ``describe-availability-zones`` displays details for the Availability Zones that are available to you. The response includes Availability Zones only for the current Region. In this example, it uses the profiles default ``us-west-2`` (Oregon) Region. ::
aws ec2 describe-availability-zones
Output::
{
"AvailabilityZones": [
{
"State": "available",
"OptInStatus": "opt-in-not-required",
"Messages": [],
"RegionName": "us-west-2",
"ZoneName": "us-west-2a",
"ZoneId": "usw2-az1",
"GroupName": "us-west-2",
"NetworkBorderGroup": "us-west-2"
},
{
"State": "available",
"OptInStatus": "opt-in-not-required",
"Messages": [],
"RegionName": "us-west-2",
"ZoneName": "us-west-2b",
"ZoneId": "usw2-az2",
"GroupName": "us-west-2",
"NetworkBorderGroup": "us-west-2"
},
{
"State": "available",
"OptInStatus": "opt-in-not-required",
"Messages": [],
"RegionName": "us-west-2",
"ZoneName": "us-west-2c",
"ZoneId": "usw2-az3",
"GroupName": "us-west-2",
"NetworkBorderGroup": "us-west-2"
},
{
"State": "available",
"OptInStatus": "opt-in-not-required",
"Messages": [],
"RegionName": "us-west-2",
"ZoneName": "us-west-2d",
"ZoneId": "usw2-az4",
"GroupName": "us-west-2",
"NetworkBorderGroup": "us-west-2"
},
{
"State": "available",
"OptInStatus": "opted-in",
"Messages": [],
"RegionName": "us-west-2",
"ZoneName": "us-west-2-lax-1a",
"ZoneId": "usw2-lax1-az1",
"GroupName": "us-west-2-lax-1",
"NetworkBorderGroup": "us-west-2-lax-1"
}
]
}
awscli-1.18.69/awscli/examples/ec2/cancel-spot-fleet-requests.rst 0000644 0000000 0000000 00000002164 13664010074 024605 0 ustar root root 0000000 0000000 **To cancel Spot fleet requests**
This example command cancels a Spot fleet request and terminates the associated Spot Instances.
Command::
aws ec2 cancel-spot-fleet-requests --spot-fleet-request-ids sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE --terminate-instances
Output::
{
"SuccessfulFleetRequests": [
{
"SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE",
"CurrentSpotFleetRequestState": "cancelled_running",
"PreviousSpotFleetRequestState": "active"
}
],
"UnsuccessfulFleetRequests": []
}
This example command cancels a Spot fleet request without terminating the associated Spot Instances.
Command::
aws ec2 cancel-spot-fleet-requests --spot-fleet-request-ids sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE --no-terminate-instances
Output::
{
"SuccessfulFleetRequests": [
{
"SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE",
"CurrentSpotFleetRequestState": "cancelled_terminating",
"PreviousSpotFleetRequestState": "active"
}
],
"UnsuccessfulFleetRequests": []
}
awscli-1.18.69/awscli/examples/ec2/delete-transit-gateway-multicast-domain.rst 0000755 0000000 0000000 00000001420 13664010074 027257 0 ustar root root 0000000 0000000 **To delete a transit gateway multicast domain**
This example returns the route table propagations for the specified route table.::
aws ec2 delete-transit-gateway-multicast-domain \
--transit-gateway-multicast-domain-id tgw-mcast-domain-0c4905cef7EXAMPLE
Output::
{
"TransitGatewayMulticastDomain": {
"TransitGatewayMulticastDomainId": "tgw-mcast-domain-02bb79002bEXAMPLE",
"TransitGatewayId": "tgw-0d88d2d0d5EXAMPLE",
"State": "deleting",
"CreationTime": "2019-11-20T22:02:03.000Z"
}
}
For more information, see 'Delete a Transit Gateway Multicast Domain'__ in the *AWS Transit Gateways User Guide*.
awscli-1.18.69/awscli/examples/ec2/describe-traffic-mirror-targets.rst 0000644 0000000 0000000 00000001705 13664010074 025602 0 ustar root root 0000000 0000000 **To describe a Traffic Mirror Target**
The following ``describe-traffic-mirror-targets`` example displays details of the specified Traffic Mirror target. ::
aws ec2 describe-traffic-mirror-targets \
--traffic-mirror-target-id tmt-0dabe9b0a6EXAMPLE
Output::
{
"TrafficMirrorTargets": [
{
"TrafficMirrorTargetId": "tmt-0dabe9b0a6EXAMPLE",
"NetworkLoadBalancerArn": "arn:aws:elasticloadbalancing:us-east-1:111122223333:loadbalancer/net/NLB/7cdec873fEXAMPLE",
"Type": "network-load-balancer",
"Description": "Example Network Load Balancer Target",
"OwnerId": "111122223333",
"Tags": []
}
]
}
For more information, see `View Traffic Mirror Target Details `__ in the *AWS Traffic Mirroring Guide*.
awscli-1.18.69/awscli/examples/ec2/describe-nat-gateways.rst 0000644 0000000 0000000 00000002566 13664010074 023617 0 ustar root root 0000000 0000000 **To describe your NAT gateways**
This example describes all of your NAT gateways.
Command::
aws ec2 describe-nat-gateways
Output::
{
"NatGateways": [
{
"NatGatewayAddresses": [
{
"PublicIp": "198.11.222.333",
"NetworkInterfaceId": "eni-9dec76cd",
"AllocationId": "eipalloc-89c620ec",
"PrivateIp": "10.0.0.149"
}
],
"VpcId": "vpc-1a2b3c4d",
"Tags": [
{
"Value": "IT",
"Key": "Department"
}
],
"State": "available",
"NatGatewayId": "nat-05dba92075d71c408",
"SubnetId": "subnet-847e4dc2",
"CreateTime": "2015-12-01T12:26:55.983Z"
},
{
"NatGatewayAddresses": [
{
"PublicIp": "1.2.3.12",
"NetworkInterfaceId": "eni-71ec7621",
"AllocationId": "eipalloc-5d42583f",
"PrivateIp": "10.0.0.77"
}
],
"VpcId": "vpc-11aa22bb",
"Tags": [
{
"Value": "Finance",
"Key": "Department"
}
],
"State": "available",
"NatGatewayId": "nat-0a93acc57881d4199",
"SubnetId": "subnet-7f7e4d39",
"CreateTime": "2015-12-01T12:09:22.040Z"
}
]
} awscli-1.18.69/awscli/examples/ec2/modify-launch-template.rst 0000644 0000000 0000000 00000001072 13664010074 023774 0 ustar root root 0000000 0000000 **To change the default launch template version**
This example specifies version 2 of the specified launch template as the default version.
Command::
aws ec2 modify-launch-template --launch-template-id lt-0abcd290751193123 --default-version 2
Output::
{
"LaunchTemplate": {
"LatestVersionNumber": 2,
"LaunchTemplateId": "lt-0abcd290751193123",
"LaunchTemplateName": "WebServers",
"DefaultVersionNumber": 2,
"CreatedBy": "arn:aws:iam::123456789012:root",
"CreateTime": "2017-12-01T13:35:46.000Z"
}
} awscli-1.18.69/awscli/examples/ec2/associate-client-vpn-target-network.rst 0000644 0000000 0000000 00000001234 13664010074 026427 0 ustar root root 0000000 0000000 **To associate a target network with a Client VPN endpoint**
The following ``associate-client-vpn-target-network`` example associates a subnet with the specified Client VPN endpoint. ::
aws ec2 associate-client-vpn-target-network \
--subnet-id subnet-0123456789abcabca \
--client-vpn-endpoint-id cvpn-endpoint-123456789123abcde
Output::
{
"AssociationId": "cvpn-assoc-12312312312312312",
"Status": {
"Code": "associating"
}
}
For more information, see `Target Networks `__ in the *AWS Client VPN Administrator Guide*.
awscli-1.18.69/awscli/examples/ec2/modify-traffic-mirror-session.rst 0000644 0000000 0000000 00000002105 13664010074 025316 0 ustar root root 0000000 0000000 **To modify a Traffic Mirror Session**
The following ``modify-traffic-mirror-session`` example changes the traffic mirror session description and the number of packets to mirror. ::
aws ec2 modify-traffic-mirror-session \
--description "Change packet length" \
--traffic-mirror-session-id tms-08a33b1214EXAMPLE \
--remove-fields "packet-length"
Output::
{
"TrafficMirrorSession": {
"TrafficMirrorSessionId": "tms-08a33b1214EXAMPLE",
"TrafficMirrorTargetId": "tmt-07f75d8feeEXAMPLE",
"TrafficMirrorFilterId": "tmf-04812ff784EXAMPLE",
"NetworkInterfaceId": "eni-070203f901EXAMPLE",
"OwnerId": "111122223333",
"SessionNumber": 1,
"VirtualNetworkId": 7159709,
"Description": "Change packet length",
"Tags": []
}
}
For more information, see `Modify Your Traffic MIrror Session `__ in the *AWS Traffic Mirroring Guide*.
awscli-1.18.69/awscli/examples/ec2/describe-byoip-cidrs.rst 0000644 0000000 0000000 00000000712 13664010074 023426 0 ustar root root 0000000 0000000 **To describe your provisioned address ranges**
The following ``describe-byoip-cidrs`` example displays details about the public IPv4 address ranges that you provisioned for use by AWS. ::
aws ec2 describe-byoip-cidrs
Output::
{
"ByoipCidrs": [
{
"Cidr": "203.0.113.25/24",
"StatusMessage": "ipv4pool-ec2-1234567890abcdef0",
"State": "provisioned"
}
]
}
awscli-1.18.69/awscli/examples/ec2/describe-client-vpn-endpoints.rst 0000644 0000000 0000000 00000003175 13664010074 025270 0 ustar root root 0000000 0000000 **To describe your Client VPN endpoints**
The following example displays details about all of your Client VPN endpoints. ::
aws ec2 describe-client-vpn-endpoints
Output::
{
"ClientVpnEndpoints": [
{
"ClientVpnEndpointId": "cvpn-endpoint-123456789123abcde",
"Description": "",
"Status": {
"Code": "available"
},
"CreationTime": "2019-07-08T11:37:27",
"DnsName": "*.cvpn-endpoint-123456789123abcde.prod.clientvpn.ap-south-1.amazonaws.com",
"ClientCidrBlock": "172.31.0.0/16",
"DnsServers": [
"8.8.8.8"
],
"SplitTunnel": false,
"VpnProtocol": "openvpn",
"TransportProtocol": "udp",
"ServerCertificateArn": "arn:aws:acm:ap-south-1:123456789012:certificate/a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
"AuthenticationOptions": [
{
"Type": "certificate-authentication",
"MutualAuthentication": {
"ClientRootCertificateChain": "arn:aws:acm:ap-south-1:123456789012:certificate/a1b2c3d4-5678-90ab-cdef-22222EXAMPLE"
}
}
],
"ConnectionLogOptions": {
"Enabled": false
},
"Tags": [
{
"Key": "Name",
"Value": "Client VPN"
}
]
}
]
}
awscli-1.18.69/awscli/examples/ec2/create-local-gateway-route-table-vpc-association.rst 0000755 0000000 0000000 00000001346 13664010074 030746 0 ustar root root 0000000 0000000 **To associate a VPC with a route table**
The following ``create-local-gateway-route-table-vpc-association`` example associates the specified VPC with the specified local gateway route table. ::
aws ec2 create-local-gateway-route-table-vpc-association \
--local-gateway-route-table-id lgw-rtb-059615ef7dEXAMPLE \
--vpc-id vpc-07ef66ac71EXAMPLE
Output::
{
"LocalGatewayRouteTableVpcAssociation": {
"LocalGatewayRouteTableVpcAssociationId": "lgw-vpc-assoc-0ee765bcc8EXAMPLE",
"LocalGatewayRouteTableId": "lgw-rtb-059615ef7dEXAMPLE",
"LocalGatewayId": "lgw-09b493aa7cEXAMPLE",
"VpcId": "vpc-07ef66ac71EXAMPLE",
"State": "associated"
}
}
awscli-1.18.69/awscli/examples/ec2/create-reserved-instances-listing.rst 0000755 0000000 0000000 00000000753 13664010074 026150 0 ustar root root 0000000 0000000 **To list a Reserved Instance in the Reserved Instance Marketplace**
The following ``create-reserved-instances-listing`` example creates a listing for the specified Reserved Instance in the Reserved Instance Marketplace. ::
aws ec2 create-reserved-instances-listing \
--reserved-instances-id 5ec28771-05ff-4b9b-aa31-9e57dexample \
--instance-count 3 \
--price-schedules CurrencyCode=USD,Price=25.50 \
--client-token 550e8400-e29b-41d4-a716-446655440000
awscli-1.18.69/awscli/examples/ec2/enable-vgw-route-propagation.rst 0000644 0000000 0000000 00000000460 13664010074 025130 0 ustar root root 0000000 0000000 **To enable route propagation**
This example enables the specified virtual private gateway to propagate static routes to the specified route table. If the command succeeds, no output is returned.
Command::
aws ec2 enable-vgw-route-propagation --route-table-id rtb-22574640 --gateway-id vgw-9a4cacf3
awscli-1.18.69/awscli/examples/ec2/create-transit-gateway-vpc-attachment.rst 0000755 0000000 0000000 00000004214 13664010074 026730 0 ustar root root 0000000 0000000 **Example 1: To associate a Transit Gateway with a VPC**
The following ``create-transit-gateway-vpc-attachment`` example creates a transit gateway attachment to the specified VPC. ::
aws ec2 create-transit-gateway-vpc-attachment \
--transit-gateway-id tgw-0262a0e521EXAMPLE \
--vpc-id vpc-07e8ffd50f49335df \
--subnet-id subnet-0752213d59EXAMPLE
Output::
{
"TransitGatewayVpcAttachment": {
"TransitGatewayAttachmentId": "tgw-attach-0a34fe6b4fEXAMPLE",
"TransitGatewayId": "tgw-0262a0e521EXAMPLE",
"VpcId": "vpc-07e8ffd50fEXAMPLE",
"VpcOwnerId": "111122223333",
"State": "pending",
"SubnetIds": [
"subnet-0752213d59EXAMPLE"
],
"CreationTime": "2019-07-10T17:33:46.000Z",
"Options": {
"DnsSupport": "enable",
"Ipv6Support": "disable"
}
}
}
**Example 2: To associate a Transit Gateway with multiple subnets in a VPC**
The following ``create-transit-gateway-vpc-attachment`` example creates a transit gateway attachment to the specified VPC and subnets. ::
aws ec2 create-transit-gateway-vpc-attachment \
--transit-gateway-id tgw-02f776b1a7EXAMPLE \
--vpc-id vpc-3EXAMPLE \
--subnet-ids "subnet-dEXAMPLE" "subnet-6EXAMPLE"
Output::
{
"TransitGatewayVpcAttachment": {
"TransitGatewayAttachmentId": "tgw-attach-0e141e0bebEXAMPLE",
"TransitGatewayId": "tgw-02f776b1a7EXAMPLE",
"VpcId": "vpc-3EXAMPLE",
"VpcOwnerId": "111122223333",
"State": "pending",
"SubnetIds": [
"subnet-6EXAMPLE",
"subnet-dEXAMPLE"
],
"CreationTime": "2019-12-17T20:07:52.000Z",
"Options": {
"DnsSupport": "enable",
"Ipv6Support": "disable"
}
}
}
For more information, see `Create a Transit Gateway Attachment to a VPC`__ in the *AWS Transit Gateways User Guide*.
awscli-1.18.69/awscli/examples/ec2/request-spot-fleet.rst 0000644 0000000 0000000 00000012003 13664010074 023170 0 ustar root root 0000000 0000000 **To request a Spot fleet in the subnet with the lowest price**
This example command creates a Spot fleet request with two launch specifications that differ only by subnet.
The Spot fleet launches the instances in the specified subnet with the lowest price.
If the instances are launched in a default VPC, they receive a public IP address by default.
If the instances are launched in a nondefault VPC, they do not receive a public IP address by default.
Note that you can't specify different subnets from the same Availability Zone in a Spot fleet request.
Command::
aws ec2 request-spot-fleet --spot-fleet-request-config file://config.json
Config.json::
{
"SpotPrice": "0.04",
"TargetCapacity": 2,
"IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"KeyName": "my-key-pair",
"SecurityGroups": [
{
"GroupId": "sg-1a2b3c4d"
}
],
"InstanceType": "m3.medium",
"SubnetId": "subnet-1a2b3c4d, subnet-3c4d5e6f",
"IamInstanceProfile": {
"Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role"
}
}
]
}
Output::
{
"SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE"
}
**To request a Spot fleet in the Availability Zone with the lowest price**
This example command creates a Spot fleet request with two launch specifications that differ only by Availability Zone.
The Spot fleet launches the instances in the specified Availability Zone with the lowest price.
If your account supports EC2-VPC only, Amazon EC2 launches the Spot instances in the default subnet of the Availability Zone.
If your account supports EC2-Classic, Amazon EC2 launches the instances in EC2-Classic in the Availability Zone.
Command::
aws ec2 request-spot-fleet --spot-fleet-request-config file://config.json
Config.json::
{
"SpotPrice": "0.04",
"TargetCapacity": 2,
"IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"KeyName": "my-key-pair",
"SecurityGroups": [
{
"GroupId": "sg-1a2b3c4d"
}
],
"InstanceType": "m3.medium",
"Placement": {
"AvailabilityZone": "us-west-2a, us-west-2b"
},
"IamInstanceProfile": {
"Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role"
}
}
]
}
**To launch Spot instances in a subnet and assign them public IP addresses**
This example command assigns public addresses to instances launched in a nondefault VPC.
Note that when you specify a network interface, you must include the subnet ID and security group ID
using the network interface.
Command::
aws ec2 request-spot-fleet --spot-fleet-request-config file://config.json
Config.json::
{
"SpotPrice": "0.04",
"TargetCapacity": 2,
"IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"KeyName": "my-key-pair",
"InstanceType": "m3.medium",
"NetworkInterfaces": [
{
"DeviceIndex": 0,
"SubnetId": "subnet-1a2b3c4d",
"Groups": [ "sg-1a2b3c4d" ],
"AssociatePublicIpAddress": true
}
],
"IamInstanceProfile": {
"Arn": "arn:aws:iam::880185128111:instance-profile/my-iam-role"
}
}
]
}
**To request a Spot fleet using the diversified allocation strategy**
This example command creates a Spot fleet request that launches 30 instances using the diversified allocation strategy.
The launch specifications differ by instance type. The Spot fleet distributes the instances
across the launch specifications such that there are 10 instances of each type.
Command::
aws ec2 request-spot-fleet --spot-fleet-request-config file://config.json
Config.json::
{
"SpotPrice": "0.70",
"TargetCapacity": 30,
"AllocationStrategy": "diversified",
"IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role",
"LaunchSpecifications": [
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "c4.2xlarge",
"SubnetId": "subnet-1a2b3c4d"
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "m3.2xlarge",
"SubnetId": "subnet-1a2b3c4d"
},
{
"ImageId": "ami-1a2b3c4d",
"InstanceType": "r3.2xlarge",
"SubnetId": "subnet-1a2b3c4d"
}
]
}
For more information, see `Spot Fleet Requests`_ in the *Amazon Elastic Compute Cloud User Guide*.
.. _`Spot Fleet Requests`: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html
awscli-1.18.69/awscli/examples/ec2/assign-private-ip-addresses.rst 0000644 0000000 0000000 00000001542 13664010074 024743 0 ustar root root 0000000 0000000 **To assign a specific secondary private IP address a network interface**
This example assigns the specified secondary private IP address to the specified network interface. If the command succeeds, no output is returned.
Command::
aws ec2 assign-private-ip-addresses --network-interface-id eni-e5aa89a3 --private-ip-addresses 10.0.0.82
**To assign secondary private IP addresses that Amazon EC2 selects to a network interface**
This example assigns two secondary private IP addresses to the specified network interface. Amazon EC2 automatically assigns these IP addresses from the available IP addresses in the CIDR block range of the subnet the network interface is associated with. If the command succeeds, no output is returned.
Command::
aws ec2 assign-private-ip-addresses --network-interface-id eni-e5aa89a3 --secondary-private-ip-address-count 2
awscli-1.18.69/awscli/examples/ec2/create-traffic-mirror-target.rst 0000644 0000000 0000000 00000003411 13664010074 025076 0 ustar root root 0000000 0000000 **To create a a Network Load Balancer Traffic Mirror target**
The following ``create-traffic-mirror-target`` example creates a Network Load Balancer Traffic Mirror target. ::
aws ec2 create-traffic-mirror-target \
--description "Example Network Load Balancer Target" \
--network-load-balancer-arn arn:aws:elasticloadbalancing:us-east-1:111122223333:loadbalancer/net/NLB/7cdec873EXAMPLE
Output::
{
"TrafficMirrorTarget": {
"Type": "network-load-balancer",
"Tags": [],
"Description": "Example Network Load Balancer Target",
"OwnerId": "111122223333",
"NetworkLoadBalancerArn": "arn:aws:elasticloadbalancing:us-east-1:724145273726:loadbalancer/net/NLB/7cdec873EXAMPLE",
"TrafficMirrorTargetId": "tmt-0dabe9b0a6EXAMPLE"
},
"ClientToken": "d5c090f5-8a0f-49c7-8281-72c796a21f72"
}
**To create a network Traffic Mirror target**
The following ``create-traffic-mirror-target`` example creates a network interface Traffic Mirror target.
aws ec2 create-traffic-mirror-target \
--description "Network interface target" \
--network-interface-id eni-eni-01f6f631eEXAMPLE
Output::
{
"ClientToken": "5289a345-0358-4e62-93d5-47ef3061d65e",
"TrafficMirrorTarget": {
"Description": "Network interface target",
"NetworkInterfaceId": "eni-01f6f631eEXAMPLE",
"TrafficMirrorTargetId": "tmt-02dcdbe2abEXAMPLE",
"OwnerId": "111122223333",
"Type": "network-interface",
"Tags": []
}
}
For more information, see `Create a Traffic Mirror Target `__ in the *AWS Traffic Mirroring Guide*. awscli-1.18.69/awscli/examples/ec2/describe-dhcp-options.rst 0000644 0000000 0000000 00000003537 13664010074 023621 0 ustar root root 0000000 0000000 **To describe your DHCP options**
The following ``describe-dhcp-options`` example retrieves details about your DHCP options. ::
aws ec2 describe-dhcp-options
Output::
{
"DhcpOptions": [
{
"DhcpConfigurations": [
{
"Key": "domain-name",
"Values": [
{
"Value": "us-east-2.compute.internal"
}
]
},
{
"Key": "domain-name-servers",
"Values": [
{
"Value": "AmazonProvidedDNS"
}
]
}
],
"DhcpOptionsId": "dopt-19edf471",
"OwnerId": "111122223333"
},
{
"DhcpConfigurations": [
{
"Key": "domain-name",
"Values": [
{
"Value": "us-east-2.compute.internal"
}
]
},
{
"Key": "domain-name-servers",
"Values": [
{
"Value": "AmazonProvidedDNS"
}
]
}
],
"DhcpOptionsId": "dopt-fEXAMPLE",
"OwnerId": "111122223333"
}
]
}
For more information, see `Working with DHCP Option Sets `__ in the *AWS VPC User Guide*.
awscli-1.18.69/awscli/examples/ec2/revoke-security-group-egress.rst 0000644 0000000 0000000 00000001370 13664010074 025205 0 ustar root root 0000000 0000000 **To remove the rule that allows outbound traffic to a specific address range**
This example command removes the rule that grants access to the specified address ranges on TCP port 80.
Command::
aws ec2 revoke-security-group-egress --group-id sg-1a2b3c4d --ip-permissions '[{"IpProtocol": "tcp", "FromPort": 80, "ToPort": 80, "IpRanges": [{"CidrIp": "10.0.0.0/16"}]}]'
**To remove the rule that allows outbound traffic to a specific security group**
This example command removes the rule that grants access to the specified security group on TCP port 80.
Command::
aws ec2 revoke-security-group-egress --group-id sg-1a2b3c4d --ip-permissions '[{"IpProtocol": "tcp", "FromPort": 80, "ToPort": 80, "UserIdGroupPairs": [{"GroupId": "sg-4b51a32f"}]}]'
awscli-1.18.69/awscli/examples/ec2/disassociate-transit-gateway-multicast-domain.rst 0000755 0000000 0000000 00000002112 13664010074 030467 0 ustar root root 0000000 0000000 **To disassociate subnets from a multicast domain**
This example disassociates a subnet from the specified multicast domain. ::
aws ec2 disassociate-transit-gateway-multicast-domain \
--transit-gateway-attachment-id tgw-attach-070e571cd1EXAMPLE \
--subnet-id subnet-000de86e3bEXAMPLE \
--transit-gateway-multicast-domain-id tgw-mcast-domain-0c4905cef7EXAMPLE
Output::
{
"Associations": {
"TransitGatewayMulticastDomainId": "tgw-mcast-domain-0c4905cef7EXAMPLE",
"TransitGatewayAttachmentId": "tgw-attach-070e571cd1EXAMPLE",
"ResourceId": "vpc-7EXAMPLE",
"ResourceType": "vpc",
"Subnets": [
{
"SubnetId": "subnet-000de86e3bEXAMPLE",
"State": "disassociating"
}
]
}
}
For more information, see 'Disassociate Subnets from a Transit Gateway Multicast Domain'__ in the *AWS Transit Gateways User Guide*'.
awscli-1.18.69/awscli/examples/ec2/search-local-gateway-routes.rst 0000755 0000000 0000000 00000001217 13664010074 024743 0 ustar root root 0000000 0000000 **To search for routes in a local gateway route table**
The following ``search-local-gateway-routes`` example searches for static routes in the specified local gateway route table. ::
aws ec2 search-local-gateway-routes \
--local-gateway-route-table-id lgw-rtb-059615ef7dEXAMPLE \
--filters "Name=type,Values=static"
Output::
{
"Route": {
"DestinationCidrBlock": "0.0.0.0/0",
"LocalGatewayVirtualInterfaceGroupId": "lgw-vif-grp-07145b276bEXAMPLE",
"Type": "static",
"State": "deleted",
"LocalGatewayRouteTableId": "lgw-rtb-059615ef7EXAMPLE"
}
}
awscli-1.18.69/awscli/examples/ec2/import-snapshot.rst 0000755 0000000 0000000 00000001474 13664010074 022604 0 ustar root root 0000000 0000000 **To import a snapshot**
The following ``import-snapshot`` example imports the specified disk as a snapshot. ::
aws ec2 import-snapshot \
--description "My server VMDK" \
--disk-container Format=VMDK,UserBucket={S3Bucket=my-import-bucket,S3Key=vms/my-server-vm.vmdk}
Output::
{
"Description": "My server VMDK",
"ImportTaskId": "import-snap-1234567890abcdef0",
"SnapshotTaskDetail": {
"Description": "My server VMDK",
"DiskImageSize": "0.0",
"Format": "VMDK",
"Progress": "3",
"Status": "active",
"StatusMessage": "pending"
"UserBucket": {
"S3Bucket": "my-import-bucket",
"S3Key": "vms/my-server-vm.vmdk"
}
}
}
awscli-1.18.69/awscli/examples/ec2/modify-snapshot-attribute.rst 0000644 0000000 0000000 00000001363 13664010074 024554 0 ustar root root 0000000 0000000 **Example 1: To modify a snapshot attribute**
The following ``modify-snapshot-attribute`` example updates the ``createVolumePermission`` attribute for the specified snapshot, removing volume permissions for the specified user. ::
aws ec2 modify-snapshot-attribute \
--snapshot-id snap-1234567890abcdef0 \
--attribute createVolumePermission \
--operation-type remove \
--user-ids 123456789012
**Example 2: To make a snapshot public**
The following ``modify-snapshot-attribute`` example makes the specified snapshot public. ::
aws ec2 modify-snapshot-attribute \
--snapshot-id snap-1234567890abcdef0 \
--attribute createVolumePermission \
--operation-type add \
--group-names all
awscli-1.18.69/awscli/examples/ec2/get-associated-ipv6-pool-cidrs.rst 0000644 0000000 0000000 00000000740 13664010074 025254 0 ustar root root 0000000 0000000 **To get the associations for an IPv6 address pool**
The following ``get-associated-ipv6-pool-cidrs`` example gets the associations for the specified IPv6 address pool. ::
aws ec2 get-associated-ipv6-pool-cidrs \
--pool-id ipv6pool-ec2-012345abc12345abc
Output::
{
"Ipv6CidrAssociations": [
{
"Ipv6Cidr": "2001:db8:1234:1a00::/56",
"AssociatedResource": "vpc-111111222222333ab"
}
]
}
awscli-1.18.69/awscli/examples/ec2/copy-fpga-image.rst 0000644 0000000 0000000 00000000533 13664010074 022372 0 ustar root root 0000000 0000000 **To copy an Amazon FPGA image**
This example copies the specified AFI from the ``us-east-1`` region to the current region (``eu-west-1``).
Command::
aws ec2 copy-fpga-image --name copy-afi --source-fpga-image-id afi-0d123e123bfc85abc --source-region us-east-1 --region eu-west-1
Output::
{
"FpgaImageId": "afi-06b12350a123fbabc"
}
awscli-1.18.69/awscli/examples/ec2/get-console-output.rst 0000644 0000000 0000000 00000002151 13664010074 023200 0 ustar root root 0000000 0000000 **To get the console output**
This example gets the console ouput for the specified Linux instance.
Command::
aws ec2 get-console-output --instance-id i-1234567890abcdef0
Output::
{
"InstanceId": "i-1234567890abcdef0",
"Timestamp": "2013-07-25T21:23:53.000Z",
"Output": "..."
}
**To get the latest console output**
This example gets the latest console output for the specified instance.
Command::
aws ec2 get-console-output --instance-id i-1234567890abcdef0 --latest --output text
Output::
i-1234567890abcdef0 [ 0.000000] Command line: root=LABEL=/ console=tty1 console=ttyS0 selinux=0 nvme_core.io_timeout=4294967295
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
...
Cloud-init v. 0.7.6 finished at Wed, 09 May 2018 19:01:13 +0000. Datasource DataSourceEc2. Up 21.50 seconds
Amazon Linux AMI release 2018.03
Kernel 4.14.26-46.32.amzn1.x86_64 on an x86_64
2018-05-09T19:07:01.000Z awscli-1.18.69/awscli/examples/ec2/create-egress-only-internet-gateway.rst 0000644 0000000 0000000 00000000725 13664010074 026425 0 ustar root root 0000000 0000000 **To create an egress-only Internet gateway**
This example creates an egress-only Internet gateway for the specified VPC.
Command::
aws ec2 create-egress-only-internet-gateway --vpc-id vpc-0c62a468
Output::
{
"EgressOnlyInternetGateway": {
"EgressOnlyInternetGatewayId": "eigw-015e0e244e24dfe8a",
"Attachments": [
{
"State": "attached",
"VpcId": "vpc-0c62a468"
}
]
}
} awscli-1.18.69/awscli/examples/ec2/modify-spot-fleet-request.rst 0000644 0000000 0000000 00000001227 13664010074 024463 0 ustar root root 0000000 0000000 **To modify a Spot fleet request**
This example command updates the target capacity of the specified Spot fleet request.
Command::
aws ec2 modify-spot-fleet-request --target-capacity 20 --spot-fleet-request-id sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE
Output::
{
"Return": true
}
This example command decreases the target capacity of the specified Spot fleet request without terminating any Spot Instances as a result.
Command::
aws ec2 modify-spot-fleet-request --target-capacity 10 --excess-capacity-termination-policy NoTermination --spot-fleet-request-ids sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE
Output::
{
"Return": true
}
awscli-1.18.69/awscli/examples/ec2/delete-traffic-mirror-filter.rst 0000644 0000000 0000000 00000001030 13664010074 025067 0 ustar root root 0000000 0000000 **To delete a traffic mirror filter**
The following ``delete-traffic-mirror-filter`` example deletes the specified traffic mirror filter. ::
aws ec2 delete-traffic-mirror-filter \
--traffic-mirror-filter-id tmf-0be0b25fcdEXAMPLE
Output::
{
"TrafficMirrorFilterId": "tmf-0be0b25fcdEXAMPLE"
}
For more information, see `Delete a Traffic Mirror Filter `__ in the *AWS Traffic Mirroring Guide*.
awscli-1.18.69/awscli/examples/ec2/create-image.rst 0000644 0000000 0000000 00000002446 13664010074 021755 0 ustar root root 0000000 0000000 **To create an AMI from an Amazon EBS-backed instance**
This example creates an AMI from the specified instance.
Command::
aws ec2 create-image --instance-id i-1234567890abcdef0 --name "My server" --description "An AMI for my server"
Output::
{
"ImageId": "ami-5731123e"
}
This example creates an AMI and sets the --no-reboot parameter, so that the instance is not rebooted before the image is created.
Command::
aws ec2 create-image --instance-id i-0b09a25c58929de26 --name "My server" --no-reboot
Output::
{
"ImageId": "ami-1a2b3c4d"
}
**To create an AMI using a block device mapping**
Add the following parameter to your ``create-image`` command to add an Amazon EBS volume with the device name ``/dev/sdh`` and a volume size of 100::
--block-device-mappings "[{\"DeviceName\": \"/dev/sdh\",\"Ebs\":{\"VolumeSize\":100}}]"
Add the following parameter to your ``create-image`` command to add ``ephemeral1`` as an instance store volume with the device name ``/dev/sdc``::
--block-device-mappings "[{\"DeviceName\": \"/dev/sdc\",\"VirtualName\":\"ephemeral1\"}]"
Add the following parameter to your ``create-image`` command to omit a device included on the instance (for example, ``/dev/sdf``)::
--block-device-mappings "[{\"DeviceName\": \"/dev/sdf\",\"NoDevice\":\"\"}]"
awscli-1.18.69/awscli/examples/ec2/delete-transit-gateway-route.rst 0000755 0000000 0000000 00000001625 13664010074 025152 0 ustar root root 0000000 0000000 **To delete a CIDR block from a route table**
The following command deletes the CIDR block from the specified transit gateway route table. ::
aws ec2 delete-transit-gateway-route \
--transit-gateway-route-table-id tgw-rtb-0b6f6aaa01EXAMPLE \
--destination-cidr-block 10.0.2.0/24
Output::
{
"Route": {
"DestinationCidrBlock": "10.0.2.0/24",
"TransitGatewayAttachments": [
{
"ResourceId": "vpc-0065acced4EXAMPLE",
"TransitGatewayAttachmentId": "tgw-attach-0b5968d3b6EXAMPLE",
"ResourceType": "vpc"
}
],
"Type": "static",
"State": "deleted"
}
}
For more information, see `Delete a Static Route `__ in the *AWS Transit Gateways*.
awscli-1.18.69/awscli/examples/ec2/create-placement-group.rst 0000644 0000000 0000000 00000000704 13664010074 023770 0 ustar root root 0000000 0000000 **To create a placement group**
This example command creates a placement group with the specified name.
Command::
aws ec2 create-placement-group --group-name my-cluster --strategy cluster
**To create a partition placement group**
This example command creates a partition placement group named ``HDFS-Group-A`` with five partitions.
Command::
aws ec2 create-placement-group --group-name HDFS-Group-A --strategy partition --partition-count 5
awscli-1.18.69/awscli/examples/ec2/cancel-conversion-task.rst 0000644 0000000 0000000 00000000422 13664010074 023772 0 ustar root root 0000000 0000000 **To cancel an active conversion of an instance or a volume**
This example cancels the upload associated with the task ID import-i-fh95npoc. If the command succeeds, no output is returned.
Command::
aws ec2 cancel-conversion-task --conversion-task-id import-i-fh95npoc
awscli-1.18.69/awscli/examples/ec2/describe-vpc-endpoint-connections.rst 0000644 0000000 0000000 00000001236 13664010074 026132 0 ustar root root 0000000 0000000 **To describe VPC endpoint connections**
This example describes the interface endpoint connections to your endpoint service and filters the results to display endpoints that are ``PendingAcceptance``.
Command::
aws ec2 describe-vpc-endpoint-connections --filters Name=vpc-endpoint-state,Values=pendingAcceptance
Output::
{
"VpcEndpointConnections": [
{
"VpcEndpointId": "vpce-0abed31004e618123",
"ServiceId": "vpce-svc-0abced088d20def56",
"CreationTimestamp": "2017-11-30T10:00:24.350Z",
"VpcEndpointState": "pendingAcceptance",
"VpcEndpointOwner": "123456789012"
}
]
} awscli-1.18.69/awscli/examples/ec2/confirm-product-instance.rst 0000644 0000000 0000000 00000000444 13664010074 024343 0 ustar root root 0000000 0000000 **To confirm the product instance**
This example determines whether the specified product code is associated with the specified instance.
Command::
aws ec2 confirm-product-instance --product-code 774F4FF8 --instance-id i-1234567890abcdef0
Output::
{
"OwnerId": "123456789012"
} awscli-1.18.69/awscli/examples/ec2/move-address-to-vpc.rst 0000644 0000000 0000000 00000000341 13664010074 023221 0 ustar root root 0000000 0000000 **To move an address to EC2-VPC**
This example moves Elastic IP address 54.123.4.56 to the EC2-VPC platform.
Command::
aws ec2 move-address-to-vpc --public-ip 54.123.4.56
Output::
{
"Status": "MoveInProgress"
} awscli-1.18.69/awscli/examples/ec2/reset-ebs-default-kms-key-id.rst 0000644 0000000 0000000 00000000543 13664010074 024711 0 ustar root root 0000000 0000000 **To reset your default CMK for EBS encryption**
The following ``reset-ebs-default-kms-key-id`` example resets the default CMK for EBS encryption for your AWS account in the current Region. ::
aws ec2 reset-ebs-default-kms-key-id
Output::
{
"KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/8c5b2c63-b9bc-45a3-a87a-5513eEXAMPLE"
}
awscli-1.18.69/awscli/examples/ec2/describe-bundle-tasks.rst 0000644 0000000 0000000 00000001064 13664010074 023577 0 ustar root root 0000000 0000000 **To describe your bundle tasks**
This example describes all of your bundle tasks.
Command::
aws ec2 describe-bundle-tasks
Output::
{
"BundleTasks": [
{
"UpdateTime": "2015-09-15T13:26:54.000Z",
"InstanceId": "i-1234567890abcdef0",
"Storage": {
"S3": {
"Prefix": "winami",
"Bucket": "bundletasks"
}
},
"State": "bundling",
"StartTime": "2015-09-15T13:24:35.000Z",
"Progress": "3%",
"BundleId": "bun-2a4e041c"
}
]
} awscli-1.18.69/awscli/examples/ec2/create-network-interface.rst 0000644 0000000 0000000 00000002162 13664010074 024315 0 ustar root root 0000000 0000000 **To create a network interface**
This example creates a network interface for the specified subnet.
Command::
aws ec2 create-network-interface --subnet-id subnet-9d4a7b6c --description "my network interface" --groups sg-903004f8 --private-ip-address 10.0.2.17
Output::
{
"NetworkInterface": {
"Status": "pending",
"MacAddress": "02:1a:80:41:52:9c",
"SourceDestCheck": true,
"VpcId": "vpc-a01106c2",
"Description": "my network interface",
"NetworkInterfaceId": "eni-e5aa89a3",
"PrivateIpAddresses": [
{
"Primary": true,
"PrivateIpAddress": "10.0.2.17"
}
],
"RequesterManaged": false,
"AvailabilityZone": "us-east-1d",
"Ipv6Addresses": [],
"Groups": [
{
"GroupName": "default",
"GroupId": "sg-903004f8"
}
],
"SubnetId": "subnet-9d4a7b6c",
"OwnerId": "123456789012",
"TagSet": [],
"PrivateIpAddress": "10.0.2.17"
}
} awscli-1.18.69/awscli/examples/ec2/get-capacity-reservation-usage.rst 0000644 0000000 0000000 00000001604 13664010074 025440 0 ustar root root 0000000 0000000 **To view capacity reservation usage across AWS accounts**
The following ``get-capacity-reservation-usage`` example displays usage information for the specified capacity reservation. ::
aws ec2 get-capacity-reservation-usage \
--capacity-reservation-id cr-1234abcd56EXAMPLE
Output::
{
"CapacityReservationId": "cr-1234abcd56EXAMPLE ",
"InstanceUsages": [
{
"UsedInstanceCount": 1,
"AccountId": "123456789012"
}
],
"AvailableInstanceCount": 4,
"TotalInstanceCount": 5,
"State": "active",
"InstanceType": "t2.medium"
}
For more information, see `Viewing Shared Capacity Reservation Usage `__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*.
awscli-1.18.69/awscli/examples/ec2/copy-snapshot.rst 0000644 0000000 0000000 00000001665 13664010074 022243 0 ustar root root 0000000 0000000 **Example 1: To copy a snapshot**
The following ``copy-snapshot`` example command copies the specified snapshot from the ``us-west-2`` Region to the ``us-east-1`` Region and adds a short description. ::
aws ec2 copy-snapshot \
--region us-east-1 \
--source-region us-west-2 \
--source-snapshot-id snap-066877671789bd71b \
--description "This is my copied snapshot."
Output::
{
"SnapshotId": "snap-066877671789bd71b"
}
**Example 2: To copy an unencrypted snapshot and encrypt the new snapshot**
The following ``copy-snapshot`` command copies the specified unencrypted snapshot from the ``us-west-2`` Region to the current Region and encrypts the new snapshot using the specified AWS KMS customer master key (CMK). ::
aws ec2 copy-snapshot \
--source-region us-west-2 \
--source-snapshot-id snap-066877671789bd71b \
--encrypted \
--kmd-key-id alias/my-cmk
awscli-1.18.69/awscli/examples/ec2/describe-volume-status.rst 0000644 0000000 0000000 00000002743 13664010074 024040 0 ustar root root 0000000 0000000 **To describe the status of a single volume**
This example command describes the status for the volume ``vol-1234567890abcdef0``.
Command::
aws ec2 describe-volume-status --volume-ids vol-1234567890abcdef0
Output::
{
"VolumeStatuses": [
{
"VolumeStatus": {
"Status": "ok",
"Details": [
{
"Status": "passed",
"Name": "io-enabled"
},
{
"Status": "not-applicable",
"Name": "io-performance"
}
]
},
"AvailabilityZone": "us-east-1a",
"VolumeId": "vol-1234567890abcdef0",
"Actions": [],
"Events": []
}
]
}
**To describe the status of impaired volumes**
This example command describes the status for all volumes that are impaired. In this example output, there are no impaired volumes.
Command::
aws ec2 describe-volume-status --filters Name=volume-status.status,Values=impaired
Output::
{
"VolumeStatuses": []
}
If you have a volume with a failed status check (status is impaired), see `Working with an Impaired Volume`_ in the *Amazon EC2 User Guide*.
.. _`Working with an Impaired Volume`: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-status.html#work_volumes_impaired
awscli-1.18.69/awscli/examples/ec2/modify-id-format.rst 0000755 0000000 0000000 00000001336 13664010074 022601 0 ustar root root 0000000 0000000 **To enable the longer ID format for a resource**
The following ``modify-id-format`` example enables the longer ID format for the ``instance`` resource type. ::
aws ec2 modify-id-format \
--resource instance \
--use-long-ids
**To disable the longer ID format for a resource**
The following ``modify-id-format`` example disables the longer ID format for the ``instance`` resource type. ::
aws ec2 modify-id-format \
--resource instance \
--no-use-long-ids
The following ``modify-id-format`` example enables the longer ID format for all supported resource types that are within their opt-in period. ::
aws ec2 modify-id-format \
--resource all-current \
--use-long-ids
awscli-1.18.69/awscli/examples/ec2/modify-vpc-endpoint-service-permissions.rst 0000644 0000000 0000000 00000001161 13664010074 027325 0 ustar root root 0000000 0000000 **To modify endpoint service permissions**
This example adds permission for an AWS account to connect to the specified endpoint service.
Command::
aws ec2 modify-vpc-endpoint-service-permissions --service-id vpce-svc-03d5ebb7d9579a2b3 --add-allowed-principals '["arn:aws:iam::123456789012:root"]'
Output::
{
"ReturnValue": true
}
This example adds permission for a specific IAM user (``admin``) to connect to the specified endpoint service.
Command::
aws ec2 modify-vpc-endpoint-service-permissions --service-id vpce-svc-03d5ebb7d9579a2b3 --add-allowed-principals '["arn:aws:iam::123456789012:user/admin"]'
awscli-1.18.69/awscli/examples/ec2/request-spot-instances.rst 0000644 0000000 0000000 00000011577 13664010074 024077 0 ustar root root 0000000 0000000 **To request Spot Instances**
This example command creates a one-time Spot Instance request for five instances in the specified Availability Zone.
If your account supports EC2-VPC only, Amazon EC2 launches the instances in the default subnet of the specified Availability Zone.
If your account supports EC2-Classic, Amazon EC2 launches the instances in EC2-Classic in the specified Availability Zone.
Command::
aws ec2 request-spot-instances --spot-price "0.03" --instance-count 5 --type "one-time" --launch-specification file://specification.json
Specification.json::
{
"ImageId": "ami-1a2b3c4d",
"KeyName": "my-key-pair",
"SecurityGroupIds": [ "sg-1a2b3c4d" ],
"InstanceType": "m3.medium",
"Placement": {
"AvailabilityZone": "us-west-2a"
},
"IamInstanceProfile": {
"Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role"
}
}
Output::
{
"SpotInstanceRequests": [
{
"Status": {
"UpdateTime": "2014-03-25T20:54:21.000Z",
"Code": "pending-evaluation",
"Message": "Your Spot request has been submitted for review, and is pending evaluation."
},
"ProductDescription": "Linux/UNIX",
"SpotInstanceRequestId": "sir-df6f405d",
"State": "open",
"LaunchSpecification": {
"Placement": {
"AvailabilityZone": "us-west-2a"
},
"ImageId": "ami-1a2b3c4d",
"KeyName": "my-key-pair",
"SecurityGroups": [
{
"GroupName": "my-security-group",
"GroupId": "sg-1a2b3c4d"
}
],
"Monitoring": {
"Enabled": false
},
"IamInstanceProfile": {
"Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role"
},
"InstanceType": "m3.medium"
},
"Type": "one-time",
"CreateTime": "2014-03-25T20:54:20.000Z",
"SpotPrice": "0.050000"
},
...
]
}
This example command creates a one-time Spot Instance request for five instances in the specified subnet.
Amazon EC2 launches the instances in the specified subnet. If the VPC is a nondefault VPC, the instances
do not receive a public IP address by default.
Command::
aws ec2 request-spot-instances --spot-price "0.050" --instance-count 5 --type "one-time" --launch-specification file://specification.json
Specification.json::
{
"ImageId": "ami-1a2b3c4d",
"SecurityGroupIds": [ "sg-1a2b3c4d" ],
"InstanceType": "m3.medium",
"SubnetId": "subnet-1a2b3c4d",
"IamInstanceProfile": {
"Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role"
}
}
Output::
{
"SpotInstanceRequests": [
{
"Status": {
"UpdateTime": "2014-03-25T22:21:58.000Z",
"Code": "pending-evaluation",
"Message": "Your Spot request has been submitted for review, and is pending evaluation."
},
"ProductDescription": "Linux/UNIX",
"SpotInstanceRequestId": "sir-df6f405d",
"State": "open",
"LaunchSpecification": {
"Placement": {
"AvailabilityZone": "us-west-2a"
}
"ImageId": "ami-1a2b3c4d"
"SecurityGroups": [
{
"GroupName": "my-security-group",
"GroupID": "sg-1a2b3c4d"
}
]
"SubnetId": "subnet-1a2b3c4d",
"Monitoring": {
"Enabled": false
},
"IamInstanceProfile": {
"Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role"
},
"InstanceType": "m3.medium",
},
"Type": "one-time",
"CreateTime": "2014-03-25T22:21:58.000Z",
"SpotPrice": "0.050000"
},
...
]
}
This example assigns a public IP address to the Spot Instances that you launch in a nondefault VPC.
Note that when you specify a network interface, you must include the subnet ID and security group ID
using the network interface.
Command::
aws ec2 request-spot-instances --spot-price "0.050" --instance-count 1 --type "one-time" --launch-specification file://specification.json
Specification.json::
{
"ImageId": "ami-1a2b3c4d",
"KeyName": "my-key-pair",
"InstanceType": "m3.medium",
"NetworkInterfaces": [
{
"DeviceIndex": 0,
"SubnetId": "subnet-1a2b3c4d",
"Groups": [ "sg-1a2b3c4d" ],
"AssociatePublicIpAddress": true
}
],
"IamInstanceProfile": {
"Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role"
}
}
awscli-1.18.69/awscli/examples/ec2/create-security-group.rst 0000644 0000000 0000000 00000001407 13664010074 023670 0 ustar root root 0000000 0000000 **To create a security group for EC2-Classic**
This example creates a security group named ``MySecurityGroup``.
Command::
aws ec2 create-security-group --group-name MySecurityGroup --description "My security group"
Output::
{
"GroupId": "sg-903004f8"
}
**To create a security group for EC2-VPC**
This example creates a security group named ``MySecurityGroup`` for the specified VPC.
Command::
aws ec2 create-security-group --group-name MySecurityGroup --description "My security group" --vpc-id vpc-1a2b3c4d
Output::
{
"GroupId": "sg-903004f8"
}
For more information, see `Using Security Groups`_ in the *AWS Command Line Interface User Guide*.
.. _`Using Security Groups`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-sg.html
awscli-1.18.69/awscli/examples/ec2/delete-transit-gateway-peering-attachment.rst 0000644 0000000 0000000 00000002102 13664010074 027557 0 ustar root root 0000000 0000000 **To delete a transit gateway peering attachment**
The following ``delete-transit-gateway-peering-attachment`` example deletes the specified transit gateway peering attachment. ::
aws ec2 delete-transit-gateway-peering-attachment \
--transit-gateway-attachment-id tgw-attach-4455667788aabbccd
Output::
{
"TransitGatewayPeeringAttachment": {
"TransitGatewayAttachmentId": "tgw-attach-4455667788aabbccd",
"RequesterTgwInfo": {
"TransitGatewayId": "tgw-123abc05e04123abc",
"OwnerId": "123456789012",
"Region": "us-west-2"
},
"AccepterTgwInfo": {
"TransitGatewayId": "tgw-11223344aabbcc112",
"OwnerId": "123456789012",
"Region": "us-east-2"
},
"State": "deleting",
"CreationTime": "2019-12-09T11:38:31.000Z"
}
}
For more information, see `Transit Gateway Peering Attachments `__ in the *Transit Gateways Guide*.
awscli-1.18.69/awscli/examples/ec2/describe-aggregate-id-format.rst 0000755 0000000 0000000 00000002211 13664010074 025007 0 ustar root root 0000000 0000000 **To describe the longer ID format settings for all resource types in a Region**
The following ``describe-aggregate-id-format`` example describes the overall long ID format status for the current Region. The ``Deadline`` value indicates that the deadlines for these resources to permanently switch from the short ID format to the long ID format expired. The ``UseLongIdsAggregated`` value indicates that all IAM users and IAM roles are configured to use long ID format for all resource types. ::
aws ec2 describe-aggregate-id-format
Output::
{
"UseLongIdsAggregated": true,
"Statuses": [
{
"Deadline": "2018-08-13T02:00:00.000Z",
"Resource": "network-interface-attachment",
"UseLongIds": true
},
{
"Deadline": "2016-12-13T02:00:00.000Z",
"Resource": "instance",
"UseLongIds": true
},
{
"Deadline": "2018-08-13T02:00:00.000Z",
"Resource": "elastic-ip-association",
"UseLongIds": true
},
...
]
} awscli-1.18.69/awscli/examples/ec2/purchase-host-reservation.rst 0000644 0000000 0000000 00000001351 13664010074 024550 0 ustar root root 0000000 0000000 **To purchase a Dedicated Host Reservation**
This example purchases the specified Dedicated Host Reservation offering for the specified Dedicated Host in your account.
Command::
aws ec2 purchase-host-reservation --offering-id hro-03f707bf363b6b324 --host-id-set h-013abcd2a00cbd123
Output::
{
"TotalHourlyPrice": "1.499",
"Purchase": [
{
"HourlyPrice": "1.499",
"InstanceFamily": "m4",
"PaymentOption": "NoUpfront",
"HostIdSet": [
"h-013abcd2a00cbd123"
],
"HostReservationId": "hr-0d418a3a4ffc669ae",
"UpfrontPrice": "0.000",
"Duration": 31536000
}
],
"TotalUpfrontPrice": "0.000"
} awscli-1.18.69/awscli/examples/ec2/associate-route-table.rst 0000644 0000000 0000000 00000000436 13664010074 023623 0 ustar root root 0000000 0000000 **To associate a route table with a subnet**
This example associates the specified route table with the specified subnet.
Command::
aws ec2 associate-route-table --route-table-id rtb-22574640 --subnet-id subnet-9d4a7b6c
Output::
{
"AssociationId": "rtbassoc-781d0d1a"
} awscli-1.18.69/awscli/examples/ec2/accept-vpc-endpoint-connections.rst 0000644 0000000 0000000 00000000516 13664010074 025611 0 ustar root root 0000000 0000000 **To accept an interface endpoint connection request**
This example accepts the specified endpoint connection request for the specified endpoint service.
Command::
aws ec2 accept-vpc-endpoint-connections --service-id vpce-svc-03d5ebb7d9579a2b3 --vpc-endpoint-ids vpce-0c1308d7312217abc
Output::
{
"Unsuccessful": []
} awscli-1.18.69/awscli/examples/ec2/modify-network-interface-attribute.rst 0000644 0000000 0000000 00000002235 13664010074 026343 0 ustar root root 0000000 0000000 **To modify the attachment attribute of a network interface**
This example command modifies the ``attachment`` attribute of the specified network interface.
Command::
aws ec2 modify-network-interface-attribute --network-interface-id eni-686ea200 --attachment AttachmentId=eni-attach-43348162,DeleteOnTermination=false
**To modify the description attribute of a network interface**
This example command modifies the ``description`` attribute of the specified network interface.
Command::
aws ec2 modify-network-interface-attribute --network-interface-id eni-686ea200 --description "My description"
**To modify the groupSet attribute of a network interface**
This example command modifies the ``groupSet`` attribute of the specified network interface.
Command::
aws ec2 modify-network-interface-attribute --network-interface-id eni-686ea200 --groups sg-903004f8 sg-1a2b3c4d
**To modify the sourceDestCheck attribute of a network interface**
This example command modifies the ``sourceDestCheck`` attribute of the specified network interface.
Command::
aws ec2 modify-network-interface-attribute --network-interface-id eni-686ea200 --no-source-dest-check
awscli-1.18.69/awscli/examples/ec2/disassociate-route-table.rst 0000644 0000000 0000000 00000000365 13664010074 024324 0 ustar root root 0000000 0000000 **To disassociate a route table**
This example disassociates the specified route table from the specified subnet. If the command succeeds, no output is returned.
Command::
aws ec2 disassociate-route-table --association-id rtbassoc-781d0d1a
awscli-1.18.69/awscli/examples/ec2/get-password-data.rst 0000644 0000000 0000000 00000001723 13664010074 022755 0 ustar root root 0000000 0000000 **To get the encrypted password**
This example gets the encrypted password.
Command::
aws ec2 get-password-data --instance-id i-1234567890abcdef0
Output::
{
"InstanceId": "i-1234567890abcdef0",
"Timestamp": "2013-08-07T22:18:38.000Z",
"PasswordData": "gSlJFq+VpcZXqy+iktxMF6NyxQ4qCrT4+gaOuNOenX1MmgXPTj7XEXAMPLE
UQ+YeFfb+L1U4C4AKv652Ux1iRB3CPTYP7WmU3TUnhsuBd+p6LVk7T2lKUml6OXbk6WPW1VYYm/TRPB1
e1DQ7PY4an/DgZT4mwcpRFigzhniQgDDeO1InvSDcwoUTwNs0Y1S8ouri2W4n5GNlriM3Q0AnNVelVz/
53TkDtxbNoU606M1gK9zUWSxqEgwvbV2j8c5rP0WCuaMWSFl4ziDu4bd7q+4RSyi8NUsVWnKZ4aEZffu
DPGzKrF5yLlf3etP2L4ZR6CvG7K1hx7VKOQVN32Dajw=="
}
**To get the decrypted password**
This example gets the decrypted password.
Command::
aws ec2 get-password-data --instance-id i-1234567890abcdef0 --priv-launch-key C:\Keys\MyKeyPair.pem
Output::
{
"InstanceId": "i-1234567890abcdef0",
"Timestamp": "2013-08-30T23:18:05.000Z",
"PasswordData": "&ViJ652e*u"
}
awscli-1.18.69/awscli/examples/ec2/modify-vpn-connection.rst 0000644 0000000 0000000 00000002671 13664010074 023657 0 ustar root root 0000000 0000000 **To modify a VPN connection**
The following ``modify-vpn-connection`` example changes the target gateway for VPN connection ``vpn-12345678901234567`` to virtual private gateway ``vgw-11223344556677889``::
aws ec2 modify-vpn-connection \
--vpn-connection-id vpn-12345678901234567 \
--vpn-gateway-id vgw-11223344556677889
Output::
{
"VpnConnection": {
"CustomerGatewayConfiguration": "...configuration information...",
"CustomerGatewayId": "cgw-aabbccddee1122334",
"Category": "VPN",
"State": "modifying",
"Type": "ipsec.1",
"VpnConnectionId": "vpn-12345678901234567",
"VpnGatewayId": "vgw-11223344556677889",
"Options": {
"StaticRoutesOnly": false
},
"VgwTelemetry": [
{
"AcceptedRouteCount": 0,
"LastStatusChange": "2019-07-17T07:34:00.000Z",
"OutsideIpAddress": "18.210.3.222",
"Status": "DOWN",
"StatusMessage": "IPSEC IS DOWN"
},
{
"AcceptedRouteCount": 0,
"LastStatusChange": "2019-07-20T21:20:16.000Z",
"OutsideIpAddress": "34.193.129.33",
"Status": "DOWN",
"StatusMessage": "IPSEC IS DOWN"
}
]
}
}
awscli-1.18.69/awscli/examples/ec2/delete-fpga-image.rst 0000644 0000000 0000000 00000000300 13664010074 022652 0 ustar root root 0000000 0000000 **To delete an Amazon FPGA image**
This example deletes the specified AFI.
Command::
aws ec2 delete-fpga-image --fpga-image-id afi-06b12350a123fbabc
Output::
{
"Return": true
}
awscli-1.18.69/awscli/examples/ec2/describe-reserved-instances.rst 0000644 0000000 0000000 00000004420 13664010074 025006 0 ustar root root 0000000 0000000 **To describe your Reserved Instances**
This example command describes the Reserved Instances that you own.
Command::
aws ec2 describe-reserved-instances
Output::
{
"ReservedInstances": [
{
"ReservedInstancesId": "b847fa93-e282-4f55-b59a-1342fexample",
"OfferingType": "No Upfront",
"AvailabilityZone": "us-west-1c",
"End": "2016-08-14T21:34:34.000Z",
"ProductDescription": "Linux/UNIX",
"UsagePrice": 0.00,
"RecurringCharges": [
{
"Amount": 0.104,
"Frequency": "Hourly"
}
],
"Start": "2015-08-15T21:34:35.086Z",
"State": "active",
"FixedPrice": 0.0,
"CurrencyCode": "USD",
"Duration": 31536000,
"InstanceTenancy": "default",
"InstanceType": "m3.medium",
"InstanceCount": 2
},
...
]
}
**To describe your Reserved Instances using filters**
This example filters the response to include only three-year, t2.micro Linux/UNIX Reserved Instances in us-west-1c.
Command::
aws ec2 describe-reserved-instances --filters Name=duration,Values=94608000 Name=instance-type,Values=t2.micro Name=product-description,Values=Linux/UNIX Name=availability-zone,Values=us-east-1e
Output::
{
"ReservedInstances": [
{
"ReservedInstancesId": "f127bd27-edb7-44c9-a0eb-0d7e09259af0",
"OfferingType": "All Upfront",
"AvailabilityZone": "us-east-1e",
"End": "2018-03-26T21:34:34.000Z",
"ProductDescription": "Linux/UNIX",
"UsagePrice": 0.00,
"RecurringCharges": [],
"Start": "2015-03-27T21:34:35.848Z",
"State": "active",
"FixedPrice": 151.0,
"CurrencyCode": "USD",
"Duration": 94608000,
"InstanceTenancy": "default",
"InstanceType": "t2.micro",
"InstanceCount": 1
}
]
}
For more information, see `Using Amazon EC2 Instances`_ in the *AWS Command Line Interface User Guide*.
.. _`Using Amazon EC2 Instances`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-launch.html
awscli-1.18.69/awscli/examples/ec2/modify-instance-capacity-reservation-attributes.rst 0000644 0000000 0000000 00000002600 13664010074 031031 0 ustar root root 0000000 0000000 **Example 1: To modify an instance's capacity reservation targeting settings**
The following ``modify-instance-capacity-reservation-attributes`` example modifies a stopped instance to target a specific capacity reservation. ::
aws ec2 modify-instance-capacity-reservation-attributes \
--instance-id i-EXAMPLE8765abcd4e \
--capacity-reservation-specification 'CapacityReservationTarget={CapacityReservationId= cr-1234abcd56EXAMPLE }'
Output::
{
"Return": true
}
**Example 2: To modify an instance's capacity reservation targeting settings**
The following ``modify-instance-capacity-reservation-attributes`` example modifies a stopped instance that targets the specified capacity reservation to launch in any capacity reservation that has matching attributes (instance type, platform, Availability Zone) and that has open instance matching criteria. ::
aws ec2 modify-instance-capacity-reservation-attributes \
--instance-id i-EXAMPLE8765abcd4e \
--capacity-reservation-specification 'CapacityReservationPreference=open'
Output::
{
"Return": true
}
For more information, see `Modifying an Instance's Capacity Reservation Settings `__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*.
awscli-1.18.69/awscli/examples/ec2/deprovision-byoip-cidr.rst 0000644 0000000 0000000 00000000513 13664010074 024023 0 ustar root root 0000000 0000000 **To remove an IP address range from use**
The following example removes the specified address range from use with AWS. ::
aws ec2 deprovision-byoip-cidr \
--cidr 203.0.113.25/24
Output::
{
"ByoipCidr": {
"Cidr": "203.0.113.25/24",
"State": "pending-deprovision"
}
}
awscli-1.18.69/awscli/examples/ec2/release-hosts.rst 0000644 0000000 0000000 00000000570 13664010074 022204 0 ustar root root 0000000 0000000 **To release a Dedicated host from your account**
To release a Dedicated host from your account. Instances that are on the host must be stopped or terminated before the host can be released.
Command::
aws ec2 release-hosts --host-id=h-0029d6e3cacf1b3da
Output::
{
"Successful": [
"h-0029d6e3cacf1b3da"
],
"Unsuccessful": []
}
awscli-1.18.69/awscli/examples/ec2/describe-key-pairs.rst 0000644 0000000 0000000 00000001055 13664010074 023107 0 ustar root root 0000000 0000000 **To display a key pair**
This example displays the fingerprint for the key pair named ``MyKeyPair``.
Command::
aws ec2 describe-key-pairs --key-name MyKeyPair
Output::
{
"KeyPairs": [
{
"KeyName": "MyKeyPair",
"KeyFingerprint": "1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f"
}
]
}
For more information, see `Using Key Pairs`_ in the *AWS Command Line Interface User Guide*.
.. _`Using Key Pairs`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-keypairs.html
awscli-1.18.69/awscli/examples/ec2/associate-iam-instance-profile.rst 0000644 0000000 0000000 00000001212 13664010074 025377 0 ustar root root 0000000 0000000 **To associate an IAM instance profile with an instance**
This example associates an IAM instance profile named ``admin-role`` with instance ``i-123456789abcde123``.
Command::
aws ec2 associate-iam-instance-profile --instance-id i-123456789abcde123 --iam-instance-profile Name=admin-role
Output::
{
"IamInstanceProfileAssociation": {
"InstanceId": "i-123456789abcde123",
"State": "associating",
"AssociationId": "iip-assoc-0e7736511a163c209",
"IamInstanceProfile": {
"Id": "AIPAJBLK7RKJKWDXVHIEC",
"Arn": "arn:aws:iam::123456789012:instance-profile/admin-role"
}
}
}
awscli-1.18.69/awscli/examples/ec2/create-fpga-image.rst 0000644 0000000 0000000 00000000703 13664010074 022662 0 ustar root root 0000000 0000000 **To create an Amazon FPGA image**
This example creates an AFI from the specified tarball in the specified bucket.
Command::
aws ec2 create-fpga-image --name my-afi --description test-afi --input-storage-location Bucket=my-fpga-bucket,Key=dcp/17_12_22-103226.Developer_CL.tar --logs-storage-location Bucket=my-fpga-bucket,Key=logs
Output::
{
"FpgaImageId": "afi-0d123e123bfc85abc",
"FpgaImageGlobalId": "agfi-123cb27b5e84a0abc"
}
awscli-1.18.69/awscli/examples/ec2/delete-placement-group.rst 0000644 0000000 0000000 00000000242 13664010074 023764 0 ustar root root 0000000 0000000 **To delete a placement group**
This example command deletes the specified placement group.
Command::
aws ec2 delete-placement-group --group-name my-cluster
awscli-1.18.69/awscli/examples/ec2/describe-vpc-peering-connections.rst 0000644 0000000 0000000 00000005362 13664010074 025747 0 ustar root root 0000000 0000000 **To describe your VPC peering connections**
This example describes all of your VPC peering connections.
Command::
aws ec2 describe-vpc-peering-connections
Output::
{
"VpcPeeringConnections": [
{
"Status": {
"Message": "Active",
"Code": "active"
},
"Tags": [
{
"Value": "Peering-1",
"Key": "Name"
}
],
"AccepterVpcInfo": {
"OwnerId": "111122223333",
"VpcId": "vpc-1a2b3c4d",
"CidrBlock": "10.0.1.0/28"
},
"VpcPeeringConnectionId": "pcx-11122233",
"RequesterVpcInfo": {
"PeeringOptions": {
"AllowEgressFromLocalVpcToRemoteClassicLink": false,
"AllowEgressFromLocalClassicLinkToRemoteVpc": false
},
"OwnerId": "444455556666",
"VpcId": "vpc-123abc45",
"CidrBlock": "192.168.0.0/16"
}
},
{
"Status": {
"Message": "Pending Acceptance by 444455556666",
"Code": "pending-acceptance"
},
"Tags": [],
"RequesterVpcInfo": {
"PeeringOptions": {
"AllowEgressFromLocalVpcToRemoteClassicLink": false,
"AllowEgressFromLocalClassicLinkToRemoteVpc": false
},
"OwnerId": "444455556666",
"VpcId": "vpc-11aa22bb",
"CidrBlock": "10.0.0.0/28"
},
"VpcPeeringConnectionId": "pcx-abababab",
"ExpirationTime": "2014-04-03T09:12:43.000Z",
"AccepterVpcInfo": {
"OwnerId": "444455556666",
"VpcId": "vpc-33cc44dd"
}
}
]
}
**To describe specific VPC peering connections**
This example describes all of your VPC peering connections that are in the pending-acceptance state.
Command::
aws ec2 describe-vpc-peering-connections --filters Name=status-code,Values=pending-acceptance
This example describes all of your VPC peering connections that have the tag Owner=Finance.
Command::
aws ec2 describe-vpc-peering-connections --filters Name=tag:Owner,Values=Finance
This example describes all of the VPC peering connections you requested for the specified VPC, vpc-1a2b3c4d.
Command::
aws ec2 describe-vpc-peering-connections --filters Name=requester-vpc-info.vpc-id,Values=vpc-1a2b3c4d
awscli-1.18.69/awscli/examples/ec2/delete-network-acl.rst 0000644 0000000 0000000 00000000304 13664010074 023107 0 ustar root root 0000000 0000000 **To delete a network ACL**
This example deletes the specified network ACL. If the command succeeds, no output is returned.
Command::
aws ec2 delete-network-acl --network-acl-id acl-5fb85d36
awscli-1.18.69/awscli/examples/ec2/delete-launch-template-versions.rst 0000644 0000000 0000000 00000000763 13664010074 025623 0 ustar root root 0000000 0000000 **To delete a launch template version**
This example deletes the specified launch template version.
Command::
aws ec2 delete-launch-template-versions --launch-template-id lt-0abcd290751193123 --versions 1
Output::
{
"UnsuccessfullyDeletedLaunchTemplateVersions": [],
"SuccessfullyDeletedLaunchTemplateVersions": [
{
"LaunchTemplateName": "TestVersion",
"VersionNumber": 1,
"LaunchTemplateId": "lt-0abcd290751193123"
}
]
} awscli-1.18.69/awscli/examples/ec2/delete-transit-gateway-route-table.rst 0000755 0000000 0000000 00000001536 13664010074 026240 0 ustar root root 0000000 0000000 **To delete a transit gateway route table**
The following ``delete-transit-gateway-route-table`` example deletes the specified transit gateway route table. ::
aws ec2 delete-transit-gateway-route-table \
--transit-gateway-route-table-id tgw-rtb-0b6f6aaa01EXAMPLE
Output::
{
"TransitGatewayRouteTable": {
"TransitGatewayRouteTableId": "tgw-rtb-0b6f6aaa01EXAMPLE",
"TransitGatewayId": "tgw-02f776b1a7EXAMPLE",
"State": "deleting",
"DefaultAssociationRouteTable": false,
"DefaultPropagationRouteTable": false,
"CreationTime": "2019-07-17T20:27:26.000Z"
}
}
For more information, see `Delete a Transit Gateway Route Table `__ in the *AWS Transit Gateways Guide*.
awscli-1.18.69/awscli/examples/ec2/create-instance-export-task.rst 0000644 0000000 0000000 00000001631 13664010074 024751 0 ustar root root 0000000 0000000 **To export an instance**
This example command creates a task to export the instance i-1234567890abcdef0 to the Amazon S3 bucket
myexportbucket.
Command::
aws ec2 create-instance-export-task --description "RHEL5 instance" --instance-id i-1234567890abcdef0 --target-environment vmware --export-to-s3-task DiskImageFormat=vmdk,ContainerFormat=ova,S3Bucket=myexportbucket,S3Prefix=RHEL5
Output::
{
"ExportTask": {
"State": "active",
"InstanceExportDetails": {
"InstanceId": "i-1234567890abcdef0",
"TargetEnvironment": "vmware"
},
"ExportToS3Task": {
"S3Bucket": "myexportbucket",
"S3Key": "RHEL5export-i-fh8sjjsq.ova",
"DiskImageFormat": "vmdk",
"ContainerFormat": "ova"
},
"Description": "RHEL5 instance",
"ExportTaskId": "export-i-fh8sjjsq"
}
}
awscli-1.18.69/awscli/examples/ec2/enable-fast-snapshot-restores.rst 0000755 0000000 0000000 00000002107 13664010074 025311 0 ustar root root 0000000 0000000 **To enable fast snapshot restore**
The following ``enable-fast-snapshot-restores`` example enables fast snapshot restore for the specified snapshot in the specified Availability Zones. ::
aws ec2 enable-fast-snapshot-restores \
--availability-zones us-east-2a us-east-2b \
--source-snapshot-ids snap-1234567890abcdef0
Output::
{
"Successful": [
{
"SnapshotId": "snap-1234567890abcdef0"
"AvailabilityZone": "us-east-2a",
"State": "enabling",
"StateTransitionReason": "Client.UserInitiated",
"OwnerId": "123456789012",
"EnablingTime": "2020-01-25T23:57:49.602Z"
},
{
"SnapshotId": "snap-1234567890abcdef0"
"AvailabilityZone": "us-east-2b",
"State": "enabling",
"StateTransitionReason": "Client.UserInitiated",
"OwnerId": "123456789012",
"EnablingTime": "2020-01-25T23:57:49.596Z"
}
],
"Unsuccessful": []
}
awscli-1.18.69/awscli/examples/ec2/wait/ 0000755 0000000 0000000 00000000000 13664010277 017643 5 ustar root root 0000000 0000000 awscli-1.18.69/awscli/examples/ec2/wait/instance-running.rst 0000644 0000000 0000000 00000000444 13664010074 023654 0 ustar root root 0000000 0000000 **To wait until an instance is running**
The following ``wait instance-running`` example pauses and resumes running only after it confirms that the specified instance is running. It produces no output. ::
aws ec2 wait instance-running \
--instance-ids i-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/bundle-task-complete.rst 0000755 0000000 0000000 00000000470 13664010074 024413 0 ustar root root 0000000 0000000 **To pause running until a bundle task is completed**
The following ``wait bundle-task-completed`` example pauses and continues only after it can confirm that the specified bundle task is completed. ::
aws ec2 wait bundle-task-completed \
--bundle-ids bun-2a4e041c
This command produces no output. awscli-1.18.69/awscli/examples/ec2/wait/vpc-exists.rst 0000644 0000000 0000000 00000000413 13664010074 022473 0 ustar root root 0000000 0000000 **To wait until a virtual private cloud (VPC) exists**
The following ``wait vpc-exists`` example command pauses and resumes running only after it confirms that the specified VPC exists. ::
aws ec2 wait vpc-exists \
--vpc-ids vpc-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/vpn-connection-available.rst 0000644 0000000 0000000 00000000506 13664010074 025247 0 ustar root root 0000000 0000000 **To wait until a VPN connection is available**
The following ``vpn-connection-available`` example pauses and resumes running only after it confirms that the specified VPN connection is available. It produces no output. ::
aws ec2 wait vpn-connection-available \
--vpn-connection-ids vpn-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/nat-gateway-available.rst 0000644 0000000 0000000 00000000474 13664010074 024534 0 ustar root root 0000000 0000000 **To wait until a NAT gateway is available**
The following ``wait nat-gateway-available`` example pauses and resumes running only after it confirms that the specified NAT gateway is available. It produces no output. ::
aws ec2 wait nat-gateway-available \
--nat-gateway-ids nat-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/volume-deleted.rst 0000644 0000000 0000000 00000000443 13664010074 023304 0 ustar root root 0000000 0000000 **To wait until a volume is deleted**
The following ``wait volume-deleted`` example command pauses and resumes running only after it confirms that the specified volume is deleted. It produces no output. ::
aws ec2 wait volume-deleted \
--volume-ids vol-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/system-status-ok.rst 0000644 0000000 0000000 00000000475 13664010074 023652 0 ustar root root 0000000 0000000 **To wait until the system status is OK**
The following ``wait system-status-ok`` example command pauses and resumes running only after it confirms that the system status of the specified instance is OK. It produces no output. ::
aws ec2 wait system-status-ok \
--instance-ids i-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/subnet-available.rst 0000644 0000000 0000000 00000000446 13664010074 023612 0 ustar root root 0000000 0000000 **To wait until a subnet is available**
The following ``wait subnet-available`` example pauses and resumes running only after it confirms that the specified subnet is available. It produces no output. ::
aws ec2 wait subnet-available \
--subnet-ids subnet-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/instance-stopped.rst 0000644 0000000 0000000 00000000444 13664010074 023652 0 ustar root root 0000000 0000000 **To wait until an instance is stopped**
The following ``wait instance-stopped`` example pauses and resumes running only after it confirms that the specified instance is stopped. It produces no output. ::
aws ec2 wait instance-stopped \
--instance-ids i-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/customer-gateway-available.rst 0000644 0000000 0000000 00000000525 13664010074 025610 0 ustar root root 0000000 0000000 **To wait until a customer gateway is available**
The following ``wait customer-gateway-available`` example pauses and resumes running only after it confirms that the specified customer gateway is available. It produces no output. ::
aws ec2 wait customer-gateway-available \
--customer-gateway-ids cgw-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/export-task-completed.rst 0000755 0000000 0000000 00000000500 13664010074 024621 0 ustar root root 0000000 0000000 **To pause running until an export task is completed**
The following ``wait export-task-completed`` example pauses and continues only after it can confirm that the specified export task is completed. ::
aws ec2 wait export-task-completed \
--export-task-ids export-i-fgelt0i7
This command produces no output.
awscli-1.18.69/awscli/examples/ec2/wait/vpc-peering-connection-deleted.rst 0000644 0000000 0000000 00000000553 13664010074 026353 0 ustar root root 0000000 0000000 **To wait until a VPC peering connection is deleted**
The following ``wait vpc-peering-connection-deleted`` example pauses and resumes running only after it confirms that the specified VPC peering connection is deleted. It produces no output. ::
aws ec2 wait vpc-peering-connection-deleted \
--vpc-peering-connection-ids pcx-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/export-task-cancelled.rst 0000755 0000000 0000000 00000000500 13664010074 024557 0 ustar root root 0000000 0000000 **To pause running until an export task is cancelled**
The following ``wait export-task-cancelled`` example pauses and continues only after it can confirm that the specified export task is cancelled. ::
aws ec2 wait export-task-cancelled \
--export-task-ids export-i-fgelt0i7
This command produces no output.
awscli-1.18.69/awscli/examples/ec2/wait/instance-terminated.rst 0000644 0000000 0000000 00000000455 13664010074 024332 0 ustar root root 0000000 0000000 **To wait until an instance terminates**
The following ``wait instance-terminated`` example pauses and resumes running only after it confirms that the specified instance is terminated. It produces no output. ::
aws ec2 wait instance-terminated \
--instance-ids i-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/conversion-task-deleted.rst 0000755 0000000 0000000 00000000513 13664010074 025123 0 ustar root root 0000000 0000000 **To pause running until a conversion task is deleted**
The following ``wait conversion-task-deleted`` example pauses and continues only after it can confirm that the specified conversion task is deleted. ::
aws ec2 wait conversion-task-deleted \
--conversion-task-ids import-i-fh95npoc
This command produces no output.
awscli-1.18.69/awscli/examples/ec2/wait/spot-instance-request-fulfilled.rst 0000644 0000000 0000000 00000000617 13664010074 026615 0 ustar root root 0000000 0000000 **To wait until an Spot Instance request is fulfilled**
The following ``wait spot-instance-request-fulfilled`` example pauses and resumes running only after it confirms that a Spot Instance request is fulfilled in the specified Availability Zone. It produces no output. ::
aws ec2 wait spot-instance-request-fulfilled \
--filters Name=launched-availability-zone,Values=us-east-1
awscli-1.18.69/awscli/examples/ec2/wait/volume-available.rst 0000644 0000000 0000000 00000000453 13664010074 023617 0 ustar root root 0000000 0000000 **To wait until a volume is available**
The following ``wait volume-available`` example command pauses and resumes running only after it confirms that the specified volume is available. It produces no output. ::
aws ec2 wait volume-available \
--volume-ids vol-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/snapshot-completed.rst 0000644 0000000 0000000 00000000456 13664010074 024206 0 ustar root root 0000000 0000000 **To wait until a snapshot is completed**
The following ``wait snapshot-completed`` example pauses and resumes running only after it confirms that the specified snapshot is completed. It produces no output. ::
aws ec2 wait snapshot-completed \
--snapshot-ids snap-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/password-data-available.rst 0000644 0000000 0000000 00000000560 13664010074 025060 0 ustar root root 0000000 0000000 **To wait until the password data for a Windows instance is available**
The following ``wait password-data-available`` example pauses and resumes running only after it confirms that the password data for the specified Windows instance is available. It produces no output. ::
aws ec2 wait password-data-available \
--instance-id i-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/instance-status-ok.rst 0000644 0000000 0000000 00000000472 13664010074 024127 0 ustar root root 0000000 0000000 **To wait until the status of an instance is OK**
The following ``wait instance-status-ok`` example pauses and resumes running only after it confirms that the status of the specified instance is OK. It produces no output. ::
aws ec2 wait instance-status-ok \
--instance-ids i-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/network-interface-available.rst 0000644 0000000 0000000 00000000532 13664010074 025735 0 ustar root root 0000000 0000000 **To wait until a network interface is available**
The following ``wait network-interface-available`` example pauses and resumes running only after it confirms that the specified network interface is available. It produces no output. ::
aws ec2 wait network-interface-available \
--network-interface-ids eni-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/vpc-peering-connection-exists.rst 0000644 0000000 0000000 00000000506 13664010074 026262 0 ustar root root 0000000 0000000 **To wait until a VPC peering connection exists**
The following ``wait vpc-peering-connection-exists`` example pauses and continues only when it can confirm that the specified VPC peering connection exists. ::
aws ec2 wait vpc-peering-connection-exists \
--vpc-peering-connection-ids pcx-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/vpn-connection-deleted.rst 0000644 0000000 0000000 00000000503 13664010074 024732 0 ustar root root 0000000 0000000 **To wait until a VPN connection is deleted**
The following ``waitt vpn-connection-deleted`` example command pauses and continues when it can confirm that the specified VPN connection is deleted. It produces no output. ::
aws ec2 wait vpn-connection-deleted \
--vpn-connection-ids vpn-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/image-available.rst 0000644 0000000 0000000 00000000456 13664010074 023375 0 ustar root root 0000000 0000000 **To wait until an image is available**
The following ``wait image-available`` example pauses and resumes running only after it confirms that the specified Amazon Machine Image is available. It produces no output. ::
aws ec2 wait image-available \
--image-ids ami-0abcdef1234567890
awscli-1.18.69/awscli/examples/ec2/wait/volume-in-use.rst 0000644 0000000 0000000 00000000427 13664010074 023100 0 ustar root root 0000000 0000000 **To wait until a volume is in use**
The following ``wait volume-in-use`` example pauses and resumes running only after it confirms that the specified volume is in use. It produces no output. ::
aws ec2 wait volume-in-use \
--volume-ids vol-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/conversion-task-completed.rst 0000755 0000000 0000000 00000000524 13664010074 025473 0 ustar root root 0000000 0000000 **To pause running until a conversion task is completed**
The following ``wait conversion-task-completed`` example pauses and continues only after it can confirm that the specified conversion task is completed. ::
aws ec2 wait conversion-task-completed \
--conversion-task-ids import-i-fh95npoc
This command produces no output.
awscli-1.18.69/awscli/examples/ec2/wait/instance-exists.rst 0000644 0000000 0000000 00000000424 13664010074 023511 0 ustar root root 0000000 0000000 **To wait until an instance exists**
The following ``wait instance-exists`` example pauses and resumes running only after it confirms that the specified instance exists. It produces no output. ::
aws ec2 wait instance-exists \
--instance-ids i-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/conversion-task-cancelled.rst 0000755 0000000 0000000 00000000524 13664010074 025431 0 ustar root root 0000000 0000000 **To pause running until a conversion task is cancelled**
The following ``wait conversion-task-cancelled`` example pauses and continues only after it can confirm that the specified conversion task is cancelled. ::
aws ec2 wait conversion-task-cancelled \
--conversion-task-ids import-i-fh95npoc
This command produces no output.
awscli-1.18.69/awscli/examples/ec2/wait/vpc-available.rst 0000644 0000000 0000000 00000000454 13664010074 023101 0 ustar root root 0000000 0000000 **To wait until a virtual private cloud (VPC) is available**
The following ``wait vpc-available`` example pauses and resumes running only after it confirms that the specified VPC is available. It produces no output. ::
aws ec2 wait vpc-available \
--vpc-ids vpc-1234567890abcdef0
awscli-1.18.69/awscli/examples/ec2/wait/key-pair-exists.rst 0000644 0000000 0000000 00000000416 13664010074 023427 0 ustar root root 0000000 0000000 **To wait until a key pair exists**
The following ``wait key-pair-exists`` example pauses and resumes running only after it confirms that the specified key pair exists. It produces no output. ::
aws ec2 wait key-pair-exists \
--key-names my-key-pair
awscli-1.18.69/awscli/examples/ec2/wait/security-group-exists.rst 0000755 0000000 0000000 00000000472 13664010074 024714 0 ustar root root 0000000 0000000 **To pause running until a security group exists**
The following ``wait security-group-exists`` example pauses and continues only after it can confirm that the specified security group exists. ::
aws ec2 wait security-group-exists \
--group-ids sg-07e789d0fb10492ee
This command produces no output.
awscli-1.18.69/awscli/examples/ec2/wait/image-exists.rst 0000644 0000000 0000000 00000000434 13664010074 022770 0 ustar root root 0000000 0000000 **To wait until an image exists**
The following ``wait image-exists`` example pauses and resumes running only after it confirms that the specified Amazon Machine Image exists. It produces no output. ::
aws ec2 wait image-exists \
--image-ids ami-0abcdef1234567890
awscli-1.18.69/awscli/examples/ec2/replace-network-acl-association.rst 0000644 0000000 0000000 00000000535 13664010074 025600 0 ustar root root 0000000 0000000 **To replace the network ACL associated with a subnet**
This example associates the specified network ACL with the subnet for the specified network ACL association.
Command::
aws ec2 replace-network-acl-association --association-id aclassoc-e5b95c8c --network-acl-id acl-5fb85d36
Output::
{
"NewAssociationId": "aclassoc-3999875b"
} awscli-1.18.69/awscli/examples/ec2/describe-principal-id-format.rst 0000755 0000000 0000000 00000002146 13664010074 025051 0 ustar root root 0000000 0000000 **To describe the ID format for IAM users and roles with long ID format enabled**
The following ``describe-principal-id-format`` example describes the ID format for the root user, all IAM roles, and all IAM users with long ID format enabled. ::
aws ec2 describe-principal-id-format \
--resource instance
Output::
{
"Principals": [
{
"Arn": "arn:aws:iam::123456789012:root",
"Statuses": [
{
"Deadline": "2016-12-15T00:00:00.000Z",
"Resource": "reservation",
"UseLongIds": true
},
{
"Deadline": "2016-12-15T00:00:00.000Z",
"Resource": "instance",
"UseLongIds": true
},
{
"Deadline": "2016-12-15T00:00:00.000Z",
"Resource": "volume",
"UseLongIds": true
},
]
},
...
]
}
awscli-1.18.69/awscli/examples/ec2/accept-transit-gateway-peering-attachment.rst 0000644 0000000 0000000 00000002277 13664010074 027571 0 ustar root root 0000000 0000000 **To accept a transit gateway peering attachment**
The following ``accept-transit-gateway-peering-attachment`` example accepts the specified transit gateway peering attachment. The ``--region`` parameter specifies the Region that the accepter transit gateway is located in. ::
aws ec2 accept-transit-gateway-peering-attachment \
--transit-gateway-attachment-id tgw-attach-4455667788aabbccd \
--region us-east-2
Output::
{
"TransitGatewayPeeringAttachment": {
"TransitGatewayAttachmentId": "tgw-attach-4455667788aabbccd",
"RequesterTgwInfo": {
"TransitGatewayId": "tgw-123abc05e04123abc",
"OwnerId": "123456789012",
"Region": "us-west-2"
},
"AccepterTgwInfo": {
"TransitGatewayId": "tgw-11223344aabbcc112",
"OwnerId": "123456789012",
"Region": "us-east-2"
},
"State": "pending",
"CreationTime": "2019-12-09T11:38:31.000Z"
}
}
For more information, see `Transit Gateway Peering Attachments `__ in the *Transit Gateways Guide*.
awscli-1.18.69/awscli/examples/ec2/allocate-hosts.rst 0000644 0000000 0000000 00000003443 13664010074 022352 0 ustar root root 0000000 0000000 **Example 1: To allocate a Dedicated Host**
The following ``allocate-hosts`` example allocates a single Dedicated Host in the ``eu-west-1a`` Availability Zone, onto which you can launch ``m5.large`` instances. By default, the Dedicated Host accepts only target instance launches, and does not support host recovery. ::
aws ec2 allocate-hosts \
--instance-type m5.large \
--availability-zone eu-west-1a \
--quantity 1
Output::
{
"HostIds": [
"h-07879acf49EXAMPLE"
]
}
**Example 2: To allocate a Dedicated Host with auto-placement and host recovery enabled**
The following ``allocate-hosts`` example allocates a single Dedicated Host in the ``eu-west-1a`` Availability Zone with auto-placement and host recovery enabled. ::
aws ec2 allocate-hosts \
--instance-type m5.large \
--availability-zone eu-west-1a \
--auto-placement on \
--host-recovery on \
--quantity 1
Output::
{
"HostIds": [
"h-07879acf49EXAMPLE"
]
}
**Example 3: To allocate a Dedicated Host with tags**
The following ``allocate-hosts`` example allocates a single Dedicated Host and applies a tag with a key named ``purpose`` and a value of ``production``. ::
aws ec2 allocate-hosts \
--instance-type m5.large \
--availability-zone eu-west-1a \
--quantity 1 \
--tag-specifications 'ResourceType=dedicated-host,Tags={Key=purpose,Value=production}'
Output::
{
"HostIds": [
"h-07879acf49EXAMPLE"
]
}
For more information, see `Allocating Dedicated Hosts `__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*.
awscli-1.18.69/awscli/examples/ec2/describe-security-groups.rst 0000644 0000000 0000000 00000011365 13664010074 024374 0 ustar root root 0000000 0000000 **To describe a security group for EC2-Classic**
This example displays information about the security group named ``MySecurityGroup``.
Command::
aws ec2 describe-security-groups --group-names MySecurityGroup
Output::
{
"SecurityGroups": [
{
"IpPermissionsEgress": [],
"Description": "My security group",
"IpPermissions": [
{
"PrefixListIds": [],
"FromPort": 22,
"IpRanges": [
{
"CidrIp": "203.0.113.0/24"
}
],
"ToPort": 22,
"IpProtocol": "tcp",
"UserIdGroupPairs": []
}
],
"GroupName": "MySecurityGroup",
"OwnerId": "123456789012",
"GroupId": "sg-903004f8",
}
]
}
**To describe a security group for EC2-VPC**
This example displays information about the security group with the ID sg-903004f8. Note that you can't reference a security group for EC2-VPC by name.
Command::
aws ec2 describe-security-groups --group-ids sg-903004f8
Output::
{
"SecurityGroups": [
{
"IpPermissionsEgress": [
{
"IpProtocol": "-1",
"IpRanges": [
{
"CidrIp": "0.0.0.0/0"
}
],
"UserIdGroupPairs": [],
"PrefixListIds": []
}
],
"Description": "My security group",
"Tags": [
{
"Value": "SG1",
"Key": "Name"
}
],
"IpPermissions": [
{
"IpProtocol": "-1",
"IpRanges": [],
"UserIdGroupPairs": [
{
"UserId": "123456789012",
"GroupId": "sg-903004f8"
}
],
"PrefixListIds": []
},
{
"PrefixListIds": [],
"FromPort": 22,
"IpRanges": [
{
"Description": "Access from NY office",
"CidrIp": "203.0.113.0/24"
}
],
"ToPort": 22,
"IpProtocol": "tcp",
"UserIdGroupPairs": []
}
],
"GroupName": "MySecurityGroup",
"VpcId": "vpc-1a2b3c4d",
"OwnerId": "123456789012",
"GroupId": "sg-903004f8",
}
]
}
**To describe security groups that have specific rules**
(EC2-VPC only) This example uses filters to describe security groups that have a rule that allows SSH traffic (port 22) and a rule that allows traffic from all addresses (``0.0.0.0/0``). The output is filtered to display only the names of the security groups. Security groups must match all filters to be returned in the results; however, a single rule does not have to match all filters. For example, the output returns a security group with a rule that allows SSH traffic from a specific IP address and another rule that allows HTTP traffic from all addresses.
Command::
aws ec2 describe-security-groups --filters Name=ip-permission.from-port,Values=22 Name=ip-permission.to-port,Values=22 Name=ip-permission.cidr,Values='0.0.0.0/0' --query "SecurityGroups[*].{Name:GroupName}"
Output::
[
{
"Name": "default"
},
{
"Name": "Test SG"
},
{
"Name": "SSH-Access-Group"
}
]
**To describe tagged security groups**
This example describes all security groups that include ``test`` in the security group name, and that have the tag ``Test=To-delete``. The output is filtered to display only the names and IDs of the security groups.
Command::
aws ec2 describe-security-groups --filters Name=group-name,Values=*test* Name=tag:Test,Values=To-delete --query "SecurityGroups[*].{Name:GroupName,ID:GroupId}"
Output::
[
{
"Name": "testfornewinstance",
"ID": "sg-33bb22aa"
},
{
"Name": "newgrouptest",
"ID": "sg-1a2b3c4d"
}
]
For more information, see `Using Security Groups`_ in the *AWS Command Line Interface User Guide*.
.. _`Using Security Groups`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-sg.html
awscli-1.18.69/awscli/examples/ec2/terminate-client-vpn-connections.rst 0000644 0000000 0000000 00000001666 13664010074 026022 0 ustar root root 0000000 0000000 **To terminate a connection to a Client VPN endpoint**
The following ``terminate-client-vpn-connections`` example terminates the specified connection to the Client VPN endpoint. ::
aws ec2 terminate-client-vpn-connections \
--client-vpn-endpoint-id vpn-endpoint-123456789123abcde \
--connection-id cvpn-connection-04edd76f5201e0cb8
Output::
{
"ClientVpnEndpointId": "vpn-endpoint-123456789123abcde",
"ConnectionStatuses": [
{
"ConnectionId": "cvpn-connection-04edd76f5201e0cb8",
"PreviousStatus": {
"Code": "active"
},
"CurrentStatus": {
"Code": "terminating"
}
}
]
}
For more information, see `Client Connections `__ in the *AWS Client VPN Administrator Guide*.
awscli-1.18.69/awscli/examples/ec2/accept-transit-gateway-vpc-attachment.rst 0000755 0000000 0000000 00000002034 13664010074 026722 0 ustar root root 0000000 0000000 **To accept a request to attach a VPC to a transit gateway.**
The following ``accept-transit-gateway-vpc-attachment`` example accepts the request forte specified attachment. ::
accept-transit-gateway-vpc-attachment \
--transit-gateway-attachment-id tgw-attach-0a34fe6b4fEXAMPLE
Output::
{
"TransitGatewayVpcAttachment": {
"TransitGatewayAttachmentId": "tgw-attach-0a34fe6b4fEXAMPLE",
"TransitGatewayId": "tgw-0262a0e521EXAMPLE",
"VpcId": "vpc-07e8ffd50fEXAMPLE",
"VpcOwnerId": "123456789012",
"State": "pending",
"SubnetIds": [
"subnet-0752213d59EXAMPLE"
],
"CreationTime": "2019-07-10T17:33:46.000Z",
"Options": {
"DnsSupport": "enable",
"Ipv6Support": "disable"
}
}
}
For more information, see `Transit Gateway Attachments to a VPC`__ in the *AWS Transit Gateways Guide*.
awscli-1.18.69/awscli/examples/ec2/detach-network-interface.rst 0000644 0000000 0000000 00000000414 13664010074 024300 0 ustar root root 0000000 0000000 **To detach a network interface from your instance**
This example detaches the specified network interface from the specified instance. If the command succeeds, no output is returned.
Command::
aws ec2 detach-network-interface --attachment-id eni-attach-66c4350a
awscli-1.18.69/awscli/examples/ec2/describe-client-vpn-connections.rst 0000644 0000000 0000000 00000003576 13664010074 025614 0 ustar root root 0000000 0000000 **To describe the connections to a Client VPN endpoint**
The following ``describe-client-vpn-connections`` example displays details about the client connections to the specified Client VPN endpoint. ::
aws ec2 describe-client-vpn-connections \
--client-vpn-endpoint-id cvpn-endpoint-123456789123abcde
Output::
{
"Connections": [
{
"ClientVpnEndpointId": "cvpn-endpoint-123456789123abcde",
"Timestamp": "2019-08-12 07:58:34",
"ConnectionId": "cvpn-connection-0e03eb24267165acd",
"ConnectionEstablishedTime": "2019-08-12 07:57:14",
"IngressBytes": "32302",
"EgressBytes": "5696",
"IngressPackets": "332",
"EgressPackets": "67",
"ClientIp": "172.31.0.225",
"CommonName": "client1.domain.tld",
"Status": {
"Code": "terminated"
},
"ConnectionEndTime": "2019-08-12 07:58:34"
},
{
"ClientVpnEndpointId": "cvpn-endpoint-123456789123abcde",
"Timestamp": "2019-08-12 08:02:54",
"ConnectionId": "cvpn-connection-00668867a40f18253",
"ConnectionEstablishedTime": "2019-08-12 08:02:53",
"IngressBytes": "2951",
"EgressBytes": "2611",
"IngressPackets": "9",
"EgressPackets": "6",
"ClientIp": "172.31.0.226",
"CommonName": "client1.domain.tld",
"Status": {
"Code": "active"
},
"ConnectionEndTime": "-"
}
]
}
For more information, see `Client Connections `__ in the *AWS Client VPN Administrator Guide*.
awscli-1.18.69/awscli/examples/ec2/associate-transit-gateway-route-table.rst 0000755 0000000 0000000 00000001620 13664010074 026743 0 ustar root root 0000000 0000000 **To associate a transit gateway route table with a transit gateway attachment**
The following example associates the specified transit gateway route table with the specified VPC attachment. ::
aws ec2 associate-transit-gateway-route-table \
--transit-gateway-route-table-id tgw-rtb-002573ed1eEXAMPLE \
--transit-gateway-attachment-id tgw-attach-0b5968d3b6EXAMPLE
Output::
{
"Association": {
"TransitGatewayRouteTableId": "tgw-rtb-002573ed1eEXAMPLE",
"TransitGatewayAttachmentId": "tgw-attach-0b5968d3b6EXAMPLE",
"ResourceId": "vpc-0065acced4EXAMPLE",
"ResourceType": "vpc",
"State": "associating"
}
}
For more information, see `Associate a Transit Gateway Route Table `__ in the *AWS Transit Gateways Guide*.
awscli-1.18.69/awscli/examples/ec2/disassociate-subnet-cidr-block.rst 0000644 0000000 0000000 00000001033 13664010074 025401 0 ustar root root 0000000 0000000 **To disassociate an IPv6 CIDR block from a subnet**
This example disassociates an IPv6 CIDR block from a subnet using the association ID for the CIDR block.
Command::
aws ec2 disassociate-subnet-cidr-block --association-id subnet-cidr-assoc-3aa54053
Output::
{
"SubnetId": "subnet-5f46ec3b",
"Ipv6CidrBlockAssociation": {
"Ipv6CidrBlock": "2001:db8:1234:1a00::/64",
"AssociationId": "subnet-cidr-assoc-3aa54053",
"Ipv6CidrBlockState": {
"State": "disassociating"
}
}
} awscli-1.18.69/awscli/examples/ec2/create-vpc.rst 0000755 0000000 0000000 00000006674 13664010074 021475 0 ustar root root 0000000 0000000 **Example 1: To create a VPC**
The following ``create-vpc`` example creates a VPC with the specified IPv4 CIDR block. ::
aws ec2 create-vpc \
--ipv6-cidr-block-network-border-group us-west-2-lax-1 \
--cidr-block 10.0.0.0/16
Output::
{
"Vpc": {
"CidrBlock": "10.0.0.0/16",
"DhcpOptionsId": "dopt-5EXAMPLE",
"State": "pending",
"VpcId": "vpc-0a60eb65b4EXAMPLE",
"OwnerId": "123456789012",
"InstanceTenancy": "default",
"Ipv6CidrBlockAssociationSet": [],
"CidrBlockAssociationSet": [
{
"AssociationId": "vpc-cidr-assoc-07501b79ecEXAMPLE",
"CidrBlock": "10.0.0.0/16",
"CidrBlockState": {
"State": "associated"
}
"NetworkBorderGroup": "us-west-2-lax-1"
}
],
"IsDefault": false,
"Tags": []
}
}
**Example 2: To create a VPC with dedicated tenancy**
The following ``create-vpc`` example creates a VPC with the specified IPv4 CIDR block and dedicated tenancy.
aws ec2 create-vpc \
--cidr-block 10.0.0.0/16 \
--instance-tenancy dedicated
Output::
{
"Vpc": {
"CidrBlock": "10.0.0.0/16",
"DhcpOptionsId": "dopt-19edf471",
"State": "pending",
"VpcId": "vpc-0a53287fa4EXAMPLE",
"OwnerId": "111122223333",
"InstanceTenancy": "dedicated",
"Ipv6CidrBlockAssociationSet": [],
"CidrBlockAssociationSet": [
{
"AssociationId": "vpc-cidr-assoc-00b24cc1c2EXAMPLE",
"CidrBlock": "10.0.0.0/16",
"CidrBlockState": {
"State": "associated"
}
}
],
"IsDefault": false,
"Tags": []
}
}
**Example 3: To create a VPC with an IPv6 CIDR block**
The following ``create-vpc`` example creates a VPC with an Amazon-provided IPv6 CIDR block.
aws ec2 create-vpc \
--cidr-block 10.0.0.0/16 \
--amazon-provided-ipv6-cidr-block
Output::
{
"Vpc": {
"CidrBlock": "10.0.0.0/16",
"DhcpOptionsId": "dopt-dEXAMPLE",
"State": "pending",
"VpcId": "vpc-0fc5e3406bEXAMPLE",
"OwnerId": "123456789012",
"InstanceTenancy": "default",
"Ipv6CidrBlockAssociationSet": [
{
"AssociationId": "vpc-cidr-assoc-068432c60bEXAMPLE",
"Ipv6CidrBlock": "",
"Ipv6CidrBlockState": {
"State": "associating"
},
"Ipv6Pool": "Amazon",
"NetworkBorderGroup": "us-west-2"
}
],
"CidrBlockAssociationSet": [
{
"AssociationId": "vpc-cidr-assoc-0669f8f9f5EXAMPLE",
"CidrBlock": "10.0.0.0/16",
"CidrBlockState": {
"State": "associated"
}
}
],
"IsDefault": false,
"Tags": []
}
}
For more information, see `Creating a VPC `__ in the *AWS VPC User Guide*.
awscli-1.18.69/awscli/examples/ec2/detach-vpn-gateway.rst 0000644 0000000 0000000 00000000430 13664010074 023111 0 ustar root root 0000000 0000000 **To detach a virtual private gateway from your VPC**
This example detaches the specified virtual private gateway from the specified VPC. If the command succeeds, no output is returned.
Command::
aws ec2 detach-vpn-gateway --vpn-gateway-id vgw-9a4cacf3 --vpc-id vpc-a01106c2
awscli-1.18.69/awscli/examples/ec2/get-transit-gateway-attachment-propagations.rst 0000755 0000000 0000000 00000001424 13664010074 030162 0 ustar root root 0000000 0000000 **To list the route tables to which the specified resource attachment propagates routes**
The following ``get-transit-gateway-attachment-propagations`` example lists the route table to which the specified resource attachment propagates routes. ::
aws ec2 get-transit-gateway-attachment-propagations \
--transit-gateway-attachment-id tgw-attach-09fbd47ddfEXAMPLE
Output::
{
"TransitGatewayAttachmentPropagations": [
{
"TransitGatewayRouteTableId": "tgw-rtb-0882c61b97EXAMPLE",
"State": "enabled"
}
]
}
For more information, see `View Transit Gateway Route Tables `__ in the *AWS Transit Gateways Guide*.
awscli-1.18.69/awscli/examples/ec2/reset-snapshot-attribute.rst 0000644 0000000 0000000 00000000446 13664010074 024410 0 ustar root root 0000000 0000000 **To reset a snapshot attribute**
This example resets the create volume permissions for snapshot ``snap-1234567890abcdef0``. If the command succeeds, no output is returned.
Command::
aws ec2 reset-snapshot-attribute --snapshot-id snap-1234567890abcdef0 --attribute createVolumePermission
awscli-1.18.69/awscli/examples/ec2/purchase-reserved-instances-offering.rst 0000644 0000000 0000000 00000000652 13664010074 026640 0 ustar root root 0000000 0000000 **To purchase a Reserved Instance offering**
This example command illustrates a purchase of a Reserved Instances offering, specifying an offering ID and instance count.
Command::
aws ec2 purchase-reserved-instances-offering --reserved-instances-offering-id ec06327e-dd07-46ee-9398-75b5fexample --instance-count 3
Output::
{
"ReservedInstancesId": "af9f760e-6f91-4559-85f7-4980eexample"
}
awscli-1.18.69/awscli/examples/ec2/describe-vpc-classic-link.rst 0000644 0000000 0000000 00000001223 13664010074 024342 0 ustar root root 0000000 0000000 **To describe the ClassicLink status of your VPCs**
This example lists the ClassicLink status of vpc-88888888.
Command::
aws ec2 describe-vpc-classic-link --vpc-id vpc-88888888
Output::
{
"Vpcs": [
{
"ClassicLinkEnabled": true,
"VpcId": "vpc-88888888",
"Tags": [
{
"Value": "classiclinkvpc",
"Key": "Name"
}
]
}
]
}
This example lists only VPCs that are enabled for Classiclink (the filter value of ``is-classic-link-enabled`` is set to ``true``).
Command::
aws ec2 describe-vpc-classic-link --filter "Name=is-classic-link-enabled,Values=true"
awscli-1.18.69/awscli/examples/ec2/create-transit-gateway-peering-attachment.rst 0000644 0000000 0000000 00000002325 13664010074 027567 0 ustar root root 0000000 0000000 **To create a transit gateway peering attachment**
The following ``create-transit-gateway-peering-attachment`` example creates a peering attachment request between the two specified transit gateways. ::
aws ec2 create-transit-gateway-peering-attachment \
--transit-gateway-id tgw-123abc05e04123abc \
--peer-transit-gateway-id tgw-11223344aabbcc112 \
--peer-account-id 123456789012 \
--peer-region us-east-2
Output::
{
"TransitGatewayPeeringAttachment": {
"TransitGatewayAttachmentId": "tgw-attach-4455667788aabbccd",
"RequesterTgwInfo": {
"TransitGatewayId": "tgw-123abc05e04123abc",
"OwnerId": "123456789012",
"Region": "us-west-2"
},
"AccepterTgwInfo": {
"TransitGatewayId": "tgw-11223344aabbcc112",
"OwnerId": "123456789012",
"Region": "us-east-2"
},
"State": "initiatingRequest",
"CreationTime": "2019-12-09T11:38:05.000Z"
}
}
For more information, see `Transit Gateway Peering Attachments `__ in the *Transit Gateways Guide*.
awscli-1.18.69/awscli/examples/ec2/create-client-vpn-endpoint.rst 0000644 0000000 0000000 00000002113 13664010074 024557 0 ustar root root 0000000 0000000 **To create a Client VPN endpoint**
The following ``create-client-vpn-endpoint`` example creates a Client VPN endpoint that uses mutual authentication and specifies a value for the client CIDR block. ::
aws ec2 create-client-vpn-endpoint \
--client-cidr-block "172.31.0.0/16" \
--server-certificate-arn arn:aws:acm:ap-south-1:123456789012:certificate/a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
--authentication-options Type=certificate-authentication,MutualAuthentication={ClientRootCertificateChainArn=arn:aws:acm:ap-south-1:123456789012:certificate/a1b2c3d4-5678-90ab-cdef-22222EXAMPLE} \
--connection-log-options Enabled=false
Output::
{
"ClientVpnEndpointId": "cvpn-endpoint-123456789123abcde",
"Status": {
"Code": "pending-associate"
},
"DnsName": "cvpn-endpoint-123456789123abcde.prod.clientvpn.ap-south-1.amazonaws.com"
}
For more information, see `Client VPN Endpoints `__ in the *AWS Client VPN Administrator Guide*.
awscli-1.18.69/awscli/examples/ec2/modify-default-credit-specification.rst 0000755 0000000 0000000 00000000645 13664010074 026433 0 ustar root root 0000000 0000000 **To modify the default credit option**
The following ``modify-default-credit-specification`` example modifies the default credit option for T2 instances. ::
aws ec2 modify-default-credit-specification \
--instance-family t2 \
--cpu-credits unlimited
Output::
{
"InstanceFamilyCreditSpecification": {
"InstanceFamily": "t2",
"CpuCredits": "unlimited"
}
}
awscli-1.18.69/awscli/examples/ec2/report-instance-status.rst 0000644 0000000 0000000 00000000363 13664010074 024064 0 ustar root root 0000000 0000000 **To report status feedback for an instance**
This example command reports status feedback for the specified instance.
Command::
aws ec2 report-instance-status --instances i-1234567890abcdef0 --status impaired --reason-codes unresponsive
awscli-1.18.69/awscli/examples/ec2/describe-security-group-references.rst 0000644 0000000 0000000 00000001037 13664010074 026323 0 ustar root root 0000000 0000000 **To describe security group references**
This example describes the security group references for ``sg-bbbb2222``. The response indicates that security group ``sg-bbbb2222`` is being referenced by a security group in VPC ``vpc-aaaaaaaa``.
Command::
aws ec2 describe-security-group-references --group-id sg-bbbbb22222
Output::
{
"SecurityGroupsReferenceSet": [
{
"ReferencingVpcId": "vpc-aaaaaaaa ",
"GroupId": "sg-bbbbb22222",
"VpcPeeringConnectionId": "pcx-b04deed9"
}
]
} awscli-1.18.69/awscli/examples/ec2/describe-import-image-tasks.rst 0000755 0000000 0000000 00000003533 13664010074 024726 0 ustar root root 0000000 0000000 **To monitor an import image task**
The following ``describe-import-image-tasks`` example checks the status of the specified import image task. ::
aws ec2 describe-import-image-tasks \
--import-task-ids import-ami-1234567890abcdef0
Output for an import image task that is in progress. ::
{
"ImportImageTasks": [
{
"ImportTaskId": "import-ami-1234567890abcdef0",
"Progress": "28",
"SnapshotDetails": [
{
"DiskImageSize": 705638400.0,
"Format": "ova",
"Status": "completed",
"UserBucket": {
"S3Bucket": "my-import-bucket",
"S3Key": "vms/my-server-vm.ova"
}
}
],
"Status": "active",
"StatusMessage": "converting"
}
]
}
Output for an import image task that is completed. The ID of the resulting AMI is provided by ``ImageId``. ::
{
"ImportImageTasks": [
{
"ImportTaskId": "import-ami-1234567890abcdef0",
"ImageId": "ami-1234567890abcdef0",
"SnapshotDetails": [
{
"DiskImageSize": 705638400.0,
"Format": "ova",
"SnapshotId": "snap-1234567890abcdef0"
"Status": "completed",
"UserBucket": {
"S3Bucket": "my-import-bucket",
"S3Key": "vms/my-server-vm.ova"
}
}
],
"Status": "completed"
}
]
}
awscli-1.18.69/awscli/examples/ec2/describe-spot-fleet-instances.rst 0000644 0000000 0000000 00000001065 13664010074 025253 0 ustar root root 0000000 0000000 **To describe the Spot Instances associated with a Spot fleet**
This example command lists the Spot instances associated with the specified Spot fleet.
Command::
aws ec2 describe-spot-fleet-instances --spot-fleet-request-id sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE
Output::
{
"ActiveInstances": [
{
"InstanceId": "i-1234567890abcdef0",
"InstanceType": "m3.medium",
"SpotInstanceRequestId": "sir-08b93456"
},
...
],
"SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE"
}
awscli-1.18.69/awscli/examples/ec2/deregister-transit-gateway-multicast-group-members.rst 0000755 0000000 0000000 00000001655 13664010074 031501 0 ustar root root 0000000 0000000 **To deregister group members from a multicast group**
This example deregisters the specified network interface group member from the transit gateway multicast group. ::
aws ec2 deregister-transit-gateway-multicast-group-members \
--transit-gateway-multicast-domain-id tgw-mcast-domain-0c4905cef7EXAMPLE \
--group-ip-address 224.0.1.0 \
--network-interface-ids eni-0e246d3269EXAMPLE
Output::
{
"DeregisteredMulticastGroupMembers": {
"TransitGatewayMulticastDomainId": "tgw-mcast-domain-0c4905cef7EXAMPLE",
"RegisteredNetworkInterfaceIds": [
"eni-0e246d3269EXAMPLE"
],
"GroupIpAddress": "224.0.1.0"
}
}
For more information, see `Deregister Members from a Multicast Group `__ in the *AWS Transit Gateways Users Guide*. awscli-1.18.69/awscli/examples/ec2/describe-vpc-endpoint-service-configurations.rst 0000644 0000000 0000000 00000001731 13664010074 030300 0 ustar root root 0000000 0000000 **To describe endpoint service configurations**
This example describes your endpoint service configurations.
Command::
aws ec2 describe-vpc-endpoint-service-configurations
Output::
{
"ServiceConfigurations": [
{
"ServiceType": [
{
"ServiceType": "Interface"
}
],
"NetworkLoadBalancerArns": [
"arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/net/NLBforService/8218753950b25648"
],
"ServiceName": "com.amazonaws.vpce.us-east-1.vpce-svc-0e7555fb6441987e1",
"ServiceState": "Available",
"ServiceId": "vpce-svc-0e7555fb6441987e1",
"AcceptanceRequired": true,
"AvailabilityZones": [
"us-east-1d"
],
"BaseEndpointDnsNames": [
"vpce-svc-0e7555fb6441987e1.us-east-1.vpce.amazonaws.com"
]
}
]
} awscli-1.18.69/awscli/examples/ec2/authorize-security-group-ingress.rst 0000644 0000000 0000000 00000013216 13664010074 026110 0 ustar root root 0000000 0000000 **[EC2-Classic] To add a rule that allows inbound SSH traffic**
The following example enables inbound traffic on TCP port 22 (SSH). If the command succeeds, no output is returned. ::
aws ec2 authorize-security-group-ingress \\
--group-name MySecurityGroup \
--protocol tcp \
--port 22 \
--cidr 203.0.113.0/24
This command produces no output.
**[EC2-Classic] To add a rule that allows inbound HTTP traffic from a security group in another account**
The following example enables inbound traffic on TCP port 80 from a source security group (``otheraccountgroup``) in a different AWS account (123456789012). Incoming traffic is allowed based on the private IP addresses of instances that are associated with the source security group (not the public IP or Elastic IP addresses). ::
aws ec2 authorize-security-group-ingress \
--group-name MySecurityGroup \
--protocol tcp \
--port 80 \
--source-group otheraccountgroup \
--group-owner 123456789012
This command produces no output.
**[EC2-Classic] To add a rule that allows inbound HTTPS traffic from an ELB**
The following example enables inbound traffic on TCP port 443 from an ELB. ::
aws ec2 authorize-security-group-ingress \
--group-name MySecurityGroup \
--protocol tcp \
--port 443 \
--source-group amazon-elb-sg \
--group-owner amazon-elb
**[EC2-VPC] To add a rule that allows inbound SSH traffic**
The following example enables inbound traffic on TCP port 22 (SSH). Note that you can't reference a security group for EC2-VPC by name. ::
aws ec2 authorize-security-group-ingress \
--group-id sg-1234567890abcdef0 \
--protocol tcp \
--port 22 \
--cidr 203.0.113.0/24
This command produces no output.
**[EC2-VPC] To add a rule that allows inbound HTTP traffic from another security group**
The following example enables inbound access on TCP port 80 from the source security group ``sg-1a2b3c4d``. Note that for EC2-VPC, the source group must be in the same VPC or in a peer VPC (requires a VPC peering connection). Incoming traffic is allowed based on the private IP addresses of instances that are associated with the source security group (not the public IP or Elastic IP addresses). ::
aws ec2 authorize-security-group-ingress \
--group-id sg-1234567890abcdef0 \
--protocol tcp \
--port 80 \
--source-group sg-1a2b3c4d
This command produces no output.
**[EC2-VPC] To add one rule for RDP and another rule for ping/ICMP**
The following example uses the ``ip-permissions`` parameter to add two rules, one that enables inbound access on TCP port 3389 (RDP) and the other that enables ping/ICMP.
(Windows)::
aws ec2 authorize-security-group-ingress ^
--group-id sg-1234567890abcdef0 ^
--ip-permissions IpProtocol=tcp,FromPort=3389,ToPort=3389,IpRanges=[{CidrIp=172.31.0.0/16}] IpProtocol=icmp,FromPort=-1,ToPort=-1,IpRanges=[{CidrIp=172.31.0.0/16}]
**[EC2-VPC] To add a rule for ICMP traffic**
The following example uses the ``ip-permissions`` parameter to add an inbound rule that allows the ICMP message ``Destination Unreachable: Fragmentation Needed and Don't Fragment was Set`` (Type 3, Code 4) from anywhere.
(Linux)::
aws ec2 authorize-security-group-ingress \
--group-id sg-1234567890abcdef0 \
--ip-permissions IpProtocol=icmp,FromPort=3,ToPort=4,IpRanges='[{CidrIp=0.0.0.0/0}]'
(Windows)::
aws ec2 authorize-security-group-ingress ^
--group-id sg-1234567890abcdef0 ^
--ip-permissions IpProtocol=icmp,FromPort=3,ToPort=4,IpRanges=[{CidrIp=0.0.0.0/0}]
This command produces no output.
**[EC2-VPC] To add a rule for IPv6 traffic**
The following example grants SSH access (port 22) from the IPv6 range ``2001:db8:1234:1a00::/64``.
(Linux)::
aws ec2 authorize-security-group-ingress \
--group-id sg-1234567890abcdef0 \
--ip-permissions IpProtocol=tcp,FromPort=22,ToPort=22,Ipv6Ranges='[{CidrIpv6=2001:db8:1234:1a00::/64}]'
(Windows)::
aws ec2 authorize-security-group-ingress ^
--group-id sg-1234567890abcdef0 ^
--ip-permissions IpProtocol=tcp,FromPort=22,ToPort=22,Ipv6Ranges=[{CidrIpv6=2001:db8:1234:1a00::/64}]
**[EC2-VPC] To add a rule for ICMPv6 traffic**
The following example uses the ``ip-permissions`` parameter to add an inbound rule that allows ICMPv6 traffic from anywhere.
(Linux)::
aws ec2 authorize-security-group-ingress \
--group-id sg-1234567890abcdef0 \
--ip-permissions IpProtocol=icmpv6,Ipv6Ranges='[{CidrIpv6=::/0}]'
(Windows)::
aws ec2 authorize-security-group-ingress ^
--group-id sg-1234567890abcdef0 ^
--ip-permissions IpProtocol=icmpv6,Ipv6Ranges=[{CidrIpv6=::/0}]
**Add a rule with a description**
The following example uses the ``ip-permissions`` parameter to add an inbound rule that allows RDP traffic from a specific IPv4 address range. The rule includes a description to help you identify it later.
(Linux)::
aws ec2 authorize-security-group-ingress \
--group-id sg-1234567890abcdef0 \
--ip-permissions IpProtocol=tcp,FromPort=3389,ToPort=3389,IpRanges='[{CidrIp=203.0.113.0/24,Description="RDP access from NY office"}]'
(Windows)::
aws ec2 authorize-security-group-ingress ^
--group-id sg-1234567890abcdef0 ^
--ip-permissions IpProtocol=tcp,FromPort=3389,ToPort=3389,IpRanges=[{CidrIp=203.0.113.0/24,Description="RDP access from NY office"}]
For more information, see `Using Security Groups`_ in the *AWS Command Line Interface User Guide*.
.. _`Using Security Groups`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-sg.html awscli-1.18.69/awscli/examples/ec2/create-vpc-peering-connection.rst 0000644 0000000 0000000 00000003663 13664010074 025251 0 ustar root root 0000000 0000000 **To create a VPC peering connection between your VPCs**
This example requests a peering connection between your VPCs vpc-1a2b3c4d and vpc-11122233.
Command::
aws ec2 create-vpc-peering-connection --vpc-id vpc-1a2b3c4d --peer-vpc-id vpc-11122233
Output::
{
"VpcPeeringConnection": {
"Status": {
"Message": "Initiating Request to 444455556666",
"Code": "initiating-request"
},
"Tags": [],
"RequesterVpcInfo": {
"OwnerId": "444455556666",
"VpcId": "vpc-1a2b3c4d",
"CidrBlock": "10.0.0.0/28"
},
"VpcPeeringConnectionId": "pcx-111aaa111",
"ExpirationTime": "2014-04-02T16:13:36.000Z",
"AccepterVpcInfo": {
"OwnerId": "444455556666",
"VpcId": "vpc-11122233"
}
}
}
**To create a VPC peering connection with a VPC in another account**
This example requests a peering connection between your VPC (vpc-1a2b3c4d), and a VPC (vpc-11122233) that belongs AWS account 123456789012.
Command::
aws ec2 create-vpc-peering-connection --vpc-id vpc-1a2b3c4d --peer-vpc-id vpc-11122233 --peer-owner-id 123456789012
**To create a VPC peering connection with a VPC in a different region**
This example requests a peering connection between your VPC in the current region (vpc-1a2b3c4d), and a VPC (vpc-11122233) in your account in the ``us-west-2`` region.
Command::
aws ec2 create-vpc-peering-connection --vpc-id vpc-1a2b3c4d --peer-vpc-id vpc-11122233 --peer-region us-west-2
This example requests a peering connection between your VPC in the current region (vpc-1a2b3c4d), and a VPC (vpc-11122233) that belongs AWS account 123456789012 that's in the ``us-west-2`` region.
Command::
aws ec2 create-vpc-peering-connection --vpc-id vpc-1a2b3c4d --peer-vpc-id vpc-11122233 --peer-owner-id 123456789012 --peer-region us-west-2 awscli-1.18.69/awscli/examples/ec2/associate-subnet-cidr-block.rst 0000644 0000000 0000000 00000001011 13664010074 024675 0 ustar root root 0000000 0000000 **To associate an IPv6 CIDR block with a subnet**
This example associates an IPv6 CIDR block with the specified subnet.
Command::
aws ec2 associate-subnet-cidr-block --subnet-id subnet-5f46ec3b --ipv6-cidr-block 2001:db8:1234:1a00::/64
Output::
{
"SubnetId": "subnet-5f46ec3b",
"Ipv6CidrBlockAssociation": {
"Ipv6CidrBlock": "2001:db8:1234:1a00::/64",
"AssociationId": "subnet-cidr-assoc-3aa54053",
"Ipv6CidrBlockState": {
"State": "associating"
}
}
} awscli-1.18.69/awscli/examples/ec2/describe-regions.rst 0000755 0000000 0000000 00000021402 13664010074 022652 0 ustar root root 0000000 0000000 **Example 1: To describe all of your enabled Regions**
The following ``describe-regions`` example describes all of the Regions that are enabled for your account. ::
aws ec2 describe-regions
Output::
{
"Regions": [
{
"Endpoint": "ec2.eu-north-1.amazonaws.com",
"RegionName": "eu-north-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.ap-south-1.amazonaws.com",
"RegionName": "ap-south-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.eu-west-3.amazonaws.com",
"RegionName": "eu-west-3",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.eu-west-2.amazonaws.com",
"RegionName": "eu-west-2",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.eu-west-1.amazonaws.com",
"RegionName": "eu-west-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.ap-northeast-3.amazonaws.com",
"RegionName": "ap-northeast-3",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.ap-northeast-2.amazonaws.com",
"RegionName": "ap-northeast-2",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.ap-northeast-1.amazonaws.com",
"RegionName": "ap-northeast-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.sa-east-1.amazonaws.com",
"RegionName": "sa-east-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.ca-central-1.amazonaws.com",
"RegionName": "ca-central-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.ap-southeast-1.amazonaws.com",
"RegionName": "ap-southeast-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.ap-southeast-2.amazonaws.com",
"RegionName": "ap-southeast-2",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.eu-central-1.amazonaws.com",
"RegionName": "eu-central-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.us-east-1.amazonaws.com",
"RegionName": "us-east-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.us-east-2.amazonaws.com",
"RegionName": "us-east-2",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.us-west-1.amazonaws.com",
"RegionName": "us-west-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.us-west-2.amazonaws.com",
"RegionName": "us-west-2",
"OptInStatus": "opt-in-not-required"
}
]
}
**Example 2: To describe enabled Regions with an endpoint whose name contains a specific string**
The following ``describe-regions`` example describes all Regions that you have enabled that have the string "us" in the endpoint. ::
aws ec2 describe-regions --filters "Name=endpoint,Values=*us*"
Output::
{
"Regions": [
{
"Endpoint": "ec2.us-east-1.amazonaws.com",
"RegionName": "us-east-1"
},
{
"Endpoint": "ec2.us-east-2.amazonaws.com",
"RegionName": "us-east-2"
},
{
"Endpoint": "ec2.us-west-1.amazonaws.com",
"RegionName": "us-west-1"
},
{
"Endpoint": "ec2.us-west-2.amazonaws.com",
"RegionName": "us-west-2"
},
]
}
**To describe all Regions**
The following ``describe-regions`` example describes all available Regions, including opt-in Regions like HKG and BAH. For a description of opt-in Regions, see `Available Regions `__ in the *Amazon EC2 User Guide*. ::
aws ec2 describe-regions \
--all-regions
Output::
{
"Regions": [
{
"Endpoint": "ec2.eu-north-1.amazonaws.com",
"RegionName": "eu-north-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.ap-south-1.amazonaws.com",
"RegionName": "ap-south-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.eu-west-3.amazonaws.com",
"RegionName": "eu-west-3",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.eu-west-2.amazonaws.com",
"RegionName": "eu-west-2",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.eu-west-1.amazonaws.com",
"RegionName": "eu-west-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.ap-northeast-3.amazonaws.com",
"RegionName": "ap-northeast-3",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.me-south-1.amazonaws.com",
"RegionName": "me-south-1",
"OptInStatus": "not-opted-in"
},
{
"Endpoint": "ec2.ap-northeast-2.amazonaws.com",
"RegionName": "ap-northeast-2",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.ap-northeast-1.amazonaws.com",
"RegionName": "ap-northeast-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.sa-east-1.amazonaws.com",
"RegionName": "sa-east-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.ca-central-1.amazonaws.com",
"RegionName": "ca-central-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.ap-east-1.amazonaws.com",
"RegionName": "ap-east-1",
"OptInStatus": "not-opted-in"
},
{
"Endpoint": "ec2.ap-southeast-1.amazonaws.com",
"RegionName": "ap-southeast-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.ap-southeast-2.amazonaws.com",
"RegionName": "ap-southeast-2",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.eu-central-1.amazonaws.com",
"RegionName": "eu-central-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.us-east-1.amazonaws.com",
"RegionName": "us-east-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.us-east-2.amazonaws.com",
"RegionName": "us-east-2",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.us-west-1.amazonaws.com",
"RegionName": "us-west-1",
"OptInStatus": "opt-in-not-required"
},
{
"Endpoint": "ec2.us-west-2.amazonaws.com",
"RegionName": "us-west-2",
"OptInStatus": "opt-in-not-required"
}
]
}
**To list the Region names only**
The following ``describe-regions`` example uses the ``--query`` parameter to filter the output and return only the names of the Regions as text. ::
aws ec2 describe-regions \
--all-regions \
--query "Regions[].{Name:RegionName}" \
--output text
Output::
eu-north-1
ap-south-1
eu-west-3
eu-west-2
eu-west-1
ap-northeast-3
ap-northeast-2
me-south-1
ap-northeast-1
sa-east-1
ca-central-1
ap-east-1
ap-southeast-1
ap-southeast-2
eu-central-1
us-east-1
us-east-2
us-west-1
us-west-2
awscli-1.18.69/awscli/examples/ec2/delete-customer-gateway.rst 0000644 0000000 0000000 00000000330 13664010074 024160 0 ustar root root 0000000 0000000 **To delete a customer gateway**
This example deletes the specified customer gateway. If the command succeeds, no output is returned.
Command::
aws ec2 delete-customer-gateway --customer-gateway-id cgw-0e11f167
awscli-1.18.69/awscli/examples/ec2/reset-instance-attribute.rst 0000644 0000000 0000000 00000001632 13664010074 024353 0 ustar root root 0000000 0000000 **To reset the sourceDestCheck attribute**
This example resets the ``sourceDestCheck`` attribute of the specified instance. The instance must be in a VPC. If the command succeeds, no output is returned.
Command::
aws ec2 reset-instance-attribute --instance-id i-1234567890abcdef0 --attribute sourceDestCheck
**To reset the kernel attribute**
This example resets the ``kernel`` attribute of the specified instance. The instance must be in the ``stopped`` state. If the command succeeds, no output is returned.
Command::
aws ec2 reset-instance-attribute --instance-id i-1234567890abcdef0 --attribute kernel
**To reset the ramdisk attribute**
This example resets the ``ramdisk`` attribute of the specified instance. The instance must be in the ``stopped`` state. If the command succeeds, no output is returned.
Command::
aws ec2 reset-instance-attribute --instance-id i-1234567890abcdef0 --attribute ramdisk
awscli-1.18.69/awscli/examples/ec2/describe-identity-id-format.rst 0000755 0000000 0000000 00000002410 13664010074 024713 0 ustar root root 0000000 0000000 **To describe the ID format for an IAM role**
The following ``describe-identity-id-format`` example describes the ID format received by instances created by the IAM role ``EC2Role`` in your AWS account. ::
aws ec2 describe-identity-id-format \
--principal-arn arn:aws:iam::123456789012:role/my-iam-role \
--resource instance
The following output indicates that instances created by this role receive IDs in long ID format. ::
{
"Statuses": [
{
"Deadline": "2016-12-15T00:00:00Z",
"Resource": "instance",
"UseLongIds": true
}
]
}
**To describe the ID format for an IAM user**
The following ``describe-identity-id-format`` example describes the ID format received by snapshots created by the IAM user ``AdminUser`` in your AWS account. ::
aws ec2 describe-identity-id-format \
--principal-arn arn:aws:iam::123456789012:user/AdminUser \
--resource snapshot
The output indicates that snapshots created by this user receive IDs in long ID format. ::
{
"Statuses": [
{
"Deadline": "2016-12-15T00:00:00Z",
"Resource": "snapshot",
"UseLongIds": true
}
]
} awscli-1.18.69/awscli/examples/ec2/delete-dhcp-options.rst 0000644 0000000 0000000 00000000321 13664010074 023267 0 ustar root root 0000000 0000000 **To delete a DHCP options set**
This example deletes the specified DHCP options set. If the command succeeds, no output is returned.
Command::
aws ec2 delete-dhcp-options --dhcp-options-id dopt-d9070ebb
awscli-1.18.69/awscli/examples/ec2/enable-vpc-classic-link-dns-support.rst 0000644 0000000 0000000 00000000351 13664010074 026305 0 ustar root root 0000000 0000000 **To enable ClassicLink DNS support for a VPC**
This example enables ClassicLink DNS support for ``vpc-88888888``.
Command::
aws ec2 enable-vpc-classic-link-dns-support --vpc-id vpc-88888888
Output::
{
"Return": true
} awscli-1.18.69/awscli/examples/ec2/describe-launch-templates.rst 0000644 0000000 0000000 00000002764 13664010074 024461 0 ustar root root 0000000 0000000 **To describe launch templates**
This example describes your launch templates.
Command::
aws ec2 describe-launch-templates
Output::
{
"LaunchTemplates": [
{
"LatestVersionNumber": 2,
"LaunchTemplateId": "lt-0e06d290751193123",
"LaunchTemplateName": "TemplateForWebServer",
"DefaultVersionNumber": 2,
"CreatedBy": "arn:aws:iam::123456789012:root",
"CreateTime": "2017-11-27T09:30:23.000Z"
},
{
"LatestVersionNumber": 6,
"LaunchTemplateId": "lt-0c45b5e061ec98456",
"LaunchTemplateName": "DBServersTemplate",
"DefaultVersionNumber": 1,
"CreatedBy": "arn:aws:iam::123456789012:root",
"CreateTime": "2017-11-20T09:25:22.000Z"
},
{
"LatestVersionNumber": 1,
"LaunchTemplateId": "lt-0d47d774e8e52dabc",
"LaunchTemplateName": "MyLaunchTemplate2",
"DefaultVersionNumber": 1,
"CreatedBy": "arn:aws:iam::123456789012:root",
"CreateTime": "2017-11-02T12:06:21.000Z"
},
{
"LatestVersionNumber": 3,
"LaunchTemplateId": "lt-01e5f948eb4f589d6",
"LaunchTemplateName": "testingtemplate2",
"DefaultVersionNumber": 1,
"CreatedBy": "arn:aws:sts::123456789012:assumed-role/AdminRole/i-03ee35176e2e5aabc",
"CreateTime": "2017-12-01T08:19:48.000Z"
},
]
} awscli-1.18.69/awscli/examples/ec2/associate-vpc-cidr-block.rst 0000755 0000000 0000000 00000002351 13664010074 024200 0 ustar root root 0000000 0000000 **Example 1: To associate an Amazon-provided IPv6 CIDR block with a VPC**
The following ``associate-vpc-cidr-block`` example associates an IPv6 CIDR block with the specified VPC.::
aws ec2 associate-vpc-cidr-block \
--amazon-provided-ipv6-cidr-block \
--ipv6-cidr-block-network-border-group us-west-2-lax-1 \
--vpc-id vpc-8EXAMPLE
Output::
{
"Ipv6CidrBlockAssociation": {
"AssociationId": "vpc-cidr-assoc-0838ce7d9dEXAMPLE",
"Ipv6CidrBlockState": {
"State": "associating"
},
"NetworkBorderGroup": "us-west-2-lax-1"
},
"VpcId": "vpc-8EXAMPLE"
}
**Example 2:To associate an additional IPv4 CIDR block with a VPC**
The following ``associate-vpc-cidr-block`` example associates the IPv4 CIDR block ``10.2.0.0/16`` with the specified VPC. ::
aws ec2 associate-vpc-cidr-block \
--vpc-id vpc-1EXAMPLE \
--cidr-block 10.2.0.0/16
Output::
{
"CidrBlockAssociation": {
"AssociationId": "vpc-cidr-assoc-2EXAMPLE",
"CidrBlock": "10.2.0.0/16",
"CidrBlockState": {
"State": "associating"
}
},
"VpcId": "vpc-1EXAMPLE"
}
awscli-1.18.69/awscli/examples/ec2/import-image.rst 0000755 0000000 0000000 00000001322 13664010074 022017 0 ustar root root 0000000 0000000 **To import a VM image file as an AMI**
The following ``import-image`` example imports the specified OVA. ::
aws ec2 import-image \
--disk-containers Format=ova,UserBucket="{S3Bucket=my-import-bucket,S3Key=vms/my-server-vm.ova}"
Output::
{
"ImportTaskId": "import-ami-1234567890abcdef0",
"Progress": "2",
"SnapshotDetails": [
{
"DiskImageSize": 0.0,
"Format": "ova",
"UserBucket": {
"S3Bucket": "my-import-bucket",
"S3Key": "vms/my-server-vm.ova"
}
}
],
"Status": "active",
"StatusMessage": "pending"
}
awscli-1.18.69/awscli/examples/ec2/apply-security-groups-to-client-vpn-target-network.rst 0000644 0000000 0000000 00000001415 13664010074 031404 0 ustar root root 0000000 0000000 **To apply security groups to a target network for a Client VPN endpoint**
The following ``apply-security-groups-to-client-vpn-target-network`` example applies security group ``sg-01f6e627a89f4db32`` to the association between the specified target network and Client VPN endpoint. ::
aws ec2 apply-security-groups-to-client-vpn-target-network \
--security-group-ids sg-01f6e627a89f4db32 \
--vpc-id vpc-0e2110c2f324332e0 \
--client-vpn-endpoint-id cvpn-endpoint-123456789123abcde
Output::
{
"SecurityGroupIds": [
"sg-01f6e627a89f4db32"
]
}
For more information, see `Target Networks `__ in the *AWS Client VPN Administrator Guide*.
awscli-1.18.69/awscli/examples/ec2/describe-host-reservations.rst 0000644 0000000 0000000 00000001414 13664010074 024701 0 ustar root root 0000000 0000000 **To describe Dedicated Host Reservations in your account**
This example describes the Dedicated Host Reservations in your account.
Command::
aws ec2 describe-host-reservations
Output::
{
"HostReservationSet": [
{
"Count": 1,
"End": "2019-01-10T12:14:09Z",
"HourlyPrice": "1.499",
"InstanceFamily": "m4",
"OfferingId": "hro-03f707bf363b6b324",
"PaymentOption": "NoUpfront",
"State": "active",
"HostIdSet": [
"h-013abcd2a00cbd123"
],
"Start": "2018-01-10T12:14:09Z",
"HostReservationId": "hr-0d418a3a4ffc669ae",
"UpfrontPrice": "0.000",
"Duration": 31536000
}
]
} awscli-1.18.69/awscli/examples/ec2/describe-reserved-instances-offerings.rst 0000644 0000000 0000000 00000006750 13664010074 026776 0 ustar root root 0000000 0000000 **To describe Reserved Instances offerings**
This example command describes all Reserved Instances available for purchase in the region.
Command::
aws ec2 describe-reserved-instances-offerings
Output::
{
"ReservedInstancesOfferings": [
{
"OfferingType": "Partial Upfront",
"AvailabilityZone": "us-east-1b",
"InstanceTenancy": "default",
"PricingDetails": [],
"ProductDescription": "Red Hat Enterprise Linux",
"UsagePrice": 0.0,
"RecurringCharges": [
{
"Amount": 0.088,
"Frequency": "Hourly"
}
],
"Marketplace": false,
"CurrencyCode": "USD",
"FixedPrice": 631.0,
"Duration": 94608000,
"ReservedInstancesOfferingId": "9a06095a-bdc6-47fe-a94a-2a382f016040",
"InstanceType": "c1.medium"
},
{
"OfferingType": "PartialUpfront",
"AvailabilityZone": "us-east-1b",
"InstanceTenancy": "default",
"PricingDetails": [],
"ProductDescription": "Linux/UNIX",
"UsagePrice": 0.0,
"RecurringCharges": [
{
"Amount": 0.028,
"Frequency": "Hourly"
}
],
"Marketplace": false,
"CurrencyCode": "USD",
"FixedPrice": 631.0,
"Duration": 94608000,
"ReservedInstancesOfferingId": "bfbefc6c-0d10-418d-b144-7258578d329d",
"InstanceType": "c1.medium"
},
...
}
**To describe your Reserved Instances offerings using options**
This example lists Reserved Instances offered by AWS with the following specifications: t1.micro instance types, Windows (Amazon VPC) product, and Heavy Utilization offerings.
Command::
aws ec2 describe-reserved-instances-offerings --no-include-marketplace --instance-type "t1.micro" --product-description "Windows (Amazon VPC)" --offering-type "no upfront"
Output::
{
"ReservedInstancesOfferings": [
{
"OfferingType": "No Upfront",
"AvailabilityZone": "us-east-1b",
"InstanceTenancy": "default",
"PricingDetails": [],
"ProductDescription": "Windows",
"UsagePrice": 0.0,
"RecurringCharges": [
{
"Amount": 0.015,
"Frequency": "Hourly"
}
],
"Marketplace": false,
"CurrencyCode": "USD",
"FixedPrice": 0.0,
"Duration": 31536000,
"ReservedInstancesOfferingId": "c48ab04c-fe69-4f94-8e39-a23842292823",
"InstanceType": "t1.micro"
},
...
{
"OfferingType": "No Upfront",
"AvailabilityZone": "us-east-1d",
"InstanceTenancy": "default",
"PricingDetails": [],
"ProductDescription": "Windows (Amazon VPC)",
"UsagePrice": 0.0,
"RecurringCharges": [
{
"Amount": 0.015,
"Frequency": "Hourly"
}
],
"Marketplace": false,
"CurrencyCode": "USD",
"FixedPrice": 0.0,
"Duration": 31536000,
"ReservedInstancesOfferingId": "3a98bf7d-2123-42d4-b4f5-8dbec4b06dc6",
"InstanceType": "t1.micro"
}
]
}
awscli-1.18.69/awscli/examples/ec2/delete-traffic-mirror-target.rst 0000644 0000000 0000000 00000001036 13664010074 025076 0 ustar root root 0000000 0000000 **To delete a traffic mirror target**
The following ``delete-traffic-mirror-target`` example deletes the specified traffic mirror target. ::
aws ec2 delete-traffic-mirror-target \
--traffic-mirror-target-id tmt-060f48ce9EXAMPLE
Output::
{
"TrafficMirrorTargetId": "tmt-060f48ce9EXAMPLE"
}
For more information, see `Delete a Traffic Mirror Target `__ in the *AWS Traffic Mirroring Guide*.
awscli-1.18.69/awscli/examples/ec2/import-key-pair.rst 0000644 0000000 0000000 00000001343 13664010074 022456 0 ustar root root 0000000 0000000 **To import a public key**
First, generate a key pair with the tool of your choice. For example, use this ssh-keygen command:
Command::
ssh-keygen -t rsa -C "my-key" -f ~/.ssh/my-key
Output::
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ec2-user/.ssh/my-key.
Your public key has been saved in /home/ec2-user/.ssh/my-key.pub.
...
This example command imports the specified public key.
Command::
aws ec2 import-key-pair --key-name "my-key" --public-key-material file://~/.ssh/my-key.pub
Output::
{
"KeyName": "my-key",
"KeyFingerprint": "1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca"
}
awscli-1.18.69/awscli/examples/ec2/delete-tags.rst 0000755 0000000 0000000 00000002517 13664010074 021632 0 ustar root root 0000000 0000000 **Example 1: To delete a tag from a resource**
The following ``delete-tags`` example deletes the tag ``Stack=Test`` from the specified image. When you specify both a value and a key name, the tag is deleted only if the tag's value matches the specified value. ::
aws ec2 delete-tags \
--resources ami-1234567890abcdef0 \
--tags Key=Stack,Value=Test
It's optional to specify the value for a tag. The following ``delete-tags`` example deletes the tag with the key name ``purpose`` from the specified instance, regardless of the tag value for the tag. ::
aws ec2 delete-tags \
--resources i-1234567890abcdef0 \
--tags Key=purpose
If you specify the empty string as the tag value, the tag is deleted only if the tag's value is the empty string. The following ``delete-tags`` example specifies the empty string as the tag value for the tag to delete. ::
aws ec2 delete-tags \
--resources i-1234567890abcdef0 \
--tags Key=Name,Value=
**Example 2: To delete a tag from multiple resources**
The following ``delete-tags`` example deletes the tag``Purpose=Test`` from both an instance and an AMI. As shown in the previous example, you can omit the tag value from the command. ::
aws ec2 delete-tags \
--resources i-1234567890abcdef0 ami-1234567890abcdef0 \
--tags Key=Purpose
awscli-1.18.69/awscli/examples/ec2/describe-instances.rst 0000755 0000000 0000000 00000015661 13664010074 023205 0 ustar root root 0000000 0000000 **Example 1: To describe an Amazon EC2 instance**
The following ``describe-instances`` example displays details about the specified instance. ::
aws ec2 describe-instances --instance-ids i-1234567890abcdef0
**Example 2: To describe instances based on instance type**
The following ``describe-instances`` example displays details about only instances of the specified type. ::
aws ec2 describe-instances --filters Name=instance-type,Values=m5.large
**Example 3: To describe instances based on tags**
The following ``describe-instances`` example displays details about only those instances that have a tag with the specified tag key (Owner), regardless of the tag value. ::
aws ec2 describe-instances --filters "Name=tag-key,Values=Owner"
The following ``describe-instances`` example displays details about only those instances that have a tag with the specified tag value (my-team), regardless of the tag key. ::
aws ec2 describe-instances --filters "Name=tag-value,Values=my-team"
The following ``describe-instances`` example displays details about only those instances that have the specified tag (Owner=my-team). ::
aws ec2 describe-instances --filters "Name=tag:Owner,Values=my-team"
**Example 4: To filter the results based on multiple conditions**
The following ``describe-instances`` example displays details about all instances with the specified type that are also in the specified Availability Zone. ::
aws ec2 describe-instances \
--filters Name=instance-type,Values=t2.micro,t3.micro Name=availability-zone,Values=us-east-2c
The following ``describe-instances`` example uses a JSON input file to perform the same filtering as the previous example. When filters get more complicated, they can be easier to specify in a JSON file. ::
aws ec2 describe-instances --filters file://filters.json
Contents of ``filters.json``::
[
{
"Name": "instance-type",
"Values": ["t2.micro", "t3.micro"]
},
{
"Name": "availability-zone",
"Values": ["us-east-2c"]
}
]
**Example 5: To restrict the results to only specified fields**
The following ``describe-instances`` example uses the ``--query`` parameter to display only the AMI ID and tags for the specified instance. ::
aws ec2 describe-instances \
--instance-id i-1234567890abcdef0 \
--query "Reservations[*].Instances[*].[ImageId,Tags[*]]"
The following ``describe-instances`` example uses the ``--query`` parameter to display only the instance and subnet IDs for all instances.
Linux Command::
aws ec2 describe-instances \
--query 'Reservations[*].Instances[*].{Instance:InstanceId,Subnet:SubnetId}' \
--output json
Windows Command::
aws ec2 describe-instances ^
--query "Reservations[*].Instances[*].{Instance:InstanceId,Subnet:SubnetId}" ^
--output json
Output::
[
{
"Instance": "i-057750d42936e468a",
"Subnet": "subnet-069beee9b12030077"
},
{
"Instance": "i-001efd250faaa6ffa",
"Subnet": "subnet-0b715c6b7db68927a"
},
{
"Instance": "i-027552a73f021f3bd",
"Subnet": "subnet-0250c25a1f4e15235"
}
]
**Example 6: To describe instances with a specific tag and filter the results to specific fields**
The following ``describe-instances`` example displays the instance ID, Availability Zone, and the value of the ``Name`` tag for instances that have a tag with the name ``tag-key``.
Linux Command::
aws ec2 describe-instances \
--filter Name=tag-key,Values=Name \
--query 'Reservations[*].Instances[*].{Instance:InstanceId,AZ:Placement.AvailabilityZone,Name:Tags[?Key==`Name`]|[0].Value}' \
--output table
Windows Command::
aws ec2 describe-instances ^
--filter Name=tag-key,Values=Name ^
--query "Reservations[*].Instances[*].{Instance:InstanceId,AZ:Placement.AvailabilityZone,Name:Tags[?Key=='Name']|[0].Value}" ^
--output table
Output::
-------------------------------------------------------------
| DescribeInstances |
+--------------+-----------------------+--------------------+
| AZ | Instance | Name |
+--------------+-----------------------+--------------------+
| us-east-2b | i-057750d42936e468a | my-prod-server |
| us-east-2a | i-001efd250faaa6ffa | test-server-1 |
| us-east-2a | i-027552a73f021f3bd | test-server-2 |
+--------------+-----------------------+--------------------+
**Example 7: To view the partition number for an instance in a partition placement group**
The following ``describe-instances`` example displays details about the specified instance. The output includes the placement information for the instance, which contains the placement group name and the partition number for the instance. ::
aws ec2 describe-instances \
--instance-id i-0123a456700123456
The following output is truncated to show only the relevant information::
"Placement": {
"AvailabilityZone": "us-east-1c",
"GroupName": "HDFS-Group-A",
"PartitionNumber": 3,
"Tenancy": "default"
}
For more information, see `Describing Instances in a Placement Group `__ in the *Amazon Elastic Compute Cloud Users Guide*.
**Example 8: To filter instances for a specific partition placement group and partition number**
The following ``describe-instances`` example filters the results to only those instances with the specified placement group and partition number. ::
aws ec2 describe-instances \
--filters "Name = placement-group-name, Values = HDFS-Group-A" "Name = placement-partition-number, Values = 7"
The following output is truncated to show only the relevant pieces::
"Instances": [
{
"InstanceId": "i-0123a456700123456",
"InstanceType": "r4.large",
"Placement": {
"AvailabilityZone": "us-east-1c",
"GroupName": "HDFS-Group-A",
"PartitionNumber": 7,
"Tenancy": "default"
}
},
{
"InstanceId": "i-9876a543210987654",
"InstanceType": "r4.large",
"Placement": {
"AvailabilityZone": "us-east-1c",
"GroupName": "HDFS-Group-A",
"PartitionNumber": 7,
"Tenancy": "default"
}
],
For more information, see `Describing Instances in a Placement Group `__ in the *Amazon Elastic Compute Cloud Users Guide*. awscli-1.18.69/awscli/examples/ec2/describe-public-ipv4-pools.rst 0000644 0000000 0000000 00000001517 13664010074 024476 0 ustar root root 0000000 0000000 **To describe your public IPv4 address pools**
The following ``describe-public-ipv4-pools`` example displays details about the address pools that were created when you provisioned public IPv4 address ranges using Bring Your Own IP Addresses (BYOIP). ::
aws ec2 describe-public-ipv4-pools
Output::
{
"PublicIpv4Pools": [
{
"PoolId": "ipv4pool-ec2-1234567890abcdef0",
"PoolAddressRanges": [
{
"FirstAddress": "203.0.113.0",
"LastAddress": "203.0.113.255",
"AddressCount": 256,
"AvailableAddressCount": 256
}
],
"TotalAddressCount": 256,
"TotalAvailableAddressCount": 256
}
]
}
awscli-1.18.69/awscli/examples/ec2/describe-network-interfaces.rst 0000644 0000000 0000000 00000012257 13664010074 025023 0 ustar root root 0000000 0000000 **To describe your network interfaces**
This example describes all your network interfaces.
Command::
aws ec2 describe-network-interfaces
Output::
{
"NetworkInterfaces": [
{
"Status": "in-use",
"MacAddress": "02:2f:8f:b0:cf:75",
"SourceDestCheck": true,
"VpcId": "vpc-a01106c2",
"Description": "my network interface",
"Association": {
"PublicIp": "203.0.113.12",
"AssociationId": "eipassoc-0fbb766a",
"PublicDnsName": "ec2-203-0-113-12.compute-1.amazonaws.com",
"IpOwnerId": "123456789012"
},
"NetworkInterfaceId": "eni-e5aa89a3",
"PrivateIpAddresses": [
{
"PrivateDnsName": "ip-10-0-1-17.ec2.internal",
"Association": {
"PublicIp": "203.0.113.12",
"AssociationId": "eipassoc-0fbb766a",
"PublicDnsName": "ec2-203-0-113-12.compute-1.amazonaws.com",
"IpOwnerId": "123456789012"
},
"Primary": true,
"PrivateIpAddress": "10.0.1.17"
}
],
"RequesterManaged": false,
"Ipv6Addresses": [],
"PrivateDnsName": "ip-10-0-1-17.ec2.internal",
"AvailabilityZone": "us-east-1d",
"Attachment": {
"Status": "attached",
"DeviceIndex": 1,
"AttachTime": "2013-11-30T23:36:42.000Z",
"InstanceId": "i-1234567890abcdef0",
"DeleteOnTermination": false,
"AttachmentId": "eni-attach-66c4350a",
"InstanceOwnerId": "123456789012"
},
"Groups": [
{
"GroupName": "default",
"GroupId": "sg-8637d3e3"
}
],
"SubnetId": "subnet-b61f49f0",
"OwnerId": "123456789012",
"TagSet": [],
"PrivateIpAddress": "10.0.1.17"
},
{
"Status": "in-use",
"MacAddress": "02:58:f5:ef:4b:06",
"SourceDestCheck": true,
"VpcId": "vpc-a01106c2",
"Description": "Primary network interface",
"Association": {
"PublicIp": "198.51.100.0",
"IpOwnerId": "amazon"
},
"NetworkInterfaceId": "eni-f9ba99bf",
"PrivateIpAddresses": [
{
"Association": {
"PublicIp": "198.51.100.0",
"IpOwnerId": "amazon"
},
"Primary": true,
"PrivateIpAddress": "10.0.1.149"
}
],
"RequesterManaged": false,
"Ipv6Addresses": [],
"AvailabilityZone": "us-east-1d",
"Attachment": {
"Status": "attached",
"DeviceIndex": 0,
"AttachTime": "2013-11-30T23:35:33.000Z",
"InstanceId": "i-0598c7d356eba48d7",
"DeleteOnTermination": true,
"AttachmentId": "eni-attach-1b9db777",
"InstanceOwnerId": "123456789012"
},
"Groups": [
{
"GroupName": "default",
"GroupId": "sg-8637d3e3"
}
],
"SubnetId": "subnet-b61f49f0",
"OwnerId": "123456789012",
"TagSet": [],
"PrivateIpAddress": "10.0.1.149"
}
]
}
This example describes network interfaces that have a tag with the key ``Purpose`` and the value ``Prod``.
Command::
aws ec2 describe-network-interfaces --filters Name=tag:Purpose,Values=Prod
Output::
{
"NetworkInterfaces": [
{
"Status": "available",
"MacAddress": "12:2c:bd:f9:bf:17",
"SourceDestCheck": true,
"VpcId": "vpc-8941ebec",
"Description": "ProdENI",
"NetworkInterfaceId": "eni-b9a5ac93",
"PrivateIpAddresses": [
{
"PrivateDnsName": "ip-10-0-1-55.ec2.internal",
"Primary": true,
"PrivateIpAddress": "10.0.1.55"
},
{
"PrivateDnsName": "ip-10-0-1-117.ec2.internal",
"Primary": false,
"PrivateIpAddress": "10.0.1.117"
}
],
"RequesterManaged": false,
"PrivateDnsName": "ip-10-0-1-55.ec2.internal",
"AvailabilityZone": "us-east-1d",
"Ipv6Addresses": [],
"Groups": [
{
"GroupName": "MySG",
"GroupId": "sg-905002f5"
}
],
"SubnetId": "subnet-31d6c219",
"OwnerId": "123456789012",
"TagSet": [
{
"Value": "Prod",
"Key": "Purpose"
}
],
"PrivateIpAddress": "10.0.1.55"
}
]
} awscli-1.18.69/awscli/examples/ec2/attach-network-interface.rst 0000644 0000000 0000000 00000000507 13664010074 024317 0 ustar root root 0000000 0000000 **To attach a network interface to an instance**
This example attaches the specified network interface to the specified instance.
Command::
aws ec2 attach-network-interface --network-interface-id eni-e5aa89a3 --instance-id i-1234567890abcdef0 --device-index 1
Output::
{
"AttachmentId": "eni-attach-66c4350a"
} awscli-1.18.69/awscli/examples/ec2/describe-local-gateways.rst 0000755 0000000 0000000 00000001013 13664010074 024114 0 ustar root root 0000000 0000000 **To describe your Local Gateways**
The following ``describe-local-gateways`` example displays details for the local gateways that are available to you. ::
aws ec2 describe-local-gateways
Output::
{
"LocalGateways": [
{
"LocalGatewayId": "lgw-09b493aa7cEXAMPLE",
"OutpostArn": "arn:aws:outposts:us-west-2:123456789012:outpost/op-0dc11b66ed59f995a",
"OwnerId": "123456789012",
"State": "available"
}
]
}
awscli-1.18.69/awscli/examples/ec2/describe-traffic-mirror-sessions.rst 0000644 0000000 0000000 00000003150 13664010074 025773 0 ustar root root 0000000 0000000 **To describe a Traffic Mirror Session**
The following ``describe-traffic-mirror-sessions`` example displays details of the your Traffic Mirror sessions. ::
aws ec2 describe-traffic-mirror-sessions
Output::
{
"TrafficMirrorSessions": [
{
"Tags": [],
"VirtualNetworkId": 42,
"OwnerId": "111122223333",
"Description": "TCP Session",
"NetworkInterfaceId": "eni-0a471a5cf3EXAMPLE",
"TrafficMirrorTargetId": "tmt-0dabe9b0a6EXAMPLE",
"TrafficMirrorFilterId": "tmf-083e18f985EXAMPLE",
"PacketLength": 20,
"SessionNumber": 1,
"TrafficMirrorSessionId": "tms-0567a4c684EXAMPLE"
},
{
"Tags": [
{
"Key": "Name",
"Value": "tag test"
}
],
"VirtualNetworkId": 13314501,
"OwnerId": "111122223333",
"Description": "TCP Session",
"NetworkInterfaceId": "eni-0a471a5cf3EXAMPLE",
"TrafficMirrorTargetId": "tmt-03665551cbEXAMPLE",
"TrafficMirrorFilterId": "tmf-06c787846cEXAMPLE",
"SessionNumber": 2,
"TrafficMirrorSessionId": "tms-0060101cf8EXAMPLE"
}
]
}
For more information, see `View Traffic Mirror Session Details `__ in the *AWS Traffic Mirroring Guide*. awscli-1.18.69/awscli/examples/ec2/delete-network-acl-entry.rst 0000644 0000000 0000000 00000000411 13664010074 024245 0 ustar root root 0000000 0000000 **To delete a network ACL entry**
This example deletes ingress rule number 100 from the specified network ACL. If the command succeeds, no output is returned.
Command::
aws ec2 delete-network-acl-entry --network-acl-id acl-5fb85d36 --ingress --rule-number 100
awscli-1.18.69/awscli/examples/ec2/create-snapshots.rst 0000644 0000000 0000000 00000006363 13664010074 022717 0 ustar root root 0000000 0000000 **Example 1: To create a multi-volume snapshot**
The following ``create-snapshots`` example creates snapshots of all volumes attached to the specified instance. ::
aws ec2 create-snapshots \
--instance-specification InstanceId=i-1234567890abcdef0 \
--description "This is snapshot of a volume from my-instance"
Output::
{
"Snapshots": [
{
"Description": "This is a snapshot of a volume from my-instance",
"Tags": [],
"Encrypted": false,
"VolumeId": "vol-0a01d2d5a34697479",
"State": "pending",
"VolumeSize": 16,
"StartTime": "2019-08-05T16:58:19.000Z",
"Progress": "",
"OwnerId": "123456789012",
"SnapshotId": "snap-07f30e3909aa0045e"
},
{
"Description": "This is a snapshot of a volume from my-instance",
"Tags": [],
"Encrypted": false,
"VolumeId": "vol-02d0d4947008cb1a2",
"State": "pending",
"VolumeSize": 20,
"StartTime": "2019-08-05T16:58:19.000Z",
"Progress": "",
"OwnerId": "123456789012",
"SnapshotId": "snap-0ec20b602264aad48"
},
...
]
}
**Example 2: To create a multi-volume snapshot with tags from the source volume**
The following ``create-snapshots`` example creates snapshots of all volumes attached to the specified instance and copies the tags from each volume to its corresponding snapshot. ::
aws ec2 create-snapshots \
--instance-specification InstanceId=i-1234567890abcdef0 \
--copy-tags-from-source volume \
--description "This is snapshot of a volume from my-instance"
Output::
{
"Snapshots": [
{
"Description": "This is a snapshot of a volume from my-instance",
"Tags": [
{
"Key": "Name",
"Value": "my-volume"
}
],
"Encrypted": false,
"VolumeId": "vol-02d0d4947008cb1a2",
"State": "pending",
"VolumeSize": 20,
"StartTime": "2019-08-05T16:53:04.000Z",
"Progress": "",
"OwnerId": "123456789012",
"SnapshotId": "snap-053bfaeb821a458dd"
}
...
]
}
**Example 3: To create a multi-volume snapshot not including the root volume**
The following ``create-snapshots`` example creates a snapshot of all volumes attached to the specified instance except for the root volume. ::
aws ec2 create-snapshots \
--instance-specification InstanceId=i-1234567890abcdef0,ExcludeBootVolume=true
**Example 4: To create a multi-volume snapshot and add tags**
The following ``create-snapshots`` example creates snapshots of all volumes attached to the specified instance and adds two tags to each snapshot. ::
aws ec2 create-snapshots \
--instance-specification InstanceId=i-1234567890abcdef0
--tag-specifications ResourceType=snapshot,Tags=[{Key=Name,Value=backup},{Key=costcenter,Value=123}]
awscli-1.18.69/awscli/examples/ec2/describe-vpc-attribute.rst 0000644 0000000 0000000 00000002025 13664010074 023772 0 ustar root root 0000000 0000000 **To describe the enableDnsSupport attribute**
This example describes the ``enableDnsSupport`` attribute. This attribute indicates whether DNS resolution is enabled for the VPC. If this attribute is ``true``, the Amazon DNS server resolves DNS hostnames for your instances to their corresponding IP addresses; otherwise, it does not.
Command::
aws ec2 describe-vpc-attribute --vpc-id vpc-a01106c2 --attribute enableDnsSupport
Output::
{
"VpcId": "vpc-a01106c2",
"EnableDnsSupport": {
"Value": true
}
}
**To describe the enableDnsHostnames attribute**
This example describes the ``enableDnsHostnames`` attribute. This attribute indicates whether the instances launched in the VPC get DNS hostnames. If this attribute is ``true``, instances in the VPC get DNS hostnames; otherwise, they do not.
Command::
aws ec2 describe-vpc-attribute --vpc-id vpc-a01106c2 --attribute enableDnsHostnames
Output::
{
"VpcId": "vpc-a01106c2",
"EnableDnsHostnames": {
"Value": true
}
} awscli-1.18.69/awscli/examples/ec2/describe-spot-instance-requests.rst 0000644 0000000 0000000 00000004634 13664010074 025651 0 ustar root root 0000000 0000000 **To describe Spot Instance requests**
This example describes all of your Spot Instance requests.
Command::
aws ec2 describe-spot-instance-requests
Output::
{
"SpotInstanceRequests": [
{
"Status": {
"UpdateTime": "2014-04-30T18:16:21.000Z",
"Code": "fulfilled",
"Message": "Your Spot request is fulfilled."
},
"ProductDescription": "Linux/UNIX",
"InstanceId": "i-1234567890abcdef0",
"SpotInstanceRequestId": "sir-08b93456",
"State": "active",
"LaunchedAvailabilityZone": "us-west-1b",
"LaunchSpecification": {
"ImageId": "ami-7aba833f",
"KeyName": "May14Key",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Ebs": {
"DeleteOnTermination": true,
"VolumeType": "standard",
"VolumeSize": 8
}
}
],
"EbsOptimized": false,
"SecurityGroups": [
{
"GroupName": "launch-wizard-1",
"GroupId": "sg-e38f24a7"
}
],
"InstanceType": "m1.small"
},
"Type": "one-time",
"CreateTime": "2014-04-30T18:14:55.000Z",
"SpotPrice": "0.010000"
},
{
"Status": {
"UpdateTime": "2014-04-30T18:16:21.000Z",
"Code": "fulfilled",
"Message": "Your Spot request is fulfilled."
},
"ProductDescription": "Linux/UNIX",
"InstanceId": "i-1234567890abcdef1",
"SpotInstanceRequestId": "sir-285b1e56",
"State": "active",
"LaunchedAvailabilityZone": "us-west-1b",
"LaunchSpecification": {
"ImageId": "ami-7aba833f",
"KeyName": "May14Key",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Ebs": {
"DeleteOnTermination": true,
"VolumeType": "standard",
"VolumeSize": 8
}
}
],
"EbsOptimized": false,
"SecurityGroups": [
{
"GroupName": "launch-wizard-1",
"GroupId": "sg-e38f24a7"
}
],
"InstanceType": "m1.small"
},
"Type": "one-time",
"CreateTime": "2014-04-30T18:14:55.000Z",
"SpotPrice": "0.010000"
}
]
}
awscli-1.18.69/awscli/examples/ec2/modify-vpn-tunnel-options.rst 0000644 0000000 0000000 00000006062 13664010074 024514 0 ustar root root 0000000 0000000 **To modify the tunnel options for a VPN connection**
The following ``modify-vpn-tunnel-options`` example updates the Diffie-Hellmann groups that are permitted for the specified tunnel and VPN connection. ::
aws ec2 modify-vpn-tunnel-options \
--vpn-connection-id vpn-12345678901234567 \
--vpn-tunnel-outside-ip-address 203.0.113.17 \
--tunnel-options Phase1DHGroupNumbers=[{Value=14},{Value=15},{Value=16},{Value=17},{Value=18}],Phase2DHGroupNumbers=[{Value=14},{Value=15},{Value=16},{Value=17},{Value=18}]
Output::
{
"VpnConnection": {
"CustomerGatewayConfiguration": "...configuration information...",
"CustomerGatewayId": "cgw-aabbccddee1122334",
"Category": "VPN",
"State": "available",
"Type": "ipsec.1",
"VpnConnectionId": "vpn-12345678901234567",
"VpnGatewayId": "vgw-11223344556677889",
"Options": {
"StaticRoutesOnly": false,
"TunnelOptions": [
{
"OutsideIpAddress": "203.0.113.17",
"Phase1DHGroupNumbers": [
{
"Value": 14
},
{
"Value": 15
},
{
"Value": 16
},
{
"Value": 17
},
{
"Value": 18
}
],
"Phase2DHGroupNumbers": [
{
"Value": 14
},
{
"Value": 15
},
{
"Value": 16
},
{
"Value": 17
},
{
"Value": 18
}
]
},
{
"OutsideIpAddress": "203.0.114.19"
}
]
},
"VgwTelemetry": [
{
"AcceptedRouteCount": 0,
"LastStatusChange": "2019-09-10T21:56:54.000Z",
"OutsideIpAddress": "203.0.113.17",
"Status": "DOWN",
"StatusMessage": "IPSEC IS DOWN"
},
{
"AcceptedRouteCount": 0,
"LastStatusChange": "2019-09-10T21:56:43.000Z",
"OutsideIpAddress": "203.0.114.19",
"Status": "DOWN",
"StatusMessage": "IPSEC IS DOWN"
}
]
}
}
awscli-1.18.69/awscli/examples/ec2/authorize-security-group-egress.rst 0000644 0000000 0000000 00000002051 13664010074 025721 0 ustar root root 0000000 0000000 **To add a rule that allows outbound traffic to a specific address range**
This example command adds a rule that grants access to the specified address ranges on TCP port 80.
Command (Linux)::
aws ec2 authorize-security-group-egress --group-id sg-1a2b3c4d --ip-permissions IpProtocol=tcp,FromPort=80,ToPort=80,IpRanges='[{CidrIp=10.0.0.0/16}]'
Command (Windows)::
aws ec2 authorize-security-group-egress --group-id sg-1a2b3c4d --ip-permissions IpProtocol=tcp,FromPort=80,ToPort=80,IpRanges=[{CidrIp=10.0.0.0/16}]
**To add a rule that allows outbound traffic to a specific security group**
This example command adds a rule that grants access to the specified security group on TCP port 80.
Command (Linux)::
aws ec2 authorize-security-group-egress --group-id sg-1a2b3c4d --ip-permissions IpProtocol=tcp,FromPort=80,ToPort=80,UserIdGroupPairs='[{GroupId=sg-4b51a32f}]'
Command (Windows)::
aws ec2 authorize-security-group-egress --group-id sg-1a2b3c4d --ip-permissions IpProtocol=tcp,FromPort=80,ToPort=80,UserIdGroupPairs=[{GroupId=sg-4b51a32f}]
awscli-1.18.69/awscli/examples/ec2/describe-subnets.rst 0000644 0000000 0000000 00000010271 13664010132 022661 0 ustar root root 0000000 0000000 **Example 1: To describe your subnets**
The following ``describe-subnets`` example displays the details of your subnets. ::
aws ec2 describe-subnets
Output::
{
"Subnets": [
{
"AvailabilityZone": "us-east-1d",
"AvailabilityZoneId": "use1-az2",
"AvailableIpAddressCount": 4089,
"CidrBlock": "172.31.80.0/20",
"DefaultForAz": true,
"MapPublicIpOnLaunch": false,
"MapCustomerOwnedIpOnLaunch": true,
"State": "available",
"SubnetId": "subnet-0bb1c79de3EXAMPLE",
"VpcId": "vpc-0ee975135dEXAMPLE",
"OwnerId": "111122223333",
"AssignIpv6AddressOnCreation": false,
"Ipv6CidrBlockAssociationSet": [],
"CustomerOwnedIpv4Pool:": 'pool-2EXAMPLE',
"SubnetArn": "arn:aws:ec2:us-east-2:111122223333:subnet/subnet-0bb1c79de3EXAMPLE"
},
{
"AvailabilityZone": "us-east-1d",
"AvailabilityZoneId": "use1-az2",
"AvailableIpAddressCount": 4089,
"CidrBlock": "172.31.80.0/20",
"DefaultForAz": true,
"MapPublicIpOnLaunch": true,
"MapCustomerOwnedIpOnLaunch": false,
"State": "available",
"SubnetId": "subnet-8EXAMPLE",
"VpcId": "vpc-3EXAMPLE",
"OwnerId": "1111222233333",
"AssignIpv6AddressOnCreation": false,
"Ipv6CidrBlockAssociationSet": [],
"Tags": [
{
"Key": "Name",
"Value": "MySubnet"
}
],
"SubnetArn": "arn:aws:ec2:us-east-1:111122223333:subnet/subnet-8EXAMPLE"
}
]
}
For more information, see `Working with VPCs and Subnets `__ in the *AWS VPC User Guide*.
**Example 2: To describe a specificied VPCs subnets**
The following ``describe-subnets`` example uses a filter to retrieve details for the subnets of the specified VPC. ::
aws ec2 describe-subnets \
--filters "Name=vpc-id,Values=vpc-3EXAMPLE"
Output::
{
"Subnets": [
{
"AvailabilityZone": "us-east-1d",
"AvailabilityZoneId": "use1-az2",
"AvailableIpAddressCount": 4089,
"CidrBlock": "172.31.80.0/20",
"DefaultForAz": true,
"MapPublicIpOnLaunch": true,
"MapCustomerOwnedIpOnLaunch": false,
"State": "available",
"SubnetId": "subnet-8EXAMPLE",
"VpcId": "vpc-3EXAMPLE",
"OwnerId": "1111222233333",
"AssignIpv6AddressOnCreation": false,
"Ipv6CidrBlockAssociationSet": [],
"Tags": [
{
"Key": "Name",
"Value": "MySubnet"
}
],
"SubnetArn": "arn:aws:ec2:us-east-1:111122223333:subnet/subnet-8EXAMPLE"
}
]
}
For more information, see `Working with VPCs and Subnets `__ in the *AWS VPC User Guide*.
**Example 3: To describe subnets with a specific tag**
The following ``describe-subnets`` example uses a filter to retrieve the details of those subnets with the tag ``Name=MySubnet``. The command specifies that the output is a simple text string. ::
aws ec2 describe-subnets \
--filters Name=tag:Name,Values=MySubnet \
--output text
Output::
SUBNETS False us-east-1c use1-az1 250 10.0.0.0/24 False False False 111122223333 available arn:aws:ec2:us-east-1:111122223333:subnet/subnet-0d3d002af8EXAMPLE subnet-0d3d002af8EXAMPLE vpc-0065acced4EXAMPLE TAGS Name MySubnet
For more information, see `Working with VPCs and Subnets `__ in the *AWS VPC User Guide*.
awscli-1.18.69/awscli/examples/ec2/describe-network-acls.rst 0000644 0000000 0000000 00000010630 13664010074 023613 0 ustar root root 0000000 0000000 **To describe your network ACLs**
The following ``describe-network-acls`` example retrieves details about your network ACLs. ::
aws ec2 describe-network-acls
Output::
{
"NetworkAcls": [
{
"Associations": [
{
"NetworkAclAssociationId": "aclassoc-0c1679dc41EXAMPLE",
"NetworkAclId": "acl-0ea1f54ca7EXAMPLE",
"SubnetId": "subnet-0931fc2fa5EXAMPLE"
}
],
"Entries": [
{
"CidrBlock": "0.0.0.0/0",
"Egress": true,
"Protocol": "-1",
"RuleAction": "allow",
"RuleNumber": 100
},
{
"CidrBlock": "0.0.0.0/0",
"Egress": true,
"Protocol": "-1",
"RuleAction": "deny",
"RuleNumber": 32767
},
{
"CidrBlock": "0.0.0.0/0",
"Egress": false,
"Protocol": "-1",
"RuleAction": "allow",
"RuleNumber": 100
},
{
"CidrBlock": "0.0.0.0/0",
"Egress": false,
"Protocol": "-1",
"RuleAction": "deny",
"RuleNumber": 32767
}
],
"IsDefault": true,
"NetworkAclId": "acl-0ea1f54ca7EXAMPLE",
"Tags": [],
"VpcId": "vpc-06e4ab6c6cEXAMPLE",
"OwnerId": "111122223333"
},
{
"Associations": [],
"Entries": [
{
"CidrBlock": "0.0.0.0/0",
"Egress": true,
"Protocol": "-1",
"RuleAction": "allow",
"RuleNumber": 100
},
{
"Egress": true,
"Ipv6CidrBlock": "::/0",
"Protocol": "-1",
"RuleAction": "allow",
"RuleNumber": 101
},
{
"CidrBlock": "0.0.0.0/0",
"Egress": true,
"Protocol": "-1",
"RuleAction": "deny",
"RuleNumber": 32767
},
{
"Egress": true,
"Ipv6CidrBlock": "::/0",
"Protocol": "-1",
"RuleAction": "deny",
"RuleNumber": 32768
},
{
"CidrBlock": "0.0.0.0/0",
"Egress": false,
"Protocol": "-1",
"RuleAction": "allow",
"RuleNumber": 100
},
{
"Egress": false,
"Ipv6CidrBlock": "::/0",
"Protocol": "-1",
"RuleAction": "allow",
"RuleNumber": 101
},
{
"CidrBlock": "0.0.0.0/0",
"Egress": false,
"Protocol": "-1",
"RuleAction": "deny",
"RuleNumber": 32767
},
{
"Egress": false,
"Ipv6CidrBlock": "::/0",
"Protocol": "-1",
"RuleAction": "deny",
"RuleNumber": 32768
}
],
"IsDefault": true,
"NetworkAclId": "acl-0e2a78e4e2EXAMPLE",
"Tags": [],
"VpcId": "vpc-03914afb3eEXAMPLE",
"OwnerId": "111122223333"
}
]
}
For more information, see `Network ACLs `__ in the *AWS VPC User Guide*.
awscli-1.18.69/awscli/examples/ec2/cancel-export-task.rst 0000644 0000000 0000000 00000000360 13664010074 023127 0 ustar root root 0000000 0000000 **To cancel an active export task**
This example cancels an active export task with the task ID export-i-fgelt0i7. If the command succeeds, no output is returned.
Command::
aws ec2 cancel-export-task --export-task-id export-i-fgelt0i7
awscli-1.18.69/awscli/examples/ec2/reset-image-attribute.rst 0000644 0000000 0000000 00000000477 13664010074 023637 0 ustar root root 0000000 0000000 **To reset the launchPermission attribute**
This example resets the ``launchPermission`` attribute for the specified AMI to its default value. By default, AMIs are private. If the command succeeds, no output is returned.
Command::
aws ec2 reset-image-attribute --image-id ami-5731123e --attribute launchPermission
awscli-1.18.69/awscli/examples/ec2/provision-byoip-cidr.rst 0000644 0000000 0000000 00000001224 13664010074 023512 0 ustar root root 0000000 0000000 **To provision an address range**
The following ``provision-byoip-cidr`` example provisions a public IP address range for use with AWS. ::
aws ec2 provision-byoip-cidr \
--cidr 203.0.113.25/24 \
--cidr-authorization-context Message="$text_message",Signature="$signed_message"
Output::
{
"ByoipCidr": {
"Cidr": "203.0.113.25/24",
"State": "pending-provision"
}
}
For more information about creating the messages strings for the authorization context, see `Bring Your Own IP Addresses `__ in the *Amazon EC2 User Guide*.
awscli-1.18.69/awscli/examples/ec2/describe-spot-fleet-requests.rst 0000644 0000000 0000000 00000011503 13664010074 025135 0 ustar root root 0000000 0000000 **To describe your Spot fleet requests**
This example describes all of your Spot fleet requests.
Command::
aws ec2 describe-spot-fleet-requests
Output::
{
"SpotFleetRequestConfigs": [
{
"SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE",
"SpotFleetRequestConfig": {
"TargetCapacity": 20,
"LaunchSpecifications": [
{
"EbsOptimized": false,
"NetworkInterfaces": [
{
"SubnetId": "subnet-a61dafcf",
"DeviceIndex": 0,
"DeleteOnTermination": false,
"AssociatePublicIpAddress": true,
"SecondaryPrivateIpAddressCount": 0
}
],
"InstanceType": "cc2.8xlarge",
"ImageId": "ami-1a2b3c4d"
},
{
"EbsOptimized": false,
"NetworkInterfaces": [
{
"SubnetId": "subnet-a61dafcf",
"DeviceIndex": 0,
"DeleteOnTermination": false,
"AssociatePublicIpAddress": true,
"SecondaryPrivateIpAddressCount": 0
}
],
"InstanceType": "r3.8xlarge",
"ImageId": "ami-1a2b3c4d"
}
],
"SpotPrice": "0.05",
"IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role"
},
"SpotFleetRequestState": "active"
},
{
"SpotFleetRequestId": "sfr-306341ed-9739-402e-881b-ce47bEXAMPLE",
"SpotFleetRequestConfig": {
"TargetCapacity": 20,
"LaunchSpecifications": [
{
"EbsOptimized": false,
"NetworkInterfaces": [
{
"SubnetId": "subnet-6e7f829e",
"DeviceIndex": 0,
"DeleteOnTermination": false,
"AssociatePublicIpAddress": true,
"SecondaryPrivateIpAddressCount": 0
}
],
"InstanceType": "m3.medium",
"ImageId": "ami-1a2b3c4d"
}
],
"SpotPrice": "0.05",
"IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role"
},
"SpotFleetRequestState": "active"
}
]
}
**To describe a Spot fleet request**
This example describes the specified Spot fleet request.
Command::
aws ec2 describe-spot-fleet-requests --spot-fleet-request-ids sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE
Output::
{
"SpotFleetRequestConfigs": [
{
"SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE",
"SpotFleetRequestConfig": {
"TargetCapacity": 20,
"LaunchSpecifications": [
{
"EbsOptimized": false,
"NetworkInterfaces": [
{
"SubnetId": "subnet-a61dafcf",
"DeviceIndex": 0,
"DeleteOnTermination": false,
"AssociatePublicIpAddress": true,
"SecondaryPrivateIpAddressCount": 0
}
],
"InstanceType": "cc2.8xlarge",
"ImageId": "ami-1a2b3c4d"
},
{
"EbsOptimized": false,
"NetworkInterfaces": [
{
"SubnetId": "subnet-a61dafcf",
"DeviceIndex": 0,
"DeleteOnTermination": false,
"AssociatePublicIpAddress": true,
"SecondaryPrivateIpAddressCount": 0
}
],
"InstanceType": "r3.8xlarge",
"ImageId": "ami-1a2b3c4d"
}
],
"SpotPrice": "0.05",
"IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role"
},
"SpotFleetRequestState": "active"
}
]
}
awscli-1.18.69/awscli/examples/ec2/disable-transit-gateway-route-table-propagation.rst 0000644 0000000 0000000 00000001735 13664010074 030720 0 ustar root root 0000000 0000000 **To disable a transit gateway attachment to propagate routes to the specified propagation route table**
The following ``disable-transit-gateway-route-table-propagation`` example disables the specified attachment to propagate routes to the specified propagation route table. ::
aws ec2 disable-transit-gateway-route-table-propagation \
--transit-gateway-route-table-id tgw-rtb-0a823edbdeEXAMPLE \
--transit-gateway-attachment-id tgw-attach-09b52ccdb5EXAMPLE
Output::
{
"Propagation": {
"TransitGatewayAttachmentId": "tgw-attach-09b52ccdb5EXAMPLE",
"ResourceId": "vpc-4d7de228",
"ResourceType": "vpc",
"TransitGatewayRouteTableId": "tgw-rtb-0a823edbdeEXAMPLE",
"State": "disabled"
}
}
For more information, see `Disable Route Table Propagation `__ in the *AWS Transit Gateways Guide*.
awscli-1.18.69/awscli/examples/ec2/attach-vpn-gateway.rst 0000644 0000000 0000000 00000000532 13664010074 023130 0 ustar root root 0000000 0000000 **To attach a virtual private gateway to your VPC**
This example attaches the specified virtual private gateway to the specified VPC.
Command::
aws ec2 attach-vpn-gateway --vpn-gateway-id vgw-9a4cacf3 --vpc-id vpc-a01106c2
Output::
{
"VpcAttachement": {
"State": "attaching",
"VpcId": "vpc-a01106c2"
}
} awscli-1.18.69/awscli/examples/ec2/associate-dhcp-options.rst 0000644 0000000 0000000 00000001055 13664010074 024005 0 ustar root root 0000000 0000000 **To associate a DHCP options set with your VPC**
This example associates the specified DHCP options set with the specified VPC. If the command succeeds, no output is returned.
Command::
aws ec2 associate-dhcp-options --dhcp-options-id dopt-d9070ebb --vpc-id vpc-a01106c2
**To associate the default DHCP options set with your VPC**
This example associates the default DHCP options set with the specified VPC. If the command succeeds, no output is returned.
Command::
aws ec2 associate-dhcp-options --dhcp-options-id default --vpc-id vpc-a01106c2
awscli-1.18.69/awscli/examples/ec2/describe-vpc-endpoint-connection-notifications.rst 0000644 0000000 0000000 00000001447 13664010132 030615 0 ustar root root 0000000 0000000 **To describe endpoint connection notifications**
The following ``describe-vpc-endpoint-connection-notifications`` example describes all of your endpoint connection notifications. ::
aws ec2 describe-vpc-endpoint-connection-notifications
Output::
{
"ConnectionNotificationSet": [
{
"ConnectionNotificationState": "Enabled",
"ConnectionNotificationType": "Topic",
"ConnectionEvents": [
"Accept",
"Reject",
"Delete",
"Connect"
],
"ConnectionNotificationId": "vpce-nfn-04bcb952bc8af7abc",
"ConnectionNotificationArn": "arn:aws:sns:us-east-1:123456789012:VpceNotification",
"VpcEndpointId": "vpce-0324151a02f327123"
}
]
}
awscli-1.18.69/awscli/examples/ec2/delete-network-interface.rst 0000644 0000000 0000000 00000000334 13664010074 024313 0 ustar root root 0000000 0000000 **To delete a network interface**
This example deletes the specified network interface. If the command succeeds, no output is returned.
Command::
aws ec2 delete-network-interface --network-interface-id eni-e5aa89a3
awscli-1.18.69/awscli/examples/ec2/describe-scheduled-instance-availability.rst 0000644 0000000 0000000 00000002616 13664010074 027421 0 ustar root root 0000000 0000000 **To describe an available schedule**
This example describes a schedule that occurs every week on Sunday, starting on the specified date.
Command::
aws ec2 describe-scheduled-instance-availability --recurrence Frequency=Weekly,Interval=1,OccurrenceDays=[1] --first-slot-start-time-range EarliestTime=2016-01-31T00:00:00Z,LatestTime=2016-01-31T04:00:00Z
Output::
{
"ScheduledInstanceAvailabilitySet": [
{
"AvailabilityZone": "us-west-2b",
"TotalScheduledInstanceHours": 1219,
"PurchaseToken": "eyJ2IjoiMSIsInMiOjEsImMiOi...",
"MinTermDurationInDays": 366,
"AvailableInstanceCount": 20,
"Recurrence": {
"OccurrenceDaySet": [
1
],
"Interval": 1,
"Frequency": "Weekly",
"OccurrenceRelativeToEnd": false
},
"Platform": "Linux/UNIX",
"FirstSlotStartTime": "2016-01-31T00:00:00Z",
"MaxTermDurationInDays": 366,
"SlotDurationInHours": 23,
"NetworkPlatform": "EC2-VPC",
"InstanceType": "c4.large",
"HourlyPrice": "0.095"
},
...
]
}
To narrow the results, you can add filters that specify the operating system, network, and instance type.
Command:
--filters Name=platform,Values=Linux/UNIX Name=network-platform,Values=EC2-VPC Name=instance-type,Values=c4.large
awscli-1.18.69/awscli/examples/ec2/attach-classic-link-vpc.rst 0000644 0000000 0000000 00000000510 13664010074 024024 0 ustar root root 0000000 0000000 **To link (attach) an EC2-Classic instance to a VPC**
This example links instance i-1234567890abcdef0 to VPC vpc-88888888 through the VPC security group sg-12312312.
Command::
aws ec2 attach-classic-link-vpc --instance-id i-1234567890abcdef0 --vpc-id vpc-88888888 --groups sg-12312312
Output::
{
"Return": true
} awscli-1.18.69/awscli/examples/ec2/describe-transit-gateways.rst 0000644 0000000 0000000 00000004274 13664010074 024517 0 ustar root root 0000000 0000000 **To describe your transit gateways**
The following ``describe-transit-gateways`` example retrieves details about your transit gateways. ::
aws ec2 describe-transit-gateways
Output::
{
"TransitGateways": [
{
"TransitGatewayId": "tgw-0262a0e521EXAMPLE",
"TransitGatewayArn": "arn:aws:ec2:us-east-2:111122223333:transit-gateway/tgw-0262a0e521EXAMPLE",
"State": "available",
"OwnerId": "111122223333",
"Description": "MyTGW",
"CreationTime": "2019-07-10T14:02:12.000Z",
"Options": {
"AmazonSideAsn": 64516,
"AutoAcceptSharedAttachments": "enable",
"DefaultRouteTableAssociation": "enable",
"AssociationDefaultRouteTableId": "tgw-rtb-018774adf3EXAMPLE",
"DefaultRouteTablePropagation": "enable",
"PropagationDefaultRouteTableId": "tgw-rtb-018774adf3EXAMPLE",
"VpnEcmpSupport": "enable",
"DnsSupport": "enable"
},
"Tags": []
},
{
"TransitGatewayId": "tgw-0fb8421e2dEXAMPLE",
"TransitGatewayArn": "arn:aws:ec2:us-east-2:111122223333:transit-gateway/tgw-0fb8421e2da853bf3",
"State": "available",
"OwnerId": "111122223333",
"CreationTime": "2019-03-15T22:57:33.000Z",
"Options": {
"AmazonSideAsn": 65412,
"AutoAcceptSharedAttachments": "disable",
"DefaultRouteTableAssociation": "enable",
"AssociationDefaultRouteTableId": "tgw-rtb-06a241a3d8EXAMPLE",
"DefaultRouteTablePropagation": "enable",
"PropagationDefaultRouteTableId": "tgw-rtb-06a241a3d8EXAMPLE",
"VpnEcmpSupport": "enable",
"DnsSupport": "enable"
},
"Tags": [
{
"Key": "Name",
"Value": "TGW1"
}
]
}
]
}
awscli-1.18.69/awscli/examples/ec2/enable-ebs-encryption-by-default.rst 0000644 0000000 0000000 00000000441 13664010074 025642 0 ustar root root 0000000 0000000 **To enable EBS encryption by default**
The following ``enable-ebs-encryption-by-default`` example enables EBS encryption by default for your AWS account in the current Region. ::
aws ec2 enable-ebs-encryption-by-default
Output::
{
"EbsEncryptionByDefault": true
}
awscli-1.18.69/awscli/examples/ec2/authorize-client-vpn-ingress.rst 0000644 0000000 0000000 00000001232 13664010074 025161 0 ustar root root 0000000 0000000 **To add an authorization rule for a Client VPN endpoint**
The following ``authorize-client-vpn-ingress`` example adds an ingress authorization rule that permits all clients to access the internet (``0.0.0.0/0``). ::
aws ec2 authorize-client-vpn-ingress \
--client-vpn-endpoint-id cvpn-endpoint-123456789123abcde \
--target-network-cidr 0.0.0.0/0 \
--authorize-all-groups
Output::
{
"Status": {
"Code": "authorizing"
}
}
For more information, see `Authorization Rules `__ in the *AWS Client VPN Administrator Guide*.
awscli-1.18.69/awscli/examples/ec2/disassociate-iam-instance-profile.rst 0000644 0000000 0000000 00000001146 13664010074 026105 0 ustar root root 0000000 0000000 **To disassociate an IAM instance profile**
This example disassociates an IAM instance profile with the association ID ``iip-assoc-05020b59952902f5f``.
Command::
aws ec2 disassociate-iam-instance-profile --association-id iip-assoc-05020b59952902f5f
Output::
{
"IamInstanceProfileAssociation": {
"InstanceId": "i-123456789abcde123",
"State": "disassociating",
"AssociationId": "iip-assoc-05020b59952902f5f",
"IamInstanceProfile": {
"Id": "AIPAI5IVIHMFFYY2DKV5Y",
"Arn": "arn:aws:iam::123456789012:instance-profile/admin-role"
}
}
}
awscli-1.18.69/awscli/examples/ec2/create-network-acl-entry.rst 0000644 0000000 0000000 00000001412 13664010074 024250 0 ustar root root 0000000 0000000 **To create a network ACL entry**
This example creates an entry for the specified network ACL. The rule allows ingress traffic from any IPv4 address (0.0.0.0/0) on UDP port 53 (DNS) into any associated subnet. If the command succeeds, no output is returned.
Command::
aws ec2 create-network-acl-entry --network-acl-id acl-5fb85d36 --ingress --rule-number 100 --protocol udp --port-range From=53,To=53 --cidr-block 0.0.0.0/0 --rule-action allow
This example creates a rule for the specified network ACL that allows ingress traffic from any IPv6 address (::/0) on TCP port 80 (HTTP).
Command::
aws ec2 create-network-acl-entry --network-acl-id acl-5fb85d36 --ingress --rule-number 120 --protocol tcp --port-range From=80,To=80 --ipv6-cidr-block ::/0 --rule-action allow awscli-1.18.69/awscli/examples/ec2/disassociate-address.rst 0000644 0000000 0000000 00000001003 13664010074 023514 0 ustar root root 0000000 0000000 **To disassociate an Elastic IP addresses in EC2-Classic**
This example disassociates an Elastic IP address from an instance in EC2-Classic. If the command succeeds, no output is returned.
Command::
aws ec2 disassociate-address --public-ip 198.51.100.0
**To disassociate an Elastic IP address in EC2-VPC**
This example disassociates an Elastic IP address from an instance in a VPC. If the command succeeds, no output is returned.
Command::
aws ec2 disassociate-address --association-id eipassoc-2bebb745
awscli-1.18.69/awscli/examples/ec2/delete-vpn-connection.rst 0000644 0000000 0000000 00000000320 13664010074 023617 0 ustar root root 0000000 0000000 **To delete a VPN connection**
This example deletes the specified VPN connection. If the command succeeds, no output is returned.
Command::
aws ec2 delete-vpn-connection --vpn-connection-id vpn-40f41529
awscli-1.18.69/awscli/examples/ec2/describe-local-gateway-route-tables.rst 0000755 0000000 0000000 00000001114 13664010074 026337 0 ustar root root 0000000 0000000 **To describe your Local Gateway Route Tables**
The following ``describe-local-gateway-route-tables`` example displays details about the local gateway route tables. ::
aws ec2 describe-local-gateway-route-tables
Output::
{
"LocalGatewayRouteTables": [
{
"LocalGatewayRouteTableId": "lgw-rtb-059615ef7deEXAMPLE",
"LocalGatewayId": "lgw-09b493aa7cEXAMPLE",
"OutpostArn": "arn:aws:outposts:us-west-2:111122223333:outpost/op-0dc11b66edEXAMPLE",
"State": "available"
}
]
}
awscli-1.18.69/awscli/examples/ec2/delete-transit-gateway-vpc-attachment.rst 0000644 0000000 0000000 00000001641 13664010074 026725 0 ustar root root 0000000 0000000 **To delete a transit gateway VPC attachment**
The following ``delete-transit-gateway-vpc-attachment`` example deletes the specified transit gateway VPC attachment. ::
aws ec2 delete-transit-gateway-vpc-attachment \
--transit-gateway-attachment-id tgw-attach-0d2c54bdbEXAMPLE
Output::
{
"TransitGatewayVpcAttachment": {
"TransitGatewayAttachmentId": "tgw-attach-0d2c54bdb3EXAMPLE",
"TransitGatewayId": "tgw-02f776b1a7EXAMPLE",
"VpcId": "vpc-0065acced4f61c651",
"VpcOwnerId": "111122223333",
"State": "deleting",
"CreationTime": "2019-07-17T16:04:27.000Z"
}
}{
"Key": {
"Key":
"Value"
}
}
For more information, see `Delete a VPC Attachment `__ in the *AWS Transit Gateways Guide*.
awscli-1.18.69/awscli/examples/ec2/modify-volume.rst 0000644 0000000 0000000 00000002750 13664010074 022224 0 ustar root root 0000000 0000000 **Example 1: To modify a volume by changing its size**
The following ``modify-volume`` example changes the size of the specified volume to 150GB.
Command::
aws ec2 modify-volume --size 150 --volume-id vol-1234567890abcdef0
Output::
{
"VolumeModification": {
"TargetSize": 150,
"TargetVolumeType": "io1",
"ModificationState": "modifying",
"VolumeId": " vol-1234567890abcdef0",
"TargetIops": 100,
"StartTime": "2019-05-17T11:27:19.000Z",
"Progress": 0,
"OriginalVolumeType": "io1",
"OriginalIops": 100,
"OriginalSize": 100
}
}
**Example 2: To modify a volume by changing its type, size, and IOPS value**
The following ``modify-volume`` example changes the volume type to Provisioned IOPS SSD, sets the target IOPS rate to 10000, and sets the volume size to 350GB. ::
aws ec2 modify-volume \
--volume-type io1 \
--iops 10000 \
--size 350 \
--volume-id vol-1234567890abcdef0
Output::
{
"VolumeModification": {
"TargetSize": 350,
"TargetVolumeType": "io1",
"ModificationState": "modifying",
"VolumeId": "vol-0721c1a9d08c93bf6",
"TargetIops": 10000,
"StartTime": "2019-05-17T11:38:57.000Z",
"Progress": 0,
"OriginalVolumeType": "gp2",
"OriginalIops": 150,
"OriginalSize": 50
}
}
awscli-1.18.69/awscli/examples/ec2/create-fleet.rst 0000644 0000000 0000000 00000011611 13664010074 021764 0 ustar root root 0000000 0000000 **To create an EC2 Fleet that launches Spot Instances as the default purchasing model**
This example creates an EC2 Fleet using the minimum parameters required to launch a fleet: a launch template, target capacity, and default purchasing model. The launch template is identified by its launch template ID and version number. The target capacity for the fleet is 2 instances, and the default purchasing model is ``spot``, which results in the fleet launching 2 Spot Instances.
When you create an EC2 Fleet, use a JSON file to specify information about the instances to launch.
Command::
aws ec2 create-fleet --cli-input-json file://file_name.json
Output::
{
"FleetId": "fleet-12a34b55-67cd-8ef9-ba9b-9208dEXAMPLE"
}
Where file_name.json contains the following::
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-0e8c754449b27161c",
"Version": "1"
}
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 2,
"DefaultTargetCapacityType": "spot"
}
}
**To create an EC2 Fleet that launches On-Demand Instances as the default purchasing model**
This example creates an EC2 Fleet using the minimum parameters required to launch a fleet: a launch template, target capacity, and default purchasing model. The launch template is identified by its launch template ID and version number. The target capacity for the fleet is 2 instances, and the default purchasing model is ``on-demand``, which results in the fleet launching 2 On-Demand Instances.
When you create an EC2 Fleet, use a JSON file to specify information about the instances to launch.
Command::
aws ec2 create-fleet --cli-input-json file://file_name.json
Output::
{
"FleetId": "fleet-12a34b55-67cd-8ef9-ba9b-9208dEXAMPLE"
}
Where file_name.json contains the following::
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-0e8c754449b27161c",
"Version": "1"
}
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 2,
"DefaultTargetCapacityType": "on-demand"
}
}
**To create an EC2 Fleet that launches On-Demand Instances as the primary capacity**
This example creates an EC2 Fleet that specifies the total target capacity of 2 instances for the fleet, and a target capacity of 1 On-Demand Instance. The default purchasing model is ``spot``. The fleet launches 1 On-Demand Instance as specified, but needs to launch one more instance to fulfil the total target capacity. The purchasing model for the difference is calculated as ``TotalTargetCapacity`` - ``OnDemandTargetCapacity`` = ``DefaultTargetCapacityType``, which results in the fleet launching 1 Spot Instance.
When you create an EC2 Fleet, use a JSON file to specify information about the instances to launch.
Command::
aws ec2 create-fleet --cli-input-json file://file_name.json
Output::
{
"FleetId": "fleet-12a34b55-67cd-8ef9-ba9b-9208dEXAMPLE"
}
Where file_name.json contains the following::
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-0e8c754449b27161c",
"Version": "1"
}
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 2,
"OnDemandTargetCapacity":1,
"DefaultTargetCapacityType": "spot"
}
}
**To create an EC2 Fleet that launches Spot Instances using the lowest-price allocation strategy**
If the allocation strategy for Spot Instances is not specified, the default allocation strategy, which is ``lowest-price``, is used. This example creates an EC2 Fleet using the ``lowest-price`` allocation strategy. The three launch specifications, which override the launch template, have different instance types but the same weighted capacity and subnet. The total target capacity is 2 instances and the default purchasing model is ``spot``. The EC2 Fleet launches 2 Spot Instances using the instance type of the launch specification with the lowest price.
When you create an EC2 Fleet, use a JSON file to specify information about the instances to launch.
Command::
aws ec2 create-fleet --cli-input-json file://file_name.json
Output::
{
"FleetId": "fleet-12a34b55-67cd-8ef9-ba9b-9208dEXAMPLE"
}
Where file_name.json contains the following::
{
"LaunchTemplateConfigs": [
{
"LaunchTemplateSpecification": {
"LaunchTemplateId": "lt-0e8c754449b27161c",
"Version": "1"
}
"Overrides": [
{
"InstanceType": "c4.large",
"WeightedCapacity": 1,
"SubnetId": "subnet-a4f6c5d3"
},
{
"InstanceType": "c3.large",
"WeightedCapacity": 1,
"SubnetId": "subnet-a4f6c5d3"
},
{
"InstanceType": "c5.large",
"WeightedCapacity": 1,
"SubnetId": "subnet-a4f6c5d3"
}
]
}
],
"TargetCapacitySpecification": {
"TotalTargetCapacity": 2,
"DefaultTargetCapacityType": "spot"
}
}
awscli-1.18.69/awscli/examples/ec2/describe-volumes-modifications.rst 0000644 0000000 0000000 00000001317 13664010074 025524 0 ustar root root 0000000 0000000 **To describe the modification status for a volume**
The following ``describe-volumes-modifications`` example describes the volume modification status of the specified volume. ::
aws ec2 describe-volumes-modifications \
--volume-ids vol-1234567890abcdef0
Output::
{
"VolumeModification": {
"TargetSize": 150,
"TargetVolumeType": "io1",
"ModificationState": "optimizing",
"VolumeId": " vol-1234567890abcdef0",
"TargetIops": 100,
"StartTime": "2019-05-17T11:27:19.000Z",
"Progress": 70,
"OriginalVolumeType": "io1",
"OriginalIops": 100,
"OriginalSize": 100
}
}
awscli-1.18.69/awscli/examples/ec2/describe-snapshot-attribute.rst 0000644 0000000 0000000 00000001357 13664010074 025050 0 ustar root root 0000000 0000000 **To describe the snapshot attributes for a snapshot**
The following ``describe-snapshot`` example describes the ``createVolumePermission`` attribute for the specified snapshot. ::
aws ec2 describe-snapshot-attribute \
--snapshot-id snap-066877671789bd71b \
--attribute createVolumePermission
The output indicates that the specified user has volume permissions. ::
{
"SnapshotId": "snap-066877671789bd71b",
"CreateVolumePermissions": [
{
"UserId": "123456789012"
}
]
}
Output similar to the following indicates that there are no volume permissions. ::
{
"SnapshotId": "snap-066877671789bd71b",
"CreateVolumePermissions": []
}
awscli-1.18.69/awscli/examples/ec2/replace-network-acl-entry.rst 0000644 0000000 0000000 00000000625 13664010074 024425 0 ustar root root 0000000 0000000 **To replace a network ACL entry**
This example replaces an entry for the specified network ACL. The new rule 100 allows ingress traffic from 203.0.113.12/24 on UDP port 53 (DNS) into any associated subnet.
Command::
aws ec2 replace-network-acl-entry --network-acl-id acl-5fb85d36 --ingress --rule-number 100 --protocol udp --port-range From=53,To=53 --cidr-block 203.0.113.12/24 --rule-action allow
awscli-1.18.69/awscli/examples/ec2/attach-internet-gateway.rst 0000644 0000000 0000000 00000000420 13664010074 024151 0 ustar root root 0000000 0000000 **To attach an Internet gateway to your VPC**
This example attaches the specified Internet gateway to the specified VPC. If the command succeeds, no output is returned.
Command::
aws ec2 attach-internet-gateway --internet-gateway-id igw-c0a643a9 --vpc-id vpc-a01106c2 awscli-1.18.69/awscli/examples/ec2/delete-vpc-peering-connection.rst 0000644 0000000 0000000 00000000350 13664010074 025236 0 ustar root root 0000000 0000000 **To delete a VPC peering connection**
This example deletes the specified VPC peering connection.
Command::
aws ec2 delete-vpc-peering-connection --vpc-peering-connection-id pcx-1a2b3c4d
Output::
{
"Return": true
}
awscli-1.18.69/awscli/examples/ec2/replace-route.rst 0000644 0000000 0000000 00000000571 13664010074 022176 0 ustar root root 0000000 0000000 **To replace a route**
This example replaces the specified route in the specified route table. The new route matches the specified CIDR and sends the traffic to the specified virtual private gateway. If the command succeeds, no output is returned.
Command::
aws ec2 replace-route --route-table-id rtb-22574640 --destination-cidr-block 10.0.0.0/16 --gateway-id vgw-9a4cacf3 awscli-1.18.69/awscli/examples/ec2/modify-vpc-attribute.rst 0000644 0000000 0000000 00000001642 13664010074 023505 0 ustar root root 0000000 0000000 **To modify the enableDnsSupport attribute**
This example modifies the ``enableDnsSupport`` attribute. This attribute indicates whether DNS resolution is enabled for the VPC. If this attribute is ``true``, the Amazon DNS server resolves DNS hostnames for your instances to their corresponding IP addresses; otherwise, it does not. If the command succeeds, no output is returned.
Command::
aws ec2 modify-vpc-attribute --vpc-id vpc-a01106c2 --enable-dns-support "{\"Value\":false}"
**To modify the enableDnsHostnames attribute**
This example modifies the ``enableDnsHostnames`` attribute. This attribute indicates whether instances launched in the VPC get DNS hostnames. If this attribute is ``true``, instances in the VPC get DNS hostnames; otherwise, they do not. If the command succeeds, no output is returned.
Command::
aws ec2 modify-vpc-attribute --vpc-id vpc-a01106c2 --enable-dns-hostnames "{\"Value\":false}"
awscli-1.18.69/awscli/examples/ec2/disable-vgw-route-propagation.rst 0000644 0000000 0000000 00000000467 13664010074 025314 0 ustar root root 0000000 0000000 **To disable route propagation**
This example disables the specified virtual private gateway from propagating static routes to the specified route table. If the command succeeds, no output is returned.
Command::
aws ec2 disable-vgw-route-propagation --route-table-id rtb-22574640 --gateway-id vgw-9a4cacf3
awscli-1.18.69/awscli/examples/ec2/create-transit-gateway-route.rst 0000755 0000000 0000000 00000001752 13664010074 025154 0 ustar root root 0000000 0000000 **To create a Transit Gateway Route**
The following ``create-transit-gateway-route`` example creates a route for the specified route table. ::
aws ec2 create-transit-gateway-route \
--destination-cidr-block 10.0.2.0/24 \
--transit-gateway-route-table-id tgw-rtb-0b6f6aaa01EXAMPLE \
--transit-gateway-attachment-id tgw-attach-0b5968d3b6EXAMPLE
Output::
{
"Route": {
"DestinationCidrBlock": "10.0.2.0/24",
"TransitGatewayAttachments": [
{
"ResourceId": "vpc-0065acced4EXAMPLE",
"TransitGatewayAttachmentId": "tgw-attach-0b5968d3b6EXAMPLE",
"ResourceType": "vpc"
}
],
"Type": "static",
"State": "active"
}
}
For more information, see `Create a Transit Gateway Route `__ in the *AWS Transit Gateways Guide*.
awscli-1.18.69/awscli/examples/ec2/create-client-vpn-route.rst 0000644 0000000 0000000 00000001221 13664010074 024074 0 ustar root root 0000000 0000000 **To create a route for a Client VPN endpoint**
The following ``create-client-vpn-route`` example adds a route to the internet (``0.0.0.0/0``) for the specified subnet of the Client VPN endpoint. ::
aws ec2 create-client-vpn-route \
--client-vpn-endpoint-id cvpn-endpoint-123456789123abcde \
--destination-cidr-block 0.0.0.0/0 \
--target-vpc-subnet-id subnet-0123456789abcabca
Output::
{
"Status": {
"Code": "creating"
}
}
For more information, see `Routes