azure logo
Azure Classic v5.38.0, Mar 21 23

azure.connections.ApiConnection

Manages an API Connection.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
    {
        Location = "West Europe",
    });

    var exampleManagedApi = Azure.Connections.GetManagedApi.Invoke(new()
    {
        Name = "servicebus",
        Location = exampleResourceGroup.Location,
    });

    var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        Sku = "Basic",
    });

    var exampleApiConnection = new Azure.Connections.ApiConnection("exampleApiConnection", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        ManagedApiId = exampleManagedApi.Apply(getManagedApiResult => getManagedApiResult.Id),
        DisplayName = "Example 1",
        ParameterValues = 
        {
            { "connectionString", exampleNamespace.DefaultPrimaryConnectionString },
        },
        Tags = 
        {
            { "Hello", "World" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/connections"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleManagedApi := connections.GetManagedApiOutput(ctx, connections.GetManagedApiOutputArgs{
			Name:     pulumi.String("servicebus"),
			Location: exampleResourceGroup.Location,
		}, nil)
		exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			Sku:               pulumi.String("Basic"),
		})
		if err != nil {
			return err
		}
		_, err = connections.NewApiConnection(ctx, "exampleApiConnection", &connections.ApiConnectionArgs{
			ResourceGroupName: exampleResourceGroup.Name,
			ManagedApiId: exampleManagedApi.ApplyT(func(exampleManagedApi connections.GetManagedApiResult) (*string, error) {
				return &exampleManagedApi.Id, nil
			}).(pulumi.StringPtrOutput),
			DisplayName: pulumi.String("Example 1"),
			ParameterValues: pulumi.StringMap{
				"connectionString": exampleNamespace.DefaultPrimaryConnectionString,
			},
			Tags: pulumi.StringMap{
				"Hello": pulumi.String("World"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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.connections.ConnectionsFunctions;
import com.pulumi.azure.connections.inputs.GetManagedApiArgs;
import com.pulumi.azure.servicebus.Namespace;
import com.pulumi.azure.servicebus.NamespaceArgs;
import com.pulumi.azure.connections.ApiConnection;
import com.pulumi.azure.connections.ApiConnectionArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        final var exampleManagedApi = ConnectionsFunctions.getManagedApi(GetManagedApiArgs.builder()
            .name("servicebus")
            .location(exampleResourceGroup.location())
            .build());

        var exampleNamespace = new Namespace("exampleNamespace", NamespaceArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .sku("Basic")
            .build());

        var exampleApiConnection = new ApiConnection("exampleApiConnection", ApiConnectionArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .managedApiId(exampleManagedApi.applyValue(getManagedApiResult -> getManagedApiResult).applyValue(exampleManagedApi -> exampleManagedApi.applyValue(getManagedApiResult -> getManagedApiResult.id())))
            .displayName("Example 1")
            .parameterValues(Map.of("connectionString", exampleNamespace.defaultPrimaryConnectionString()))
            .tags(Map.of("Hello", "World"))
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_managed_api = azure.connections.get_managed_api_output(name="servicebus",
    location=example_resource_group.location)
example_namespace = azure.servicebus.Namespace("exampleNamespace",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    sku="Basic")
example_api_connection = azure.connections.ApiConnection("exampleApiConnection",
    resource_group_name=example_resource_group.name,
    managed_api_id=example_managed_api.id,
    display_name="Example 1",
    parameter_values={
        "connectionString": example_namespace.default_primary_connection_string,
    },
    tags={
        "Hello": "World",
    })
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleManagedApi = azure.connections.getManagedApiOutput({
    name: "servicebus",
    location: exampleResourceGroup.location,
});
const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    sku: "Basic",
});
const exampleApiConnection = new azure.connections.ApiConnection("exampleApiConnection", {
    resourceGroupName: exampleResourceGroup.name,
    managedApiId: exampleManagedApi.apply(exampleManagedApi => exampleManagedApi.id),
    displayName: "Example 1",
    parameterValues: {
        connectionString: exampleNamespace.defaultPrimaryConnectionString,
    },
    tags: {
        Hello: "World",
    },
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleNamespace:
    type: azure:servicebus:Namespace
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      sku: Basic
  exampleApiConnection:
    type: azure:connections:ApiConnection
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      managedApiId: ${exampleManagedApi.id}
      displayName: Example 1
      parameterValues:
        connectionString: ${exampleNamespace.defaultPrimaryConnectionString}
      tags:
        Hello: World
variables:
  exampleManagedApi:
    fn::invoke:
      Function: azure:connections:getManagedApi
      Arguments:
        name: servicebus
        location: ${exampleResourceGroup.location}

Create ApiConnection Resource

new ApiConnection(name: string, args: ApiConnectionArgs, opts?: CustomResourceOptions);
@overload
def ApiConnection(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  display_name: Optional[str] = None,
                  managed_api_id: Optional[str] = None,
                  name: Optional[str] = None,
                  parameter_values: Optional[Mapping[str, str]] = None,
                  resource_group_name: Optional[str] = None,
                  tags: Optional[Mapping[str, str]] = None)
@overload
def ApiConnection(resource_name: str,
                  args: ApiConnectionArgs,
                  opts: Optional[ResourceOptions] = None)
func NewApiConnection(ctx *Context, name string, args ApiConnectionArgs, opts ...ResourceOption) (*ApiConnection, error)
public ApiConnection(string name, ApiConnectionArgs args, CustomResourceOptions? opts = null)
public ApiConnection(String name, ApiConnectionArgs args)
public ApiConnection(String name, ApiConnectionArgs args, CustomResourceOptions options)
type: azure:connections:ApiConnection
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ApiConnectionArgs
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 ApiConnectionArgs
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 ApiConnectionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ApiConnectionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ApiConnectionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

ManagedApiId string

The ID of the Managed API which this API Connection is linked to. Changing this forces a new API Connection to be created.

ResourceGroupName string

The name of the Resource Group where this API Connection should exist. Changing this forces a new API Connection to be created.

DisplayName string

A display name for this API Connection. Changing this forces a new API Connection to be created.

Name string

The Name which should be used for this API Connection. Changing this forces a new API Connection to be created.

ParameterValues Dictionary<string, string>

A map of parameter values associated with this API Connection. Changing this forces a new API Connection to be created.

Tags Dictionary<string, string>

A mapping of tags which should be assigned to the API Connection.

ManagedApiId string

The ID of the Managed API which this API Connection is linked to. Changing this forces a new API Connection to be created.

ResourceGroupName string

The name of the Resource Group where this API Connection should exist. Changing this forces a new API Connection to be created.

DisplayName string

A display name for this API Connection. Changing this forces a new API Connection to be created.

Name string

The Name which should be used for this API Connection. Changing this forces a new API Connection to be created.

ParameterValues map[string]string

A map of parameter values associated with this API Connection. Changing this forces a new API Connection to be created.

Tags map[string]string

A mapping of tags which should be assigned to the API Connection.

managedApiId String

The ID of the Managed API which this API Connection is linked to. Changing this forces a new API Connection to be created.

resourceGroupName String

The name of the Resource Group where this API Connection should exist. Changing this forces a new API Connection to be created.

displayName String

A display name for this API Connection. Changing this forces a new API Connection to be created.

name String

The Name which should be used for this API Connection. Changing this forces a new API Connection to be created.

parameterValues Map<String,String>

A map of parameter values associated with this API Connection. Changing this forces a new API Connection to be created.

tags Map<String,String>

A mapping of tags which should be assigned to the API Connection.

managedApiId string

The ID of the Managed API which this API Connection is linked to. Changing this forces a new API Connection to be created.

resourceGroupName string

The name of the Resource Group where this API Connection should exist. Changing this forces a new API Connection to be created.

displayName string

A display name for this API Connection. Changing this forces a new API Connection to be created.

name string

The Name which should be used for this API Connection. Changing this forces a new API Connection to be created.

parameterValues {[key: string]: string}

A map of parameter values associated with this API Connection. Changing this forces a new API Connection to be created.

tags {[key: string]: string}

A mapping of tags which should be assigned to the API Connection.

managed_api_id str

The ID of the Managed API which this API Connection is linked to. Changing this forces a new API Connection to be created.

resource_group_name str

The name of the Resource Group where this API Connection should exist. Changing this forces a new API Connection to be created.

display_name str

A display name for this API Connection. Changing this forces a new API Connection to be created.

name str

The Name which should be used for this API Connection. Changing this forces a new API Connection to be created.

parameter_values Mapping[str, str]

A map of parameter values associated with this API Connection. Changing this forces a new API Connection to be created.

tags Mapping[str, str]

A mapping of tags which should be assigned to the API Connection.

managedApiId String

The ID of the Managed API which this API Connection is linked to. Changing this forces a new API Connection to be created.

resourceGroupName String

The name of the Resource Group where this API Connection should exist. Changing this forces a new API Connection to be created.

displayName String

A display name for this API Connection. Changing this forces a new API Connection to be created.

name String

The Name which should be used for this API Connection. Changing this forces a new API Connection to be created.

parameterValues Map<String>

A map of parameter values associated with this API Connection. Changing this forces a new API Connection to be created.

tags Map<String>

A mapping of tags which should be assigned to the API Connection.

Outputs

All input properties are implicitly available as output properties. Additionally, the ApiConnection 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 ApiConnection Resource

Get an existing ApiConnection 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?: ApiConnectionState, opts?: CustomResourceOptions): ApiConnection
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        display_name: Optional[str] = None,
        managed_api_id: Optional[str] = None,
        name: Optional[str] = None,
        parameter_values: Optional[Mapping[str, str]] = None,
        resource_group_name: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None) -> ApiConnection
func GetApiConnection(ctx *Context, name string, id IDInput, state *ApiConnectionState, opts ...ResourceOption) (*ApiConnection, error)
public static ApiConnection Get(string name, Input<string> id, ApiConnectionState? state, CustomResourceOptions? opts = null)
public static ApiConnection get(String name, Output<String> id, ApiConnectionState 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:
DisplayName string

A display name for this API Connection. Changing this forces a new API Connection to be created.

ManagedApiId string

The ID of the Managed API which this API Connection is linked to. Changing this forces a new API Connection to be created.

Name string

The Name which should be used for this API Connection. Changing this forces a new API Connection to be created.

ParameterValues Dictionary<string, string>

A map of parameter values associated with this API Connection. Changing this forces a new API Connection to be created.

ResourceGroupName string

The name of the Resource Group where this API Connection should exist. Changing this forces a new API Connection to be created.

Tags Dictionary<string, string>

A mapping of tags which should be assigned to the API Connection.

DisplayName string

A display name for this API Connection. Changing this forces a new API Connection to be created.

ManagedApiId string

The ID of the Managed API which this API Connection is linked to. Changing this forces a new API Connection to be created.

Name string

The Name which should be used for this API Connection. Changing this forces a new API Connection to be created.

ParameterValues map[string]string

A map of parameter values associated with this API Connection. Changing this forces a new API Connection to be created.

ResourceGroupName string

The name of the Resource Group where this API Connection should exist. Changing this forces a new API Connection to be created.

Tags map[string]string

A mapping of tags which should be assigned to the API Connection.

displayName String

A display name for this API Connection. Changing this forces a new API Connection to be created.

managedApiId String

The ID of the Managed API which this API Connection is linked to. Changing this forces a new API Connection to be created.

name String

The Name which should be used for this API Connection. Changing this forces a new API Connection to be created.

parameterValues Map<String,String>

A map of parameter values associated with this API Connection. Changing this forces a new API Connection to be created.

resourceGroupName String

The name of the Resource Group where this API Connection should exist. Changing this forces a new API Connection to be created.

tags Map<String,String>

A mapping of tags which should be assigned to the API Connection.

displayName string

A display name for this API Connection. Changing this forces a new API Connection to be created.

managedApiId string

The ID of the Managed API which this API Connection is linked to. Changing this forces a new API Connection to be created.

name string

The Name which should be used for this API Connection. Changing this forces a new API Connection to be created.

parameterValues {[key: string]: string}

A map of parameter values associated with this API Connection. Changing this forces a new API Connection to be created.

resourceGroupName string

The name of the Resource Group where this API Connection should exist. Changing this forces a new API Connection to be created.

tags {[key: string]: string}

A mapping of tags which should be assigned to the API Connection.

display_name str

A display name for this API Connection. Changing this forces a new API Connection to be created.

managed_api_id str

The ID of the Managed API which this API Connection is linked to. Changing this forces a new API Connection to be created.

name str

The Name which should be used for this API Connection. Changing this forces a new API Connection to be created.

parameter_values Mapping[str, str]

A map of parameter values associated with this API Connection. Changing this forces a new API Connection to be created.

resource_group_name str

The name of the Resource Group where this API Connection should exist. Changing this forces a new API Connection to be created.

tags Mapping[str, str]

A mapping of tags which should be assigned to the API Connection.

displayName String

A display name for this API Connection. Changing this forces a new API Connection to be created.

managedApiId String

The ID of the Managed API which this API Connection is linked to. Changing this forces a new API Connection to be created.

name String

The Name which should be used for this API Connection. Changing this forces a new API Connection to be created.

parameterValues Map<String>

A map of parameter values associated with this API Connection. Changing this forces a new API Connection to be created.

resourceGroupName String

The name of the Resource Group where this API Connection should exist. Changing this forces a new API Connection to be created.

tags Map<String>

A mapping of tags which should be assigned to the API Connection.

Import

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

 $ pulumi import azure:connections/apiConnection:ApiConnection example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.Web/connections/example-connection

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.