Module appmesh

@pulumi/aws > appmesh

class Mesh

extends CustomResource

Provides an AWS App Mesh service mesh resource.

Example Usage

Basic

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const simple = new aws.appmesh.Mesh("simple", {});

Egress Filter

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const simple = new aws.appmesh.Mesh("simple", {
    spec: {
        egressFilter: {
            type: "ALLOW_ALL",
        },
    },
});

constructor

new Mesh(name: string, args?: MeshArgs, opts?: pulumi.CustomResourceOptions)

Create a Mesh resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: MeshState, opts?: pulumi.CustomResourceOptions): Mesh

Get an existing Mesh resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property arn

public arn: pulumi.Output<string>;

The ARN of the service mesh.

property createdDate

public createdDate: pulumi.Output<string>;

The creation date of the service mesh.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property lastUpdatedDate

public lastUpdatedDate: pulumi.Output<string>;

The last update date of the service mesh.

property name

public name: pulumi.Output<string>;

The name to use for the service mesh.

property spec

public spec: pulumi.Output<{
    egressFilter: {
        type: string;
    };
} | undefined>;

The service mesh specification to apply.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Route

extends CustomResource

Provides an AWS App Mesh route resource.

Example Usage

HTTP Routing

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const serviceb = new aws.appmesh.Route("serviceb", {
    meshName: aws_appmesh_mesh_simple.id,
    spec: {
        httpRoute: {
            action: {
                weightedTargets: [
                    {
                        virtualNode: aws_appmesh_virtual_node_serviceb1.name,
                        weight: 90,
                    },
                    {
                        virtualNode: aws_appmesh_virtual_node_serviceb2.name,
                        weight: 10,
                    },
                ],
            },
            match: {
                prefix: "/",
            },
        },
    },
    virtualRouterName: aws_appmesh_virtual_router_serviceb.name,
});

TCP Routing

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const serviceb = new aws.appmesh.Route("serviceb", {
    meshName: aws_appmesh_mesh_simple.id,
    spec: {
        tcpRoute: {
            action: {
                weightedTargets: [{
                    virtualNode: aws_appmesh_virtual_node_serviceb1.name,
                    weight: 100,
                }],
            },
        },
    },
    virtualRouterName: aws_appmesh_virtual_router_serviceb.name,
});

constructor

new Route(name: string, args: RouteArgs, opts?: pulumi.CustomResourceOptions)

Create a Route resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RouteState, opts?: pulumi.CustomResourceOptions): Route

Get an existing Route resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property arn

public arn: pulumi.Output<string>;

The ARN of the route.

property createdDate

public createdDate: pulumi.Output<string>;

The creation date of the route.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property lastUpdatedDate

public lastUpdatedDate: pulumi.Output<string>;

The last update date of the route.

property meshName

public meshName: pulumi.Output<string>;

The name of the service mesh in which to create the route.

property name

public name: pulumi.Output<string>;

The name to use for the route.

property spec

public spec: pulumi.Output<{
    httpRoute: {
        action: {
            weightedTargets: {
                virtualNode: string;
                weight: number;
            }[];
        };
        match: {
            prefix: string;
        };
    };
    tcpRoute: {
        action: {
            weightedTargets: {
                virtualNode: string;
                weight: number;
            }[];
        };
    };
}>;

The route specification to apply.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property virtualRouterName

public virtualRouterName: pulumi.Output<string>;

The name of the virtual router in which to create the route.

class VirtualNode

extends CustomResource

Provides an AWS App Mesh virtual node resource.

Breaking Changes

Because of backward incompatible API changes (read here), aws_appmesh_virtual_node resource definitions created with provider versions earlier than v2.3.0 will need to be modified:

  • Rename the service_name attribute of the dns object to hostname.

  • Replace the backends attribute of the spec object with one or more backend configuration blocks, setting virtual_service_name to the name of the service.

The Terraform state associated with existing resources will automatically be migrated.

Example Usage

