service_linked_role#
State module for managing IAM Service linked role.
- async idem_aws.states.aws.iam.service_linked_role.present(hub, 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.
Note
Updates to role name, custom suffix and description are not allowed by AWS. Only tags can be updated.
All service linked roles does not support custom suffix
- Parameters:
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: elasticbeanstalk.amazonaws.com
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:
[iam-service-linked-role-name]: aws.iam.service_linked_role.present: - name: 'string' - service_name: 'string' - custom_suffix: 'string' - resource_id: 'string' - description: 'string' - tags: - Key: 'string' Value: 'string'
- Returns:
Dict[str, Any]
Examples
AWSServiceRoleForAutoScaling: aws.iam.service_linked_role.present: - name: AWSServiceRoleForAutoScaling - resource_id: AWSServiceRoleForAutoScaling - service_name: autoscaling.amazonaws.com - custom_suffix: test_suffix - description: This is custom description - tags: - Key: firstkey Value: firstvalue - Key: 2ndkey Value: 2ndvalue
- async idem_aws.states.aws.iam.service_linked_role.absent(hub, 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.
- Parameters:
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:
[service_linked_role-resource-id]: aws.iam.service_linked_role.absent: - name: "string" - resource_id: "string"
- Returns:
Dict[str, Any]
Examples
resource_is_absent: aws.iam.service_linked_role.absent: - resource_id: AWSServiceRoleForAutoScaling
- async idem_aws.states.aws.iam.service_linked_role.describe(hub, 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.
- Returns:
Dict[str, Any]
Examples
$ idem describe aws.iam.service_linked_role