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

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

azure.apimanagement.Gateway

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

    Manages an API Management Gateway.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const exampleService = new azure.apimanagement.Service("example", {
        name: "example-apim",
        location: example.location,
        resourceGroupName: example.name,
        publisherName: "pub1",
        publisherEmail: "pub1@email.com",
        skuName: "Consumption_0",
    });
    const exampleGateway = new azure.apimanagement.Gateway("example", {
        name: "example-gateway",
        apiManagementId: exampleService.id,
        description: "Example API Management gateway",
        locationData: {
            name: "example name",
            city: "example city",
            district: "example district",
            region: "example region",
        },
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    example_service = azure.apimanagement.Service("example",
        name="example-apim",
        location=example.location,
        resource_group_name=example.name,
        publisher_name="pub1",
        publisher_email="pub1@email.com",
        sku_name="Consumption_0")
    example_gateway = azure.apimanagement.Gateway("example",
        name="example-gateway",
        api_management_id=example_service.id,
        description="Example API Management gateway",
        location_data=azure.apimanagement.GatewayLocationDataArgs(
            name="example name",
            city="example city",
            district="example district",
            region="example region",
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
    			Name:              pulumi.String("example-apim"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			PublisherName:     pulumi.String("pub1"),
    			PublisherEmail:    pulumi.String("pub1@email.com"),
    			SkuName:           pulumi.String("Consumption_0"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = apimanagement.NewGateway(ctx, "example", &apimanagement.GatewayArgs{
    			Name:            pulumi.String("example-gateway"),
    			ApiManagementId: exampleService.ID(),
    			Description:     pulumi.String("Example API Management gateway"),
    			LocationData: &apimanagement.GatewayLocationDataArgs{
    				Name:     pulumi.String("example name"),
    				City:     pulumi.String("example city"),
    				District: pulumi.String("example district"),
    				Region:   pulumi.String("example region"),
    			},
    		})
    		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 = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var exampleService = new Azure.ApiManagement.Service("example", new()
        {
            Name = "example-apim",
            Location = example.Location,
            ResourceGroupName = example.Name,
            PublisherName = "pub1",
            PublisherEmail = "pub1@email.com",
            SkuName = "Consumption_0",
        });
    
        var exampleGateway = new Azure.ApiManagement.Gateway("example", new()
        {
            Name = "example-gateway",
            ApiManagementId = exampleService.Id,
            Description = "Example API Management gateway",
            LocationData = new Azure.ApiManagement.Inputs.GatewayLocationDataArgs
            {
                Name = "example name",
                City = "example city",
                District = "example district",
                Region = "example region",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.apimanagement.Service;
    import com.pulumi.azure.apimanagement.ServiceArgs;
    import com.pulumi.azure.apimanagement.Gateway;
    import com.pulumi.azure.apimanagement.GatewayArgs;
    import com.pulumi.azure.apimanagement.inputs.GatewayLocationDataArgs;
    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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .name("example-resources")
                .location("West Europe")
                .build());
    
            var exampleService = new Service("exampleService", ServiceArgs.builder()
                .name("example-apim")
                .location(example.location())
                .resourceGroupName(example.name())
                .publisherName("pub1")
                .publisherEmail("pub1@email.com")
                .skuName("Consumption_0")
                .build());
    
            var exampleGateway = new Gateway("exampleGateway", GatewayArgs.builder()
                .name("example-gateway")
                .apiManagementId(exampleService.id())
                .description("Example API Management gateway")
                .locationData(GatewayLocationDataArgs.builder()
                    .name("example name")
                    .city("example city")
                    .district("example district")
                    .region("example region")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      exampleService:
        type: azure:apimanagement:Service
        name: example
        properties:
          name: example-apim
          location: ${example.location}
          resourceGroupName: ${example.name}
          publisherName: pub1
          publisherEmail: pub1@email.com
          skuName: Consumption_0
      exampleGateway:
        type: azure:apimanagement:Gateway
        name: example
        properties:
          name: example-gateway
          apiManagementId: ${exampleService.id}
          description: Example API Management gateway
          locationData:
            name: example name
            city: example city
            district: example district
            region: example region
    

    Create Gateway Resource

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

    Constructor syntax

    new Gateway(name: string, args: GatewayArgs, opts?: CustomResourceOptions);
    @overload
    def Gateway(resource_name: str,
                args: GatewayArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Gateway(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                api_management_id: Optional[str] = None,
                location_data: Optional[GatewayLocationDataArgs] = None,
                description: Optional[str] = None,
                name: Optional[str] = None)
    func NewGateway(ctx *Context, name string, args GatewayArgs, opts ...ResourceOption) (*Gateway, error)
    public Gateway(string name, GatewayArgs args, CustomResourceOptions? opts = null)
    public Gateway(String name, GatewayArgs args)
    public Gateway(String name, GatewayArgs args, CustomResourceOptions options)
    
    type: azure:apimanagement:Gateway
    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 GatewayArgs
    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 GatewayArgs
    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 GatewayArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GatewayArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GatewayArgs
    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 gatewayResource = new Azure.ApiManagement.Gateway("gatewayResource", new()
    {
        ApiManagementId = "string",
        LocationData = new Azure.ApiManagement.Inputs.GatewayLocationDataArgs
        {
            Name = "string",
            City = "string",
            District = "string",
            Region = "string",
        },
        Description = "string",
        Name = "string",
    });
    
    example, err := apimanagement.NewGateway(ctx, "gatewayResource", &apimanagement.GatewayArgs{
    	ApiManagementId: pulumi.String("string"),
    	LocationData: &apimanagement.GatewayLocationDataArgs{
    		Name:     pulumi.String("string"),
    		City:     pulumi.String("string"),
    		District: pulumi.String("string"),
    		Region:   pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    })
    
    var gatewayResource = new Gateway("gatewayResource", GatewayArgs.builder()
        .apiManagementId("string")
        .locationData(GatewayLocationDataArgs.builder()
            .name("string")
            .city("string")
            .district("string")
            .region("string")
            .build())
        .description("string")
        .name("string")
        .build());
    
    gateway_resource = azure.apimanagement.Gateway("gatewayResource",
        api_management_id="string",
        location_data=azure.apimanagement.GatewayLocationDataArgs(
            name="string",
            city="string",
            district="string",
            region="string",
        ),
        description="string",
        name="string")
    
    const gatewayResource = new azure.apimanagement.Gateway("gatewayResource", {
        apiManagementId: "string",
        locationData: {
            name: "string",
            city: "string",
            district: "string",
            region: "string",
        },
        description: "string",
        name: "string",
    });
    
    type: azure:apimanagement:Gateway
    properties:
        apiManagementId: string
        description: string
        locationData:
            city: string
            district: string
            name: string
            region: string
        name: string
    

    Gateway Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Gateway resource accepts the following input properties:

    ApiManagementId string
    The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
    LocationData GatewayLocationData
    A location_data block as documented below.
    Description string
    The description of the API Management Gateway.
    Name string
    The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
    ApiManagementId string
    The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
    LocationData GatewayLocationDataArgs
    A location_data block as documented below.
    Description string
    The description of the API Management Gateway.
    Name string
    The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
    apiManagementId String
    The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
    locationData GatewayLocationData
    A location_data block as documented below.
    description String
    The description of the API Management Gateway.
    name String
    The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
    apiManagementId string
    The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
    locationData GatewayLocationData
    A location_data block as documented below.
    description string
    The description of the API Management Gateway.
    name string
    The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
    api_management_id str
    The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
    location_data GatewayLocationDataArgs
    A location_data block as documented below.
    description str
    The description of the API Management Gateway.
    name str
    The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
    apiManagementId String
    The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
    locationData Property Map
    A location_data block as documented below.
    description String
    The description of the API Management Gateway.
    name String
    The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Gateway Resource

    Get an existing Gateway 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?: GatewayState, opts?: CustomResourceOptions): Gateway
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_management_id: Optional[str] = None,
            description: Optional[str] = None,
            location_data: Optional[GatewayLocationDataArgs] = None,
            name: Optional[str] = None) -> Gateway
    func GetGateway(ctx *Context, name string, id IDInput, state *GatewayState, opts ...ResourceOption) (*Gateway, error)
    public static Gateway Get(string name, Input<string> id, GatewayState? state, CustomResourceOptions? opts = null)
    public static Gateway get(String name, Output<String> id, GatewayState 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:
    ApiManagementId string
    The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
    Description string
    The description of the API Management Gateway.
    LocationData GatewayLocationData
    A location_data block as documented below.
    Name string
    The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
    ApiManagementId string
    The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
    Description string
    The description of the API Management Gateway.
    LocationData GatewayLocationDataArgs
    A location_data block as documented below.
    Name string
    The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
    apiManagementId String
    The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
    description String
    The description of the API Management Gateway.
    locationData GatewayLocationData
    A location_data block as documented below.
    name String
    The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
    apiManagementId string
    The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
    description string
    The description of the API Management Gateway.
    locationData GatewayLocationData
    A location_data block as documented below.
    name string
    The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
    api_management_id str
    The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
    description str
    The description of the API Management Gateway.
    location_data GatewayLocationDataArgs
    A location_data block as documented below.
    name str
    The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.
    apiManagementId String
    The ID of the API Management Resource in which the gateway will be created. Changing this forces a new API Management Gateway resource to be created.
    description String
    The description of the API Management Gateway.
    locationData Property Map
    A location_data block as documented below.
    name String
    The name which should be used for the API Management Gateway. Changing this forces a new API Management Gateway to be created.

    Supporting Types

    GatewayLocationData, GatewayLocationDataArgs

    Name string
    A canonical name for the geographic or physical location.
    City string
    The city or locality where the resource is located.
    District string
    The district, state, or province where the resource is located.
    Region string
    The country or region where the resource is located.
    Name string
    A canonical name for the geographic or physical location.
    City string
    The city or locality where the resource is located.
    District string
    The district, state, or province where the resource is located.
    Region string
    The country or region where the resource is located.
    name String
    A canonical name for the geographic or physical location.
    city String
    The city or locality where the resource is located.
    district String
    The district, state, or province where the resource is located.
    region String
    The country or region where the resource is located.
    name string
    A canonical name for the geographic or physical location.
    city string
    The city or locality where the resource is located.
    district string
    The district, state, or province where the resource is located.
    region string
    The country or region where the resource is located.
    name str
    A canonical name for the geographic or physical location.
    city str
    The city or locality where the resource is located.
    district str
    The district, state, or province where the resource is located.
    region str
    The country or region where the resource is located.
    name String
    A canonical name for the geographic or physical location.
    city String
    The city or locality where the resource is located.
    district String
    The district, state, or province where the resource is located.
    region String
    The country or region where the resource is located.

    Import

    API Management Gateways can be imported using the resource id, e.g.

    $ pulumi import azure:apimanagement/gateway:Gateway example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/gateways/gateway1
    

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

    Package Details

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

    We recommend using Azure Native.

    Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi