Alicloud - dennisholee/notes GitHub Wiki

Setup user accounts

Create DevOps Group

Assign permission to group:

  • AliyunRAMFullAccess
  • AliyunVPCFullAccess

Initialize aliyun cli

liyun configure --mode AK --profile dennisAK
Configuring profile 'dennisAK' in 'AK' authenticate mode...
Access Key Id [*********************xdv]: 
Access Key Secret [***************************nGX]: 
Default Region Id []: cn-hongkong
Default Output Format [json]: json (Only support json)
Default Language [zh|en] en: 
Saving profile[dennisAK] ...Done.

Configure Done!!!
..............888888888888888888888 ........=8888888888888888888D=..............
...........88888888888888888888888 ..........D8888888888888888888888I...........
.........,8888888888888ZI: ...........................=Z88D8888888888D..........
.........+88888888 ..........................................88888888D..........
.........+88888888 .......Welcome to use Alibaba Cloud.......O8888888D..........
.........+88888888 ............. ************* ..............O8888888D..........
.........+88888888 .... Command Line Interface(Reloaded) ....O8888888D..........
.........+88888888...........................................88888888D..........
..........D888888888888DO+. ..........................?ND888888888888D..........
...........O8888888888888888888888...........D8888888888888888888888=...........
............ .:D8888888888888888888.........78888888888888888888O ..............

ECS

SSH to ECS

export PEM_KEY_FILE=
export ECS_IP=

eval `ssh-agent`
ssh-add ${PEM_KEY_FILE}
ssh -A root ${ECS_IP}

VPC

Create VPC

aliyun vpc CreateVpc --RegionId cn-hongkong --CidrBlock "192.168.0.0/24" --VpcName edmz

Delete VPC

# Detach VPC from Cloud Enterprise Network (CEN)
aliyun vpc RevokeInstanceFromCen --CenId {CEN_ID} --InstanceType vpc --InstanceId {VPC_ID} 

Create 2 Tier Network

# Add NAT gateway
aliyun vpc CreateNatGateway --RegionId cn-hongkong --VpcId vpc-j6ckjk3fyvn1j45iguxa3