Skip to main content

service_linked_roles

Creates, updates, deletes or gets a service_linked_role resource or lists service_linked_roles in a region

Overview

Nameservice_linked_roles
TypeResource
DescriptionResource Type definition for AWS::IAM::ServiceLinkedRole
Idawscc.iam.service_linked_roles

Fields

NameDatatypeDescription
role_namestringThe name of the role.
custom_suffixstringA string that you provide, which is combined with the service-provided prefix to form the complete role name.
descriptionstringThe description of the role.
aws_service_namestringThe service principal for the AWS service to which this role is attached.
regionstringAWS region.

For more information, see AWS::IAM::ServiceLinkedRole.

Methods

NameAccessible byRequired Params
create_resourceINSERT, region
delete_resourceDELETEIdentifier, region
update_resourceUPDATEIdentifier, PatchDocument, region
get_resourceSELECTIdentifier, region

SELECT examples

Gets all properties from an individual service_linked_role.

SELECT
region,
role_name,
custom_suffix,
description,
aws_service_name
FROM awscc.iam.service_linked_roles
WHERE
region = 'us-east-1' AND
Identifier = '{{ role_name }}';

INSERT example

Use the following StackQL query and manifest file to create a new service_linked_role resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.iam.service_linked_roles (
,
region
)
SELECT
'{{ }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a service_linked_role resource, using stack-deploy.

/*+ update */
UPDATE awscc.iam.service_linked_roles
SET PatchDocument = string('{{ {
"Description": description
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ role_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.iam.service_linked_roles
WHERE
Identifier = '{{ role_name }}' AND
region = 'us-east-1'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the service_linked_roles resource, the following permissions are required:

iam:CreateServiceLinkedRole,
iam:GetRole