Basic

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const serviceb1 = new aws.appmesh.VirtualNode("serviceb1", {
    meshName: aws_appmesh_mesh_simple.id,
    spec: {
        backends: [{
            virtualService: {
                virtualServiceName: "servicea.simpleapp.local",
            },
        }],
        listener: {
            portMapping: {
                port: 8080,
                protocol: "http",
            },
        },
        serviceDiscovery: {
            dns: {
                hostname: "serviceb.simpleapp.local",
            },
        },
    },
});

Listener Health Check

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const serviceb1 = new aws.appmesh.VirtualNode("serviceb1", {
    meshName: aws_appmesh_mesh_simple.id,
    spec: {
        backends: [{
            virtualService: {
                virtualServiceName: "servicea.simpleapp.local",
            },
        }],
        listener: {
            healthCheck: {
                healthyThreshold: 2,
                intervalMillis: 5000,
                path: "/ping",
                protocol: "http",
                timeoutMillis: 2000,
                unhealthyThreshold: 2,
            },
            portMapping: {
                port: 8080,
                protocol: "http",
            },
        },
        serviceDiscovery: {
            dns: {
                hostname: "serviceb.simpleapp.local",
            },
        },
    },
});

Logging

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const serviceb1 = new aws.appmesh.VirtualNode("serviceb1", {
    meshName: aws_appmesh_mesh_simple.id,
    spec: {
        backends: [{
            virtualService: {
                virtualServiceName: "servicea.simpleapp.local",
            },
        }],
        listener: {
            portMapping: {
                port: 8080,
                protocol: "http",
            },
        },
        logging: {
            accessLog: {
                file: {
                    path: "/dev/stdout",
                },
            },
        },
        serviceDiscovery: {
            dns: {
                hostname: "serviceb.simpleapp.local",
            },
        },
    },
});

constructor

new VirtualNode(name: string, args: VirtualNodeArgs, opts?: pulumi.CustomResourceOptions)

Create a VirtualNode resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VirtualNodeState, opts?: pulumi.CustomResourceOptions): VirtualNode

Get an existing VirtualNode resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property arn

public arn: pulumi.Output<string>;

The ARN of the virtual node.

property createdDate

public createdDate: pulumi.Output<string>;

The creation date of the virtual node.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property lastUpdatedDate

public lastUpdatedDate: pulumi.Output<string>;

The last update date of the virtual node.

property meshName

public meshName: pulumi.Output<string>;

The name of the service mesh in which to create the virtual node.

property name

public name: pulumi.Output<string>;

The name to use for the virtual node.

property spec

public spec: pulumi.Output<{
    backends: {
        virtualService: {
            virtualServiceName: string;
        };
    }[];
    listener: {
        healthCheck: {
            healthyThreshold: number;
            intervalMillis: number;
            path: string;
            port: number;
            protocol: string;
            timeoutMillis: number;
            unhealthyThreshold: number;
        };
        portMapping: {
            port: number;
            protocol: string;
        };
    };
    logging: {
        accessLog: {
            file: {
                path: string;
            };
        };
    };
    serviceDiscovery: {
        dns: {
            hostname: string;
        };
    };
}>;

The virtual node specification to apply.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class VirtualRouter

extends CustomResource

Provides an AWS App Mesh virtual router resource.

Breaking Changes

Because of backward incompatible API changes (read here and here), aws_appmesh_virtual_router resource definitions created with provider versions earlier than v2.3.0 will need to be modified:

  • Remove service service_names from the spec argument. AWS has created a aws_appmesh_virtual_service resource for each of service names. These resource can be imported using terraform import.

  • Add a listener configuration block to the spec argument.

The Terraform state associated with existing resources will automatically be migrated.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const serviceb = new aws.appmesh.VirtualRouter("serviceb", {
    meshName: aws_appmesh_mesh_simple.id,
    spec: {
        listener: {
            portMapping: {
                port: 8080,
                protocol: "http",
            },
        },
    },
});

constructor

