aws.appmesh.VirtualRouter
Explore with Pulumi AI
Provides an AWS App Mesh virtual router resource.
Breaking Changes
Because of backward incompatible API changes (read here and here), aws.appmesh.VirtualRouter
resource definitions created with provider versions earlier than v2.3.0 will need to be modified:
Remove service
service_names
from thespec
argument. AWS has created aaws.appmesh.VirtualService
resource for each service name. Import these resource usingpulumi import
.Add a
listener
configuration block to thespec
argument.
The 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", {
name: "serviceB",
meshName: simple.id,
spec: {
listeners: [{
portMapping: {
port: 8080,
protocol: "http",
},
}],
},
});
import pulumi
import pulumi_aws as aws
serviceb = aws.appmesh.VirtualRouter("serviceb",
name="serviceB",
mesh_name=simple["id"],
spec={
"listeners": [{
"port_mapping": {
"port": 8080,
"protocol": "http",
},
}],
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appmesh"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := appmesh.NewVirtualRouter(ctx, "serviceb", &appmesh.VirtualRouterArgs{
Name: pulumi.String("serviceB"),
MeshName: pulumi.Any(simple.Id),
Spec: &appmesh.VirtualRouterSpecArgs{
Listeners: appmesh.VirtualRouterSpecListenerArray{
&appmesh.VirtualRouterSpecListenerArgs{
PortMapping: &appmesh.VirtualRouterSpecListenerPortMappingArgs{
Port: pulumi.Int(8080),
Protocol: pulumi.String("http"),
},
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var serviceb = new Aws.AppMesh.VirtualRouter("serviceb", new()
{
Name = "serviceB",
MeshName = simple.Id,
Spec = new Aws.AppMesh.Inputs.VirtualRouterSpecArgs
{
Listeners = new[]
{
new Aws.AppMesh.Inputs.VirtualRouterSpecListenerArgs
{
PortMapping = new Aws.AppMesh.Inputs.VirtualRouterSpecListenerPortMappingArgs
{
Port = 8080,
Protocol = "http",
},
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.appmesh.VirtualRouter;
import com.pulumi.aws.appmesh.VirtualRouterArgs;
import com.pulumi.aws.appmesh.inputs.VirtualRouterSpecArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var serviceb = new VirtualRouter("serviceb", VirtualRouterArgs.builder()
.name("serviceB")
.meshName(simple.id())
.spec(VirtualRouterSpecArgs.builder()
.listeners(VirtualRouterSpecListenerArgs.builder()
.portMapping(VirtualRouterSpecListenerPortMappingArgs.builder()
.port(8080)
.protocol("http")
.build())
.build())
.build())
.build());
}
}
resources:
serviceb:
type: aws:appmesh:VirtualRouter
properties:
name: serviceB
meshName: ${simple.id}
spec:
listeners:
- portMapping:
port: 8080
protocol: http
Create VirtualRouter Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VirtualRouter(name: string, args: VirtualRouterArgs, opts?: CustomResourceOptions);
@overload
def VirtualRouter(resource_name: str,
args: VirtualRouterArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VirtualRouter(resource_name: str,
opts: Optional[ResourceOptions] = None,
mesh_name: Optional[str] = None,
spec: Optional[VirtualRouterSpecArgs] = None,
mesh_owner: Optional[str] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewVirtualRouter(ctx *Context, name string, args VirtualRouterArgs, opts ...ResourceOption) (*VirtualRouter, error)
public VirtualRouter(string name, VirtualRouterArgs args, CustomResourceOptions? opts = null)
public VirtualRouter(String name, VirtualRouterArgs args)
public VirtualRouter(String name, VirtualRouterArgs args, CustomResourceOptions options)
type: aws:appmesh:VirtualRouter
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args VirtualRouterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VirtualRouterArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VirtualRouterArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VirtualRouterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VirtualRouterArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var virtualRouterResource = new Aws.AppMesh.VirtualRouter("virtualRouterResource", new()
{
MeshName = "string",
Spec = new Aws.AppMesh.Inputs.VirtualRouterSpecArgs
{
Listeners = new[]
{
new Aws.AppMesh.Inputs.VirtualRouterSpecListenerArgs
{
PortMapping = new Aws.AppMesh.Inputs.VirtualRouterSpecListenerPortMappingArgs
{
Port = 0,
Protocol = "string",
},
},
},
},
MeshOwner = "string",
Name = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := appmesh.NewVirtualRouter(ctx, "virtualRouterResource", &appmesh.VirtualRouterArgs{
MeshName: pulumi.String("string"),
Spec: &appmesh.VirtualRouterSpecArgs{
Listeners: appmesh.VirtualRouterSpecListenerArray{
&appmesh.VirtualRouterSpecListenerArgs{
PortMapping: &appmesh.VirtualRouterSpecListenerPortMappingArgs{
Port: pulumi.Int(0),
Protocol: pulumi.String("string"),
},
},
},
},
MeshOwner: pulumi.String("string"),
Name: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var virtualRouterResource = new VirtualRouter("virtualRouterResource", VirtualRouterArgs.builder()
.meshName("string")
.spec(VirtualRouterSpecArgs.builder()
.listeners(VirtualRouterSpecListenerArgs.builder()
.portMapping(VirtualRouterSpecListenerPortMappingArgs.builder()
.port(0)
.protocol("string")
.build())
.build())
.build())
.meshOwner("string")
.name("string")
.tags(Map.of("string", "string"))
.build());
virtual_router_resource = aws.appmesh.VirtualRouter("virtualRouterResource",
mesh_name="string",
spec={
"listeners": [{
"port_mapping": {
"port": 0,
"protocol": "string",
},
}],
},
mesh_owner="string",
name="string",
tags={
"string": "string",
})
const virtualRouterResource = new aws.appmesh.VirtualRouter("virtualRouterResource", {
meshName: "string",
spec: {
listeners: [{
portMapping: {
port: 0,
protocol: "string",
},
}],
},
meshOwner: "string",
name: "string",
tags: {
string: "string",
},
});
type: aws:appmesh:VirtualRouter
properties:
meshName: string
meshOwner: string
name: string
spec:
listeners:
- portMapping:
port: 0
protocol: string
tags:
string: string
VirtualRouter Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The VirtualRouter resource accepts the following input properties:
- Mesh
Name string - Name of the service mesh in which to create the virtual router. Must be between 1 and 255 characters in length.
- Spec
Virtual
Router Spec - Virtual router specification to apply.
- Mesh
Owner string - AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
- Name string
- Name to use for the virtual router. Must be between 1 and 255 characters in length.
- Dictionary<string, string>
- Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Mesh
Name string - Name of the service mesh in which to create the virtual router. Must be between 1 and 255 characters in length.
- Spec
Virtual
Router Spec Args - Virtual router specification to apply.
- Mesh
Owner string - AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
- Name string
- Name to use for the virtual router. Must be between 1 and 255 characters in length.
- map[string]string
- Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- mesh
Name String - Name of the service mesh in which to create the virtual router. Must be between 1 and 255 characters in length.
- spec
Virtual
Router Spec - Virtual router specification to apply.
- mesh
Owner String - AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
- name String
- Name to use for the virtual router. Must be between 1 and 255 characters in length.
- Map<String,String>
- Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- mesh
Name string - Name of the service mesh in which to create the virtual router. Must be between 1 and 255 characters in length.
- spec
Virtual
Router Spec - Virtual router specification to apply.
- mesh
Owner string - AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
- name string
- Name to use for the virtual router. Must be between 1 and 255 characters in length.
- {[key: string]: string}
- Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- mesh_
name str - Name of the service mesh in which to create the virtual router. Must be between 1 and 255 characters in length.
- spec
Virtual
Router Spec Args - Virtual router specification to apply.
- mesh_
owner str - AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
- name str
- Name to use for the virtual router. Must be between 1 and 255 characters in length.
- Mapping[str, str]
- Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- mesh
Name String - Name of the service mesh in which to create the virtual router. Must be between 1 and 255 characters in length.
- spec Property Map
- Virtual router specification to apply.
- mesh
Owner String - AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
- name String
- Name to use for the virtual router. Must be between 1 and 255 characters in length.
- Map<String>
- Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the VirtualRouter resource produces the following output properties:
- Arn string
- ARN of the virtual router.
- Created
Date string - Creation date of the virtual router.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated stringDate - Last update date of the virtual router.
- Resource
Owner string - Resource owner's AWS account ID.
- Dictionary<string, string>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- ARN of the virtual router.
- Created
Date string - Creation date of the virtual router.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated stringDate - Last update date of the virtual router.
- Resource
Owner string - Resource owner's AWS account ID.
- map[string]string
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- ARN of the virtual router.
- created
Date String - Creation date of the virtual router.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated StringDate - Last update date of the virtual router.
- resource
Owner String - Resource owner's AWS account ID.
- Map<String,String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- ARN of the virtual router.
- created
Date string - Creation date of the virtual router.
- id string
- The provider-assigned unique ID for this managed resource.
- last
Updated stringDate - Last update date of the virtual router.
- resource
Owner string - Resource owner's AWS account ID.
- {[key: string]: string}
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
- ARN of the virtual router.
- created_
date str - Creation date of the virtual router.
- id str
- The provider-assigned unique ID for this managed resource.
- last_
updated_ strdate - Last update date of the virtual router.
- resource_
owner str - Resource owner's AWS account ID.
- Mapping[str, str]
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- ARN of the virtual router.
- created
Date String - Creation date of the virtual router.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated StringDate - Last update date of the virtual router.
- resource
Owner String - Resource owner's AWS account ID.
- Map<String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Look up Existing VirtualRouter Resource
Get an existing VirtualRouter resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: VirtualRouterState, opts?: CustomResourceOptions): VirtualRouter
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
created_date: Optional[str] = None,
last_updated_date: Optional[str] = None,
mesh_name: Optional[str] = None,
mesh_owner: Optional[str] = None,
name: Optional[str] = None,
resource_owner: Optional[str] = None,
spec: Optional[VirtualRouterSpecArgs] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> VirtualRouter
func GetVirtualRouter(ctx *Context, name string, id IDInput, state *VirtualRouterState, opts ...ResourceOption) (*VirtualRouter, error)
public static VirtualRouter Get(string name, Input<string> id, VirtualRouterState? state, CustomResourceOptions? opts = null)
public static VirtualRouter get(String name, Output<String> id, VirtualRouterState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
- ARN of the virtual router.
- Created
Date string - Creation date of the virtual router.
- Last
Updated stringDate - Last update date of the virtual router.
- Mesh
Name string - Name of the service mesh in which to create the virtual router. Must be between 1 and 255 characters in length.
- Mesh
Owner string - AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
- Name string
- Name to use for the virtual router. Must be between 1 and 255 characters in length.
- Resource
Owner string - Resource owner's AWS account ID.
- Spec
Virtual
Router Spec - Virtual router specification to apply.
- Dictionary<string, string>
- Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- ARN of the virtual router.
- Created
Date string - Creation date of the virtual router.
- Last
Updated stringDate - Last update date of the virtual router.
- Mesh
Name string - Name of the service mesh in which to create the virtual router. Must be between 1 and 255 characters in length.
- Mesh
Owner string - AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
- Name string
- Name to use for the virtual router. Must be between 1 and 255 characters in length.
- Resource
Owner string - Resource owner's AWS account ID.
- Spec
Virtual
Router Spec Args - Virtual router specification to apply.
- map[string]string
- Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- ARN of the virtual router.
- created
Date String - Creation date of the virtual router.
- last
Updated StringDate - Last update date of the virtual router.
- mesh
Name String - Name of the service mesh in which to create the virtual router. Must be between 1 and 255 characters in length.
- mesh
Owner String - AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
- name String
- Name to use for the virtual router. Must be between 1 and 255 characters in length.
- resource
Owner String - Resource owner's AWS account ID.
- spec
Virtual
Router Spec - Virtual router specification to apply.
- Map<String,String>
- Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- ARN of the virtual router.
- created
Date string - Creation date of the virtual router.
- last
Updated stringDate - Last update date of the virtual router.
- mesh
Name string - Name of the service mesh in which to create the virtual router. Must be between 1 and 255 characters in length.
- mesh
Owner string - AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
- name string
- Name to use for the virtual router. Must be between 1 and 255 characters in length.
- resource
Owner string - Resource owner's AWS account ID.
- spec
Virtual
Router Spec - Virtual router specification to apply.
- {[key: string]: string}
- Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
- ARN of the virtual router.
- created_
date str - Creation date of the virtual router.
- last_
updated_ strdate - Last update date of the virtual router.
- mesh_
name str - Name of the service mesh in which to create the virtual router. Must be between 1 and 255 characters in length.
- mesh_
owner str - AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
- name str
- Name to use for the virtual router. Must be between 1 and 255 characters in length.
- resource_
owner str - Resource owner's AWS account ID.
- spec
Virtual
Router Spec Args - Virtual router specification to apply.
- Mapping[str, str]
- Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- ARN of the virtual router.
- created
Date String - Creation date of the virtual router.
- last
Updated StringDate - Last update date of the virtual router.
- mesh
Name String - Name of the service mesh in which to create the virtual router. Must be between 1 and 255 characters in length.
- mesh
Owner String - AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
- name String
- Name to use for the virtual router. Must be between 1 and 255 characters in length.
- resource
Owner String - Resource owner's AWS account ID.
- spec Property Map
- Virtual router specification to apply.
- Map<String>
- Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Supporting Types
VirtualRouterSpec, VirtualRouterSpecArgs
- Listeners
List<Virtual
Router Spec Listener> - Listeners that the virtual router is expected to receive inbound traffic from. Currently only one listener is supported per virtual router.
- Listeners
[]Virtual
Router Spec Listener - Listeners that the virtual router is expected to receive inbound traffic from. Currently only one listener is supported per virtual router.
- listeners
List<Virtual
Router Spec Listener> - Listeners that the virtual router is expected to receive inbound traffic from. Currently only one listener is supported per virtual router.
- listeners
Virtual
Router Spec Listener[] - Listeners that the virtual router is expected to receive inbound traffic from. Currently only one listener is supported per virtual router.
- listeners
Sequence[Virtual
Router Spec Listener] - Listeners that the virtual router is expected to receive inbound traffic from. Currently only one listener is supported per virtual router.
- listeners List<Property Map>
- Listeners that the virtual router is expected to receive inbound traffic from. Currently only one listener is supported per virtual router.
VirtualRouterSpecListener, VirtualRouterSpecListenerArgs
- Port
Mapping VirtualRouter Spec Listener Port Mapping - Port mapping information for the listener.
- Port
Mapping VirtualRouter Spec Listener Port Mapping - Port mapping information for the listener.
- port
Mapping VirtualRouter Spec Listener Port Mapping - Port mapping information for the listener.
- port
Mapping VirtualRouter Spec Listener Port Mapping - Port mapping information for the listener.
- port_
mapping VirtualRouter Spec Listener Port Mapping - Port mapping information for the listener.
- port
Mapping Property Map - Port mapping information for the listener.
VirtualRouterSpecListenerPortMapping, VirtualRouterSpecListenerPortMappingArgs
Import
Using pulumi import
, import App Mesh virtual routers using mesh_name
together with the virtual router’s name
. For example:
$ pulumi import aws:appmesh/virtualRouter:VirtualRouter serviceb simpleapp/serviceB
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.