mshaik@noc:~$ sudo apt-get install awscli
mshaik@noc:~$ aws help
AWS() AWS()
NAME
aws –
DESCRIPTION
The AWS Command Line Interface is a unified tool to manage your AWS
services.
SYNOPSIS
aws [options] <command> <subcommand> [parameters]
Use aws command help for information on a specific command. Use aws
help topics to view a list of available help topics. The synopsis for
each command shows its parameters and their usage. Optional parameters
are shown in square brackets.
OPTIONS
–debug (boolean)
Turn on debug logging.
–endpoint-url (string)
Override command’s default URL with the given URL.
–no-verify-ssl (boolean)
By default, the AWS CLI uses SSL when communicating with AWS services.
For each SSL connection, the AWS CLI will verify SSL certificates. This
option overrides the default behavior of verifying SSL certificates.
–no-paginate (boolean)
Disable automatic pagination.
–output (string)
The formatting style for command output.
o json
o text
o table
–query (string)
A JMESPath query to use in filtering the response data.
–profile (string)
Use a specific profile from your credential file.
–region (string)
The region to use. Overrides config/env settings.
–version (string)
Display the version of this tool.
–color (string)
Turn on/off color output.
o on
o off
o auto
–no-sign-request (boolean)
Do not sign requests. Credentials will not be loaded if this argument
is provided.
–ca-bundle (string)
The CA certificate bundle to use when verifying SSL certificates. Over-
rides config/env settings.
–cli-read-timeout (int)
The maximum socket read time in seconds. If the value is set to 0, the
socket read will be blocking and not timeout.
–cli-connect-timeout (int)
The maximum socket connect time in seconds. If the value is set to 0,
the socket connect will be blocking and not timeout.
AVAILABLE SERVICES
o acm
o apigateway
o application-autoscaling
o autoscaling
o budgets
o cloudformation
o cloudfront
o cloudhsm
o cloudsearch
o cloudsearchdomain
o cloudtrail
o cloudwatch
o codecommit
o codepipeline
o cognito-identity
o cognito-idp
o cognito-sync
o configservice
o configure
o datapipeline
o deploy
o devicefarm
o directconnect
o discovery
o dms
o ds
o dynamodb
o dynamodbstreams
o ec2
o ecr
o ecs
o efs
o elasticache
o elasticbeanstalk
o elastictranscoder
o elb
o elbv2
o emr
o es
o events
o firehose
o gamelift
o glacier
o help
o iam
o importexport
o inspector
o iot
o iot-data
o kinesis
o kinesisanalytics
o kms
o lambda
o logs
o machinelearning
o marketplacecommerceanalytics
o meteringmarketplace
o opsworks
o rds
o redshift
o route53
o route53domains
o s3
o s3api
o sdb
o servicecatalog
o ses
o sms
o snowball
o sns
o sqs
o ssm
o storagegateway
o sts
o support
o swf
o waf
o workspaces
SEE ALSO
o aws help topics
mshaik@noc:~$ aws ec2 help
EC2() EC2()
NAME
ec2 –
DESCRIPTION
Amazon Elastic Compute Cloud (Amazon EC2) provides resizable computing
capacity in the Amazon Web Services (AWS) cloud. Using Amazon EC2 elim-
inates your need to invest in hardware up front, so you can develop and
deploy applications faster.
AVAILABLE COMMANDS
o accept-reserved-instances-exchange-quote
o accept-vpc-peering-connection
o allocate-address
o allocate-hosts
o assign-private-ip-addresses
o associate-address
o associate-dhcp-options
o associate-route-table
o attach-classic-link-vpc
o attach-internet-gateway
o attach-network-interface
o attach-volume
o attach-vpn-gateway
o authorize-security-group-egress
o authorize-security-group-ingress
o bundle-instance
o cancel-bundle-task
o cancel-conversion-task
o cancel-export-task
o cancel-import-task
o cancel-reserved-instances-listing
o cancel-spot-fleet-requests
o cancel-spot-instance-requests
o confirm-product-instance
o copy-image
o copy-snapshot
o create-customer-gateway
o create-dhcp-options
o create-flow-logs
o create-image
o create-instance-export-task
o create-internet-gateway
o create-key-pair
o create-nat-gateway
o create-network-acl
o create-network-acl-entry
o create-network-interface
o create-placement-group
o create-reserved-instances-listing
o create-route
o create-route-table
o create-security-group
o create-snapshot
o create-spot-datafeed-subscription
o create-subnet
o create-tags
o create-volume
o create-vpc
o create-vpc-endpoint
o create-vpc-peering-connection
o create-vpn-connection
o create-vpn-connection-route
o create-vpn-gateway
o delete-customer-gateway
o delete-dhcp-options
o delete-flow-logs
o delete-internet-gateway
o delete-key-pair
o delete-nat-gateway
o delete-network-acl
o delete-network-acl-entry
o delete-network-interface
o delete-placement-group
o delete-route
o delete-route-table
o delete-security-group
o delete-snapshot
o delete-spot-datafeed-subscription
o delete-subnet
o delete-tags
o delete-volume
o delete-vpc
o delete-vpc-endpoints
o delete-vpc-peering-connection
o delete-vpn-connection
o delete-flow-logs
o delete-internet-gateway
o delete-key-pair
o delete-nat-gateway
o delete-network-acl
o delete-network-acl-entry
o delete-network-interface
o delete-placement-group
o delete-route
o delete-route-table
o delete-security-group
o delete-snapshot
o delete-spot-datafeed-subscription
o delete-subnet
o delete-tags
o delete-volume
o delete-vpc
o delete-vpc-endpoints
o delete-vpc-peering-connection
o delete-vpn-connection
o describe-import-snapshot-tasks
o describe-instance-attribute
o describe-instance-status
o describe-instances
o describe-internet-gateways
o describe-key-pairs
o describe-moving-addresses
o describe-nat-gateways
o describe-network-acls
o describe-network-interface-attribute
o describe-network-interfaces
o describe-placement-groups
o describe-prefix-lists
o describe-regions
o describe-reserved-instances
o describe-reserved-instances-listings
o describe-reserved-instances-modifications
o describe-reserved-instances-offerings
o describe-route-tables
o describe-scheduled-instance-availability
o describe-scheduled-instances
o describe-security-group-references
o describe-security-groups
o describe-snapshot-attribute
o describe-snapshots
o describe-spot-datafeed-subscription
o describe-spot-fleet-instances
o describe-spot-fleet-request-history
o describe-spot-fleet-requests
o describe-spot-instance-requests
o describe-spot-price-history
o describe-stale-security-groups
o describe-subnets
o describe-tags
o describe-volume-attribute
o describe-volume-status
o describe-volumes
o describe-vpc-attribute
o describe-vpc-classic-link
o describe-vpc-classic-link-dns-support
o describe-vpc-endpoint-services
o describe-vpc-endpoints
o describe-vpc-peering-connections
o describe-vpcs
o describe-vpn-connections
o describe-vpn-gateways
o detach-classic-link-vpc
o detach-internet-gateway
o detach-network-interface
o detach-volume
o detach-vpn-gateway
o disable-vgw-route-propagation
o disable-vpc-classic-link
o disable-vpc-classic-link-dns-support
o disassociate-address
o disassociate-route-table
o enable-vgw-route-propagation
o enable-volume-io
o enable-vpc-classic-link
o enable-vpc-classic-link-dns-support
o get-console-output
o get-console-screenshot
o get-host-reservation-purchase-preview
o get-password-data
o get-reserved-instances-exchange-quote
o help
o import-image
o import-key-pair
o import-snapshot
o modify-hosts
o modify-id-format
o modify-identity-id-format
o modify-image-attribute
o modify-instance-attribute
o modify-instance-placement
o modify-network-interface-attribute
o modify-reserved-instances
o modify-snapshot-attribute
o modify-spot-fleet-request
o modify-subnet-attribute
o modify-volume-attribute
o modify-vpc-attribute
o modify-vpc-endpoint
o modify-vpc-peering-connection-options
o monitor-instances
o move-address-to-vpc
o purchase-host-reservation
o purchase-reserved-instances-offering
o purchase-scheduled-instances
o reboot-instances
o register-image
o reject-vpc-peering-connection
o release-address
o release-hosts
o replace-network-acl-association
o replace-network-acl-entry
o replace-route
o replace-route-table-association
o report-instance-status
o request-spot-fleet
o request-spot-instances
o reset-image-attribute
o reset-instance-attribute
o reset-network-interface-attribute
o reset-snapshot-attribute
o restore-address-to-classic
o revoke-security-group-egress
o revoke-security-group-ingress
o run-instances
o run-scheduled-instances
o start-instances
o stop-instances
o terminate-instances
o unassign-private-ip-addresses
o unmonitor-instances
o wait
mshaik@noc:~$ aws ec2 describe-instance-status
You must specify a region. You can also configure your region by running “aws configure”.
mshaik@noc:~$ aws configure
AWS Access Key ID [None]: XXXXXXXXXXXXXXXXXXXXXXXXXXX
AWS Secret Access Key [None]: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Default region name [None]: us-east-1
Default output format [None]:
mshaik@noc:~$ aws ec2 describe-instance-status
{
“InstanceStatuses”: []
}
aws ec2 run-instances –image-id ami-xxxxxxxx –count 1 –instance-type t2.micro –key-name MyKeyPair –security-group-ids sg-xxxxxxxx –subnet-id subnet-xxxxxxxx
