1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ServiceMesh
  5. VirtualService
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.ServiceMesh.VirtualService

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

    This resource provides the Virtual Service resource in Oracle Cloud Infrastructure Service Mesh service.

    Creates a new VirtualService.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testVirtualService = new oci.servicemesh.VirtualService("test_virtual_service", {
        compartmentId: compartmentId,
        meshId: testMesh.id,
        name: virtualServiceName,
        defaultRoutingPolicy: {
            type: virtualServiceDefaultRoutingPolicyType,
        },
        definedTags: {
            "foo-namespace.bar-key": "value",
        },
        description: virtualServiceDescription,
        freeformTags: {
            "bar-key": "value",
        },
        hosts: virtualServiceHosts,
        mtls: {
            mode: virtualServiceMtlsMode,
            maximumValidity: virtualServiceMtlsMaximumValidity,
        },
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_virtual_service = oci.service_mesh.VirtualService("test_virtual_service",
        compartment_id=compartment_id,
        mesh_id=test_mesh["id"],
        name=virtual_service_name,
        default_routing_policy={
            "type": virtual_service_default_routing_policy_type,
        },
        defined_tags={
            "foo-namespace.bar-key": "value",
        },
        description=virtual_service_description,
        freeform_tags={
            "bar-key": "value",
        },
        hosts=virtual_service_hosts,
        mtls={
            "mode": virtual_service_mtls_mode,
            "maximum_validity": virtual_service_mtls_maximum_validity,
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/ServiceMesh"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ServiceMesh.NewVirtualService(ctx, "test_virtual_service", &ServiceMesh.VirtualServiceArgs{
    			CompartmentId: pulumi.Any(compartmentId),
    			MeshId:        pulumi.Any(testMesh.Id),
    			Name:          pulumi.Any(virtualServiceName),
    			DefaultRoutingPolicy: &servicemesh.VirtualServiceDefaultRoutingPolicyArgs{
    				Type: pulumi.Any(virtualServiceDefaultRoutingPolicyType),
    			},
    			DefinedTags: pulumi.StringMap{
    				"foo-namespace.bar-key": pulumi.String("value"),
    			},
    			Description: pulumi.Any(virtualServiceDescription),
    			FreeformTags: pulumi.StringMap{
    				"bar-key": pulumi.String("value"),
    			},
    			Hosts: pulumi.Any(virtualServiceHosts),
    			Mtls: &servicemesh.VirtualServiceMtlsArgs{
    				Mode:            pulumi.Any(virtualServiceMtlsMode),
    				MaximumValidity: pulumi.Any(virtualServiceMtlsMaximumValidity),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testVirtualService = new Oci.ServiceMesh.VirtualService("test_virtual_service", new()
        {
            CompartmentId = compartmentId,
            MeshId = testMesh.Id,
            Name = virtualServiceName,
            DefaultRoutingPolicy = new Oci.ServiceMesh.Inputs.VirtualServiceDefaultRoutingPolicyArgs
            {
                Type = virtualServiceDefaultRoutingPolicyType,
            },
            DefinedTags = 
            {
                { "foo-namespace.bar-key", "value" },
            },
            Description = virtualServiceDescription,
            FreeformTags = 
            {
                { "bar-key", "value" },
            },
            Hosts = virtualServiceHosts,
            Mtls = new Oci.ServiceMesh.Inputs.VirtualServiceMtlsArgs
            {
                Mode = virtualServiceMtlsMode,
                MaximumValidity = virtualServiceMtlsMaximumValidity,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.ServiceMesh.VirtualService;
    import com.pulumi.oci.ServiceMesh.VirtualServiceArgs;
    import com.pulumi.oci.ServiceMesh.inputs.VirtualServiceDefaultRoutingPolicyArgs;
    import com.pulumi.oci.ServiceMesh.inputs.VirtualServiceMtlsArgs;
    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 testVirtualService = new VirtualService("testVirtualService", VirtualServiceArgs.builder()
                .compartmentId(compartmentId)
                .meshId(testMesh.id())
                .name(virtualServiceName)
                .defaultRoutingPolicy(VirtualServiceDefaultRoutingPolicyArgs.builder()
                    .type(virtualServiceDefaultRoutingPolicyType)
                    .build())
                .definedTags(Map.of("foo-namespace.bar-key", "value"))
                .description(virtualServiceDescription)
                .freeformTags(Map.of("bar-key", "value"))
                .hosts(virtualServiceHosts)
                .mtls(VirtualServiceMtlsArgs.builder()
                    .mode(virtualServiceMtlsMode)
                    .maximumValidity(virtualServiceMtlsMaximumValidity)
                    .build())
                .build());
    
        }
    }
    
    resources:
      testVirtualService:
        type: oci:ServiceMesh:VirtualService
        name: test_virtual_service
        properties:
          compartmentId: ${compartmentId}
          meshId: ${testMesh.id}
          name: ${virtualServiceName}
          defaultRoutingPolicy:
            type: ${virtualServiceDefaultRoutingPolicyType}
          definedTags:
            foo-namespace.bar-key: value
          description: ${virtualServiceDescription}
          freeformTags:
            bar-key: value
          hosts: ${virtualServiceHosts}
          mtls:
            mode: ${virtualServiceMtlsMode}
            maximumValidity: ${virtualServiceMtlsMaximumValidity}
    

    Create VirtualService Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new VirtualService(name: string, args: VirtualServiceArgs, opts?: CustomResourceOptions);
    @overload
    def VirtualService(resource_name: str,
                       args: VirtualServiceArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def VirtualService(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       compartment_id: Optional[str] = None,
                       mesh_id: Optional[str] = None,
                       default_routing_policy: Optional[_servicemesh.VirtualServiceDefaultRoutingPolicyArgs] = None,
                       defined_tags: Optional[Mapping[str, str]] = None,
                       description: Optional[str] = None,
                       freeform_tags: Optional[Mapping[str, str]] = None,
                       hosts: Optional[Sequence[str]] = None,
                       mtls: Optional[_servicemesh.VirtualServiceMtlsArgs] = None,
                       name: Optional[str] = None)
    func NewVirtualService(ctx *Context, name string, args VirtualServiceArgs, opts ...ResourceOption) (*VirtualService, error)
    public VirtualService(string name, VirtualServiceArgs args, CustomResourceOptions? opts = null)
    public VirtualService(String name, VirtualServiceArgs args)
    public VirtualService(String name, VirtualServiceArgs args, CustomResourceOptions options)
    
    type: oci:ServiceMesh:VirtualService
    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 VirtualServiceArgs
    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 VirtualServiceArgs
    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 VirtualServiceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VirtualServiceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VirtualServiceArgs
    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 virtualServiceResource = new Oci.ServiceMesh.VirtualService("virtualServiceResource", new()
    {
        CompartmentId = "string",
        MeshId = "string",
        DefaultRoutingPolicy = new Oci.ServiceMesh.Inputs.VirtualServiceDefaultRoutingPolicyArgs
        {
            Type = "string",
        },
        DefinedTags = 
        {
            { "string", "string" },
        },
        Description = "string",
        FreeformTags = 
        {
            { "string", "string" },
        },
        Hosts = new[]
        {
            "string",
        },
        Mtls = new Oci.ServiceMesh.Inputs.VirtualServiceMtlsArgs
        {
            Mode = "string",
            CertificateId = "string",
            MaximumValidity = 0,
        },
        Name = "string",
    });
    
    example, err := ServiceMesh.NewVirtualService(ctx, "virtualServiceResource", &ServiceMesh.VirtualServiceArgs{
    	CompartmentId: pulumi.String("string"),
    	MeshId:        pulumi.String("string"),
    	DefaultRoutingPolicy: &servicemesh.VirtualServiceDefaultRoutingPolicyArgs{
    		Type: pulumi.String("string"),
    	},
    	DefinedTags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    	FreeformTags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Hosts: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Mtls: &servicemesh.VirtualServiceMtlsArgs{
    		Mode:            pulumi.String("string"),
    		CertificateId:   pulumi.String("string"),
    		MaximumValidity: pulumi.Int(0),
    	},
    	Name: pulumi.String("string"),
    })
    
    var virtualServiceResource = new VirtualService("virtualServiceResource", VirtualServiceArgs.builder()
        .compartmentId("string")
        .meshId("string")
        .defaultRoutingPolicy(VirtualServiceDefaultRoutingPolicyArgs.builder()
            .type("string")
            .build())
        .definedTags(Map.of("string", "string"))
        .description("string")
        .freeformTags(Map.of("string", "string"))
        .hosts("string")
        .mtls(VirtualServiceMtlsArgs.builder()
            .mode("string")
            .certificateId("string")
            .maximumValidity(0)
            .build())
        .name("string")
        .build());
    
    virtual_service_resource = oci.service_mesh.VirtualService("virtualServiceResource",
        compartment_id="string",
        mesh_id="string",
        default_routing_policy={
            "type": "string",
        },
        defined_tags={
            "string": "string",
        },
        description="string",
        freeform_tags={
            "string": "string",
        },
        hosts=["string"],
        mtls={
            "mode": "string",
            "certificate_id": "string",
            "maximum_validity": 0,
        },
        name="string")
    
    const virtualServiceResource = new oci.servicemesh.VirtualService("virtualServiceResource", {
        compartmentId: "string",
        meshId: "string",
        defaultRoutingPolicy: {
            type: "string",
        },
        definedTags: {
            string: "string",
        },
        description: "string",
        freeformTags: {
            string: "string",
        },
        hosts: ["string"],
        mtls: {
            mode: "string",
            certificateId: "string",
            maximumValidity: 0,
        },
        name: "string",
    });
    
    type: oci:ServiceMesh:VirtualService
    properties:
        compartmentId: string
        defaultRoutingPolicy:
            type: string
        definedTags:
            string: string
        description: string
        freeformTags:
            string: string
        hosts:
            - string
        meshId: string
        mtls:
            certificateId: string
            maximumValidity: 0
            mode: string
        name: string
    

    VirtualService 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 VirtualService resource accepts the following input properties:

    CompartmentId string
    (Updatable) The OCID of the compartment.
    MeshId string
    The OCID of the service mesh in which this virtual service is created.
    DefaultRoutingPolicy VirtualServiceDefaultRoutingPolicy
    (Updatable) Routing policy for the virtual service.
    DefinedTags Dictionary<string, string>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    Description string
    (Updatable) Description of the resource. It can be changed after creation. Avoid entering confidential information. Example: This is my new resource
    FreeformTags Dictionary<string, string>
    (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    Hosts List<string>
    (Updatable) The DNS hostnames of the virtual service that is used by its callers. Wildcard hostnames are supported in the prefix form. Examples of valid hostnames are "www.example.com", ".example.com", ".com". Can be omitted if the virtual service will only have TCP virtual deployments.
    Mtls VirtualServiceMtls
    (Updatable) The mTLS authentication mode to use when receiving requests from other virtual services or ingress gateways within the mesh.
    Name string

    A user-friendly name. The name has to be unique within the same service mesh and cannot be changed after creation. Avoid entering confidential information. Example: My unique resource name

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    CompartmentId string
    (Updatable) The OCID of the compartment.
    MeshId string
    The OCID of the service mesh in which this virtual service is created.
    DefaultRoutingPolicy VirtualServiceDefaultRoutingPolicyArgs
    (Updatable) Routing policy for the virtual service.
    DefinedTags map[string]string
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    Description string
    (Updatable) Description of the resource. It can be changed after creation. Avoid entering confidential information. Example: This is my new resource
    FreeformTags map[string]string
    (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    Hosts []string
    (Updatable) The DNS hostnames of the virtual service that is used by its callers. Wildcard hostnames are supported in the prefix form. Examples of valid hostnames are "www.example.com", ".example.com", ".com". Can be omitted if the virtual service will only have TCP virtual deployments.
    Mtls VirtualServiceMtlsArgs
    (Updatable) The mTLS authentication mode to use when receiving requests from other virtual services or ingress gateways within the mesh.
    Name string

    A user-friendly name. The name has to be unique within the same service mesh and cannot be changed after creation. Avoid entering confidential information. Example: My unique resource name

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentId String
    (Updatable) The OCID of the compartment.
    meshId String
    The OCID of the service mesh in which this virtual service is created.
    defaultRoutingPolicy VirtualServiceDefaultRoutingPolicy
    (Updatable) Routing policy for the virtual service.
    definedTags Map<String,String>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description String
    (Updatable) Description of the resource. It can be changed after creation. Avoid entering confidential information. Example: This is my new resource
    freeformTags Map<String,String>
    (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    hosts List<String>
    (Updatable) The DNS hostnames of the virtual service that is used by its callers. Wildcard hostnames are supported in the prefix form. Examples of valid hostnames are "www.example.com", ".example.com", ".com". Can be omitted if the virtual service will only have TCP virtual deployments.
    mtls VirtualServiceMtls
    (Updatable) The mTLS authentication mode to use when receiving requests from other virtual services or ingress gateways within the mesh.
    name String

    A user-friendly name. The name has to be unique within the same service mesh and cannot be changed after creation. Avoid entering confidential information. Example: My unique resource name

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentId string
    (Updatable) The OCID of the compartment.
    meshId string
    The OCID of the service mesh in which this virtual service is created.
    defaultRoutingPolicy VirtualServiceDefaultRoutingPolicy
    (Updatable) Routing policy for the virtual service.
    definedTags {[key: string]: string}
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description string
    (Updatable) Description of the resource. It can be changed after creation. Avoid entering confidential information. Example: This is my new resource
    freeformTags {[key: string]: string}
    (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    hosts string[]
    (Updatable) The DNS hostnames of the virtual service that is used by its callers. Wildcard hostnames are supported in the prefix form. Examples of valid hostnames are "www.example.com", ".example.com", ".com". Can be omitted if the virtual service will only have TCP virtual deployments.
    mtls VirtualServiceMtls
    (Updatable) The mTLS authentication mode to use when receiving requests from other virtual services or ingress gateways within the mesh.
    name string

    A user-friendly name. The name has to be unique within the same service mesh and cannot be changed after creation. Avoid entering confidential information. Example: My unique resource name

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartment_id str
    (Updatable) The OCID of the compartment.
    mesh_id str
    The OCID of the service mesh in which this virtual service is created.
    default_routing_policy servicemesh.VirtualServiceDefaultRoutingPolicyArgs
    (Updatable) Routing policy for the virtual service.
    defined_tags Mapping[str, str]
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description str
    (Updatable) Description of the resource. It can be changed after creation. Avoid entering confidential information. Example: This is my new resource
    freeform_tags Mapping[str, str]
    (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    hosts Sequence[str]
    (Updatable) The DNS hostnames of the virtual service that is used by its callers. Wildcard hostnames are supported in the prefix form. Examples of valid hostnames are "www.example.com", ".example.com", ".com". Can be omitted if the virtual service will only have TCP virtual deployments.
    mtls servicemesh.VirtualServiceMtlsArgs
    (Updatable) The mTLS authentication mode to use when receiving requests from other virtual services or ingress gateways within the mesh.
    name str

    A user-friendly name. The name has to be unique within the same service mesh and cannot be changed after creation. Avoid entering confidential information. Example: My unique resource name

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentId String
    (Updatable) The OCID of the compartment.
    meshId String
    The OCID of the service mesh in which this virtual service is created.
    defaultRoutingPolicy Property Map
    (Updatable) Routing policy for the virtual service.
    definedTags Map<String>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description String
    (Updatable) Description of the resource. It can be changed after creation. Avoid entering confidential information. Example: This is my new resource
    freeformTags Map<String>
    (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    hosts List<String>
    (Updatable) The DNS hostnames of the virtual service that is used by its callers. Wildcard hostnames are supported in the prefix form. Examples of valid hostnames are "www.example.com", ".example.com", ".com". Can be omitted if the virtual service will only have TCP virtual deployments.
    mtls Property Map
    (Updatable) The mTLS authentication mode to use when receiving requests from other virtual services or ingress gateways within the mesh.
    name String

    A user-friendly name. The name has to be unique within the same service mesh and cannot be changed after creation. Avoid entering confidential information. Example: My unique resource name

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VirtualService resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    LifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    State string
    The current state of the Resource.
    SystemTags Dictionary<string, string>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The time when this resource was created in an RFC3339 formatted datetime string.
    TimeUpdated string
    The time when this resource was updated in an RFC3339 formatted datetime string.
    Id string
    The provider-assigned unique ID for this managed resource.
    LifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    State string
    The current state of the Resource.
    SystemTags map[string]string
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The time when this resource was created in an RFC3339 formatted datetime string.
    TimeUpdated string
    The time when this resource was updated in an RFC3339 formatted datetime string.
    id String
    The provider-assigned unique ID for this managed resource.
    lifecycleDetails String
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    state String
    The current state of the Resource.
    systemTags Map<String,String>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The time when this resource was created in an RFC3339 formatted datetime string.
    timeUpdated String
    The time when this resource was updated in an RFC3339 formatted datetime string.
    id string
    The provider-assigned unique ID for this managed resource.
    lifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    state string
    The current state of the Resource.
    systemTags {[key: string]: string}
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated string
    The time when this resource was created in an RFC3339 formatted datetime string.
    timeUpdated string
    The time when this resource was updated in an RFC3339 formatted datetime string.
    id str
    The provider-assigned unique ID for this managed resource.
    lifecycle_details str
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    state str
    The current state of the Resource.
    system_tags Mapping[str, str]
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    time_created str
    The time when this resource was created in an RFC3339 formatted datetime string.
    time_updated str
    The time when this resource was updated in an RFC3339 formatted datetime string.
    id String
    The provider-assigned unique ID for this managed resource.
    lifecycleDetails String
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    state String
    The current state of the Resource.
    systemTags Map<String>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The time when this resource was created in an RFC3339 formatted datetime string.
    timeUpdated String
    The time when this resource was updated in an RFC3339 formatted datetime string.

    Look up Existing VirtualService Resource

    Get an existing VirtualService 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?: VirtualServiceState, opts?: CustomResourceOptions): VirtualService
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            compartment_id: Optional[str] = None,
            default_routing_policy: Optional[_servicemesh.VirtualServiceDefaultRoutingPolicyArgs] = None,
            defined_tags: Optional[Mapping[str, str]] = None,
            description: Optional[str] = None,
            freeform_tags: Optional[Mapping[str, str]] = None,
            hosts: Optional[Sequence[str]] = None,
            lifecycle_details: Optional[str] = None,
            mesh_id: Optional[str] = None,
            mtls: Optional[_servicemesh.VirtualServiceMtlsArgs] = None,
            name: Optional[str] = None,
            state: Optional[str] = None,
            system_tags: Optional[Mapping[str, str]] = None,
            time_created: Optional[str] = None,
            time_updated: Optional[str] = None) -> VirtualService
    func GetVirtualService(ctx *Context, name string, id IDInput, state *VirtualServiceState, opts ...ResourceOption) (*VirtualService, error)
    public static VirtualService Get(string name, Input<string> id, VirtualServiceState? state, CustomResourceOptions? opts = null)
    public static VirtualService get(String name, Output<String> id, VirtualServiceState 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.
    The following state arguments are supported:
    CompartmentId string
    (Updatable) The OCID of the compartment.
    DefaultRoutingPolicy VirtualServiceDefaultRoutingPolicy
    (Updatable) Routing policy for the virtual service.
    DefinedTags Dictionary<string, string>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    Description string
    (Updatable) Description of the resource. It can be changed after creation. Avoid entering confidential information. Example: This is my new resource
    FreeformTags Dictionary<string, string>
    (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    Hosts List<string>
    (Updatable) The DNS hostnames of the virtual service that is used by its callers. Wildcard hostnames are supported in the prefix form. Examples of valid hostnames are "www.example.com", ".example.com", ".com". Can be omitted if the virtual service will only have TCP virtual deployments.
    LifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    MeshId string
    The OCID of the service mesh in which this virtual service is created.
    Mtls VirtualServiceMtls
    (Updatable) The mTLS authentication mode to use when receiving requests from other virtual services or ingress gateways within the mesh.
    Name string

    A user-friendly name. The name has to be unique within the same service mesh and cannot be changed after creation. Avoid entering confidential information. Example: My unique resource name

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    State string
    The current state of the Resource.
    SystemTags Dictionary<string, string>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The time when this resource was created in an RFC3339 formatted datetime string.
    TimeUpdated string
    The time when this resource was updated in an RFC3339 formatted datetime string.
    CompartmentId string
    (Updatable) The OCID of the compartment.
    DefaultRoutingPolicy VirtualServiceDefaultRoutingPolicyArgs
    (Updatable) Routing policy for the virtual service.
    DefinedTags map[string]string
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    Description string
    (Updatable) Description of the resource. It can be changed after creation. Avoid entering confidential information. Example: This is my new resource
    FreeformTags map[string]string
    (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    Hosts []string
    (Updatable) The DNS hostnames of the virtual service that is used by its callers. Wildcard hostnames are supported in the prefix form. Examples of valid hostnames are "www.example.com", ".example.com", ".com". Can be omitted if the virtual service will only have TCP virtual deployments.
    LifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    MeshId string
    The OCID of the service mesh in which this virtual service is created.
    Mtls VirtualServiceMtlsArgs
    (Updatable) The mTLS authentication mode to use when receiving requests from other virtual services or ingress gateways within the mesh.
    Name string

    A user-friendly name. The name has to be unique within the same service mesh and cannot be changed after creation. Avoid entering confidential information. Example: My unique resource name

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    State string
    The current state of the Resource.
    SystemTags map[string]string
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The time when this resource was created in an RFC3339 formatted datetime string.
    TimeUpdated string
    The time when this resource was updated in an RFC3339 formatted datetime string.
    compartmentId String
    (Updatable) The OCID of the compartment.
    defaultRoutingPolicy VirtualServiceDefaultRoutingPolicy
    (Updatable) Routing policy for the virtual service.
    definedTags Map<String,String>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description String
    (Updatable) Description of the resource. It can be changed after creation. Avoid entering confidential information. Example: This is my new resource
    freeformTags Map<String,String>
    (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    hosts List<String>
    (Updatable) The DNS hostnames of the virtual service that is used by its callers. Wildcard hostnames are supported in the prefix form. Examples of valid hostnames are "www.example.com", ".example.com", ".com". Can be omitted if the virtual service will only have TCP virtual deployments.
    lifecycleDetails String
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    meshId String
    The OCID of the service mesh in which this virtual service is created.
    mtls VirtualServiceMtls
    (Updatable) The mTLS authentication mode to use when receiving requests from other virtual services or ingress gateways within the mesh.
    name String

    A user-friendly name. The name has to be unique within the same service mesh and cannot be changed after creation. Avoid entering confidential information. Example: My unique resource name

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    state String
    The current state of the Resource.
    systemTags Map<String,String>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The time when this resource was created in an RFC3339 formatted datetime string.
    timeUpdated String
    The time when this resource was updated in an RFC3339 formatted datetime string.
    compartmentId string
    (Updatable) The OCID of the compartment.
    defaultRoutingPolicy VirtualServiceDefaultRoutingPolicy
    (Updatable) Routing policy for the virtual service.
    definedTags {[key: string]: string}
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description string
    (Updatable) Description of the resource. It can be changed after creation. Avoid entering confidential information. Example: This is my new resource
    freeformTags {[key: string]: string}
    (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    hosts string[]
    (Updatable) The DNS hostnames of the virtual service that is used by its callers. Wildcard hostnames are supported in the prefix form. Examples of valid hostnames are "www.example.com", ".example.com", ".com". Can be omitted if the virtual service will only have TCP virtual deployments.
    lifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    meshId string
    The OCID of the service mesh in which this virtual service is created.
    mtls VirtualServiceMtls
    (Updatable) The mTLS authentication mode to use when receiving requests from other virtual services or ingress gateways within the mesh.
    name string

    A user-friendly name. The name has to be unique within the same service mesh and cannot be changed after creation. Avoid entering confidential information. Example: My unique resource name

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    state string
    The current state of the Resource.
    systemTags {[key: string]: string}
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated string
    The time when this resource was created in an RFC3339 formatted datetime string.
    timeUpdated string
    The time when this resource was updated in an RFC3339 formatted datetime string.
    compartment_id str
    (Updatable) The OCID of the compartment.
    default_routing_policy servicemesh.VirtualServiceDefaultRoutingPolicyArgs
    (Updatable) Routing policy for the virtual service.
    defined_tags Mapping[str, str]
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description str
    (Updatable) Description of the resource. It can be changed after creation. Avoid entering confidential information. Example: This is my new resource
    freeform_tags Mapping[str, str]
    (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    hosts Sequence[str]
    (Updatable) The DNS hostnames of the virtual service that is used by its callers. Wildcard hostnames are supported in the prefix form. Examples of valid hostnames are "www.example.com", ".example.com", ".com". Can be omitted if the virtual service will only have TCP virtual deployments.
    lifecycle_details str
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    mesh_id str
    The OCID of the service mesh in which this virtual service is created.
    mtls servicemesh.VirtualServiceMtlsArgs
    (Updatable) The mTLS authentication mode to use when receiving requests from other virtual services or ingress gateways within the mesh.
    name str

    A user-friendly name. The name has to be unique within the same service mesh and cannot be changed after creation. Avoid entering confidential information. Example: My unique resource name

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    state str
    The current state of the Resource.
    system_tags Mapping[str, str]
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    time_created str
    The time when this resource was created in an RFC3339 formatted datetime string.
    time_updated str
    The time when this resource was updated in an RFC3339 formatted datetime string.
    compartmentId String
    (Updatable) The OCID of the compartment.
    defaultRoutingPolicy Property Map
    (Updatable) Routing policy for the virtual service.
    definedTags Map<String>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description String
    (Updatable) Description of the resource. It can be changed after creation. Avoid entering confidential information. Example: This is my new resource
    freeformTags Map<String>
    (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    hosts List<String>
    (Updatable) The DNS hostnames of the virtual service that is used by its callers. Wildcard hostnames are supported in the prefix form. Examples of valid hostnames are "www.example.com", ".example.com", ".com". Can be omitted if the virtual service will only have TCP virtual deployments.
    lifecycleDetails String
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    meshId String
    The OCID of the service mesh in which this virtual service is created.
    mtls Property Map
    (Updatable) The mTLS authentication mode to use when receiving requests from other virtual services or ingress gateways within the mesh.
    name String

    A user-friendly name. The name has to be unique within the same service mesh and cannot be changed after creation. Avoid entering confidential information. Example: My unique resource name

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    state String
    The current state of the Resource.
    systemTags Map<String>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The time when this resource was created in an RFC3339 formatted datetime string.
    timeUpdated String
    The time when this resource was updated in an RFC3339 formatted datetime string.

    Supporting Types

    VirtualServiceDefaultRoutingPolicy, VirtualServiceDefaultRoutingPolicyArgs

    Type string
    (Updatable) Type of the virtual service routing policy.
    Type string
    (Updatable) Type of the virtual service routing policy.
    type String
    (Updatable) Type of the virtual service routing policy.
    type string
    (Updatable) Type of the virtual service routing policy.
    type str
    (Updatable) Type of the virtual service routing policy.
    type String
    (Updatable) Type of the virtual service routing policy.

    VirtualServiceMtls, VirtualServiceMtlsArgs

    Mode string
    (Updatable) DISABLED: Connection is not tunneled. PERMISSIVE: Connection can be either plaintext or an mTLS tunnel. STRICT: Connection is an mTLS tunnel. Clients without a valid certificate will be rejected.
    CertificateId string
    The OCID of the certificate resource that will be used for mTLS authentication with other virtual services in the mesh.
    MaximumValidity int
    (Updatable) The number of days the mTLS certificate is valid. This value should be less than the Maximum Validity Duration for Certificates (Days) setting on the Certificate Authority associated with this Mesh. The certificate will be automatically renewed after 2/3 of the validity period, so a certificate with a maximum validity of 45 days will be renewed every 30 days.
    Mode string
    (Updatable) DISABLED: Connection is not tunneled. PERMISSIVE: Connection can be either plaintext or an mTLS tunnel. STRICT: Connection is an mTLS tunnel. Clients without a valid certificate will be rejected.
    CertificateId string
    The OCID of the certificate resource that will be used for mTLS authentication with other virtual services in the mesh.
    MaximumValidity int
    (Updatable) The number of days the mTLS certificate is valid. This value should be less than the Maximum Validity Duration for Certificates (Days) setting on the Certificate Authority associated with this Mesh. The certificate will be automatically renewed after 2/3 of the validity period, so a certificate with a maximum validity of 45 days will be renewed every 30 days.
    mode String
    (Updatable) DISABLED: Connection is not tunneled. PERMISSIVE: Connection can be either plaintext or an mTLS tunnel. STRICT: Connection is an mTLS tunnel. Clients without a valid certificate will be rejected.
    certificateId String
    The OCID of the certificate resource that will be used for mTLS authentication with other virtual services in the mesh.
    maximumValidity Integer
    (Updatable) The number of days the mTLS certificate is valid. This value should be less than the Maximum Validity Duration for Certificates (Days) setting on the Certificate Authority associated with this Mesh. The certificate will be automatically renewed after 2/3 of the validity period, so a certificate with a maximum validity of 45 days will be renewed every 30 days.
    mode string
    (Updatable) DISABLED: Connection is not tunneled. PERMISSIVE: Connection can be either plaintext or an mTLS tunnel. STRICT: Connection is an mTLS tunnel. Clients without a valid certificate will be rejected.
    certificateId string
    The OCID of the certificate resource that will be used for mTLS authentication with other virtual services in the mesh.
    maximumValidity number
    (Updatable) The number of days the mTLS certificate is valid. This value should be less than the Maximum Validity Duration for Certificates (Days) setting on the Certificate Authority associated with this Mesh. The certificate will be automatically renewed after 2/3 of the validity period, so a certificate with a maximum validity of 45 days will be renewed every 30 days.
    mode str
    (Updatable) DISABLED: Connection is not tunneled. PERMISSIVE: Connection can be either plaintext or an mTLS tunnel. STRICT: Connection is an mTLS tunnel. Clients without a valid certificate will be rejected.
    certificate_id str
    The OCID of the certificate resource that will be used for mTLS authentication with other virtual services in the mesh.
    maximum_validity int
    (Updatable) The number of days the mTLS certificate is valid. This value should be less than the Maximum Validity Duration for Certificates (Days) setting on the Certificate Authority associated with this Mesh. The certificate will be automatically renewed after 2/3 of the validity period, so a certificate with a maximum validity of 45 days will be renewed every 30 days.
    mode String
    (Updatable) DISABLED: Connection is not tunneled. PERMISSIVE: Connection can be either plaintext or an mTLS tunnel. STRICT: Connection is an mTLS tunnel. Clients without a valid certificate will be rejected.
    certificateId String
    The OCID of the certificate resource that will be used for mTLS authentication with other virtual services in the mesh.
    maximumValidity Number
    (Updatable) The number of days the mTLS certificate is valid. This value should be less than the Maximum Validity Duration for Certificates (Days) setting on the Certificate Authority associated with this Mesh. The certificate will be automatically renewed after 2/3 of the validity period, so a certificate with a maximum validity of 45 days will be renewed every 30 days.

    Import

    VirtualServices can be imported using the id, e.g.

    $ pulumi import oci:ServiceMesh/virtualService:VirtualService test_virtual_service "id"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi