操作系统为Oracle Linux 7.6
sudo yum install python
sudo yum install python-setuptools
sudo yum install python-pip python-wheel
sudo pip install --upgrade pip
sudo pip install awscli
complete -C aws_completer aws
首先在Console中的IAM服务中创建Access Key。
[vagrant@sysops ~]$ aws config
configservice configure
[vagrant@sysops ~]$ aws configure
AWS Access Key ID [None]: AKIAI......6HA
AWS Secret Access Key [None]: +cd+blGLWb0g8HuPLzRIMG0V0hjEHjb9iYhc4c7t
Default region name [None]:us-east-1
Default output format [None]:
[vagrant@sysops ~]$ aws ec2 describe-availability-zones
{
"AvailabilityZones": [
{
"State": "available",
"ZoneName": "us-east-1a",
"Messages": [],
"ZoneId": "use1-az6",
"RegionName": "us-east-1"
},
{
"State": "available",
"ZoneName": "us-east-1b",
"Messages": [],
"ZoneId": "use1-az1",
"RegionName": "us-east-1"
},
{
"State": "available",
"ZoneName": "us-east-1c",
"Messages": [],
"ZoneId": "use1-az2",
"RegionName": "us-east-1"
},
{
"State": "available",
"ZoneName": "us-east-1d",
"Messages": [],
"ZoneId": "use1-az4",
"RegionName": "us-east-1"
},
{
"State": "available",
"ZoneName": "us-east-1e",
"Messages": [],
"ZoneId": "use1-az3",
"RegionName": "us-east-1"
},
{
"State": "available",
"ZoneName": "us-east-1f",
"Messages": [],
"ZoneId": "use1-az5",
"RegionName": "us-east-1"
}
]
}
[vagrant@sysops ~]$ aws ec2 describe-availability-zones --output text
AVAILABILITYZONES us-east-1 available use1-az6 us-east-1a
AVAILABILITYZONES us-east-1 available use1-az1 us-east-1b
AVAILABILITYZONES us-east-1 available use1-az2 us-east-1c
AVAILABILITYZONES us-east-1 available use1-az4 us-east-1d
AVAILABILITYZONES us-east-1 available use1-az3 us-east-1e
AVAILABILITYZONES us-east-1 available use1-az5 us-east-1f