State module for managing IAM Service linked role.

async, ctx, name: str, service_name: str, custom_suffix: str = None, resource_id: str = None, description: str = None, tags: Dict[str, Any] = None) Dict[str, Any][source]#

Creates an IAM role that is linked to a specific Amazon Web Services service.

The service controls the attached policies and when the role can be deleted. This helps ensure that the service is not broken by an unexpectedly changed or deleted role, which could put your Amazon Web Services resources into an unknown state.


  1. Updates to role name, custom suffix and description are not allowed by AWS. Only tags can be updated.

  2. All service linked roles does not support custom suffix

  • name (str) – The name of the idem resource.

  • service_name (str) – The service principal for the Amazon Web Services service to which this role is attached. for example:

  • custom_suffix (str, Optional) – A string that you provide, which is combined with the service-provided prefix to form the complete service linked role name

  • resource_id (str, Optional) – AWS IAM Role Name.

  • description (str, Optional) – A description of the service linked role. Defaults to None.

  • 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 service linked role. Each tag consists of a key name and an associated value. Defaults to None.

    • Key (str):

      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 (str):

      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.

Request Syntax:
    - name: 'string'
    - service_name: 'string'
    - custom_suffix: 'string'
    - resource_id: 'string'
    - description: 'string'
    - tags:
      - Key: 'string'
        Value: 'string'

Dict[str, Any]


    - name: AWSServiceRoleForAutoScaling
    - resource_id: AWSServiceRoleForAutoScaling
    - service_name:
    - custom_suffix: test_suffix
    - description: This is custom description
    - tags:
      - Key: firstkey
        Value: firstvalue
      - Key: 2ndkey
        Value: 2ndvalue
async, ctx, name: str, resource_id: str = None, timeout: Dict = None) Dict[str, Any][source]#

Submits a service-linked role deletion request and returns a DeletionTaskId , which can be used to check the status of the deletion.

  • name (str) – AWS IAM service linked Role Name.

  • resource_id (str, Optional) – AWS IAM service linked Role Name. If not specified, Idem will use “name” parameter to identify the IAM service linked role on AWS.

  • timeout (Dict, Optional) –

    Timeout configuration for deletion of AWS service linked role. * delete (dict):

    Timeout configuration for deletion of a Nat Gateway * delay: The amount of time in seconds to wait between attempts. * max_attempts: Customized timeout configuration containing delay and max attempts.

Request Syntax:
    - name: "string"
    - resource_id: "string"

Dict[str, Any]


    - resource_id: AWSServiceRoleForAutoScaling
async, ctx) Dict[str, Dict[str, Any]][source]#

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

Lists the IAM service linked roles. If there are none, the operation returns an empty list.


Dict[str, Any]


$ idem describe aws.iam.service_linked_role