new VirtualRouter(name: string, args: VirtualRouterArgs, opts?: pulumi.CustomResourceOptions)

Create a VirtualRouter resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VirtualRouterState, opts?: pulumi.CustomResourceOptions): VirtualRouter

Get an existing VirtualRouter resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property arn

public arn: pulumi.Output<string>;

The ARN of the virtual router.

property createdDate

public createdDate: pulumi.Output<string>;

The creation date of the virtual router.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property lastUpdatedDate

public lastUpdatedDate: pulumi.Output<string>;

The last update date of the virtual router.

property meshName

public meshName: pulumi.Output<string>;

The name of the service mesh in which to create the virtual router.

property name

public name: pulumi.Output<string>;

The name to use for the virtual router.

property spec

public spec: pulumi.Output<{
    listener: {
        portMapping: {
            port: number;
            protocol: string;
        };
    };
}>;

The virtual router specification to apply.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class VirtualService

extends CustomResource

Provides an AWS App Mesh virtual service resource.

Example Usage

Virtual Node Provider

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const servicea = new aws.appmesh.VirtualService("servicea", {
    meshName: aws_appmesh_mesh_simple.id,
    spec: {
        provider: {
            virtualNode: {
                virtualNodeName: aws_appmesh_virtual_node_serviceb1.name,
            },
        },
    },
});

Virtual Router Provider

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const servicea = new aws.appmesh.VirtualService("servicea", {
    meshName: aws_appmesh_mesh_simple.id,
    spec: {
        provider: {
            virtualRouter: {
                virtualRouterName: aws_appmesh_virtual_router_serviceb.name,
            },
        },
    },
});

constructor

new VirtualService(name: string, args: VirtualServiceArgs, opts?: pulumi.CustomResourceOptions)

Create a VirtualService resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VirtualServiceState, opts?: pulumi.CustomResourceOptions): VirtualService

Get an existing VirtualService resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property arn

public arn: pulumi.Output<string>;

The ARN of the virtual service.

property createdDate

public createdDate: pulumi.Output<string>;

The creation date of the virtual service.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property lastUpdatedDate

public lastUpdatedDate: pulumi.Output<string>;

The last update date of the virtual service.

property meshName

public meshName: pulumi.Output<string>;

The name of the service mesh in which to create the virtual service.

property name

public name: pulumi.Output<string>;

The name to use for the virtual service.

property spec

public spec: pulumi.Output<{
    provider: {
        virtualNode: {
            virtualNodeName: string;
        };
        virtualRouter: {
            virtualRouterName: string;
        };
    };
}>;

The virtual service specification to apply.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

interface MeshArgs

The set of arguments for constructing a Mesh resource.

property name

name?: pulumi.Input<string>;

The name to use for the service mesh.

property spec

spec?: pulumi.Input<{
    egressFilter: pulumi.Input<{
        type: pulumi.Input<string>;
    }>;
}>;

The service mesh specification to apply.

interface MeshState

Input properties used for looking up and filtering Mesh resources.

property arn

arn?: pulumi.Input<string>;

The ARN of the service mesh.

property createdDate

createdDate?: pulumi.Input<string>;

The creation date of the service mesh.

property lastUpdatedDate

lastUpdatedDate?: pulumi.Input<string>;

The last update date of the service mesh.

property name

name?: pulumi.Input<string>;

The name to use for the service mesh.

property spec

spec?: pulumi.Input<{
    egressFilter: pulumi.Input<{
        type: pulumi.Input<string>;
    }>;
}>;

The service mesh specification to apply.

interface RouteArgs

The set of arguments for constructing a Route resource.

property meshName

meshName: pulumi.Input<string>;

The name of the service mesh in which to create the route.

property name

name?: pulumi.Input<string>;

The name to use for the route.

property spec

