All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.automation.kotlin.ConnectionArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.automation.kotlin

import com.pulumi.azure.automation.ConnectionArgs.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 Automation Connection.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const exampleResourceGroup = new azure.core.ResourceGroup("example", {
 *     name: "resourceGroup-example",
 *     location: "West Europe",
 * });
 * const example = azure.core.getClientConfig({});
 * const exampleAccount = new azure.automation.Account("example", {
 *     name: "account-example",
 *     location: exampleResourceGroup.location,
 *     resourceGroupName: exampleResourceGroup.name,
 *     skuName: "Basic",
 * });
 * const exampleConnection = new azure.automation.Connection("example", {
 *     name: "connection-example",
 *     resourceGroupName: exampleResourceGroup.name,
 *     automationAccountName: exampleAccount.name,
 *     type: "AzureServicePrincipal",
 *     values: {
 *         ApplicationId: "00000000-0000-0000-0000-000000000000",
 *         TenantId: example.then(example => example.tenantId),
 *         SubscriptionId: example.then(example => example.subscriptionId),
 *         CertificateThumbprint: "sample-certificate-thumbprint",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example_resource_group = azure.core.ResourceGroup("example",
 *     name="resourceGroup-example",
 *     location="West Europe")
 * example = azure.core.get_client_config()
 * example_account = azure.automation.Account("example",
 *     name="account-example",
 *     location=example_resource_group.location,
 *     resource_group_name=example_resource_group.name,
 *     sku_name="Basic")
 * example_connection = azure.automation.Connection("example",
 *     name="connection-example",
 *     resource_group_name=example_resource_group.name,
 *     automation_account_name=example_account.name,
 *     type="AzureServicePrincipal",
 *     values={
 *         "ApplicationId": "00000000-0000-0000-0000-000000000000",
 *         "TenantId": example.tenant_id,
 *         "SubscriptionId": example.subscription_id,
 *         "CertificateThumbprint": "sample-certificate-thumbprint",
 *     })
 * ```
 * ```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 = "resourceGroup-example",
 *         Location = "West Europe",
 *     });
 *     var example = Azure.Core.GetClientConfig.Invoke();
 *     var exampleAccount = new Azure.Automation.Account("example", new()
 *     {
 *         Name = "account-example",
 *         Location = exampleResourceGroup.Location,
 *         ResourceGroupName = exampleResourceGroup.Name,
 *         SkuName = "Basic",
 *     });
 *     var exampleConnection = new Azure.Automation.Connection("example", new()
 *     {
 *         Name = "connection-example",
 *         ResourceGroupName = exampleResourceGroup.Name,
 *         AutomationAccountName = exampleAccount.Name,
 *         Type = "AzureServicePrincipal",
 *         Values =
 *         {
 *             { "ApplicationId", "00000000-0000-0000-0000-000000000000" },
 *             { "TenantId", example.Apply(getClientConfigResult => getClientConfigResult.TenantId) },
 *             { "SubscriptionId", example.Apply(getClientConfigResult => getClientConfigResult.SubscriptionId) },
 *             { "CertificateThumbprint", "sample-certificate-thumbprint" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation"
 * 	"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 {
 * 		exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("resourceGroup-example"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		example, err := core.GetClientConfig(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAccount, err := automation.NewAccount(ctx, "example", &automation.AccountArgs{
 * 			Name:              pulumi.String("account-example"),
 * 			Location:          exampleResourceGroup.Location,
 * 			ResourceGroupName: exampleResourceGroup.Name,
 * 			SkuName:           pulumi.String("Basic"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = automation.NewConnection(ctx, "example", &automation.ConnectionArgs{
 * 			Name:                  pulumi.String("connection-example"),
 * 			ResourceGroupName:     exampleResourceGroup.Name,
 * 			AutomationAccountName: exampleAccount.Name,
 * 			Type:                  pulumi.String("AzureServicePrincipal"),
 * 			Values: pulumi.StringMap{
 * 				"ApplicationId":         pulumi.String("00000000-0000-0000-0000-000000000000"),
 * 				"TenantId":              pulumi.String(example.TenantId),
 * 				"SubscriptionId":        pulumi.String(example.SubscriptionId),
 * 				"CertificateThumbprint": pulumi.String("sample-certificate-thumbprint"),
 * 			},
 * 		})
 * 		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.core.CoreFunctions;
 * import com.pulumi.azure.automation.Account;
 * import com.pulumi.azure.automation.AccountArgs;
 * import com.pulumi.azure.automation.Connection;
 * import com.pulumi.azure.automation.ConnectionArgs;
 * 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("resourceGroup-example")
 *             .location("West Europe")
 *             .build());
 *         final var example = CoreFunctions.getClientConfig();
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("account-example")
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .skuName("Basic")
 *             .build());
 *         var exampleConnection = new Connection("exampleConnection", ConnectionArgs.builder()
 *             .name("connection-example")
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .automationAccountName(exampleAccount.name())
 *             .type("AzureServicePrincipal")
 *             .values(Map.ofEntries(
 *                 Map.entry("ApplicationId", "00000000-0000-0000-0000-000000000000"),
 *                 Map.entry("TenantId", example.applyValue(getClientConfigResult -> getClientConfigResult.tenantId())),
 *                 Map.entry("SubscriptionId", example.applyValue(getClientConfigResult -> getClientConfigResult.subscriptionId())),
 *                 Map.entry("CertificateThumbprint", "sample-certificate-thumbprint")
 *             ))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   exampleResourceGroup:
 *     type: azure:core:ResourceGroup
 *     name: example
 *     properties:
 *       name: resourceGroup-example
 *       location: West Europe
 *   exampleAccount:
 *     type: azure:automation:Account
 *     name: example
 *     properties:
 *       name: account-example
 *       location: ${exampleResourceGroup.location}
 *       resourceGroupName: ${exampleResourceGroup.name}
 *       skuName: Basic
 *   exampleConnection:
 *     type: azure:automation:Connection
 *     name: example
 *     properties:
 *       name: connection-example
 *       resourceGroupName: ${exampleResourceGroup.name}
 *       automationAccountName: ${exampleAccount.name}
 *       type: AzureServicePrincipal
 *       values:
 *         ApplicationId: 00000000-0000-0000-0000-000000000000
 *         TenantId: ${example.tenantId}
 *         SubscriptionId: ${example.subscriptionId}
 *         CertificateThumbprint: sample-certificate-thumbprint
 * variables:
 *   example:
 *     fn::invoke:
 *       Function: azure:core:getClientConfig
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * Automation Connection can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:automation/connection:Connection example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/connections/conn1
 * ```
 * @property automationAccountName The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
 * @property description A description for this Connection.
 * @property name Specifies the name of the Connection. Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
 * @property type The type of the Connection - can be either builtin type such as `Azure`, `AzureClassicCertificate`, and `AzureServicePrincipal`, or a user defined types. Changing this forces a new resource to be created.
 * @property values A mapping of key value pairs passed to the connection. Different `type` needs different parameters in the `values`. Builtin types have required field values as below:
 * * `Azure`: parameters `AutomationCertificateName` and `SubscriptionID`.
 * * `AzureClassicCertificate`: parameters `SubscriptionName`, `SubscriptionId` and `CertificateAssetName`.
 * * `AzureServicePrincipal`: parameters `ApplicationId`, `CertificateThumbprint`, `SubscriptionId` and `TenantId`.
 */
public data class ConnectionArgs(
    public val automationAccountName: Output? = null,
    public val description: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val type: Output? = null,
    public val values: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.automation.ConnectionArgs =
        com.pulumi.azure.automation.ConnectionArgs.builder()
            .automationAccountName(automationAccountName?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .type(type?.applyValue({ args0 -> args0 }))
            .values(
                values?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [ConnectionArgs].
 */
@PulumiTagMarker
public class ConnectionArgsBuilder internal constructor() {
    private var automationAccountName: Output? = null

    private var description: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var type: Output? = null

    private var values: Output>? = null

    /**
     * @param value The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
     */
    @JvmName("wjdamgdjjhmydywd")
    public suspend fun automationAccountName(`value`: Output) {
        this.automationAccountName = value
    }

    /**
     * @param value A description for this Connection.
     */
    @JvmName("ceyrpoarctqfstjc")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Specifies the name of the Connection. Changing this forces a new resource to be created.
     */
    @JvmName("rpolkflpvlhnpgqp")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
     */
    @JvmName("nulrileldakdgkdk")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The type of the Connection - can be either builtin type such as `Azure`, `AzureClassicCertificate`, and `AzureServicePrincipal`, or a user defined types. Changing this forces a new resource to be created.
     */
    @JvmName("yrxhixrrcqxislah")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value A mapping of key value pairs passed to the connection. Different `type` needs different parameters in the `values`. Builtin types have required field values as below:
     * * `Azure`: parameters `AutomationCertificateName` and `SubscriptionID`.
     * * `AzureClassicCertificate`: parameters `SubscriptionName`, `SubscriptionId` and `CertificateAssetName`.
     * * `AzureServicePrincipal`: parameters `ApplicationId`, `CertificateThumbprint`, `SubscriptionId` and `TenantId`.
     */
    @JvmName("wyrmnwsbhjwsfcmq")
    public suspend fun values(`value`: Output>) {
        this.values = value
    }

    /**
     * @param value The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
     */
    @JvmName("ionltgwcqdltcjqo")
    public suspend fun automationAccountName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.automationAccountName = mapped
    }

    /**
     * @param value A description for this Connection.
     */
    @JvmName("xdrrwyxyibaisfgf")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Specifies the name of the Connection. Changing this forces a new resource to be created.
     */
    @JvmName("kxwjvjoqepcmittc")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
     */
    @JvmName("gjhwhawsxbinlajb")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The type of the Connection - can be either builtin type such as `Azure`, `AzureClassicCertificate`, and `AzureServicePrincipal`, or a user defined types. Changing this forces a new resource to be created.
     */
    @JvmName("mkhgoahtvdyoxfxq")
    public suspend fun type(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.type = mapped
    }

    /**
     * @param value A mapping of key value pairs passed to the connection. Different `type` needs different parameters in the `values`. Builtin types have required field values as below:
     * * `Azure`: parameters `AutomationCertificateName` and `SubscriptionID`.
     * * `AzureClassicCertificate`: parameters `SubscriptionName`, `SubscriptionId` and `CertificateAssetName`.
     * * `AzureServicePrincipal`: parameters `ApplicationId`, `CertificateThumbprint`, `SubscriptionId` and `TenantId`.
     */
    @JvmName("vjfgfcqqcbgmrhbt")
    public suspend fun values(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.values = mapped
    }

    /**
     * @param values A mapping of key value pairs passed to the connection. Different `type` needs different parameters in the `values`. Builtin types have required field values as below:
     * * `Azure`: parameters `AutomationCertificateName` and `SubscriptionID`.
     * * `AzureClassicCertificate`: parameters `SubscriptionName`, `SubscriptionId` and `CertificateAssetName`.
     * * `AzureServicePrincipal`: parameters `ApplicationId`, `CertificateThumbprint`, `SubscriptionId` and `TenantId`.
     */
    @JvmName("xsscsxhckxsmgxvq")
    public fun values(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.values = mapped
    }

    internal fun build(): ConnectionArgs = ConnectionArgs(
        automationAccountName = automationAccountName,
        description = description,
        name = name,
        resourceGroupName = resourceGroupName,
        type = type,
        values = values,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy