![](/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.