Skip to content

update_cross_account_attachment

update_cross_account_attachment(
    attachment_arn: GenericString,
    *,
    config_overrides: Optional[GlobalAcceleratorClientConfig] = None,
    name: Optional[AttachmentName] = None,
    add_principals: Optional[Principals] = None,
    remove_principals: Optional[Principals] = None,
    add_resources: Optional[Resources] = None,
    remove_resources: Optional[Resources] = None,
) -> UpdateCrossAccountAttachmentResponse

Update a cross-account attachment to add or remove principals or resources. When you update an attachment to remove a principal (account ID or accelerator) or a resource, Global Accelerator revokes the permission for specific resources.

For more information, see Working with cross-account attachments and resources in Global Accelerator in the Global Accelerator Developer Guide.

Parameters:

  • attachment_arn (GenericString) –

    The Amazon Resource Name (ARN) of the cross-account attachment to update.

  • name (Optional[AttachmentName], default: None ) –

    The name of the cross-account attachment.

  • add_principals (Optional[Principals], default: None ) –

    The principals to add to the cross-account attachment. A principal is an account or the Amazon Resource Name (ARN) of an accelerator that the attachment gives permission to work with resources from another account. The resources are also listed in the attachment.

    To add more than one principal, separate the account numbers or accelerator ARNs, or both, with commas.

  • remove_principals (Optional[Principals], default: None ) –

    The principals to remove from the cross-account attachment. A principal is an account or the Amazon Resource Name (ARN) of an accelerator that the attachment gives permission to work with resources from another account. The resources are also listed in the attachment.

    To remove more than one principal, separate the account numbers or accelerator ARNs, or both, with commas.

  • add_resources (Optional[Resources], default: None ) –

    The resources to add to the cross-account attachment. A resource listed in a cross-account attachment can be used with an accelerator by the principals that are listed in the attachment.

    To add more than one resource, separate the resource ARNs with commas.

  • remove_resources (Optional[Resources], default: None ) –

    The resources to remove from the cross-account attachment. A resource listed in a cross-account attachment can be used with an accelerator by the principals that are listed in the attachment.

    To remove more than one resource, separate the resource ARNs with commas.

Raises:

Source code in docs_src/capo_global_accelerator/_services/global_accelerator.py
def update_cross_account_attachment(
    self,
    attachment_arn: "capo_global_accelerator.types.generic_string.GenericString",
    *,
    config_overrides: Optional[GlobalAcceleratorClientConfig] = None,
    name: Optional[
        "capo_global_accelerator.types.attachment_name.AttachmentName"
    ] = None,
    add_principals: Optional[
        "capo_global_accelerator.types.principals.Principals"
    ] = None,
    remove_principals: Optional[
        "capo_global_accelerator.types.principals.Principals"
    ] = None,
    add_resources: Optional[
        "capo_global_accelerator.types.resources.Resources"
    ] = None,
    remove_resources: Optional[
        "capo_global_accelerator.types.resources.Resources"
    ] = None,
) -> "capo_global_accelerator.types.update_cross_account_attachment_response.UpdateCrossAccountAttachmentResponse":
    """<p>Update a cross-account attachment to add or remove principals or resources. When you update an attachment to remove a principal (account ID or accelerator) or a resource, Global Accelerator revokes the permission for specific resources. </p> <p>For more information, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/cross-account-resources.html"> Working with cross-account attachments and resources in Global Accelerator</a> in the <i> Global Accelerator Developer Guide</i>.</p>

    Args:
        attachment_arn: <p>The Amazon Resource Name (ARN) of the cross-account attachment to update.</p>
        name: <p>The name of the cross-account attachment. </p>
        add_principals: <p>The principals to add to the cross-account attachment. A principal is an account or the Amazon Resource Name (ARN) of an accelerator that the attachment gives permission to work with resources from another account. The resources are also listed in the attachment.</p> <p>To add more than one principal, separate the account numbers or accelerator ARNs, or both, with commas.</p>
        remove_principals: <p>The principals to remove from the cross-account attachment. A principal is an account or the Amazon Resource Name (ARN) of an accelerator that the attachment gives permission to work with resources from another account. The resources are also listed in the attachment.</p> <p>To remove more than one principal, separate the account numbers or accelerator ARNs, or both, with commas.</p>
        add_resources: <p>The resources to add to the cross-account attachment. A resource listed in a cross-account attachment can be used with an accelerator by the principals that are listed in the attachment.</p> <p>To add more than one resource, separate the resource ARNs with commas.</p>
        remove_resources: <p>The resources to remove from the cross-account attachment. A resource listed in a cross-account attachment can be used with an accelerator by the principals that are listed in the attachment.</p> <p>To remove more than one resource, separate the resource ARNs with commas.</p>

    Raises:
        capo_global_accelerator.errors.access_denied_exception.AccessDeniedException: <p>You don't have access permission.</p>
        capo_global_accelerator.errors.attachment_not_found_exception.AttachmentNotFoundException: <p>No cross-account attachment was found.</p>
        capo_global_accelerator.errors.internal_service_error_exception.InternalServiceErrorException: <p>There was an internal error for Global Accelerator.</p>
        capo_global_accelerator.errors.invalid_argument_exception.InvalidArgumentException: <p>An argument that you specified is invalid.</p>
        capo_global_accelerator.errors.limit_exceeded_exception.LimitExceededException: <p>Processing your request would cause you to exceed an Global Accelerator limit.</p>
        capo_global_accelerator.errors.transaction_in_progress_exception.TransactionInProgressException: <p>There's already a transaction in progress. Another transaction can't be processed.</p>
        capo_global_accelerator.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_global_accelerator.types.update_cross_account_attachment_request.UpdateCrossAccountAttachmentRequest]",
    ) -> OperationResponse[
        "capo_global_accelerator.types.update_cross_account_attachment_response.UpdateCrossAccountAttachmentResponse"
    ]:
        import capo_global_accelerator._operations.global_accelerator_v20180706.update_cross_account_attachment

        output, http_response = (
            capo_global_accelerator._operations.global_accelerator_v20180706.update_cross_account_attachment.update_cross_account_attachment(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateCrossAccountAttachment")
    )
    input_: capo_global_accelerator.types.update_cross_account_attachment_request.UpdateCrossAccountAttachmentRequest = {
        "attachment_arn": attachment_arn
    }
    if name is not None:
        input_["name"] = name
    if add_principals is not None:
        input_["add_principals"] = add_principals
    if remove_principals is not None:
        input_["remove_principals"] = remove_principals
    if add_resources is not None:
        input_["add_resources"] = add_resources
    if remove_resources is not None:
        input_["remove_resources"] = remove_resources

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