Skip to content

update_gateway async

update_gateway(
    gateway: String,
    *,
    config_overrides: Optional[AsyncECSClientConfig] = None,
    infrastructure_role_arn: Optional[String] = None,
    deletion_protection: Optional[BoxedBoolean] = None,
    configuration: Optional[UpdateGatewayConfiguration] = None,
    propagate_tags: Optional[PropagateGatewayTags] = None,
) -> UpdateGatewayResponse

Modifies the configuration of a gateway. You can change only the properties that can be applied without interrupting traffic, and the configuration variant that you provide must match the gateway's type. UpdateGateway is an asynchronous operation: the changes are applied to each load balancer the gateway manages, and the gateway reports a status of UPDATE_IN_PROGRESS until the update completes. If Amazon ECS can't update one or more resources, it makes a best effort to update the rest and the gateway status changes to UPDATE_FAILED. Use DescribeGateway to inspect the gateway's statusReason and failures list, which gives the ARN of each load balancer that was not updated and the operation, error code, and message for each failure.

If you specify infrastructureRoleArn, you must have the iam:PassRole permission for that role.

Parameters:

  • gateway (String) –

    The name or Amazon Resource Name (ARN) of the gateway to update.

  • infrastructure_role_arn (Optional[String], default: None ) –

    The Amazon Resource Name (ARN) of the IAM role that the gateway assumes to manage infrastructure on your behalf.

  • deletion_protection (Optional[BoxedBoolean], default: None ) –

    Specifies whether to enable deletion protection for the gateway. When enabled, the gateway can't be deleted.

  • configuration (Optional[UpdateGatewayConfiguration], default: None ) –

    The updated type-specific configuration for the gateway. The configuration variant must match the gateway's existing type, and only mutable fields can be changed.

  • propagate_tags (Optional[PropagateGatewayTags], default: None ) –

    Specifies whether to propagate the tags from the gateway to the infrastructure that the gateway manages. If you don't specify a value, the gateway's existing setting is unchanged.

Raises:

  • AccessDeniedException –

    You don't have authorization to perform the requested action.

  • ClientException –

    These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.

  • GatewayNotFoundException –

    The specified gateway wasn't found. Check that the gateway name or ARN is correct and that the gateway exists in your account and Region.

  • InvalidParameterException –

    The specified parameter isn't valid. Review the available parameters for the API request.

    For more information about service event errors, see Amazon ECS service event messages.

  • ServerException –

    These errors are usually caused by a server issue.

  • UnsupportedFeatureException –

    The specified task isn't supported in this Region.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To update a gateway This example raises the maximum number of Application Load Balancers that the gateway named my-gateway manages, and changes the desync mitigation mode to strictest.

>>> await client.update_gateway(gateway='my-gateway', configuration={'hostSharedAlb': {'maxAlbCount': 20, 'httpDesync': 'strictest'}})
Source code in docs_src/capo_ecs/_services/async_ecs.py
async def update_gateway(
    self,
    gateway: "capo_ecs.types.string.String",
    *,
    config_overrides: Optional[AsyncECSClientConfig] = None,
    infrastructure_role_arn: Optional["capo_ecs.types.string.String"] = None,
    deletion_protection: Optional[
        "capo_ecs.types.boxed_boolean.BoxedBoolean"
    ] = None,
    configuration: Optional[
        "capo_ecs.types.update_gateway_configuration.UpdateGatewayConfiguration"
    ] = None,
    propagate_tags: Optional[
        "capo_ecs.types.propagate_gateway_tags.PropagateGatewayTags"
    ] = None,
) -> "capo_ecs.types.update_gateway_response.UpdateGatewayResponse":
    """<p>Modifies the configuration of a gateway. You can change only the properties that can be applied without interrupting traffic, and the configuration variant that you provide must match the gateway's type. <code>UpdateGateway</code> is an asynchronous operation: the changes are applied to each load balancer the gateway manages, and the gateway reports a status of <code>UPDATE_IN_PROGRESS</code> until the update completes. If Amazon ECS can't update one or more resources, it makes a best effort to update the rest and the gateway status changes to <code>UPDATE_FAILED</code>. Use <code>DescribeGateway</code> to inspect the gateway's <code>statusReason</code> and failures list, which gives the ARN of each load balancer that was not updated and the operation, error code, and message for each failure.</p> <p>If you specify <code>infrastructureRoleArn</code>, you must have the <code>iam:PassRole</code> permission for that role.</p>

    Args:
        gateway: <p>The name or Amazon Resource Name (ARN) of the gateway to update.</p>
        infrastructure_role_arn: <p>The Amazon Resource Name (ARN) of the IAM role that the gateway assumes to manage infrastructure on your behalf.</p>
        deletion_protection: <p>Specifies whether to enable deletion protection for the gateway. When enabled, the gateway can't be deleted.</p>
        configuration: <p>The updated type-specific configuration for the gateway. The configuration variant must match the gateway's existing type, and only mutable fields can be changed.</p>
        propagate_tags: <p>Specifies whether to propagate the tags from the gateway to the infrastructure that the gateway manages. If you don't specify a value, the gateway's existing setting is unchanged.</p>

    Raises:
        capo_ecs.errors.access_denied_exception.AccessDeniedException: <p>You don't have authorization to perform the requested action.</p>
        capo_ecs.errors.client_exception.ClientException: <p>These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.</p>
        capo_ecs.errors.gateway_not_found_exception.GatewayNotFoundException: <p>The specified gateway wasn't found. Check that the gateway name or ARN is correct and that the gateway exists in your account and Region.</p>
        capo_ecs.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter isn't valid. Review the available parameters for the API request.</p> <p>For more information about service event errors, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-event-messages-list.html">Amazon ECS service event messages</a>. </p>
        capo_ecs.errors.server_exception.ServerException: <p>These errors are usually caused by a server issue.</p>
        capo_ecs.errors.unsupported_feature_exception.UnsupportedFeatureException: <p>The specified task isn't supported in this Region.</p>
        capo_ecs.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To update a gateway
        This example raises the maximum number of Application Load Balancers that the gateway named my-gateway manages, and changes the desync mitigation mode to strictest.

        >>> await client.update_gateway(gateway='my-gateway', configuration={'hostSharedAlb': {'maxAlbCount': 20, 'httpDesync': 'strictest'}})
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ecs.types.update_gateway_request.UpdateGatewayRequest]",
    ) -> AsyncOperationResponse[
        "capo_ecs.types.update_gateway_response.UpdateGatewayResponse"
    ]:
        import capo_ecs._operations.amazon_ec2_container_service_v20141113.update_gateway

        (
            output,
            http_response,
        ) = await capo_ecs._operations.amazon_ec2_container_service_v20141113.update_gateway.async_update_gateway(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateGateway")
    )
    input_: capo_ecs.types.update_gateway_request.UpdateGatewayRequest = {
        "gateway": gateway
    }
    if infrastructure_role_arn is not None:
        input_["infrastructure_role_arn"] = infrastructure_role_arn
    if deletion_protection is not None:
        input_["deletion_protection"] = deletion_protection
    if configuration is not None:
        input_["configuration"] = configuration
    if propagate_tags is not None:
        input_["propagate_tags"] = propagate_tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output