com.pulumi.azure.connections.kotlin.ApiConnectionArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.connections.kotlin
import com.pulumi.azure.connections.ApiConnectionArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Manages an API Connection.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const exampleResourceGroup = new azure.core.ResourceGroup("example", {
* name: "example-resources",
* location: "West Europe",
* });
* const example = azure.connections.getManagedApiOutput({
* name: "servicebus",
* location: exampleResourceGroup.location,
* });
* const exampleNamespace = new azure.servicebus.Namespace("example", {
* name: "acctestsbn-conn-example",
* location: exampleResourceGroup.location,
* resourceGroupName: exampleResourceGroup.name,
* sku: "Basic",
* });
* const exampleApiConnection = new azure.connections.ApiConnection("example", {
* name: "example-connection",
* resourceGroupName: exampleResourceGroup.name,
* managedApiId: example.apply(example => example.id),
* displayName: "Example 1",
* parameterValues: {
* connectionString: exampleNamespace.defaultPrimaryConnectionString,
* },
* tags: {
* Hello: "World",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example_resource_group = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example = azure.connections.get_managed_api_output(name="servicebus",
* location=example_resource_group.location)
* example_namespace = azure.servicebus.Namespace("example",
* name="acctestsbn-conn-example",
* location=example_resource_group.location,
* resource_group_name=example_resource_group.name,
* sku="Basic")
* example_api_connection = azure.connections.ApiConnection("example",
* name="example-connection",
* resource_group_name=example_resource_group.name,
* managed_api_id=example.id,
* display_name="Example 1",
* parameter_values={
* "connectionString": example_namespace.default_primary_connection_string,
* },
* tags={
* "Hello": "World",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var exampleResourceGroup = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "example-resources",
* Location = "West Europe",
* });
* var example = Azure.Connections.GetManagedApi.Invoke(new()
* {
* Name = "servicebus",
* Location = exampleResourceGroup.Location,
* });
* var exampleNamespace = new Azure.ServiceBus.Namespace("example", new()
* {
* Name = "acctestsbn-conn-example",
* Location = exampleResourceGroup.Location,
* ResourceGroupName = exampleResourceGroup.Name,
* Sku = "Basic",
* });
* var exampleApiConnection = new Azure.Connections.ApiConnection("example", new()
* {
* Name = "example-connection",
* ResourceGroupName = exampleResourceGroup.Name,
* ManagedApiId = example.Apply(getManagedApiResult => getManagedApiResult.Id),
* DisplayName = "Example 1",
* ParameterValues =
* {
* { "connectionString", exampleNamespace.DefaultPrimaryConnectionString },
* },
* Tags =
* {
* { "Hello", "World" },
* },
* });
* });
* ```
* ```go
* 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, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("example-resources"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* example := connections.GetManagedApiOutput(ctx, connections.GetManagedApiOutputArgs{
* Name: pulumi.String("servicebus"),
* Location: exampleResourceGroup.Location,
* }, nil)
* exampleNamespace, err := servicebus.NewNamespace(ctx, "example", &servicebus.NamespaceArgs{
* Name: pulumi.String("acctestsbn-conn-example"),
* Location: exampleResourceGroup.Location,
* ResourceGroupName: exampleResourceGroup.Name,
* Sku: pulumi.String("Basic"),
* })
* if err != nil {
* return err
* }
* _, err = connections.NewApiConnection(ctx, "example", &connections.ApiConnectionArgs{
* Name: pulumi.String("example-connection"),
* ResourceGroupName: exampleResourceGroup.Name,
* ManagedApiId: example.ApplyT(func(example connections.GetManagedApiResult) (*string, error) {
* return &example.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
* })
* }
* ```
* ```java
* 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()
* .name("example-resources")
* .location("West Europe")
* .build());
* final var example = ConnectionsFunctions.getManagedApi(GetManagedApiArgs.builder()
* .name("servicebus")
* .location(exampleResourceGroup.location())
* .build());
* var exampleNamespace = new Namespace("exampleNamespace", NamespaceArgs.builder()
* .name("acctestsbn-conn-example")
* .location(exampleResourceGroup.location())
* .resourceGroupName(exampleResourceGroup.name())
* .sku("Basic")
* .build());
* var exampleApiConnection = new ApiConnection("exampleApiConnection", ApiConnectionArgs.builder()
* .name("example-connection")
* .resourceGroupName(exampleResourceGroup.name())
* .managedApiId(example.applyValue(getManagedApiResult -> getManagedApiResult).applyValue(example -> example.applyValue(getManagedApiResult -> getManagedApiResult.id())))
* .displayName("Example 1")
* .parameterValues(Map.of("connectionString", exampleNamespace.defaultPrimaryConnectionString()))
* .tags(Map.of("Hello", "World"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* exampleResourceGroup:
* type: azure:core:ResourceGroup
* name: example
* properties:
* name: example-resources
* location: West Europe
* exampleNamespace:
* type: azure:servicebus:Namespace
* name: example
* properties:
* name: acctestsbn-conn-example
* location: ${exampleResourceGroup.location}
* resourceGroupName: ${exampleResourceGroup.name}
* sku: Basic
* exampleApiConnection:
* type: azure:connections:ApiConnection
* name: example
* properties:
* name: example-connection
* resourceGroupName: ${exampleResourceGroup.name}
* managedApiId: ${example.id}
* displayName: Example 1
* parameterValues:
* connectionString: ${exampleNamespace.defaultPrimaryConnectionString}
* tags:
* Hello: World
* variables:
* example:
* fn::invoke:
* Function: azure:connections:getManagedApi
* Arguments:
* name: servicebus
* location: ${exampleResourceGroup.location}
* ```
*
* ## Import
* API Connections can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:connections/apiConnection:ApiConnection example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.Web/connections/example-connection
* ```
* @property displayName A display name for this API Connection. Changing this forces a new API Connection to be created.
* @property managedApiId The ID of the Managed API which this API Connection is linked to. Changing this forces a new API Connection to be created.
* @property name The Name which should be used for this API Connection. Changing this forces a new API Connection to be created.
* @property parameterValues
* @property resourceGroupName The name of the Resource Group where this API Connection should exist. Changing this forces a new API Connection to be created.
* @property tags A mapping of tags which should be assigned to the API Connection.
*/
public data class ApiConnectionArgs(
public val displayName: Output? = null,
public val managedApiId: Output? = null,
public val name: Output? = null,
public val parameterValues: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy