Learn Idem

Learn Idem

Powered by Idem Project

aws.iam.role

**Autogenerated function**

Deletes the specified role. The role must not have any policies attached. For more information about roles, see
Working with roles.  Make sure that you do not have any Amazon EC2 instances running with the role you are about
to delete. Deleting a role or instance profile that is associated with a running instance will break any
applications running on the instance.

Args:
    name(Text): AWS IAM Role Name.
    resource_id(Text, Optional): AWS IAM Role Name to identify the IAM role on AWS.
    detach_role_policies(Bool, Default: False): if true role is detached from policies before deleted

Returns:
    Dict[str, Any]

Examples:

    .. code-block:: sls

        resource_is_absent:
          aws.iam.role.absent:
            - resource_id: value
            - detach_role_policies: True
**Autogenerated function**

Describe the resource in a way that can be recreated/managed with the corresponding "present" function


Lists the IAM roles that have the specified path prefix. If there are none, the operation returns an empty list.
For more information about roles, see Working with roles.  IAM resource-listing operations return a subset of
the available attributes for the resource. For example, this operation does not return tags, even though they
are an attribute of the returned object. To view all of the information for a role, see GetRole.  You can
paginate the results using the MaxItems and Marker parameters.


Returns:
    Dict[str, Any]

Examples:

    .. code-block:: bash

        $ idem describe aws.iam.role
**Autogenerated function**

Creates a new role for your Amazon Web Services account. For more information about roles, see IAM roles. For
information about quotas for role names and the number of roles you can create, see IAM and STS quotas in the
IAM User Guide.

Args:
    name(Text): The name of the IAM role.
    assume_role_policy_document(Dict or Text): The trust relationship policy document that grants an entity
     permission to assume the role. This can be either a dictionary or a json string.
    resource_id(Text, Optional): AWS IAM Role Name.
    description(Text, Optional): A description of the role. Defaults to None.
    max_session_duration(Integer, Optional): The maximum session duration (in seconds) that you want to set for the
     specified role. If you do not specify a value for this setting, the default maximum of one hour is applied.
      This setting can have a value from 1 hour to 12 hours.
    permissions_boundary(Text, Optional): The ARN of the policy that is used to set the permissions boundary for the role.
    tags(Dict or List, optional): Dict in the format of {tag-key: tag-value} or List of tags in the format of
        [{"Key": tag-key, "Value": tag-value}] to associate with the new role.
        Each tag consists of a key name and an associated value. Defaults to None.
        * (Key): The key name that can be used to look up or retrieve the associated value. For example,
            Department or Cost Center are common choices.
        * (Value): The value associated with this tag. For example, tags with a key name of Department could have
            values such as Human Resources, Accounting, and Support. Tags with a key name of Cost Center
            might have values that consist of the number associated with the different cost centers in your
            company. Typically, many resources have tags with the same key name but with different values.
            Amazon Web Services always interprets the tag Value as a single string. If you need to store an
            array, you can store comma-separated values in the string. However, you must interpret the value
            in your code.
    timeout(Dict, optional): Timeout configuration for create/update/deletion of AWS IAM Policy.
        * create (Dict): Timeout configuration for creating AWS IAM Policy
            * delay (int, Optional): The amount of time in seconds to wait between attempts.
            * max_attempts (int, Optional): Customized timeout configuration containing delay and max attempts.
        * update(Dict, optional): Timeout configuration for updating AWS IAM Policy
            * delay (int, Optional): The amount of time in seconds to wait between attempts.
            * max_attempts: (int, Optional) Customized timeout configuration containing delay and max attempts.
Request Syntax:
    [iam-role-name]:
      aws.iam.role.present:
      - name: 'string'
      - resource_id: 'string'
      - assume_role_policy_document: 'dict or string'
      - description: 'string'
      - max_session_duration: 'integer'
      - permissions_boundary: 'string'
      - tags:
        - Key: 'string'
          Value: 'string'

Returns:
    Dict[str, Any]

Examples:

    .. code-block:: sls

        AWSServiceRoleForEC2Spot:
          aws.iam.role.present:
            - assume_role_policy_document:
              Statement:
                - Action: sts:AssumeRole
                  Effect: Allow
                  Principal:
                    Service: spot.amazonaws.com
              Version: '2012-10-17'
            - description: Default EC2 Spot Service Linked Role
            - max_session_duration: 3600
            - tags:
              - Key: tag-key
                Value: tag-value
Use an un-managed role as a data-source. Provide role name as input

Args:
    name(string): An Idem name of the IAM role.

Request Syntax:
    [Idem-state-name]:
      aws.iam.role.search:
      - name: 'string'


Examples:

    Input state file:
    .. code-block:: bash
        idem-test-role-search:
            aws.iam.role.search:
              - name: eks-idem-test

Full plugin documentation is available on the Idem documentation site - aws.iam.role .

Last updated on 20 Sep 2022
 Edit on GitHub