spec: pulumi.Input<{
    httpRoute: pulumi.Input<{
        action: pulumi.Input<{
            weightedTargets: pulumi.Input<pulumi.Input<{
                virtualNode: pulumi.Input<string>;
                weight: pulumi.Input<number>;
            }>[]>;
        }>;
        match: pulumi.Input<{
            prefix: pulumi.Input<string>;
        }>;
    }>;
    tcpRoute: pulumi.Input<{
        action: pulumi.Input<{
            weightedTargets: pulumi.Input<pulumi.Input<{
                virtualNode: pulumi.Input<string>;
                weight: pulumi.Input<number>;
            }>[]>;
        }>;
    }>;
}>;

The route specification to apply.

property virtualRouterName

virtualRouterName: pulumi.Input<string>;

The name of the virtual router in which to create the route.

interface RouteState

Input properties used for looking up and filtering Route resources.

property arn

arn?: pulumi.Input<string>;

The ARN of the route.

property createdDate

createdDate?: pulumi.Input<string>;

The creation date of the route.

property lastUpdatedDate

lastUpdatedDate?: pulumi.Input<string>;

The last update date of the route.

property meshName

meshName?: pulumi.Input<string>;

The name of the service mesh in which to create the route.

property name

name?: pulumi.Input<string>;

The name to use for the route.

property spec

spec?: pulumi.Input<{
    httpRoute: pulumi.Input<{
        action: pulumi.Input<{
            weightedTargets: pulumi.Input<pulumi.Input<{
                virtualNode: pulumi.Input<string>;
                weight: pulumi.Input<number>;
            }>[]>;
        }>;
        match: pulumi.Input<{
            prefix: pulumi.Input<string>;
        }>;
    }>;
    tcpRoute: pulumi.Input<{
        action: pulumi.Input<{
            weightedTargets: pulumi.Input<pulumi.Input<{
                virtualNode: pulumi.Input<string>;
                weight: pulumi.Input<number>;
            }>[]>;
        }>;
    }>;
}>;

The route specification to apply.

property virtualRouterName

virtualRouterName?: pulumi.Input<string>;

The name of the virtual router in which to create the route.

interface VirtualNodeArgs

The set of arguments for constructing a VirtualNode resource.

property meshName

meshName: pulumi.Input<string>;

The name of the service mesh in which to create the virtual node.

property name

name?: pulumi.Input<string>;

The name to use for the virtual node.

property spec

spec: pulumi.Input<{
    backends: pulumi.Input<pulumi.Input<{
        virtualService: pulumi.Input<{
            virtualServiceName: pulumi.Input<string>;
        }>;
    }>[]>;
    listener: pulumi.Input<{
        healthCheck: pulumi.Input<{
            healthyThreshold: pulumi.Input<number>;
            intervalMillis: pulumi.Input<number>;
            path: pulumi.Input<string>;
            port: pulumi.Input<number>;
            protocol: pulumi.Input<string>;
            timeoutMillis: pulumi.Input<number>;
            unhealthyThreshold: pulumi.Input<number>;
        }>;
        portMapping: pulumi.Input<{
            port: pulumi.Input<number>;
            protocol: pulumi.Input<string>;
        }>;
    }>;
    logging: pulumi.Input<{
        accessLog: pulumi.Input<{
            file: pulumi.Input<{
                path: pulumi.Input<string>;
            }>;
        }>;
    }>;
    serviceDiscovery: pulumi.Input<{
        dns: pulumi.Input<{
            hostname: pulumi.Input<string>;
        }>;
    }>;
}>;

The virtual node specification to apply.

interface VirtualNodeState

Input properties used for looking up and filtering VirtualNode resources.

property arn

arn?: pulumi.Input<string>;

The ARN of the virtual node.

property createdDate

createdDate?: pulumi.Input<string>;

The creation date of the virtual node.

property lastUpdatedDate

lastUpdatedDate?: pulumi.Input<string>;

The last update date of the virtual node.

property meshName

meshName?: pulumi.Input<string>;

The name of the service mesh in which to create the virtual node.

property name

name?: pulumi.Input<string>;

The name to use for the virtual node.

property spec

