打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
​associate_iam_instance_profile亚马逊boto3

associate_iam_instance_profile(**kwargs)¶
Associates an IAM instance profile with a running or stopped instance. You cannot associate more than one IAM instance profile with an instance.
See also: AWS API Documentation
Request Syntax

代码比较间接,注意注释里的意思

主要是那个名为 instance profile的东西

response = client.associate_iam_instance_profile(
    IamInstanceProfile={
        'Arn': 'string',
        'Name': 'string'
    },
    InstanceId='string'
)
Parameters
* IamInstanceProfile (dict) -- [REQUIRED]
The IAM instance profile.
    * Arn (string) --The Amazon Resource Name (ARN) of the instance profile.
    * Name (string) --The name of the instance profile.
* InstanceId (string) -- [REQUIRED]
The ID of the instance.
Return type
dict
Returns

Response Syntax
{
    'IamInstanceProfileAssociation': {
        'AssociationId': 'string',
        'InstanceId': 'string',
        'IamInstanceProfile': {
            'Arn': 'string',
            'Id': 'string'
        },
        'State': 'associating'|'associated'|'disassociating'|'disassociated',
        'Timestamp': datetime(2015, 1, 1)
    }
}
Response Structure
* (dict) --
    * IamInstanceProfileAssociation (dict) --
Information about the IAM instance profile association.
        * AssociationId (string) --
The ID of the association.
        * InstanceId (string) --
The ID of the instance.
        * IamInstanceProfile (dict) --
The IAM instance profile.
            * Arn (string) --
The Amazon Resource Name (ARN) of the instance profile.
            * Id (string) --
The ID of the instance profile.
        * State (string) --
The state of the association.
        * Timestamp (datetime) --
The time the IAM instance profile was associated with the instance.

Examples
This example associates an IAM instance profile named admin-role with the specified instance.
response = client.associate_iam_instance_profile(
    IamInstanceProfile={
        'Name': 'admin-role',
    },
    InstanceId='i-123456789abcde123',
)

print(response)
Expected Output:
{
    'IamInstanceProfileAssociation': {
        'AssociationId': 'iip-assoc-0e7736511a163c209',
        'IamInstanceProfile': {
            'Arn': 'arn:aws:iam::123456789012:instance-profile/admin-role',
            'Id': 'AIPAJBLK7RKJKWDXVHIEC',
        },
        'InstanceId': 'i-123456789abcde123',
        'State': 'associating',
    },
    'ResponseMetadata': {
        '...': '...',
    },
}

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
ARN20171005
Weka开发[42]——DBScan源代码分析
WF4.0 基础篇 (十九) Persistence 持久化
使用Consul实现服务发现:instance-id自定义(3种方式)
Shiro中的授权问题(二)
AWS核心服务概览
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服