role#
Exec module for IAM role resource.
- async idem_aws.exec.aws.iam.role.get(hub, ctx, name: str, resource_id: str = None) Dict[str, Any] [source]#
Get an IAM role from AWS.
- Parameters:
- Returns:
Retrieves information about the specified role.
- Return type:
Examples
Calling this exec module function from the cli:
idem exec aws.iam.role.get name=<idem-name> resource_id=<role-name>
Calling this exec module function from within a state:
my_unmanaged_resource: exec.run: - path: aws.iam.role.get - kwargs: name: 'idem_name' resource_id: 'role-name'
- async idem_aws.exec.aws.iam.role.update_role_tags(hub, ctx, role_name: str, old_tags: Dict[str, Any], new_tags: Dict[str, Any]) Dict[str, Any] [source]#
Update tags of AWS IAM Role
- Parameters:
- Returns:
Returns a dict of updated tags
- Return type:
Examples
Calling this exec module function from the cli
idem exec aws.iam.role.update_role_tags role_name="some_role" old_tags='{"old_tag": "old_val"}' new_tags='{"new_tag": "new_val"}'
Using in a state:
my_unmanaged_resource: exec.run: - path: aws.iam.role.update_role_tags - kwargs: role_name: some_role old_tags: old_tag: old_val new_tags: new_tag: new_val
- async idem_aws.exec.aws.iam.role.update_role(hub, ctx, old_state: Dict[str, Any], description: str = None, max_session_duration: int = None, timeout: Dict = None)[source]#
Updates the description or maximum session duration setting of a role
- Parameters:
- Returns:
Returns a dict of updated tags
- Return type:
Examples
Calling this exec module function from the cli
idem exec aws.iam.role.update_role old_state='{}' role_name="some_role" description="Some description" max_session_duration=3600
Using in a state:
my_unmanaged_resource: exec.run: - path: aws.iam.role.update_role - kwargs: old_state: {} role_name: some_role description: Some description max_session_duration: 3600
- async idem_aws.exec.aws.iam.role.update_policy(hub, ctx, role_name: str, policy: str)[source]#
Updates the policy that grants an IAM entity permission to assume a role
- Parameters:
- Returns:
Returns status of the update
- Return type:
Examples
Calling this exec module function from the cli
idem exec aws.iam.role.update_policy role_name="some_role" policy='{}'
Using in a state:
my_unmanaged_resource: exec.run: - path: aws.iam.role.update_policy - kwargs: role_name: some_role policy: {}