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

com.pulumi.azure.kotlin.AzureProvider.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.kotlin

import com.pulumi.azure.Provider
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinProviderResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [AzureProvider].
 */
@PulumiTagMarker
public class AzureProviderResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ProviderArgs = ProviderArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend ProviderArgsBuilder.() -> Unit) {
        val builder = ProviderArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): AzureProvider {
        val builtJavaResource = Provider(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return AzureProvider(builtJavaResource)
    }
}

/**
 * The provider type for the azurerm package. By default, resources use package-wide configuration
 * settings, however an explicit `Provider` instance may be created and passed during resource
 * construction to achieve fine-grained programmatic control over provider settings. See the
 * [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
 */
public class AzureProvider internal constructor(
    override val javaResource: Provider,
) : KotlinProviderResource(javaResource, AzureProviderMapper) {
    /**
     * Base64 encoded PKCS#12 certificate bundle to use when authenticating as a Service Principal using a Client Certificate
     */
    public val clientCertificate: Output?
        get() = javaResource.clientCertificate().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The password associated with the Client Certificate. For use when authenticating as a Service Principal using a Client
     * Certificate
     */
    public val clientCertificatePassword: Output?
        get() = javaResource.clientCertificatePassword().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The path to the Client Certificate associated with the Service Principal for use when authenticating as a Service
     * Principal using a Client Certificate.
     */
    public val clientCertificatePath: Output?
        get() = javaResource.clientCertificatePath().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Client ID which should be used.
     */
    public val clientId: Output?
        get() = javaResource.clientId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The path to a file containing the Client ID which should be used.
     */
    public val clientIdFilePath: Output?
        get() = javaResource.clientIdFilePath().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Client Secret which should be used. For use When authenticating as a Service Principal using a Client Secret.
     */
    public val clientSecret: Output?
        get() = javaResource.clientSecret().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The path to a file containing the Client Secret which should be used. For use When authenticating as a Service Principal
     * using a Client Secret.
     */
    public val clientSecretFilePath: Output?
        get() = javaResource.clientSecretFilePath().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Cloud Environment which should be used. Possible values are public, usgovernment, and china. Defaults to public. Not
     * used and should not be specified when `metadata_host` is specified.
     */
    public val environment: Output?
        get() = javaResource.environment().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Hostname which should be used for the Azure Metadata Service.
     */
    public val metadataHost: Output?
        get() = javaResource.metadataHost().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The path to a custom endpoint for Managed Service Identity - in most circumstances this should be detected
     * automatically.
     */
    public val msiEndpoint: Output?
        get() = javaResource.msiEndpoint().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The bearer token for the request to the OIDC provider. For use when authenticating as a Service Principal using OpenID
     * Connect.
     */
    public val oidcRequestToken: Output?
        get() = javaResource.oidcRequestToken().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The URL for the OIDC provider from which to request an ID token. For use when authenticating as a Service Principal
     * using OpenID Connect.
     */
    public val oidcRequestUrl: Output?
        get() = javaResource.oidcRequestUrl().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The OIDC ID token for use when authenticating as a Service Principal using OpenID Connect.
     */
    public val oidcToken: Output?
        get() = javaResource.oidcToken().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The path to a file containing an OIDC ID token for use when authenticating as a Service Principal using OpenID Connect.
     */
    public val oidcTokenFilePath: Output?
        get() = javaResource.oidcTokenFilePath().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A GUID/UUID that is registered with Microsoft to facilitate partner resource usage attribution.
     */
    public val partnerId: Output?
        get() = javaResource.partnerId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The Subscription ID which should be used.
     */
    public val subscriptionId: Output?
        get() = javaResource.subscriptionId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Tenant ID which should be used.
     */
    public val tenantId: Output?
        get() = javaResource.tenantId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}

public object AzureProviderMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        Provider::class == javaResource::class

    override fun map(javaResource: Resource): AzureProvider = AzureProvider(javaResource as Provider)
}

/**
 * @see [Provider].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [AzureProvider].
 */
public suspend fun azureProvider(
    name: String,
    block: suspend AzureProviderResourceBuilder.() -> Unit,
): AzureProvider {
    val builder = AzureProviderResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Provider].
 * @param name The _unique_ name of the resulting resource.
 */
public fun azureProvider(name: String): AzureProvider {
    val builder = AzureProviderResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy