Skip to content

update_connection_group

update_connection_group(
    id: string,
    if_match: string,
    *,
    config_overrides: Optional[CloudFrontClientConfig] = None,
    ipv6_enabled: Optional[boolean] = None,
    anycast_ip_list_id: Optional[string] = None,
    enabled: Optional[boolean] = None,
) -> UpdateConnectionGroupResult

Updates a connection group.

Parameters:

  • id (string) –

    The ID of the connection group.

  • ipv6_enabled (Optional[boolean], default: None ) –

    Enable IPv6 for the connection group. For more information, see Enable IPv6 in the Amazon CloudFront Developer Guide.

  • if_match (string) –

    The value of the ETag header that you received when retrieving the connection group that you're updating.

  • anycast_ip_list_id (Optional[string], default: None ) –

    The ID of the Anycast static IP list.

  • enabled (Optional[boolean], default: None ) –

    Whether the connection group is enabled.

Raises:

Source code in docs_src/capo_cloudfront/_services/cloud_front.py
def update_connection_group(
    self,
    id: "capo_cloudfront.types.string.string",
    if_match: "capo_cloudfront.types.string.string",
    *,
    config_overrides: Optional[CloudFrontClientConfig] = None,
    ipv6_enabled: Optional["capo_cloudfront.types.boolean.boolean"] = None,
    anycast_ip_list_id: Optional["capo_cloudfront.types.string.string"] = None,
    enabled: Optional["capo_cloudfront.types.boolean.boolean"] = None,
) -> "capo_cloudfront.types.update_connection_group_result.UpdateConnectionGroupResult":
    """<p>Updates a connection group.</p>

    Args:
        id: <p>The ID of the connection group.</p>
        ipv6_enabled: <p>Enable IPv6 for the connection group. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesEnableIPv6">Enable IPv6</a> in the <i>Amazon CloudFront Developer Guide</i>.</p>
        if_match: <p>The value of the <code>ETag</code> header that you received when retrieving the connection group that you're updating.</p>
        anycast_ip_list_id: <p>The ID of the Anycast static IP list.</p>
        enabled: <p>Whether the connection group is enabled.</p>

    Raises:
        capo_cloudfront.errors.access_denied.AccessDenied: <p>Access denied.</p>
        capo_cloudfront.errors.entity_already_exists.EntityAlreadyExists: <p>The entity already exists. You must provide a unique entity.</p>
        capo_cloudfront.errors.entity_limit_exceeded.EntityLimitExceeded: <p>The entity limit has been exceeded.</p>
        capo_cloudfront.errors.entity_not_found.EntityNotFound: <p>The entity was not found.</p>
        capo_cloudfront.errors.invalid_argument.InvalidArgument: <p>An argument is invalid.</p>
        capo_cloudfront.errors.invalid_if_match_version.InvalidIfMatchVersion: <p>The <code>If-Match</code> version is missing or not valid.</p>
        capo_cloudfront.errors.precondition_failed.PreconditionFailed: <p>The precondition in one or more of the request fields evaluated to <code>false</code>.</p>
        capo_cloudfront.errors.resource_in_use.ResourceInUse: <p>Cannot delete this resource because it is in use.</p>
        capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudfront.types.update_connection_group_request.UpdateConnectionGroupRequest]",
    ) -> OperationResponse[
        "capo_cloudfront.types.update_connection_group_result.UpdateConnectionGroupResult"
    ]:
        import capo_cloudfront._operations.cloudfront2020_05_31.update_connection_group

        output, http_response = (
            capo_cloudfront._operations.cloudfront2020_05_31.update_connection_group.update_connection_group(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateConnectionGroup")
    )
    input_: capo_cloudfront.types.update_connection_group_request.UpdateConnectionGroupRequest = {
        "id": id,
        "if_match": if_match,
    }
    if ipv6_enabled is not None:
        input_["ipv6_enabled"] = ipv6_enabled
    if anycast_ip_list_id is not None:
        input_["anycast_ip_list_id"] = anycast_ip_list_id
    if enabled is not None:
        input_["enabled"] = enabled

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