1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Core
  5. getServiceGateways
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

oci.Core.getServiceGateways

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

This data source provides the list of Service Gateways in Oracle Cloud Infrastructure Core service.

Lists the service gateways in the specified compartment. You may optionally specify a VCN OCID to filter the results by VCN.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testServiceGateways = oci.Core.getServiceGateways({
    compartmentId: compartmentId,
    state: serviceGatewayState,
    vcnId: testVcn.id,
});
Copy
import pulumi
import pulumi_oci as oci

test_service_gateways = oci.Core.get_service_gateways(compartment_id=compartment_id,
    state=service_gateway_state,
    vcn_id=test_vcn["id"])
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/core"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := core.GetServiceGateways(ctx, &core.GetServiceGatewaysArgs{
			CompartmentId: compartmentId,
			State:         pulumi.StringRef(serviceGatewayState),
			VcnId:         pulumi.StringRef(testVcn.Id),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testServiceGateways = Oci.Core.GetServiceGateways.Invoke(new()
    {
        CompartmentId = compartmentId,
        State = serviceGatewayState,
        VcnId = testVcn.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Core.CoreFunctions;
import com.pulumi.oci.Core.inputs.GetServiceGatewaysArgs;
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 testServiceGateways = CoreFunctions.getServiceGateways(GetServiceGatewaysArgs.builder()
            .compartmentId(compartmentId)
            .state(serviceGatewayState)
            .vcnId(testVcn.id())
            .build());

    }
}
Copy
variables:
  testServiceGateways:
    fn::invoke:
      function: oci:Core:getServiceGateways
      arguments:
        compartmentId: ${compartmentId}
        state: ${serviceGatewayState}
        vcnId: ${testVcn.id}
Copy

