VirtualGateway class
Provides an AWS App Mesh virtual gateway resource.
Example Usage
Basic
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.appmesh.VirtualGateway("example", {
spec: {
listeners: [{
portMapping: {
port: 8080,
protocol: "http",
},
}],
},
name: "example-virtual-gateway",
meshName: "example-service-mesh",
tags: {
Environment: "test",
},
});
import pulumi
import pulumi_aws as aws
example = aws.appmesh.VirtualGateway("example",
spec={
"listeners": [{
"port_mapping": {
"port": 8080,
"protocol": "http",
},
}],
},
name="example-virtual-gateway",
mesh_name="example-service-mesh",
tags={
"Environment": "test",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.AppMesh.VirtualGateway("example", new()
{
Spec = new Aws.AppMesh.Inputs.VirtualGatewaySpecArgs
{
Listeners = new[]
{
new Aws.AppMesh.Inputs.VirtualGatewaySpecListenerArgs
{
PortMapping = new Aws.AppMesh.Inputs.VirtualGatewaySpecListenerPortMappingArgs
{
Port = 8080,
Protocol = "http",
},
},
},
},
Name = "example-virtual-gateway",
MeshName = "example-service-mesh",
Tags =
{
{ "Environment", "test" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/appmesh"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := appmesh.NewVirtualGateway(ctx, "example", &appmesh.VirtualGatewayArgs{
Spec: &appmesh.VirtualGatewaySpecArgs{
Listeners: appmesh.VirtualGatewaySpecListenerArray{
&appmesh.VirtualGatewaySpecListenerArgs{
PortMapping: &appmesh.VirtualGatewaySpecListenerPortMappingArgs{
Port: pulumi.Int(8080),
Protocol: pulumi.String("http"),
},
},
},
},
Name: pulumi.String("example-virtual-gateway"),
MeshName: pulumi.String("example-service-mesh"),
Tags: pulumi.StringMap{
"Environment": pulumi.String("test"),
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_appmesh_virtualgateway" "example" {
spec = {
listeners = [{
"portMapping" = {
"port" = 8080
"protocol" = "http"
}
}]
}
name = "example-virtual-gateway"
mesh_name = "example-service-mesh"
tags = {
"Environment" = "test"
}
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.appmesh.VirtualGateway;
import com.pulumi.aws.appmesh.VirtualGatewayArgs;
import com.pulumi.aws.appmesh.inputs.VirtualGatewaySpecArgs;
import com.pulumi.aws.appmesh.inputs.VirtualGatewaySpecListenerArgs;
import com.pulumi.aws.appmesh.inputs.VirtualGatewaySpecListenerPortMappingArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new VirtualGateway("example", VirtualGatewayArgs.builder()
.spec(VirtualGatewaySpecArgs.builder()
.listeners(VirtualGatewaySpecListenerArgs.builder()
.portMapping(VirtualGatewaySpecListenerPortMappingArgs.builder()
.port(8080)
.protocol("http")
.build())
.build())
.build())
.name("example-virtual-gateway")
.meshName("example-service-mesh")
.tags(Map.of("Environment", "test"))
.build());
}
}
resources:
example:
type: aws:appmesh:VirtualGateway
properties:
spec:
listeners:
- portMapping:
port: 8080
protocol: http
name: example-virtual-gateway
meshName: example-service-mesh
tags:
Environment: test
Access Logs and TLS
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.appmesh.VirtualGateway("example", {
spec: {
logging: {
accessLog: {
file: {
path: "/var/log/access.log",
},
},
},
listeners: [{
portMapping: {
port: 8080,
protocol: "http",
},
tls: {
certificate: {
acm: {
certificateArn: exampleAwsAcmCertificate.arn,
},
},
mode: "STRICT",
},
}],
},
name: "example-virtual-gateway",
meshName: "example-service-mesh",
});
import pulumi
import pulumi_aws as aws
example = aws.appmesh.VirtualGateway("example",
spec={
"logging": {
"access_log": {
"file": {
"path": "/var/log/access.log",
},
},
},
"listeners": [{
"port_mapping": {
"port": 8080,
"protocol": "http",
},
"tls": {
"certificate": {
"acm": {
"certificate_arn": example_aws_acm_certificate["arn"],
},
},
"mode": "STRICT",
},
}],
},
name="example-virtual-gateway",
mesh_name="example-service-mesh")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.AppMesh.VirtualGateway("example", new()
{
Spec = new Aws.AppMesh.Inputs.VirtualGatewaySpecArgs
{
Logging = new Aws.AppMesh.Inputs.VirtualGatewaySpecLoggingArgs
{
AccessLog = new Aws.AppMesh.Inputs.VirtualGatewaySpecLoggingAccessLogArgs
{
File = new Aws.AppMesh.Inputs.VirtualGatewaySpecLoggingAccessLogFileArgs
{
Path = "/var/log/access.log",
},
},
},
Listeners = new[]
{
new Aws.AppMesh.Inputs.VirtualGatewaySpecListenerArgs
{
PortMapping = new Aws.AppMesh.Inputs.VirtualGatewaySpecListenerPortMappingArgs
{
Port = 8080,
Protocol = "http",
},
Tls = new Aws.AppMesh.Inputs.VirtualGatewaySpecListenerTlsArgs
{
Certificate = new Aws.AppMesh.Inputs.VirtualGatewaySpecListenerTlsCertificateArgs
{
Acm = new Aws.AppMesh.Inputs.VirtualGatewaySpecListenerTlsCertificateAcmArgs
{
CertificateArn = exampleAwsAcmCertificate.Arn,
},
},
Mode = "STRICT",
},
},
},
},
Name = "example-virtual-gateway",
MeshName = "example-service-mesh",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/appmesh"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := appmesh.NewVirtualGateway(ctx, "example", &appmesh.VirtualGatewayArgs{
Spec: &appmesh.VirtualGatewaySpecArgs{
Logging: &appmesh.VirtualGatewaySpecLoggingArgs{
AccessLog: &appmesh.VirtualGatewaySpecLoggingAccessLogArgs{
File: &appmesh.VirtualGatewaySpecLoggingAccessLogFileArgs{
Path: pulumi.String("/var/log/access.log"),
},
},
},
Listeners: appmesh.VirtualGatewaySpecListenerArray{
&appmesh.VirtualGatewaySpecListenerArgs{
PortMapping: &appmesh.VirtualGatewaySpecListenerPortMappingArgs{
Port: pulumi.Int(8080),
Protocol: pulumi.String("http"),
},
Tls: &appmesh.VirtualGatewaySpecListenerTlsArgs{
Certificate: &appmesh.VirtualGatewaySpecListenerTlsCertificateArgs{
Acm: &appmesh.VirtualGatewaySpecListenerTlsCertificateAcmArgs{
CertificateArn: pulumi.Any(exampleAwsAcmCertificate.Arn),
},
},
Mode: pulumi.String("STRICT"),
},
},
},
},
Name: pulumi.String("example-virtual-gateway"),
MeshName: pulumi.String("example-service-mesh"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_appmesh_virtualgateway" "example" {
spec = {
logging = {
access_log = {
file = {
path = "/var/log/access.log"
}
}
}
listeners = [{
"portMapping" = {
"port" = 8080
"protocol" = "http"
}
"tls" = {
"certificate" = {
"acm" = {
"certificateArn" = exampleAwsAcmCertificate.arn
}
}
"mode" = "STRICT"
}
}]
}
name = "example-virtual-gateway"
mesh_name = "example-service-mesh"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.appmesh.VirtualGateway;
import com.pulumi.aws.appmesh.VirtualGatewayArgs;
import com.pulumi.aws.appmesh.inputs.VirtualGatewaySpecArgs;
import com.pulumi.aws.appmesh.inputs.VirtualGatewaySpecLoggingArgs;
import com.pulumi.aws.appmesh.inputs.VirtualGatewaySpecLoggingAccessLogArgs;
import com.pulumi.aws.appmesh.inputs.VirtualGatewaySpecLoggingAccessLogFileArgs;
import com.pulumi.aws.appmesh.inputs.VirtualGatewaySpecListenerArgs;
import com.pulumi.aws.appmesh.inputs.VirtualGatewaySpecListenerPortMappingArgs;
import com.pulumi.aws.appmesh.inputs.VirtualGatewaySpecListenerTlsArgs;
import com.pulumi.aws.appmesh.inputs.VirtualGatewaySpecListenerTlsCertificateArgs;
import com.pulumi.aws.appmesh.inputs.VirtualGatewaySpecListenerTlsCertificateAcmArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new VirtualGateway("example", VirtualGatewayArgs.builder()
.spec(VirtualGatewaySpecArgs.builder()
.logging(VirtualGatewaySpecLoggingArgs.builder()
.accessLog(VirtualGatewaySpecLoggingAccessLogArgs.builder()
.file(VirtualGatewaySpecLoggingAccessLogFileArgs.builder()
.path("/var/log/access.log")
.build())
.build())
.build())
.listeners(VirtualGatewaySpecListenerArgs.builder()
.portMapping(VirtualGatewaySpecListenerPortMappingArgs.builder()
.port(8080)
.protocol("http")
.build())
.tls(VirtualGatewaySpecListenerTlsArgs.builder()
.certificate(VirtualGatewaySpecListenerTlsCertificateArgs.builder()
.acm(VirtualGatewaySpecListenerTlsCertificateAcmArgs.builder()
.certificateArn(exampleAwsAcmCertificate.arn())
.build())
.build())
.mode("STRICT")
.build())
.build())
.build())
.name("example-virtual-gateway")
.meshName("example-service-mesh")
.build());
}
}
resources:
example:
type: aws:appmesh:VirtualGateway
properties:
spec:
logging:
accessLog:
file:
path: /var/log/access.log
listeners:
- portMapping:
port: 8080
protocol: http
tls:
certificate:
acm:
certificateArn: ${exampleAwsAcmCertificate.arn}
mode: STRICT
name: example-virtual-gateway
meshName: example-service-mesh
Import
Using pulumi import, import App Mesh virtual gateway using meshName together with the virtual gateway's name. For example:
$ pulumi import aws:appmesh/virtualGateway:VirtualGateway example mesh/gw1
Constructors
- VirtualGateway(String name, {VirtualGatewayArgs? args, CustomResourceOptions? options})
-
Creates a new VirtualGateway.
nameThe Pulumi resource name.argsArguments used to configure this VirtualGateway. The set of arguments for VirtualGateway.optionsResource options controlling this resource's behavior. - VirtualGateway.reference(String urn)
- Creates a typed reference to an existing VirtualGateway resource.
Properties
-
arn
↔ Output<
String> -
ARN of the virtual gateway.
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
createdDate
↔ Output<
String> -
Creation date of the virtual gateway.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
lastUpdatedDate
↔ Output<
String> -
Last update date of the virtual gateway.
latefinal
-
meshName
↔ Output<
String> -
Name of the service mesh in which to create the virtual gateway. Must be between 1 and 255 characters in length.
latefinal
-
meshOwner
↔ Output<
String> -
AWS account ID of the service mesh's owner. Defaults to the account ID the AWS provider is currently connected to.
latefinal
-
name
↔ Output<
String> -
Name to use for the virtual gateway. Must be between 1 and 255 characters in length.
latefinal
-
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceOwner
↔ Output<
String> -
Resource owner's AWS account ID.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
spec
↔ Output<
VirtualGatewaySpec> -
Virtual gateway specification to apply.
latefinal
-
Map of tags to assign to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.latefinal -
Map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block.latefinal -
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {VirtualGatewayState? state, CustomResourceOptions? options}) → VirtualGateway -
Gets an existing VirtualGateway resource's state with the given
nameandid.