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

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

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.automation.kotlin

import com.pulumi.azure.automation.CredentialArgs.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 a Automation Credential.
 * ## Example Usage
 * 
 * ```typescript
 * 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 exampleAccount = new azure.automation.Account("example", {
 *     name: "account1",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     skuName: "Basic",
 * });
 * const exampleCredential = new azure.automation.Credential("example", {
 *     name: "credential1",
 *     resourceGroupName: example.name,
 *     automationAccountName: exampleAccount.name,
 *     username: "example_user",
 *     password: "example_pwd",
 *     description: "This is an example credential",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_account = azure.automation.Account("example",
 *     name="account1",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku_name="Basic")
 * example_credential = azure.automation.Credential("example",
 *     name="credential1",
 *     resource_group_name=example.name,
 *     automation_account_name=example_account.name,
 *     username="example_user",
 *     password="example_pwd",
 *     description="This is an example credential")
 * ```
 * ```csharp
 * 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 exampleAccount = new Azure.Automation.Account("example", new()
 *     {
 *         Name = "account1",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         SkuName = "Basic",
 *     });
 *     var exampleCredential = new Azure.Automation.Credential("example", new()
 *     {
 *         Name = "credential1",
 *         ResourceGroupName = example.Name,
 *         AutomationAccountName = exampleAccount.Name,
 *         Username = "example_user",
 *         Password = "example_pwd",
 *         Description = "This is an example credential",
 *     });
 * });
 * ```
 * ```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 {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAccount, err := automation.NewAccount(ctx, "example", &automation.AccountArgs{
 * 			Name:              pulumi.String("account1"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			SkuName:           pulumi.String("Basic"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = automation.NewCredential(ctx, "example", &automation.CredentialArgs{
 * 			Name:                  pulumi.String("credential1"),
 * 			ResourceGroupName:     example.Name,
 * 			AutomationAccountName: exampleAccount.Name,
 * 			Username:              pulumi.String("example_user"),
 * 			Password:              pulumi.String("example_pwd"),
 * 			Description:           pulumi.String("This is an example credential"),
 * 		})
 * 		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.automation.Account;
 * import com.pulumi.azure.automation.AccountArgs;
 * import com.pulumi.azure.automation.Credential;
 * import com.pulumi.azure.automation.CredentialArgs;
 * 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 exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("account1")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .skuName("Basic")
 *             .build());
 *         var exampleCredential = new Credential("exampleCredential", CredentialArgs.builder()
 *             .name("credential1")
 *             .resourceGroupName(example.name())
 *             .automationAccountName(exampleAccount.name())
 *             .username("example_user")
 *             .password("example_pwd")
 *             .description("This is an example credential")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleAccount:
 *     type: azure:automation:Account
 *     name: example
 *     properties:
 *       name: account1
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       skuName: Basic
 *   exampleCredential:
 *     type: azure:automation:Credential
 *     name: example
 *     properties:
 *       name: credential1
 *       resourceGroupName: ${example.name}
 *       automationAccountName: ${exampleAccount.name}
 *       username: example_user
 *       password: example_pwd
 *       description: This is an example credential
 * ```
 * 
 * ## Import
 * Automation Credentials can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:automation/credential:Credential credential1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/credentials/credential1
 * ```
 * @property automationAccountName The name of the automation account in which the Credential is created. Changing this forces a new resource to be created.
 * @property description The description associated with this Automation Credential.
 * @property name Specifies the name of the Credential. Changing this forces a new resource to be created.
 * @property password The password associated with this Automation Credential.
 * @property resourceGroupName The name of the resource group in which the Credential is created. Changing this forces a new resource to be created.
 * @property username The username associated with this Automation Credential.
 */
public data class CredentialArgs(
    public val automationAccountName: Output? = null,
    public val description: Output? = null,
    public val name: Output? = null,
    public val password: Output? = null,
    public val resourceGroupName: Output? = null,
    public val username: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.automation.CredentialArgs =
        com.pulumi.azure.automation.CredentialArgs.builder()
            .automationAccountName(automationAccountName?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .password(password?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .username(username?.applyValue({ args0 -> args0 })).build()
}

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

    private var description: Output? = null

    private var name: Output? = null

    private var password: Output? = null

    private var resourceGroupName: Output? = null

    private var username: Output? = null

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

    /**
     * @param value The description associated with this Automation Credential.
     */
    @JvmName("tkvdmtrkiaxgwtgv")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

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

    /**
     * @param value The password associated with this Automation Credential.
     */
    @JvmName("ftctmwgygyerpkjq")
    public suspend fun password(`value`: Output) {
        this.password = value
    }

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

    /**
     * @param value The username associated with this Automation Credential.
     */
    @JvmName("jhxgnuxuifdqpdkj")
    public suspend fun username(`value`: Output) {
        this.username = value
    }

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

    /**
     * @param value The description associated with this Automation Credential.
     */
    @JvmName("mlnfnlkxmnagqild")
    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 Credential. Changing this forces a new resource to be created.
     */
    @JvmName("ydmcoydohsvvivkw")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The password associated with this Automation Credential.
     */
    @JvmName("wlibqkmoblhbgxkx")
    public suspend fun password(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.password = mapped
    }

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

    /**
     * @param value The username associated with this Automation Credential.
     */
    @JvmName("fsvmhquychlitvit")
    public suspend fun username(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.username = mapped
    }

    internal fun build(): CredentialArgs = CredentialArgs(
        automationAccountName = automationAccountName,
        description = description,
        name = name,
        password = password,
        resourceGroupName = resourceGroupName,
        username = username,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy