网上基本上没有完整的教程..(.应当是我没有搜到)
1安装依赖
yum install python-pip
yum install python-devel
pip install --upgrade pip
pip install aliyun-python-sdk-core 安装阿里包
pip install aliyun-python-sdk-sts 安装阿里包
pip install flask 安装python flask框架
2.以下为python脚本
#!/usr/bin/env python
#coding=utf-8
import flask
from flask import Flask, request
import json
from aliyunsdkcore import client
from aliyunsdkcore.profile import region_provider
from aliyunsdksts.request.v20150401 import AssumeRoleRequest
# 构建一个阿里云client, 用于发起请求
# 构建阿里云client时需要设置AccessKey ID和AccessKey Secret
REGIONID = 'ap-southeast-1'
ENDPOINT = 'sts.ap-southeast-1.aliyuncs.com'
# 配置要访问的STS endpoint
region_provider.add_endpoint('Sts', REGIONID, ENDPOINT)
# 初始化Client
clt = client.AcsClient('LTAI4FcZ***************','****************gdfsdffsdvsD