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

com.pulumi.azure.automation.kotlin.ConnectionServicePrincipalArgs.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.21.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.automation.kotlin

import com.pulumi.azure.automation.ConnectionServicePrincipalArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Manages an Automation Connection with type `AzureServicePrincipal`.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as std from "@pulumi/std";
 * 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 exampleConnectionServicePrincipal = new azure.automation.ConnectionServicePrincipal("example", {
 *     name: "connection-example",
 *     resourceGroupName: exampleResourceGroup.name,
 *     automationAccountName: exampleAccount.name,
 *     applicationId: "00000000-0000-0000-0000-000000000000",
 *     tenantId: example.then(example => example.tenantId),
 *     subscriptionId: example.then(example => example.subscriptionId),
 *     certificateThumbprint: std.file({
 *         input: "automation_certificate_test.thumb",
 *     }).then(invoke => invoke.result),
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * import pulumi_std as std
 * 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_service_principal = azure.automation.ConnectionServicePrincipal("example",
 *     name="connection-example",
 *     resource_group_name=example_resource_group.name,
 *     automation_account_name=example_account.name,
 *     application_id="00000000-0000-0000-0000-000000000000",
 *     tenant_id=example.tenant_id,
 *     subscription_id=example.subscription_id,
 *     certificate_thumbprint=std.file(input="automation_certificate_test.thumb").result)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * using Std = Pulumi.Std;
 * 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 exampleConnectionServicePrincipal = new Azure.Automation.ConnectionServicePrincipal("example", new()
 *     {
 *         Name = "connection-example",
 *         ResourceGroupName = exampleResourceGroup.Name,
 *         AutomationAccountName = exampleAccount.Name,
 *         ApplicationId = "00000000-0000-0000-0000-000000000000",
 *         TenantId = example.Apply(getClientConfigResult => getClientConfigResult.TenantId),
 *         SubscriptionId = example.Apply(getClientConfigResult => getClientConfigResult.SubscriptionId),
 *         CertificateThumbprint = Std.File.Invoke(new()
 *         {
 *             Input = "automation_certificate_test.thumb",
 *         }).Apply(invoke => invoke.Result),
 *     });
 * });
 * ```
 * ```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-std/sdk/go/std"
 * 	"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
 * 		}
 * 		invokeFile, err := std.File(ctx, &std.FileArgs{
 * 			Input: "automation_certificate_test.thumb",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = automation.NewConnectionServicePrincipal(ctx, "example", &automation.ConnectionServicePrincipalArgs{
 * 			Name:                  pulumi.String("connection-example"),
 * 			ResourceGroupName:     exampleResourceGroup.Name,
 * 			AutomationAccountName: exampleAccount.Name,
 * 			ApplicationId:         pulumi.String("00000000-0000-0000-0000-000000000000"),
 * 			TenantId:              pulumi.String(example.TenantId),
 * 			SubscriptionId:        pulumi.String(example.SubscriptionId),
 * 			CertificateThumbprint: invokeFile.Result,
 * 		})
 * 		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.ConnectionServicePrincipal;
 * import com.pulumi.azure.automation.ConnectionServicePrincipalArgs;
 * 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 exampleConnectionServicePrincipal = new ConnectionServicePrincipal("exampleConnectionServicePrincipal", ConnectionServicePrincipalArgs.builder()
 *             .name("connection-example")
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .automationAccountName(exampleAccount.name())
 *             .applicationId("00000000-0000-0000-0000-000000000000")
 *             .tenantId(example.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
 *             .subscriptionId(example.applyValue(getClientConfigResult -> getClientConfigResult.subscriptionId()))
 *             .certificateThumbprint(StdFunctions.file(FileArgs.builder()
 *                 .input("automation_certificate_test.thumb")
 *                 .build()).result())
 *             .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
 *   exampleConnectionServicePrincipal:
 *     type: azure:automation:ConnectionServicePrincipal
 *     name: example
 *     properties:
 *       name: connection-example
 *       resourceGroupName: ${exampleResourceGroup.name}
 *       automationAccountName: ${exampleAccount.name}
 *       applicationId: 00000000-0000-0000-0000-000000000000
 *       tenantId: ${example.tenantId}
 *       subscriptionId: ${example.subscriptionId}
 *       certificateThumbprint:
 *         fn::invoke:
 *           Function: std:file
 *           Arguments:
 *             input: automation_certificate_test.thumb
 *           Return: result
 * 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/connectionServicePrincipal:ConnectionServicePrincipal conn1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/connections/conn1
 * ```
 * @property applicationId The (Client) ID of the Service Principal.
 * @property automationAccountName The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
 * @property certificateThumbprint The thumbprint of the Service Principal Certificate.
 * @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 subscriptionId The subscription GUID.
 * @property tenantId The ID of the Tenant the Service Principal is assigned in.
 */
public data class ConnectionServicePrincipalArgs(
    public val applicationId: Output? = null,
    public val automationAccountName: Output? = null,
    public val certificateThumbprint: Output? = null,
    public val description: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val subscriptionId: Output? = null,
    public val tenantId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.automation.ConnectionServicePrincipalArgs =
        com.pulumi.azure.automation.ConnectionServicePrincipalArgs.builder()
            .applicationId(applicationId?.applyValue({ args0 -> args0 }))
            .automationAccountName(automationAccountName?.applyValue({ args0 -> args0 }))
            .certificateThumbprint(certificateThumbprint?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .subscriptionId(subscriptionId?.applyValue({ args0 -> args0 }))
            .tenantId(tenantId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ConnectionServicePrincipalArgs].
 */
@PulumiTagMarker
public class ConnectionServicePrincipalArgsBuilder internal constructor() {
    private var applicationId: Output? = null

    private var automationAccountName: Output? = null

    private var certificateThumbprint: Output? = null

    private var description: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var subscriptionId: Output? = null

    private var tenantId: Output? = null

    /**
     * @param value The (Client) ID of the Service Principal.
     */
    @JvmName("ukumghvcncwhuylr")
    public suspend fun applicationId(`value`: Output) {
        this.applicationId = 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("ooydgkmcskqxseaw")
    public suspend fun automationAccountName(`value`: Output) {
        this.automationAccountName = value
    }

    /**
     * @param value The thumbprint of the Service Principal Certificate.
     */
    @JvmName("mijydwidstjgitkv")
    public suspend fun certificateThumbprint(`value`: Output) {
        this.certificateThumbprint = value
    }

    /**
     * @param value A description for this Connection.
     */
    @JvmName("uxbsoxwwubwnetgr")
    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("hvcmqndwqgwfjcos")
    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("jqljurqdljtblnve")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The subscription GUID.
     */
    @JvmName("yihvylnjsswkfmcj")
    public suspend fun subscriptionId(`value`: Output) {
        this.subscriptionId = value
    }

    /**
     * @param value The ID of the Tenant the Service Principal is assigned in.
     */
    @JvmName("xervlgjhlfcmkyao")
    public suspend fun tenantId(`value`: Output) {
        this.tenantId = value
    }

    /**
     * @param value The (Client) ID of the Service Principal.
     */
    @JvmName("tdojaanhparxeioo")
    public suspend fun applicationId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.applicationId = mapped
    }

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

    /**
     * @param value The thumbprint of the Service Principal Certificate.
     */
    @JvmName("dhrqkljawbiwapqh")
    public suspend fun certificateThumbprint(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.certificateThumbprint = mapped
    }

    /**
     * @param value A description for this Connection.
     */
    @JvmName("yjpvidyydeymoalp")
    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("mvocrbycaxxfrsxf")
    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("jofbrltpedyrrbkj")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The subscription GUID.
     */
    @JvmName("bipddlajnjwknbnv")
    public suspend fun subscriptionId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.subscriptionId = mapped
    }

    /**
     * @param value The ID of the Tenant the Service Principal is assigned in.
     */
    @JvmName("gigupvauwnjxotvk")
    public suspend fun tenantId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tenantId = mapped
    }

    internal fun build(): ConnectionServicePrincipalArgs = ConnectionServicePrincipalArgs(
        applicationId = applicationId,
        automationAccountName = automationAccountName,
        certificateThumbprint = certificateThumbprint,
        description = description,
        name = name,
        resourceGroupName = resourceGroupName,
        subscriptionId = subscriptionId,
        tenantId = tenantId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy