![](/img/trans.png)
[英]Unauthorized operation error occurs when using Boto3 to launch an EC2 instance with an IAM role
[英]python boto3 attach/replace IAM role to ec2
在此处阅读文档
associate_iam_instance_profile(** kwargs)
将IAM实例配置文件与正在运行或已停止的实例相关联。 您不能将一个以上的IAM实例配置文件与一个实例相关联。
请求语法
response = client.associate_iam_instance_profile(
IamInstanceProfile={
'Arn': 'string',
'Name': 'string'
},
InstanceId='string'
)
响应语法
{
'IamInstanceProfileAssociation': {
'AssociationId': 'string',
'InstanceId': 'string',
'IamInstanceProfile': {
'Arn': 'string',
'Id': 'string'
},
'State': 'associating'|'associated'|'disassociating'|'disassociated',
'Timestamp': datetime(2015, 1, 1)
}
}
顺便说一句,您给的链接顶部有一个横幅
注意您正在查看文档的旧版本的boto(boto2)。 Boto3的下一个版本Boto3现在稳定并推荐用于一般用途。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.