We recommend using Azure Native.
Azure v6.28.0 published on Friday, Oct 3, 2025 by Pulumi
azure.apimanagement.getGateway
Start a Neo task
Explain and create an azure.apimanagement.getGateway resource
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,
}));
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)
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
})
}
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),
});
});
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.id())
.build());
}
}
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}
API Providers
This data source uses the following Azure API Providers:
Microsoft.ApiManagement- 2022-08-01
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>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]func LookupGateway(ctx *Context, args *LookupGatewayArgs, opts ...InvokeOption) (*LookupGatewayResult, error)
func LookupGatewayOutput(ctx *Context, args *LookupGatewayOutputArgs, opts ...InvokeOption) LookupGatewayResultOutput> 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)
}public static CompletableFuture<GetGatewayResult> getGateway(GetGatewayArgs args, InvokeOptions options)
public static Output<GetGatewayResult> getGateway(GetGatewayArgs args, InvokeOptions options)
fn::invoke:
function: azure:apimanagement/getGateway:getGateway
arguments:
# arguments dictionaryThe following arguments are supported:
- Api
Management stringId - The ID of the API Management Service in which the Gateway exists.
- Name string
- The name of the API Management Gateway.
- Api
Management stringId - The ID of the API Management Service in which the Gateway exists.
- Name string
- The name of the API Management Gateway.
- api
Management StringId - The ID of the API Management Service in which the Gateway exists.
- name String
- The name of the API Management Gateway.
- api
Management stringId - The ID of the API Management Service in which the Gateway exists.
- name string
- The name of the API Management Gateway.
- api_
management_ strid - The ID of the API Management Service in which the Gateway exists.
- name str
- The name of the API Management Gateway.
- api
Management StringId - The ID of the API Management Service in which the Gateway exists.
- name String
- The name of the API Management Gateway.
getGateway Result
The following output properties are available:
- Api
Management stringId - Description string
- The description of the API Management Gateway.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location
Datas List<GetGateway Location Data> - A
location_datablock as documented below. - Name string
- A canonical name for the geographic or physical location.
- Api
Management stringId - Description string
- The description of the API Management Gateway.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location
Datas []GetGateway Location Data - A
location_datablock as documented below. - Name string
- A canonical name for the geographic or physical location.
- api
Management StringId - description String
- The description of the API Management Gateway.
- id String
- The provider-assigned unique ID for this managed resource.
- location
Datas List<GetGateway Location Data> - A
location_datablock as documented below. - name String
- A canonical name for the geographic or physical location.
- api
Management stringId - description string
- The description of the API Management Gateway.
- id string
- The provider-assigned unique ID for this managed resource.
- location
Datas GetGateway Location Data[] - A
location_datablock as documented below. - name string
- A canonical name for the geographic or physical location.
- api_
management_ strid - description str
- The description of the API Management Gateway.
- id str
- The provider-assigned unique ID for this managed resource.
- location_
datas Sequence[GetGateway Location Data] - A
location_datablock as documented below. - name str
- A canonical name for the geographic or physical location.
- api
Management StringId - description String
- The description of the API Management Gateway.
- id String
- The provider-assigned unique ID for this managed resource.
- location
Datas List<Property Map> - A
location_datablock as documented below. - name String
- A canonical name for the geographic or physical location.
Supporting Types
GetGatewayLocationData
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
