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

com.pulumi.azurenative.containerregistry.kotlin.CredentialSetArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.containerregistry.kotlin

import com.pulumi.azurenative.containerregistry.CredentialSetArgs.builder
import com.pulumi.azurenative.containerregistry.kotlin.inputs.AuthCredentialArgs
import com.pulumi.azurenative.containerregistry.kotlin.inputs.AuthCredentialArgsBuilder
import com.pulumi.azurenative.containerregistry.kotlin.inputs.IdentityPropertiesArgs
import com.pulumi.azurenative.containerregistry.kotlin.inputs.IdentityPropertiesArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * An object that represents a credential set resource for a container registry.
 * Azure REST API version: 2023-01-01-preview.
 * Other available API versions: 2023-06-01-preview, 2023-07-01, 2023-08-01-preview, 2023-11-01-preview.
 * ## Example Usage
 * ### CredentialSetCreate
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var credentialSet = new AzureNative.ContainerRegistry.CredentialSet("credentialSet", new()
 *     {
 *         AuthCredentials = new[]
 *         {
 *             new AzureNative.ContainerRegistry.Inputs.AuthCredentialArgs
 *             {
 *                 Name = AzureNative.ContainerRegistry.CredentialName.Credential1,
 *                 PasswordSecretIdentifier = "https://myvault.vault.azure.net/secrets/password",
 *                 UsernameSecretIdentifier = "https://myvault.vault.azure.net/secrets/username",
 *             },
 *         },
 *         CredentialSetName = "myCredentialSet",
 *         Identity = new AzureNative.ContainerRegistry.Inputs.IdentityPropertiesArgs
 *         {
 *             Type = AzureNative.ContainerRegistry.ResourceIdentityType.SystemAssigned,
 *         },
 *         LoginServer = "docker.io",
 *         RegistryName = "myRegistry",
 *         ResourceGroupName = "myResourceGroup",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	containerregistry "github.com/pulumi/pulumi-azure-native-sdk/containerregistry/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := containerregistry.NewCredentialSet(ctx, "credentialSet", &containerregistry.CredentialSetArgs{
 * 			AuthCredentials: containerregistry.AuthCredentialArray{
 * 				&containerregistry.AuthCredentialArgs{
 * 					Name:                     pulumi.String(containerregistry.CredentialNameCredential1),
 * 					PasswordSecretIdentifier: pulumi.String("https://myvault.vault.azure.net/secrets/password"),
 * 					UsernameSecretIdentifier: pulumi.String("https://myvault.vault.azure.net/secrets/username"),
 * 				},
 * 			},
 * 			CredentialSetName: pulumi.String("myCredentialSet"),
 * 			Identity: &containerregistry.IdentityPropertiesArgs{
 * 				Type: containerregistry.ResourceIdentityTypeSystemAssigned,
 * 			},
 * 			LoginServer:       pulumi.String("docker.io"),
 * 			RegistryName:      pulumi.String("myRegistry"),
 * 			ResourceGroupName: pulumi.String("myResourceGroup"),
 * 		})
 * 		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.azurenative.containerregistry.CredentialSet;
 * import com.pulumi.azurenative.containerregistry.CredentialSetArgs;
 * import com.pulumi.azurenative.containerregistry.inputs.AuthCredentialArgs;
 * import com.pulumi.azurenative.containerregistry.inputs.IdentityPropertiesArgs;
 * 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 credentialSet = new CredentialSet("credentialSet", CredentialSetArgs.builder()
 *             .authCredentials(AuthCredentialArgs.builder()
 *                 .name("Credential1")
 *                 .passwordSecretIdentifier("https://myvault.vault.azure.net/secrets/password")
 *                 .usernameSecretIdentifier("https://myvault.vault.azure.net/secrets/username")
 *                 .build())
 *             .credentialSetName("myCredentialSet")
 *             .identity(IdentityPropertiesArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .loginServer("docker.io")
 *             .registryName("myRegistry")
 *             .resourceGroupName("myResourceGroup")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:containerregistry:CredentialSet myCredentialSet /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}
 * ```
 * @property authCredentials List of authentication credentials stored for an upstream.
 * Usually consists of a primary and an optional secondary credential.
 * @property credentialSetName The name of the credential set.
 * @property identity Identities associated with the resource. This is used to access the KeyVault secrets.
 * @property loginServer The credentials are stored for this upstream or login server.
 * @property registryName The name of the container registry.
 * @property resourceGroupName The name of the resource group. The name is case insensitive.
 */
public data class CredentialSetArgs(
    public val authCredentials: Output>? = null,
    public val credentialSetName: Output? = null,
    public val identity: Output? = null,
    public val loginServer: Output? = null,
    public val registryName: Output? = null,
    public val resourceGroupName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.containerregistry.CredentialSetArgs =
        com.pulumi.azurenative.containerregistry.CredentialSetArgs.builder()
            .authCredentials(
                authCredentials?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .credentialSetName(credentialSetName?.applyValue({ args0 -> args0 }))
            .identity(identity?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .loginServer(loginServer?.applyValue({ args0 -> args0 }))
            .registryName(registryName?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [CredentialSetArgs].
 */
@PulumiTagMarker
public class CredentialSetArgsBuilder internal constructor() {
    private var authCredentials: Output>? = null

    private var credentialSetName: Output? = null

    private var identity: Output? = null

    private var loginServer: Output? = null

    private var registryName: Output? = null

    private var resourceGroupName: Output? = null

    /**
     * @param value List of authentication credentials stored for an upstream.
     * Usually consists of a primary and an optional secondary credential.
     */
    @JvmName("swujpcnsgkrsnxnj")
    public suspend fun authCredentials(`value`: Output>) {
        this.authCredentials = value
    }

    @JvmName("qtlaomexssyqdmpi")
    public suspend fun authCredentials(vararg values: Output) {
        this.authCredentials = Output.all(values.asList())
    }

    /**
     * @param values List of authentication credentials stored for an upstream.
     * Usually consists of a primary and an optional secondary credential.
     */
    @JvmName("dfjcmoobyofbfioc")
    public suspend fun authCredentials(values: List>) {
        this.authCredentials = Output.all(values)
    }

    /**
     * @param value The name of the credential set.
     */
    @JvmName("psxmpaovnkvubaai")
    public suspend fun credentialSetName(`value`: Output) {
        this.credentialSetName = value
    }

    /**
     * @param value Identities associated with the resource. This is used to access the KeyVault secrets.
     */
    @JvmName("frclqbchosmndcry")
    public suspend fun identity(`value`: Output) {
        this.identity = value
    }

    /**
     * @param value The credentials are stored for this upstream or login server.
     */
    @JvmName("xiwxatwfutxcgagl")
    public suspend fun loginServer(`value`: Output) {
        this.loginServer = value
    }

    /**
     * @param value The name of the container registry.
     */
    @JvmName("syyvfndhgntkmule")
    public suspend fun registryName(`value`: Output) {
        this.registryName = value
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("prslwuvvysimdgrj")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value List of authentication credentials stored for an upstream.
     * Usually consists of a primary and an optional secondary credential.
     */
    @JvmName("kevjtpqrsisfluxw")
    public suspend fun authCredentials(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authCredentials = mapped
    }

    /**
     * @param argument List of authentication credentials stored for an upstream.
     * Usually consists of a primary and an optional secondary credential.
     */
    @JvmName("pulfqnqbusbcdabt")
    public suspend fun authCredentials(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AuthCredentialArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.authCredentials = mapped
    }

    /**
     * @param argument List of authentication credentials stored for an upstream.
     * Usually consists of a primary and an optional secondary credential.
     */
    @JvmName("oqjrttaxxgewfwrr")
    public suspend fun authCredentials(vararg argument: suspend AuthCredentialArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AuthCredentialArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.authCredentials = mapped
    }

    /**
     * @param argument List of authentication credentials stored for an upstream.
     * Usually consists of a primary and an optional secondary credential.
     */
    @JvmName("arnldlmoxkwoeiqu")
    public suspend fun authCredentials(argument: suspend AuthCredentialArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(AuthCredentialArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.authCredentials = mapped
    }

    /**
     * @param values List of authentication credentials stored for an upstream.
     * Usually consists of a primary and an optional secondary credential.
     */
    @JvmName("xdjyiqtfovagowwj")
    public suspend fun authCredentials(vararg values: AuthCredentialArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.authCredentials = mapped
    }

    /**
     * @param value The name of the credential set.
     */
    @JvmName("xugkhvawmwawcldl")
    public suspend fun credentialSetName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.credentialSetName = mapped
    }

    /**
     * @param value Identities associated with the resource. This is used to access the KeyVault secrets.
     */
    @JvmName("dhovhbvfiixckvxh")
    public suspend fun identity(`value`: IdentityPropertiesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identity = mapped
    }

    /**
     * @param argument Identities associated with the resource. This is used to access the KeyVault secrets.
     */
    @JvmName("hpltjlcuujdsgcui")
    public suspend fun identity(argument: suspend IdentityPropertiesArgsBuilder.() -> Unit) {
        val toBeMapped = IdentityPropertiesArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.identity = mapped
    }

    /**
     * @param value The credentials are stored for this upstream or login server.
     */
    @JvmName("tsmbakfwunkaetxm")
    public suspend fun loginServer(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.loginServer = mapped
    }

    /**
     * @param value The name of the container registry.
     */
    @JvmName("manocmyxguvbdlpa")
    public suspend fun registryName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.registryName = mapped
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("ssegpkpvqletahop")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    internal fun build(): CredentialSetArgs = CredentialSetArgs(
        authCredentials = authCredentials,
        credentialSetName = credentialSetName,
        identity = identity,
        loginServer = loginServer,
        registryName = registryName,
        resourceGroupName = resourceGroupName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy