HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/local/aws-cli/v2/dist/awscli/examples/appmesh/create-virtual-gateway.rst
**To create a new virtual gateway**

The following ``create-virtual-gateway`` example uses a JSON input file to create a virtual gateway with a listener for HTTP using port 9080. ::

    aws appmesh create-virtual-gateway \
        --mesh-name meshName \
        --virtual-gateway-name virtualGatewayName \
        --cli-input-json file://create-virtual-gateway.json

Contents of ``create-virtual-gateway.json``::

    {
        "spec": {
          "listeners": [
            {
              "portMapping": {
                "port": 9080,
                "protocol": "http"
              }
            }
          ]
        }
    }

Output::

    {
        "virtualGateway": {
            "meshName": "meshName",
            "metadata": {
                "arn": "arn:aws:appmesh:us-west-2:123456789012:mesh/meshName/virtualGateway/virtualGatewayName",
                "createdAt": "2022-04-06T10:42:42.015000-05:00",
                "lastUpdatedAt": "2022-04-06T10:42:42.015000-05:00",
                "meshOwner": "123456789012",
                "resourceOwner": "123456789012",
                "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
                "version": 1
            },
            "spec": {
                "listeners": [
                    {
                        "portMapping": {
                            "port": 9080,
                            "protocol": "http"
                        }
                    }
                ]
            },
            "status": {
                "status": "ACTIVE"
            },
            "virtualGatewayName": "virtualGatewayName"
        }
    }

For more information, see `Virtual Gateways <https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_gateways.html>`__ in the *AWS App Mesh User Guide*.