2017/02/09 - Amazon Elastic Compute Cloud - 4 new api methods
Changes Update ec2 client to latest version
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
client.associate_iam_instance_profile( IamInstanceProfile={ 'Arn': 'string', 'Name': 'string' }, InstanceId='string' )
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.
string
[REQUIRED]
The ID of the instance.
dict
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.
Replaces an IAM instance profile for the specified instance. You can use this action to change the IAM instance profile that's associated with an instance without having to disassociate the existing IAM instance profile first.
Use DescribeIamInstanceProfileAssociations to get the association ID.
See also: AWS API Documentation
Request Syntax
client.replace_iam_instance_profile_association( IamInstanceProfile={ 'Arn': 'string', 'Name': 'string' }, AssociationId='string' )
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.
string
[REQUIRED]
The ID of the existing IAM instance profile association.
dict
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.
Disassociates an IAM instance profile from a running or stopped instance.
Use DescribeIamInstanceProfileAssociations to get the association ID.
See also: AWS API Documentation
Request Syntax
client.disassociate_iam_instance_profile( AssociationId='string' )
string
[REQUIRED]
The ID of the IAM instance profile association.
dict
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.
Describes your IAM instance profile associations.
See also: AWS API Documentation
Request Syntax
client.describe_iam_instance_profile_associations( AssociationIds=[ 'string', ], Filters=[ { 'Name': 'string', 'Values': [ 'string', ] }, ], MaxResults=123, NextToken='string' )
list
One or more IAM instance profile associations.
(string) --
list
One or more filters.
instance-id - The ID of the instance.
state - The state of the association ( associating | associated | disassociating | disassociated).
(dict) --
A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.
Name (string) --
The name of the filter. Filter names are case-sensitive.
Values (list) --
One or more filter values. Filter values are case-sensitive.
(string) --
integer
The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned NextToken value.
string
The token to request the next page of results.
dict
Response Syntax
{ 'IamInstanceProfileAssociations': [ { 'AssociationId': 'string', 'InstanceId': 'string', 'IamInstanceProfile': { 'Arn': 'string', 'Id': 'string' }, 'State': 'associating'|'associated'|'disassociating'|'disassociated', 'Timestamp': datetime(2015, 1, 1) }, ], 'NextToken': 'string' }
Response Structure
(dict) --
IamInstanceProfileAssociations (list) --
Information about one or more IAM instance profile associations.
(dict) --
Describes an association between an IAM instance profile and an instance.
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.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.