AppMesh / Client / create_mesh

create_mesh#

AppMesh.Client.create_mesh(**kwargs)#

Creates a service mesh.

A service mesh is a logical boundary for network traffic between services that are represented by resources within the mesh. After you create your service mesh, you can create virtual services, virtual nodes, virtual routers, and routes to distribute traffic between the applications in your mesh.

For more information about service meshes, see Service meshes.

See also: AWS API Documentation

Request Syntax

response = client.create_mesh(
    clientToken='string',
    meshName='string',
    spec={
        'egressFilter': {
            'type': 'ALLOW_ALL'|'DROP_ALL'
        },
        'serviceDiscovery': {
            'ipPreference': 'IPv6_PREFERRED'|'IPv4_PREFERRED'|'IPv4_ONLY'|'IPv6_ONLY'
        }
    },
    tags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ]
)
Parameters:
  • clientToken (string) –

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.

    This field is autopopulated if not provided.

  • meshName (string) –

    [REQUIRED]

    The name to use for the service mesh.

  • spec (dict) –

    The service mesh specification to apply.

    • egressFilter (dict) –

      The egress filter rules for the service mesh.

      • type (string) – [REQUIRED]

        The egress filter type. By default, the type is DROP_ALL, which allows egress only from virtual nodes to other defined resources in the service mesh (and any traffic to *.amazonaws.com for Amazon Web Services API calls). You can set the egress filter type to ALLOW_ALL to allow egress to any endpoint inside or outside of the service mesh.

    • serviceDiscovery (dict) –

      An object that represents the service discovery information for a service mesh.

      • ipPreference (string) –

        The IP version to use to control traffic within the mesh.

  • tags (list) –

    Optional metadata that you can apply to the service mesh to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

    • (dict) –

      Optional metadata that you apply to a resource to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

      • key (string) – [REQUIRED]

        One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.

      • value (string) – [REQUIRED]

        The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).

Return type:

dict

Returns:

Response Syntax

{
    'mesh': {
        'meshName': 'string',
        'metadata': {
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'lastUpdatedAt': datetime(2015, 1, 1),
            'meshOwner': 'string',
            'resourceOwner': 'string',
            'uid': 'string',
            'version': 123
        },
        'spec': {
            'egressFilter': {
                'type': 'ALLOW_ALL'|'DROP_ALL'
            },
            'serviceDiscovery': {
                'ipPreference': 'IPv6_PREFERRED'|'IPv4_PREFERRED'|'IPv4_ONLY'|'IPv6_ONLY'
            }
        },
        'status': {
            'status': 'ACTIVE'|'INACTIVE'|'DELETED'
        }
    }
}

Response Structure

  • (dict) –

    • mesh (dict) –

      The full description of your service mesh following the create call.

      • meshName (string) –

        The name of the service mesh.

      • metadata (dict) –

        The associated metadata for the service mesh.

        • arn (string) –

          The full Amazon Resource Name (ARN) for the resource.

        • createdAt (datetime) –

          The Unix epoch timestamp in seconds for when the resource was created.

        • lastUpdatedAt (datetime) –

          The Unix epoch timestamp in seconds for when the resource was last updated.

        • meshOwner (string) –

          The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it’s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see Working with shared meshes.

        • resourceOwner (string) –

          The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it’s the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see Working with shared meshes.

        • uid (string) –

          The unique identifier for the resource.

        • version (integer) –

          The version of the resource. Resources are created at version 1, and this version is incremented each time that they’re updated.

      • spec (dict) –

        The associated specification for the service mesh.

        • egressFilter (dict) –

          The egress filter rules for the service mesh.

          • type (string) –

            The egress filter type. By default, the type is DROP_ALL, which allows egress only from virtual nodes to other defined resources in the service mesh (and any traffic to *.amazonaws.com for Amazon Web Services API calls). You can set the egress filter type to ALLOW_ALL to allow egress to any endpoint inside or outside of the service mesh.

        • serviceDiscovery (dict) –

          An object that represents the service discovery information for a service mesh.

          • ipPreference (string) –

            The IP version to use to control traffic within the mesh.

      • status (dict) –

        The status of the service mesh.

        • status (string) –

          The current mesh status.

Exceptions