Skip to content

accept_invitation

accept_invitation(
    environment_arn: EnvironmentArn,
    *,
    config_overrides: Optional[AssuranceClientConfig] = None,
) -> AcceptInvitationOutput

Accepts a pending invitation to connect your account to an environment. To use this operation, you must have permission to call iam:CreateServiceLinkedRole.

The invitation becomes ACTIVE when AWS Assurance can assume its service-linked role in your account. If AWS Assurance can't create or assume the role, the request fails and the invitation stays PENDING.

Parameters:

  • environment_arn (EnvironmentArn) –

    The ARN of the environment that sent the invitation. At most one active or pending invitation exists for a given account and environment at a time.

Raises:

Examples:

Accept an invitation Accepts the invitation to connect the payments team's member account to the governance environment with the AWS Assurance service-linked role.

>>> client.accept_invitation(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111')
Source code in docs_src/capo_assurance/_services/assurance.py
def accept_invitation(
    self,
    environment_arn: "capo_assurance.types.environment_arn.EnvironmentArn",
    *,
    config_overrides: Optional[AssuranceClientConfig] = None,
) -> "capo_assurance.types.accept_invitation_output.AcceptInvitationOutput":
    """<p>Accepts a pending invitation to connect your account to an environment. To use this operation, you must have permission to call <code>iam:CreateServiceLinkedRole</code>.</p> <p>The invitation becomes ACTIVE when AWS Assurance can assume its service-linked role in your account. If AWS Assurance can't create or assume the role, the request fails and the invitation stays PENDING.</p>

    Args:
        environment_arn: <p>The ARN of the environment that sent the invitation. At most one active or pending invitation exists for a given account and environment at a time.</p>

    Raises:
        capo_assurance.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.</p>
        capo_assurance.errors.conflict_exception.ConflictException: <p>A conflict occurred (for example, resource already exists).</p>
        capo_assurance.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred.</p>
        capo_assurance.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_assurance.errors.throttling_exception.ThrottlingException: <p>The request was throttled.</p>
        capo_assurance.errors.validation_exception.ValidationException: <p>The request failed validation.</p>
        capo_assurance.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Accept an invitation
        Accepts the invitation to connect the payments team's member account to the governance environment with the AWS Assurance service-linked role.

        >>> client.accept_invitation(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111')
    """

    def _handler(
        req: "OperationRequest[capo_assurance.types.accept_invitation_input.AcceptInvitationInput]",
    ) -> OperationResponse[
        "capo_assurance.types.accept_invitation_output.AcceptInvitationOutput"
    ]:
        import capo_assurance._operations.assurance.accept_invitation

        output, http_response = (
            capo_assurance._operations.assurance.accept_invitation.accept_invitation(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AcceptInvitation")
    )
    input_: capo_assurance.types.accept_invitation_input.AcceptInvitationInput = {
        "environment_arn": environment_arn
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output