Skip to content

create_proxy async

create_proxy(
    name: ProxyName,
    type: ProxyType,
    proxy_version: ProxyVersion,
    role_arn: IamRoleArn,
    configuration: ProxyConfiguration,
    network_configuration: ProxyNetworkUserConfiguration,
    *,
    config_overrides: Optional[AsyncELBProxyClientConfig] = None,
    attributes: Optional[ProxyAttributeList] = None,
    customer_kms_key_arn: Optional[CustomerKmsKeyArn] = None,
    tags: Optional[TagMap] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateProxyResponse

Creates a proxy. A proxy is a fully managed, Envoy-based proxy that runs your Envoy configuration on Amazon EC2 instances inside your own virtual private cloud (VPC). AWS provisions and scales the proxy, upgrades the Envoy version, patches the operating system, and monitors its health.

Parameters:

  • name (ProxyName) –

    The name of the proxy. The name must be unique within your account for the Region. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character.

  • type (ProxyType) –

    The type of proxy.

  • proxy_version (ProxyVersion) –

    The version of the proxy software, in major.minor format.

  • role_arn (IamRoleArn) –

    The Amazon Resource Name (ARN) of the IAM role that provides permissions to the code that your Envoy configuration runs on the proxy, such as filters and extensions. These are the permissions that this code needs when it calls AWS services.

  • configuration (ProxyConfiguration) –

    The configuration for the proxy.

  • network_configuration (ProxyNetworkUserConfiguration) –

    The network configuration for the proxy.

  • attributes (Optional[ProxyAttributeList], default: None ) –

    The attributes for the proxy. Attributes can be changed after creation. Attributes that you don't specify are set to their default values.

  • customer_kms_key_arn (Optional[CustomerKmsKeyArn], default: None ) –

    The Amazon Resource Name (ARN) of the customer managed KMS key used to encrypt the proxy's configuration content. If you don't specify a key, the default service-owned key is used.

  • tags (Optional[TagMap], default: None ) –

    The tags for the proxy.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Raises:

Examples:

To create a proxy The following example creates a proxy with the specified name, Envoy version, IAM role, and configuration file. The proxy is internet-facing over IPv4, runs in the specified subnets with the specified security group, and has deletion protection enabled.

>>> await client.create_proxy(name='my-proxy', type='envoy', proxy_version='1.40', role_arn='arn:aws:iam::123456789012:role/my-proxy-role', configuration={'configurationFile': {'configurationBytes': 'c3RhdGljX3Jlc291cmNlczoge30K'}}, network_configuration={'ipConfiguration': {'ipAddressingConfiguration': {'ipv4Addressability': 'internet-facing', 'ipv6Addressability': 'off'}}, 'vpcConfiguration': {'subnets': [{'subnetId': 'subnet-8360a9e7'}, {'subnetId': 'subnet-b7d581c0'}], 'securityGroups': [{'securityGroupId': 'sg-903004f8'}]}}, attributes=[{'key': 'deletion_protection.enabled', 'value': 'true'}], tags={'Environment': 'production'})
Source code in docs_src/capo_elb_proxy/_services/async_elb_proxy.py
async def create_proxy(
    self,
    name: "capo_elb_proxy.types.proxy_name.ProxyName",
    type: "capo_elb_proxy.types.proxy_type.ProxyType",
    proxy_version: "capo_elb_proxy.types.proxy_version.ProxyVersion",
    role_arn: "capo_elb_proxy.types.iam_role_arn.IamRoleArn",
    configuration: "capo_elb_proxy.types.proxy_configuration.ProxyConfiguration",
    network_configuration: "capo_elb_proxy.types.proxy_network_user_configuration.ProxyNetworkUserConfiguration",
    *,
    config_overrides: Optional[AsyncELBProxyClientConfig] = None,
    attributes: Optional[
        "capo_elb_proxy.types.proxy_attribute_list.ProxyAttributeList"
    ] = None,
    customer_kms_key_arn: Optional[
        "capo_elb_proxy.types.customer_kms_key_arn.CustomerKmsKeyArn"
    ] = None,
    tags: Optional["capo_elb_proxy.types.tag_map.TagMap"] = None,
    client_token: Optional["capo_elb_proxy.types.client_token.ClientToken"] = None,
) -> "capo_elb_proxy.types.create_proxy_response.CreateProxyResponse":
    """Creates a proxy. A proxy is a fully managed, Envoy-based proxy that runs your Envoy configuration on Amazon EC2 instances inside your own virtual private cloud (VPC). AWS provisions and scales the proxy, upgrades the Envoy version, patches the operating system, and monitors its health.

    Args:
        name: The name of the proxy. The name must be unique within your account for the Region. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character.
        type: The type of proxy.
        proxy_version: The version of the proxy software, in `major.minor` format.
        role_arn: The Amazon Resource Name (ARN) of the IAM role that provides permissions to the code that your Envoy configuration runs on the proxy, such as filters and extensions. These are the permissions that this code needs when it calls AWS services.
        configuration: The configuration for the proxy.
        network_configuration: The network configuration for the proxy.
        attributes: The attributes for the proxy. Attributes can be changed after creation. Attributes that you don't specify are set to their default values.
        customer_kms_key_arn: The Amazon Resource Name (ARN) of the customer managed KMS key used to encrypt the proxy's configuration content. If you don't specify a key, the default service-owned key is used.
        tags: The tags for the proxy.
        client_token: A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

    Raises:
        capo_elb_proxy.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
        capo_elb_proxy.errors.throttling_exception.ThrottlingException: The limit on the number of requests per second was exceeded.
        capo_elb_proxy.errors.access_denied_exception.AccessDeniedException: The user does not have sufficient access to perform this action.
        capo_elb_proxy.errors.conflict_exception.ConflictException: The request conflicts with the current state of the resource.
        capo_elb_proxy.errors.operation_not_permitted_exception.OperationNotPermittedException: The requested operation is not permitted.
        capo_elb_proxy.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: The request would cause a service quota to be exceeded.
        capo_elb_proxy.errors.validation_exception.ValidationException: The input does not satisfy the constraints specified by an AWS service.
        capo_elb_proxy.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To create a proxy
        The following example creates a proxy with the specified name, Envoy version, IAM role, and configuration file. The proxy is internet-facing over IPv4, runs in the specified subnets with the specified security group, and has deletion protection enabled.

        >>> await client.create_proxy(name='my-proxy', type='envoy', proxy_version='1.40', role_arn='arn:aws:iam::123456789012:role/my-proxy-role', configuration={'configurationFile': {'configurationBytes': 'c3RhdGljX3Jlc291cmNlczoge30K'}}, network_configuration={'ipConfiguration': {'ipAddressingConfiguration': {'ipv4Addressability': 'internet-facing', 'ipv6Addressability': 'off'}}, 'vpcConfiguration': {'subnets': [{'subnetId': 'subnet-8360a9e7'}, {'subnetId': 'subnet-b7d581c0'}], 'securityGroups': [{'securityGroupId': 'sg-903004f8'}]}}, attributes=[{'key': 'deletion_protection.enabled', 'value': 'true'}], tags={'Environment': 'production'})
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elb_proxy.types.create_proxy_request.CreateProxyRequest]",
    ) -> AsyncOperationResponse[
        "capo_elb_proxy.types.create_proxy_response.CreateProxyResponse"
    ]:
        import capo_elb_proxy._operations.elb_proxy.create_proxy

        (
            output,
            http_response,
        ) = await capo_elb_proxy._operations.elb_proxy.create_proxy.async_create_proxy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_elb_proxy.types.create_proxy_request.CreateProxyRequest",
    ) -> dict[str, Any]:
        import capo_elb_proxy.types.create_proxy_request

        return capo_elb_proxy.types.create_proxy_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateProxy", redact_input=_redact_input),
    )
    input_: capo_elb_proxy.types.create_proxy_request.CreateProxyRequest = {
        "name": name,
        "type": type,
        "proxy_version": proxy_version,
        "role_arn": role_arn,
        "configuration": configuration,
        "network_configuration": network_configuration,
    }
    if attributes is not None:
        input_["attributes"] = attributes
    if customer_kms_key_arn is not None:
        input_["customer_kms_key_arn"] = customer_kms_key_arn
    if tags is not None:
        input_["tags"] = tags
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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