Class VirtualNode
Provides an AWS App Mesh virtual node resource.
Breaking Changes
Because of backward incompatible API changes (read here), aws.appmesh.VirtualNode resource definitions created with provider versions earlier than v2.3.0 will need to be modified:
Rename the
service_nameattribute of thednsobject tohostname.Replace the
backendsattribute of thespecobject with one or morebackendconfiguration blocks, settingvirtual_service_nameto the name of the service.
The state associated with existing resources will automatically be migrated.
Example Usage
Basic
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var serviceb1 = new Aws.AppMesh.VirtualNode("serviceb1", new Aws.AppMesh.VirtualNodeArgs
{
MeshName = aws_appmesh_mesh.Simple.Id,
Spec = new Aws.AppMesh.Inputs.VirtualNodeSpecArgs
{
Backend =
{
{
{ "virtualService",
{
{ "virtualServiceName", "servicea.simpleapp.local" },
} },
},
},
Listener = new Aws.AppMesh.Inputs.VirtualNodeSpecListenerArgs
{
PortMapping = new Aws.AppMesh.Inputs.VirtualNodeSpecListenerPortMappingArgs
{
Port = 8080,
Protocol = "http",
},
},
ServiceDiscovery = new Aws.AppMesh.Inputs.VirtualNodeSpecServiceDiscoveryArgs
{
Dns = new Aws.AppMesh.Inputs.VirtualNodeSpecServiceDiscoveryDnsArgs
{
Hostname = "serviceb.simpleapp.local",
},
},
},
});
}
}
AWS Cloud Map Service Discovery
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.ServiceDiscovery.HttpNamespace("example", new Aws.ServiceDiscovery.HttpNamespaceArgs
{
});
var serviceb1 = new Aws.AppMesh.VirtualNode("serviceb1", new Aws.AppMesh.VirtualNodeArgs
{
MeshName = aws_appmesh_mesh.Simple.Id,
Spec = new Aws.AppMesh.Inputs.VirtualNodeSpecArgs
{
Backend =
{
{
{ "virtualService",
{
{ "virtualServiceName", "servicea.simpleapp.local" },
} },
},
},
Listener = new Aws.AppMesh.Inputs.VirtualNodeSpecListenerArgs
{
PortMapping = new Aws.AppMesh.Inputs.VirtualNodeSpecListenerPortMappingArgs
{
Port = 8080,
Protocol = "http",
},
},
ServiceDiscovery = new Aws.AppMesh.Inputs.VirtualNodeSpecServiceDiscoveryArgs
{
AwsCloudMap = new Aws.AppMesh.Inputs.VirtualNodeSpecServiceDiscoveryAwsCloudMapArgs
{
Attributes =
{
{ "stack", "blue" },
},
NamespaceName = example.Name,
ServiceName = "serviceb1",
},
},
},
});
}
}
Listener Health Check
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var serviceb1 = new Aws.AppMesh.VirtualNode("serviceb1", new Aws.AppMesh.VirtualNodeArgs
{
MeshName = aws_appmesh_mesh.Simple.Id,
Spec = new Aws.AppMesh.Inputs.VirtualNodeSpecArgs
{
Backend =
{
{
{ "virtualService",
{
{ "virtualServiceName", "servicea.simpleapp.local" },
} },
},
},
Listener = new Aws.AppMesh.Inputs.VirtualNodeSpecListenerArgs
{
HealthCheck = new Aws.AppMesh.Inputs.VirtualNodeSpecListenerHealthCheckArgs
{
HealthyThreshold = 2,
IntervalMillis = 5000,
Path = "/ping",
Protocol = "http",
TimeoutMillis = 2000,
UnhealthyThreshold = 2,
},
PortMapping = new Aws.AppMesh.Inputs.VirtualNodeSpecListenerPortMappingArgs
{
Port = 8080,
Protocol = "http",
},
},
ServiceDiscovery = new Aws.AppMesh.Inputs.VirtualNodeSpecServiceDiscoveryArgs
{
Dns = new Aws.AppMesh.Inputs.VirtualNodeSpecServiceDiscoveryDnsArgs
{
Hostname = "serviceb.simpleapp.local",
},
},
},
});
}
}
Logging
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var serviceb1 = new Aws.AppMesh.VirtualNode("serviceb1", new Aws.AppMesh.VirtualNodeArgs
{
MeshName = aws_appmesh_mesh.Simple.Id,
Spec = new Aws.AppMesh.Inputs.VirtualNodeSpecArgs
{
Backend =
{
{
{ "virtualService",
{
{ "virtualServiceName", "servicea.simpleapp.local" },
} },
},
},
Listener = new Aws.AppMesh.Inputs.VirtualNodeSpecListenerArgs
{
PortMapping = new Aws.AppMesh.Inputs.VirtualNodeSpecListenerPortMappingArgs
{
Port = 8080,
Protocol = "http",
},
},
Logging = new Aws.AppMesh.Inputs.VirtualNodeSpecLoggingArgs
{
AccessLog = new Aws.AppMesh.Inputs.VirtualNodeSpecLoggingAccessLogArgs
{
File = new Aws.AppMesh.Inputs.VirtualNodeSpecLoggingAccessLogFileArgs
{
Path = "/dev/stdout",
},
},
},
ServiceDiscovery = new Aws.AppMesh.Inputs.VirtualNodeSpecServiceDiscoveryArgs
{
Dns = new Aws.AppMesh.Inputs.VirtualNodeSpecServiceDiscoveryDnsArgs
{
Hostname = "serviceb.simpleapp.local",
},
},
},
});
}
}
Inherited Members
Namespace: Pulumi.Aws.AppMesh
Assembly: Pulumi.Aws.dll
Syntax
public class VirtualNode : CustomResource
Constructors
View SourceVirtualNode(String, VirtualNodeArgs, CustomResourceOptions)
Create a VirtualNode resource with the given unique name, arguments, and options.
Declaration
public VirtualNode(string name, VirtualNodeArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| VirtualNodeArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceArn
The ARN of the virtual node.
Declaration
public Output<string> Arn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CreatedDate
The creation date of the virtual node.
Declaration
public Output<string> CreatedDate { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
LastUpdatedDate
The last update date of the virtual node.
Declaration
public Output<string> LastUpdatedDate { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
MeshName
The name of the service mesh in which to create the virtual node.
Declaration
public Output<string> MeshName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
The name to use for the virtual node.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Spec
The virtual node specification to apply.
Declaration
public Output<VirtualNodeSpec> Spec { get; }
Property Value
| Type | Description |
|---|---|
| Output<VirtualNodeSpec> |
Tags
A map of tags to assign to the resource.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
Methods
View SourceGet(String, Input<String>, VirtualNodeState, CustomResourceOptions)
Get an existing VirtualNode resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static VirtualNode Get(string name, Input<string> id, VirtualNodeState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| VirtualNodeState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| VirtualNode |