AWS v6.71.0 published on Friday, Mar 7, 2025 by Pulumi
aws.appmesh.getVirtualService
Explore with Pulumi AI
The App Mesh Virtual Service data source allows details of an App Mesh Virtual Service to be retrieved by its name, mesh_name, and optionally the mesh_owner.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = aws.appmesh.getVirtualService({
    name: "example.mesh.local",
    meshName: "example-mesh",
});
import pulumi
import pulumi_aws as aws
test = aws.appmesh.get_virtual_service(name="example.mesh.local",
    mesh_name="example-mesh")
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.LookupVirtualService(ctx, &appmesh.LookupVirtualServiceArgs{
			Name:     "example.mesh.local",
			MeshName: "example-mesh",
		}, nil)
		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 test = Aws.AppMesh.GetVirtualService.Invoke(new()
    {
        Name = "example.mesh.local",
        MeshName = "example-mesh",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.appmesh.AppmeshFunctions;
import com.pulumi.aws.appmesh.inputs.GetVirtualServiceArgs;
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) {
        final var test = AppmeshFunctions.getVirtualService(GetVirtualServiceArgs.builder()
            .name("example.mesh.local")
            .meshName("example-mesh")
            .build());
    }
}
variables:
  test:
    fn::invoke:
      function: aws:appmesh:getVirtualService
      arguments:
        name: example.mesh.local
        meshName: example-mesh
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const current = aws.getCallerIdentity({});
const test = current.then(current => aws.appmesh.getVirtualService({
    name: "example.mesh.local",
    meshName: "example-mesh",
    meshOwner: current.accountId,
}));
import pulumi
import pulumi_aws as aws
current = aws.get_caller_identity()
test = aws.appmesh.get_virtual_service(name="example.mesh.local",
    mesh_name="example-mesh",
    mesh_owner=current.account_id)
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
	"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 {
		current, err := aws.GetCallerIdentity(ctx, &aws.GetCallerIdentityArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = appmesh.LookupVirtualService(ctx, &appmesh.LookupVirtualServiceArgs{
			Name:      "example.mesh.local",
			MeshName:  "example-mesh",
			MeshOwner: pulumi.StringRef(current.AccountId),
		}, nil)
		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 current = Aws.GetCallerIdentity.Invoke();
    var test = Aws.AppMesh.GetVirtualService.Invoke(new()
    {
        Name = "example.mesh.local",
        MeshName = "example-mesh",
        MeshOwner = current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetCallerIdentityArgs;
import com.pulumi.aws.appmesh.AppmeshFunctions;
import com.pulumi.aws.appmesh.inputs.GetVirtualServiceArgs;
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) {
        final var current = AwsFunctions.getCallerIdentity();
        final var test = AppmeshFunctions.getVirtualService(GetVirtualServiceArgs.builder()
            .name("example.mesh.local")
            .meshName("example-mesh")
            .meshOwner(current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
            .build());
    }
}
variables:
  current:
    fn::invoke:
      function: aws:getCallerIdentity
      arguments: {}
  test:
    fn::invoke:
      function: aws:appmesh:getVirtualService
      arguments:
        name: example.mesh.local
        meshName: example-mesh
        meshOwner: ${current.accountId}
Using getVirtualService
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getVirtualService(args: GetVirtualServiceArgs, opts?: InvokeOptions): Promise<GetVirtualServiceResult>
function getVirtualServiceOutput(args: GetVirtualServiceOutputArgs, opts?: InvokeOptions): Output<GetVirtualServiceResult>def get_virtual_service(mesh_name: Optional[str] = None,
                        mesh_owner: Optional[str] = None,
                        name: Optional[str] = None,
                        tags: Optional[Mapping[str, str]] = None,
                        opts: Optional[InvokeOptions] = None) -> GetVirtualServiceResult
def get_virtual_service_output(mesh_name: Optional[pulumi.Input[str]] = None,
                        mesh_owner: Optional[pulumi.Input[str]] = None,
                        name: Optional[pulumi.Input[str]] = None,
                        tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetVirtualServiceResult]func LookupVirtualService(ctx *Context, args *LookupVirtualServiceArgs, opts ...InvokeOption) (*LookupVirtualServiceResult, error)
func LookupVirtualServiceOutput(ctx *Context, args *LookupVirtualServiceOutputArgs, opts ...InvokeOption) LookupVirtualServiceResultOutput> Note: This function is named LookupVirtualService in the Go SDK.
public static class GetVirtualService 
{
    public static Task<GetVirtualServiceResult> InvokeAsync(GetVirtualServiceArgs args, InvokeOptions? opts = null)
    public static Output<GetVirtualServiceResult> Invoke(GetVirtualServiceInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVirtualServiceResult> getVirtualService(GetVirtualServiceArgs args, InvokeOptions options)
public static Output<GetVirtualServiceResult> getVirtualService(GetVirtualServiceArgs args, InvokeOptions options)
fn::invoke:
  function: aws:appmesh/getVirtualService:getVirtualService
  arguments:
    # arguments dictionaryThe following arguments are supported:
- mesh_name str
- Name of the service mesh in which the virtual service exists.
- name str
- Name of the virtual service.
- mesh_owner str
- AWS account ID of the service mesh's owner.
- Mapping[str, str]
- Map of tags.
getVirtualService Result
The following output properties are available:
- Arn string
- ARN of the virtual service.
- CreatedDate string
- Creation date of the virtual service.
- Id string
- The provider-assigned unique ID for this managed resource.
- LastUpdated stringDate 
- Last update date of the virtual service.
- MeshName string
- MeshOwner string
- Name string
- ResourceOwner string
- Resource owner's AWS account ID.
- Specs
List<GetVirtual Service Spec> 
- Virtual service specification. See the aws.appmesh.VirtualServiceresource for details.
- Dictionary<string, string>
- Map of tags.
- Arn string
- ARN of the virtual service.
- CreatedDate string
- Creation date of the virtual service.
- Id string
- The provider-assigned unique ID for this managed resource.
- LastUpdated stringDate 
- Last update date of the virtual service.
- MeshName string
- MeshOwner string
- Name string
- ResourceOwner string
- Resource owner's AWS account ID.
- Specs
[]GetVirtual Service Spec 
- Virtual service specification. See the aws.appmesh.VirtualServiceresource for details.
- map[string]string
- Map of tags.
- arn String
- ARN of the virtual service.
- createdDate String
- Creation date of the virtual service.
- id String
- The provider-assigned unique ID for this managed resource.
- lastUpdated StringDate 
- Last update date of the virtual service.
- meshName String
- meshOwner String
- name String
- resourceOwner String
- Resource owner's AWS account ID.
- specs
List<GetVirtual Service Spec> 
- Virtual service specification. See the aws.appmesh.VirtualServiceresource for details.
- Map<String,String>
- Map of tags.
- arn string
- ARN of the virtual service.
- createdDate string
- Creation date of the virtual service.
- id string
- The provider-assigned unique ID for this managed resource.
- lastUpdated stringDate 
- Last update date of the virtual service.
- meshName string
- meshOwner string
- name string
- resourceOwner string
- Resource owner's AWS account ID.
- specs
GetVirtual Service Spec[] 
- Virtual service specification. See the aws.appmesh.VirtualServiceresource for details.
- {[key: string]: string}
- Map of tags.
- arn str
- ARN of the virtual service.
- created_date str
- Creation date of the virtual service.
- id str
- The provider-assigned unique ID for this managed resource.
- last_updated_ strdate 
- Last update date of the virtual service.
- mesh_name str
- mesh_owner str
- name str
- resource_owner str
- Resource owner's AWS account ID.
- specs
Sequence[GetVirtual Service Spec] 
- Virtual service specification. See the aws.appmesh.VirtualServiceresource for details.
- Mapping[str, str]
- Map of tags.
- arn String
- ARN of the virtual service.
- createdDate String
- Creation date of the virtual service.
- id String
- The provider-assigned unique ID for this managed resource.
- lastUpdated StringDate 
- Last update date of the virtual service.
- meshName String
- meshOwner String
- name String
- resourceOwner String
- Resource owner's AWS account ID.
- specs List<Property Map>
- Virtual service specification. See the aws.appmesh.VirtualServiceresource for details.
- Map<String>
- Map of tags.
Supporting Types
GetVirtualServiceSpec   
GetVirtualServiceSpecProvider    
GetVirtualServiceSpecProviderVirtualNode      
- VirtualNode stringName 
- VirtualNode stringName 
- virtualNode StringName 
- virtualNode stringName 
- virtualNode StringName 
GetVirtualServiceSpecProviderVirtualRouter      
- VirtualRouter stringName 
- VirtualRouter stringName 
- virtualRouter StringName 
- virtualRouter stringName 
- virtualRouter StringName 
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.