1. Packages
  2. Azure Classic
  3. API Docs
  4. apimanagement
  5. getGateway

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.apimanagement.getGateway

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

Use this data source to access information about an existing API Management Gateway.

Example Usage

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

const example = azure.apimanagement.getService({
    name: "example-apim",
    resourceGroupName: "example-rg",
});
const exampleGetGateway = example.then(example => azure.apimanagement.getGateway({
    name: "example-api-gateway",
    apiManagementId: example.id,
}));
Copy
import pulumi
import pulumi_azure as azure

example = azure.apimanagement.get_service(name="example-apim",
    resource_group_name="example-rg")
example_get_gateway = azure.apimanagement.get_gateway(name="example-api-gateway",
    api_management_id=example.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{
			Name:              "example-apim",
			ResourceGroupName: "example-rg",
		}, nil)
		if err != nil {
			return err
		}
		_, err = apimanagement.LookupGateway(ctx, &apimanagement.LookupGatewayArgs{
			Name:            "example-api-gateway",
			ApiManagementId: example.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.ApiManagement.GetService.Invoke(new()
    {
        Name = "example-apim",
        ResourceGroupName = "example-rg",
    });

    var exampleGetGateway = Azure.ApiManagement.GetGateway.Invoke(new()
    {
        Name = "example-api-gateway",
        ApiManagementId = example.Apply(getServiceResult => getServiceResult.Id),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.apimanagement.ApimanagementFunctions;
import com.pulumi.azure.apimanagement.inputs.GetServiceArgs;
import com.pulumi.azure.apimanagement.inputs.GetGatewayArgs;
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 example = ApimanagementFunctions.getService(GetServiceArgs.builder()
            .name("example-apim")
            .resourceGroupName("example-rg")
            .build());

        final var exampleGetGateway = ApimanagementFunctions.getGateway(GetGatewayArgs.builder()
            .name("example-api-gateway")
            .apiManagementId(example.applyValue(getServiceResult -> getServiceResult.id()))
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:apimanagement:getService
      arguments:
        name: example-apim
        resourceGroupName: example-rg
  exampleGetGateway:
    fn::invoke:
      function: azure:apimanagement:getGateway
      arguments:
        name: example-api-gateway
        apiManagementId: ${example.id}
Copy

Using getGateway

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 getGateway(args: GetGatewayArgs, opts?: InvokeOptions): Promise<GetGatewayResult>
function getGatewayOutput(args: GetGatewayOutputArgs, opts?: InvokeOptions): Output<GetGatewayResult>
Copy
def get_gateway(api_management_id: Optional[str] = None,
                name: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetGatewayResult
def get_gateway_output(api_management_id: Optional[pulumi.Input[str]] = None,
                name: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetGatewayResult]
Copy
func LookupGateway(ctx *Context, args *LookupGatewayArgs, opts ...InvokeOption) (*LookupGatewayResult, error)
func LookupGatewayOutput(ctx *Context, args *LookupGatewayOutputArgs, opts ...InvokeOption) LookupGatewayResultOutput
Copy

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

public static class GetGateway 
{
    public static Task<GetGatewayResult> InvokeAsync(GetGatewayArgs args, InvokeOptions? opts = null)
    public static Output<GetGatewayResult> Invoke(GetGatewayInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetGatewayResult> getGateway(GetGatewayArgs args, InvokeOptions options)
public static Output<GetGatewayResult> getGateway(GetGatewayArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:apimanagement/getGateway:getGateway
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ApiManagementId This property is required. string
The ID of the API Management Service in which the Gateway exists.
Name This property is required. string
The name of the API Management Gateway.
ApiManagementId This property is required. string
The ID of the API Management Service in which the Gateway exists.
Name This property is required. string
The name of the API Management Gateway.
apiManagementId This property is required. String
The ID of the API Management Service in which the Gateway exists.
name This property is required. String
The name of the API Management Gateway.
apiManagementId This property is required. string
The ID of the API Management Service in which the Gateway exists.
name This property is required. string
The name of the API Management Gateway.
api_management_id This property is required. str
The ID of the API Management Service in which the Gateway exists.
name This property is required. str
The name of the API Management Gateway.
apiManagementId This property is required. String
The ID of the API Management Service in which the Gateway exists.
name This property is required. String
The name of the API Management Gateway.

getGateway Result

The following output properties are available:

ApiManagementId string
Description string
The description of the API Management Gateway.
Id string
The provider-assigned unique ID for this managed resource.
LocationDatas List<GetGatewayLocationData>
A location_data block as documented below.
Name string
A canonical name for the geographic or physical location.
ApiManagementId string
Description string
The description of the API Management Gateway.
Id string
The provider-assigned unique ID for this managed resource.
LocationDatas []GetGatewayLocationData
A location_data block as documented below.
Name string
A canonical name for the geographic or physical location.
apiManagementId String
description String
The description of the API Management Gateway.
id String
The provider-assigned unique ID for this managed resource.
locationDatas List<GetGatewayLocationData>
A location_data block as documented below.
name String
A canonical name for the geographic or physical location.
apiManagementId string
description string
The description of the API Management Gateway.
id string
The provider-assigned unique ID for this managed resource.
locationDatas GetGatewayLocationData[]
A location_data block as documented below.
name string
A canonical name for the geographic or physical location.
api_management_id str
description str
The description of the API Management Gateway.
id str
The provider-assigned unique ID for this managed resource.
location_datas Sequence[GetGatewayLocationData]
A location_data block as documented below.
name str
A canonical name for the geographic or physical location.
apiManagementId String
description String
The description of the API Management Gateway.
id String
The provider-assigned unique ID for this managed resource.
locationDatas List<Property Map>
A location_data block as documented below.
name String
A canonical name for the geographic or physical location.

Supporting Types

GetGatewayLocationData

City This property is required. string
The city or locality where the resource is located.
District This property is required. string
The district, state, or province where the resource is located.
Name This property is required. string
The name of the API Management Gateway.
Region This property is required. string
City This property is required. string
The city or locality where the resource is located.
District This property is required. string
The district, state, or province where the resource is located.
Name This property is required. string
The name of the API Management Gateway.
Region This property is required. string
city This property is required. String
The city or locality where the resource is located.
district This property is required. String
The district, state, or province where the resource is located.
name This property is required. String
The name of the API Management Gateway.
region This property is required. String
city This property is required. string
The city or locality where the resource is located.
district This property is required. string
The district, state, or province where the resource is located.
name This property is required. string
The name of the API Management Gateway.
region This property is required. string
city This property is required. str
The city or locality where the resource is located.
district This property is required. str
The district, state, or province where the resource is located.
name This property is required. str
The name of the API Management Gateway.
region This property is required. str
city This property is required. String
The city or locality where the resource is located.
district This property is required. String
The district, state, or province where the resource is located.
name This property is required. String
The name of the API Management Gateway.
region This property is required. String

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi