CmdID

CmdID / aws / aws appmesh

aws appmesh update-route

Updates an existing route for a specified service mesh and virtual router. AWS CLI reference

1 example 6 options Its page in the AWS CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

To update a route

The following update-route example uses a JSON input file to update the weights for a route.

aws appmesh update-route --cli-input-json file://update-route-weighted.jsonIdentify

Contents of update-route-weighted.json:

{
    "meshName": "app1",
    "routeName": "toVnServiceB-weighted",
    "spec": {
        "httpRoute": {
            "action": {
                "weightedTargets": [
                    {
                        "virtualNode": "vnServiceBv1",
                        "weight": 80
                    },
                    {
                        "virtualNode": "vnServiceBv2",
                        "weight": 20
                    }
                ]
            },
            "match": {
                "prefix": "/"
            }
        }
    },
    "virtualRouterName": "vrServiceB"
}
Its output, shortened
{
    "route": {
        "meshName": "app1",
        "metadata": {
            "arn": "arn:aws:appmesh:us-west-2:123456789012:mesh/app1/virtualRouter/vrServiceB/route/toVnServiceB-weighted",
            "createdAt": 1563811384.015,
            "lastUpdatedAt": 1563819600.022,
            "uid": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
            "version": 2
        },
        "routeName": "toVnServiceB-weighted",
        "spec": {
            "httpRoute": {
                "action": {
                    "weightedTargets": [
                        {
                            "virtualNode": "vnServiceBv1",
                            "weight": 80
                        },
                        {
                            "virtualNode": "vnServiceBv2",
                            "weight": 20
                        }
                    ]
                },
                "match": {
                    "prefix": "/"
                }
            }
        },
… 6 more lines

For more information, see Routes in the AWS App Mesh User Guide.

Options

6 in the AWS CLI reference
--client-tokenUnique, case-sensitive identifier that you provide to ensure the idempotency of the request.
--mesh-nameThe name of the service mesh that the route resides in.
--mesh-ownerThe Amazon Web Services IAM account ID of the service mesh owner.
--route-nameThe name of the route to update.
--specThe new route specification to apply.
--virtual-router-nameThe name of the virtual router that the route is associated with.