Associates a role with your account. AWS IoT Greengrass will use the role to access your Lambda functions and AWS IoT resources. This is necessary for deployments to succeed. The role must have at least minimum permissions in the policy ''AWSGreengrassResourceAccessRolePolicy''.
Parameters:
-
role_arn
(Optional[__string], default:
None
)
–
The ARN of the service role you wish to associate with your account.
Raises:
Source code in docs_src/capo_greengrass/_services/greengrass.py
| def associate_service_role_to_account(
self,
*,
config_overrides: Optional[GreengrassClientConfig] = None,
role_arn: Optional["capo_greengrass.types.__string.__string"] = None,
) -> "capo_greengrass.types.associate_service_role_to_account_response.AssociateServiceRoleToAccountResponse":
"""Associates a role with your account. AWS IoT Greengrass will use the role to access your Lambda functions and AWS IoT resources. This is necessary for deployments to succeed. The role must have at least minimum permissions in the policy ''AWSGreengrassResourceAccessRolePolicy''.
Args:
role_arn: The ARN of the service role you wish to associate with your account.
Raises:
capo_greengrass.errors.bad_request_exception.BadRequestException: General error information.
capo_greengrass.errors.internal_server_error_exception.InternalServerErrorException: General error information.
capo_greengrass.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_greengrass.types.associate_service_role_to_account_request.AssociateServiceRoleToAccountRequest]",
) -> OperationResponse[
"capo_greengrass.types.associate_service_role_to_account_response.AssociateServiceRoleToAccountResponse"
]:
import capo_greengrass._operations.greengrass.associate_service_role_to_account
output, http_response = (
capo_greengrass._operations.greengrass.associate_service_role_to_account.associate_service_role_to_account(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AssociateServiceRoleToAccount")
)
input_: capo_greengrass.types.associate_service_role_to_account_request.AssociateServiceRoleToAccountRequest = {}
if role_arn is not None:
input_["role_arn"] = role_arn
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|