spec?: pulumi.Input<{
    backends: pulumi.Input<pulumi.Input<{
        virtualService: pulumi.Input<{
            virtualServiceName: pulumi.Input<string>;
        }>;
    }>[]>;
    listener: pulumi.Input<{
        healthCheck: pulumi.Input<{
            healthyThreshold: pulumi.Input<number>;
            intervalMillis: pulumi.Input<number>;
            path: pulumi.Input<string>;
            port: pulumi.Input<number>;
            protocol: pulumi.Input<string>;
            timeoutMillis: pulumi.Input<number>;
            unhealthyThreshold: pulumi.Input<number>;
        }>;
        portMapping: pulumi.Input<{
            port: pulumi.Input<number>;
            protocol: pulumi.Input<string>;
        }>;
    }>;
    logging: pulumi.Input<{
        accessLog: pulumi.Input<{
            file: pulumi.Input<{
                path: pulumi.Input<string>;
            }>;
        }>;
    }>;
    serviceDiscovery: pulumi.Input<{
        dns: pulumi.Input<{
            hostname: pulumi.Input<string>;
        }>;
    }>;
}>;

The virtual node specification to apply.

interface VirtualRouterArgs

The set of arguments for constructing a VirtualRouter resource.

property meshName

meshName: pulumi.Input<string>;

The name of the service mesh in which to create the virtual router.

property name

name?: pulumi.Input<string>;

The name to use for the virtual router.

property spec

spec: pulumi.Input<{
    listener: pulumi.Input<{
        portMapping: pulumi.Input<{
            port: pulumi.Input<number>;
            protocol: pulumi.Input<string>;
        }>;
    }>;
}>;

The virtual router specification to apply.

interface VirtualRouterState

Input properties used for looking up and filtering VirtualRouter resources.

property arn

arn?: pulumi.Input<string>;

The ARN of the virtual router.

property createdDate

createdDate?: pulumi.Input<string>;

The creation date of the virtual router.

property lastUpdatedDate

lastUpdatedDate?: pulumi.Input<string>;

The last update date of the virtual router.

property meshName

meshName?: pulumi.Input<string>;

The name of the service mesh in which to create the virtual router.

property name

name?: pulumi.Input<string>;

The name to use for the virtual router.

property spec

spec?: pulumi.Input<{
    listener: pulumi.Input<{
        portMapping: pulumi.Input<{
            port: pulumi.Input<number>;
            protocol: pulumi.Input<string>;
        }>;
    }>;
}>;

The virtual router specification to apply.

interface VirtualServiceArgs

The set of arguments for constructing a VirtualService resource.

property meshName

meshName: pulumi.Input<string>;

The name of the service mesh in which to create the virtual service.

property name

name?: pulumi.Input<string>;

The name to use for the virtual service.

property spec

spec: pulumi.Input<{
    provider: pulumi.Input<{
        virtualNode: pulumi.Input<{
            virtualNodeName: pulumi.Input<string>;
        }>;
        virtualRouter: pulumi.Input<{
            virtualRouterName: pulumi.Input<string>;
        }>;
    }>;
}>;

The virtual service specification to apply.

interface VirtualServiceState

Input properties used for looking up and filtering VirtualService resources.

property arn

arn?: pulumi.Input<string>;

The ARN of the virtual service.

property createdDate

createdDate?: pulumi.Input<string>;

The creation date of the virtual service.

property lastUpdatedDate

lastUpdatedDate?: pulumi.Input<string>;

The last update date of the virtual service.

property meshName

meshName?: pulumi.Input<string>;

The name of the service mesh in which to create the virtual service.

property name

name?: pulumi.Input<string>;

The name to use for the virtual service.

property spec

spec?: pulumi.Input<{
    provider: pulumi.Input<{
        virtualNode: pulumi.Input<{
            virtualNodeName: pulumi.Input<string>;
        }>;
        virtualRouter: pulumi.Input<{
            virtualRouterName: pulumi.Input<string>;
        }>;
    }>;
}>;

The virtual service specification to apply.