Using getServiceGateways

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 getServiceGateways(args: GetServiceGatewaysArgs, opts?: InvokeOptions): Promise<GetServiceGatewaysResult>
function getServiceGatewaysOutput(args: GetServiceGatewaysOutputArgs, opts?: InvokeOptions): Output<GetServiceGatewaysResult>
Copy
def get_service_gateways(compartment_id: Optional[str] = None,
                         filters: Optional[Sequence[_core.GetServiceGatewaysFilter]] = None,
                         state: Optional[str] = None,
                         vcn_id: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetServiceGatewaysResult
def get_service_gateways_output(compartment_id: Optional[pulumi.Input[str]] = None,
                         filters: Optional[pulumi.Input[Sequence[pulumi.Input[_core.GetServiceGatewaysFilterArgs]]]] = None,
                         state: Optional[pulumi.Input[str]] = None,
                         vcn_id: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetServiceGatewaysResult]
Copy
func GetServiceGateways(ctx *Context, args *GetServiceGatewaysArgs, opts ...InvokeOption) (*GetServiceGatewaysResult, error)
func GetServiceGatewaysOutput(ctx *Context, args *GetServiceGatewaysOutputArgs, opts ...InvokeOption) GetServiceGatewaysResultOutput
Copy

> Note: This function is named GetServiceGateways in the Go SDK.

public static class GetServiceGateways 
{
    public static Task<GetServiceGatewaysResult> InvokeAsync(GetServiceGatewaysArgs args, InvokeOptions? opts = null)
    public static Output<GetServiceGatewaysResult> Invoke(GetServiceGatewaysInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetServiceGatewaysResult> getServiceGateways(GetServiceGatewaysArgs args, InvokeOptions options)
public static Output<GetServiceGatewaysResult> getServiceGateways(GetServiceGatewaysArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:Core/getServiceGateways:getServiceGateways
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

CompartmentId This property is required. string
The OCID of the compartment.
Filters Changes to this property will trigger replacement. List<GetServiceGatewaysFilter>
State string
A filter to return only resources that match the given lifecycle state. The state value is case-insensitive.
VcnId string
The OCID of the VCN.
CompartmentId This property is required. string
The OCID of the compartment.
Filters Changes to this property will trigger replacement. []GetServiceGatewaysFilter
State string
A filter to return only resources that match the given lifecycle state. The state value is case-insensitive.
VcnId string
The OCID of the VCN.
compartmentId This property is required. String
The OCID of the compartment.
filters Changes to this property will trigger replacement. List<GetServiceGatewaysFilter>
state String
A filter to return only resources that match the given lifecycle state. The state value is case-insensitive.
vcnId String
The OCID of the VCN.
compartmentId This property is required. string
The OCID of the compartment.
filters Changes to this property will trigger replacement. GetServiceGatewaysFilter[]
state string
A filter to return only resources that match the given lifecycle state. The state value is case-insensitive.
vcnId string
The OCID of the VCN.
compartment_id This property is required. str
The OCID of the compartment.
filters Changes to this property will trigger replacement. Sequence[core.GetServiceGatewaysFilter]
state str
A filter to return only resources that match the given lifecycle state. The state value is case-insensitive.
vcn_id str
The OCID of the VCN.
compartmentId This property is required. String
The OCID of the compartment.
filters Changes to this property will trigger replacement. List<Property Map>
state String
A filter to return only resources that match the given lifecycle state. The state value is case-insensitive.
vcnId String
The OCID of the VCN.

getServiceGateways Result

The following output properties are available:

CompartmentId string
The OCID of the compartment that contains the service gateway.
Id string
The provider-assigned unique ID for this managed resource.
ServiceGateways List<GetServiceGatewaysServiceGateway>
The list of service_gateways.
Filters List<GetServiceGatewaysFilter>
State string
The service gateway's current state.
VcnId string
The OCID of the VCN the service gateway belongs to.
CompartmentId string
The OCID of the compartment that contains the service gateway.
Id string
The provider-assigned unique ID for this managed resource.
ServiceGateways []GetServiceGatewaysServiceGateway
The list of service_gateways.
Filters []GetServiceGatewaysFilter
State string
The service gateway's current state.
VcnId string
The OCID of the VCN the service gateway belongs to.
compartmentId String
The OCID of the compartment that contains the service gateway.
id String
The provider-assigned unique ID for this managed resource.
serviceGateways List<GetServiceGatewaysServiceGateway>
The list of service_gateways.
filters List<GetServiceGatewaysFilter>
state String
The service gateway's current state.
vcnId String
The OCID of the VCN the service gateway belongs to.
compartmentId string
The OCID of the compartment that contains the service gateway.
id string
The provider-assigned unique ID for this managed resource.
serviceGateways GetServiceGatewaysServiceGateway[]
The list of service_gateways.
filters GetServiceGatewaysFilter[]
state string
The service gateway's current state.
vcnId string
The OCID of the VCN the service gateway belongs to.
compartment_id str
The OCID of the compartment that contains the service gateway.
id str
The provider-assigned unique ID for this managed resource.
service_gateways Sequence[core.GetServiceGatewaysServiceGateway]
The list of service_gateways.
filters Sequence[core.GetServiceGatewaysFilter]
state str
The service gateway's current state.
vcn_id str
The OCID of the VCN the service gateway belongs to.
compartmentId String
The OCID of the compartment that contains the service gateway.
id String
The provider-assigned unique ID for this managed resource.
serviceGateways List<Property Map>
The list of service_gateways.
filters List<Property Map>
state String
The service gateway's current state.
vcnId String
The OCID of the VCN the service gateway belongs to.

Supporting Types

GetServiceGatewaysFilter

Name This property is required. string
Values This property is required. List<string>
Regex bool
Name This property is required. string
Values This property is required. []string
Regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean
name This property is required. string
values This property is required. string[]
regex boolean
name This property is required. str
values This property is required. Sequence[str]
regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean

GetServiceGatewaysServiceGateway

BlockTraffic This property is required. bool
Whether the service gateway blocks all traffic through it. The default is false. When this is true, traffic is not routed to any services, regardless of route rules. Example: true
CompartmentId This property is required. string
The OCID of the compartment.
DefinedTags This property is required. Dictionary<string, string>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
DisplayName This property is required. string
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
FreeformTags This property is required. Dictionary<string, string>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
Id This property is required. string
The OCID of the service gateway.
RouteTableId This property is required. string
The OCID of the route table the service gateway is using. For information about why you would associate a route table with a service gateway, see Transit Routing: Private Access to Oracle Services.
Services This property is required. List<GetServiceGatewaysServiceGatewayService>
List of the Service objects enabled for this service gateway. The list can be empty. You can enable a particular Service by using AttachServiceId or UpdateServiceGateway.
State This property is required. string
A filter to return only resources that match the given lifecycle state. The state value is case-insensitive.
TimeCreated This property is required. string
The date and time the service gateway was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
VcnId This property is required. string
The OCID of the VCN.
BlockTraffic This property is required. bool
Whether the service gateway blocks all traffic through it. The default is false. When this is true, traffic is not routed to any services, regardless of route rules. Example: true
CompartmentId This property is required. string
The OCID of the compartment.
DefinedTags This property is required. map[string]string
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
DisplayName This property is required. string
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
FreeformTags This property is required. map[string]string
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
Id This property is required. string
The OCID of the service gateway.
RouteTableId This property is required. string
The OCID of the route table the service gateway is using. For information about why you would associate a route table with a service gateway, see Transit Routing: Private Access to Oracle Services.
Services This property is required. []GetServiceGatewaysServiceGatewayService
List of the Service objects enabled for this service gateway. The list can be empty. You can enable a particular Service by using AttachServiceId or UpdateServiceGateway.
State This property is required. string
A filter to return only resources that match the given lifecycle state. The state value is case-insensitive.
TimeCreated This property is required. string
The date and time the service gateway was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
VcnId This property is required. string
The OCID of the VCN.
blockTraffic This property is required. Boolean
Whether the service gateway blocks all traffic through it. The default is false. When this is true, traffic is not routed to any services, regardless of route rules. Example: true
compartmentId This property is required. String
The OCID of the compartment.
definedTags This property is required. Map<String,String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName This property is required. String
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags This property is required. Map<String,String>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. String
The OCID of the service gateway.
routeTableId This property is required. String
The OCID of the route table the service gateway is using. For information about why you would associate a route table with a service gateway, see Transit Routing: Private Access to Oracle Services.
services This property is required. List<GetServiceGatewaysServiceGatewayService>
List of the Service objects enabled for this service gateway. The list can be empty. You can enable a particular Service by using AttachServiceId or UpdateServiceGateway.
state This property is required. String
A filter to return only resources that match the given lifecycle state. The state value is case-insensitive.
timeCreated This property is required. String
The date and time the service gateway was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
vcnId This property is required. String
The OCID of the VCN.
blockTraffic This property is required. boolean
Whether the service gateway blocks all traffic through it. The default is false. When this is true, traffic is not routed to any services, regardless of route rules. Example: true
compartmentId This property is required. string
The OCID of the compartment.
definedTags This property is required. {[key: string]: string}
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName This property is required. string
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags This property is required. {[key: string]: string}
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. string
The OCID of the service gateway.
routeTableId This property is required. string
The OCID of the route table the service gateway is using. For information about why you would associate a route table with a service gateway, see Transit Routing: Private Access to Oracle Services.
services This property is required. GetServiceGatewaysServiceGatewayService[]
List of the Service objects enabled for this service gateway. The list can be empty. You can enable a particular Service by using AttachServiceId or UpdateServiceGateway.
state This property is required. string
A filter to return only resources that match the given lifecycle state. The state value is case-insensitive.
timeCreated This property is required. string
The date and time the service gateway was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
vcnId This property is required. string
The OCID of the VCN.
block_traffic This property is required. bool
Whether the service gateway blocks all traffic through it. The default is false. When this is true, traffic is not routed to any services, regardless of route rules. Example: true
compartment_id This property is required. str
The OCID of the compartment.
defined_tags This property is required. Mapping[str, str]
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
display_name This property is required. str
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeform_tags This property is required. Mapping[str, str]
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. str
The OCID of the service gateway.
route_table_id This property is required. str
The OCID of the route table the service gateway is using. For information about why you would associate a route table with a service gateway, see Transit Routing: Private Access to Oracle Services.
services This property is required. Sequence[core.GetServiceGatewaysServiceGatewayService]
List of the Service objects enabled for this service gateway. The list can be empty. You can enable a particular Service by using AttachServiceId or UpdateServiceGateway.
state This property is required. str
A filter to return only resources that match the given lifecycle state. The state value is case-insensitive.
time_created This property is required. str
The date and time the service gateway was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
vcn_id This property is required. str
The OCID of the VCN.
blockTraffic This property is required. Boolean
Whether the service gateway blocks all traffic through it. The default is false. When this is true, traffic is not routed to any services, regardless of route rules. Example: true
compartmentId This property is required. String
The OCID of the compartment.
definedTags This property is required. Map<String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName This property is required. String
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags This property is required. Map<String>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. String
The OCID of the service gateway.
routeTableId This property is required. String
The OCID of the route table the service gateway is using. For information about why you would associate a route table with a service gateway, see Transit Routing: Private Access to Oracle Services.
services This property is required. List<Property Map>
List of the Service objects enabled for this service gateway. The list can be empty. You can enable a particular Service by using AttachServiceId or UpdateServiceGateway.
state This property is required. String
A filter to return only resources that match the given lifecycle state. The state value is case-insensitive.
timeCreated This property is required. String
The date and time the service gateway was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
vcnId This property is required. String
The OCID of the VCN.

GetServiceGatewaysServiceGatewayService

ServiceId This property is required. string
The OCID of the service.
ServiceName This property is required. string
The name of the service.
ServiceId This property is required. string
The OCID of the service.
ServiceName This property is required. string
The name of the service.
serviceId This property is required. String
The OCID of the service.
serviceName This property is required. String
The name of the service.
serviceId This property is required. string
The OCID of the service.
serviceName This property is required. string
The name of the service.
service_id This property is required. str
The OCID of the service.
service_name This property is required. str
The name of the service.
serviceId This property is required. String
The OCID of the service.
serviceName This property is required. String
The name of the service.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi