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

com.pulumi.azure.attestation.kotlin.ProviderArgs.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.attestation.kotlin

import com.pulumi.azure.attestation.ProviderArgs.builder
import com.pulumi.azure.attestation.kotlin.inputs.ProviderPolicyArgs
import com.pulumi.azure.attestation.kotlin.inputs.ProviderPolicyArgsBuilder
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.Deprecated
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages an Attestation Provider.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as std from "@pulumi/std";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleProvider = new azure.attestation.Provider("example", {
 *     name: "exampleprovider",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     policySigningCertificateData: std.file({
 *         input: "./example/cert.pem",
 *     }).then(invoke => invoke.result),
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * import pulumi_std as std
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_provider = azure.attestation.Provider("example",
 *     name="exampleprovider",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     policy_signing_certificate_data=std.file(input="./example/cert.pem").result)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * using Std = Pulumi.Std;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleProvider = new Azure.Attestation.Provider("example", new()
 *     {
 *         Name = "exampleprovider",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         PolicySigningCertificateData = Std.File.Invoke(new()
 *         {
 *             Input = "./example/cert.pem",
 *         }).Apply(invoke => invoke.Result),
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/attestation"
 * 	"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 {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeFile, err := std.File(ctx, &std.FileArgs{
 * 			Input: "./example/cert.pem",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = attestation.NewProvider(ctx, "example", &attestation.ProviderArgs{
 * 			Name:                         pulumi.String("exampleprovider"),
 * 			ResourceGroupName:            example.Name,
 * 			Location:                     example.Location,
 * 			PolicySigningCertificateData: pulumi.String(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.attestation.Provider;
 * import com.pulumi.azure.attestation.ProviderArgs;
 * 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 exampleProvider = new Provider("exampleProvider", ProviderArgs.builder()
 *             .name("exampleprovider")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .policySigningCertificateData(StdFunctions.file(FileArgs.builder()
 *                 .input("./example/cert.pem")
 *                 .build()).result())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleProvider:
 *     type: azure:attestation:Provider
 *     name: example
 *     properties:
 *       name: exampleprovider
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       policySigningCertificateData:
 *         fn::invoke:
 *           Function: std:file
 *           Arguments:
 *             input: ./example/cert.pem
 *           Return: result
 * ```
 * 
 * ## Import
 * Attestation Providers can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:attestation/provider:Provider example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Attestation/attestationProviders/provider1
 * ```
 * @property location The Azure Region where the Attestation Provider should exist. Changing this forces a new resource to be created.
 * @property name The name which should be used for this Attestation Provider. Changing this forces a new resource to be created.
 * @property openEnclavePolicyBase64 Specifies the base64 URI Encoded RFC 7519 JWT that should be used for the Attestation Policy.
 * @property policies
 * @property policySigningCertificateData A valid X.509 certificate (Section 4 of [RFC4648](https://tools.ietf.org/html/rfc4648)). Changing this forces a new resource to be created.
 * > **NOTE:** If the `policy_signing_certificate_data` argument contains more than one valid X.509 certificate only the first certificate will be used.
 * @property resourceGroupName The name of the Resource Group where the attestation provider should exist. Changing this forces a new resource to be created.
 * @property sevSnpPolicyBase64 Specifies the base64 URI Encoded RFC 7519 JWT that should be used for the Attestation Policy.
 * > [More information on the JWT Policies can be found in this article on `learn.microsoft.com`](https://learn.microsoft.com/azure/attestation/author-sign-policy).
 * @property sgxEnclavePolicyBase64 Specifies the base64 URI Encoded RFC 7519 JWT that should be used for the Attestation Policy.
 * @property tags A mapping of tags which should be assigned to the Attestation Provider.
 * @property tpmPolicyBase64 Specifies the base64 URI Encoded RFC 7519 JWT that should be used for the Attestation Policy.
 */
public data class ProviderArgs(
    public val location: Output? = null,
    public val name: Output? = null,
    public val openEnclavePolicyBase64: Output? = null,
    @Deprecated(
        message = """
  This field is no longer used and will be removed in v4.0 of the Azure Provider - use
      `open_enclave_policy_base64`, `sgx_enclave_policy_base64`, `tpm_policy_base64` and
      `sev_snp_policy_base64` instead.
  """,
    )
    public val policies: Output>? = null,
    public val policySigningCertificateData: Output? = null,
    public val resourceGroupName: Output? = null,
    public val sevSnpPolicyBase64: Output? = null,
    public val sgxEnclavePolicyBase64: Output? = null,
    public val tags: Output>? = null,
    public val tpmPolicyBase64: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.attestation.ProviderArgs =
        com.pulumi.azure.attestation.ProviderArgs.builder()
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .openEnclavePolicyBase64(openEnclavePolicyBase64?.applyValue({ args0 -> args0 }))
            .policies(
                policies?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .policySigningCertificateData(policySigningCertificateData?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .sevSnpPolicyBase64(sevSnpPolicyBase64?.applyValue({ args0 -> args0 }))
            .sgxEnclavePolicyBase64(sgxEnclavePolicyBase64?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .tpmPolicyBase64(tpmPolicyBase64?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ProviderArgs].
 */
@PulumiTagMarker
public class ProviderArgsBuilder internal constructor() {
    private var location: Output? = null

    private var name: Output? = null

    private var openEnclavePolicyBase64: Output? = null

    private var policies: Output>? = null

    private var policySigningCertificateData: Output? = null

    private var resourceGroupName: Output? = null

    private var sevSnpPolicyBase64: Output? = null

    private var sgxEnclavePolicyBase64: Output? = null

    private var tags: Output>? = null

    private var tpmPolicyBase64: Output? = null

    /**
     * @param value The Azure Region where the Attestation Provider should exist. Changing this forces a new resource to be created.
     */
    @JvmName("ljaygkjdwwsxxwab")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The name which should be used for this Attestation Provider. Changing this forces a new resource to be created.
     */
    @JvmName("mumvctabaoxsikkl")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Specifies the base64 URI Encoded RFC 7519 JWT that should be used for the Attestation Policy.
     */
    @JvmName("tunolynhhxdwptkh")
    public suspend fun openEnclavePolicyBase64(`value`: Output) {
        this.openEnclavePolicyBase64 = value
    }

    /**
     * @param value
     */
    @Deprecated(
        message = """
  This field is no longer used and will be removed in v4.0 of the Azure Provider - use
      `open_enclave_policy_base64`, `sgx_enclave_policy_base64`, `tpm_policy_base64` and
      `sev_snp_policy_base64` instead.
  """,
    )
    @JvmName("bpqtidepuokunvnl")
    public suspend fun policies(`value`: Output>) {
        this.policies = value
    }

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

    /**
     * @param values
     */
    @Deprecated(
        message = """
  This field is no longer used and will be removed in v4.0 of the Azure Provider - use
      `open_enclave_policy_base64`, `sgx_enclave_policy_base64`, `tpm_policy_base64` and
      `sev_snp_policy_base64` instead.
  """,
    )
    @JvmName("ekibetlanxfifffw")
    public suspend fun policies(values: List>) {
        this.policies = Output.all(values)
    }

    /**
     * @param value A valid X.509 certificate (Section 4 of [RFC4648](https://tools.ietf.org/html/rfc4648)). Changing this forces a new resource to be created.
     * > **NOTE:** If the `policy_signing_certificate_data` argument contains more than one valid X.509 certificate only the first certificate will be used.
     */
    @JvmName("fjfftwgwwatnpkku")
    public suspend fun policySigningCertificateData(`value`: Output) {
        this.policySigningCertificateData = value
    }

    /**
     * @param value The name of the Resource Group where the attestation provider should exist. Changing this forces a new resource to be created.
     */
    @JvmName("vycvqwqcxddxeomv")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Specifies the base64 URI Encoded RFC 7519 JWT that should be used for the Attestation Policy.
     * > [More information on the JWT Policies can be found in this article on `learn.microsoft.com`](https://learn.microsoft.com/azure/attestation/author-sign-policy).
     */
    @JvmName("rdlxjhhiotebjsyv")
    public suspend fun sevSnpPolicyBase64(`value`: Output) {
        this.sevSnpPolicyBase64 = value
    }

    /**
     * @param value Specifies the base64 URI Encoded RFC 7519 JWT that should be used for the Attestation Policy.
     */
    @JvmName("wtlckqwufgypedby")
    public suspend fun sgxEnclavePolicyBase64(`value`: Output) {
        this.sgxEnclavePolicyBase64 = value
    }

    /**
     * @param value A mapping of tags which should be assigned to the Attestation Provider.
     */
    @JvmName("fkrhwliglujrsmqd")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Specifies the base64 URI Encoded RFC 7519 JWT that should be used for the Attestation Policy.
     */
    @JvmName("kkhcmdpoqtgvfotp")
    public suspend fun tpmPolicyBase64(`value`: Output) {
        this.tpmPolicyBase64 = value
    }

    /**
     * @param value The Azure Region where the Attestation Provider should exist. Changing this forces a new resource to be created.
     */
    @JvmName("jcdbbogcbndviwiu")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The name which should be used for this Attestation Provider. Changing this forces a new resource to be created.
     */
    @JvmName("ivywlckasplmxttx")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Specifies the base64 URI Encoded RFC 7519 JWT that should be used for the Attestation Policy.
     */
    @JvmName("uuowivgsbbmckyda")
    public suspend fun openEnclavePolicyBase64(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.openEnclavePolicyBase64 = mapped
    }

    /**
     * @param value
     */
    @Deprecated(
        message = """
  This field is no longer used and will be removed in v4.0 of the Azure Provider - use
      `open_enclave_policy_base64`, `sgx_enclave_policy_base64`, `tpm_policy_base64` and
      `sev_snp_policy_base64` instead.
  """,
    )
    @JvmName("ovduvatcucbqscmw")
    public suspend fun policies(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.policies = mapped
    }

    /**
     * @param argument
     */
    @Deprecated(
        message = """
  This field is no longer used and will be removed in v4.0 of the Azure Provider - use
      `open_enclave_policy_base64`, `sgx_enclave_policy_base64`, `tpm_policy_base64` and
      `sev_snp_policy_base64` instead.
  """,
    )
    @JvmName("eimisuxtqqysubya")
    public suspend fun policies(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ProviderPolicyArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.policies = mapped
    }

    /**
     * @param argument
     */
    @Deprecated(
        message = """
  This field is no longer used and will be removed in v4.0 of the Azure Provider - use
      `open_enclave_policy_base64`, `sgx_enclave_policy_base64`, `tpm_policy_base64` and
      `sev_snp_policy_base64` instead.
  """,
    )
    @JvmName("hvrspispfxfrqtsr")
    public suspend fun policies(vararg argument: suspend ProviderPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ProviderPolicyArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.policies = mapped
    }

    /**
     * @param argument
     */
    @Deprecated(
        message = """
  This field is no longer used and will be removed in v4.0 of the Azure Provider - use
      `open_enclave_policy_base64`, `sgx_enclave_policy_base64`, `tpm_policy_base64` and
      `sev_snp_policy_base64` instead.
  """,
    )
    @JvmName("udkpfuktyjjuqgwa")
    public suspend fun policies(argument: suspend ProviderPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(ProviderPolicyArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.policies = mapped
    }

    /**
     * @param values
     */
    @Deprecated(
        message = """
  This field is no longer used and will be removed in v4.0 of the Azure Provider - use
      `open_enclave_policy_base64`, `sgx_enclave_policy_base64`, `tpm_policy_base64` and
      `sev_snp_policy_base64` instead.
  """,
    )
    @JvmName("lcmkfebhiductkkh")
    public suspend fun policies(vararg values: ProviderPolicyArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.policies = mapped
    }

    /**
     * @param value A valid X.509 certificate (Section 4 of [RFC4648](https://tools.ietf.org/html/rfc4648)). Changing this forces a new resource to be created.
     * > **NOTE:** If the `policy_signing_certificate_data` argument contains more than one valid X.509 certificate only the first certificate will be used.
     */
    @JvmName("mkpovdjmuwumqmpj")
    public suspend fun policySigningCertificateData(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.policySigningCertificateData = mapped
    }

    /**
     * @param value The name of the Resource Group where the attestation provider should exist. Changing this forces a new resource to be created.
     */
    @JvmName("crbogcinuyctcyno")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Specifies the base64 URI Encoded RFC 7519 JWT that should be used for the Attestation Policy.
     * > [More information on the JWT Policies can be found in this article on `learn.microsoft.com`](https://learn.microsoft.com/azure/attestation/author-sign-policy).
     */
    @JvmName("rllhivtnwawseaxx")
    public suspend fun sevSnpPolicyBase64(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sevSnpPolicyBase64 = mapped
    }

    /**
     * @param value Specifies the base64 URI Encoded RFC 7519 JWT that should be used for the Attestation Policy.
     */
    @JvmName("akddfppugstkfvbj")
    public suspend fun sgxEnclavePolicyBase64(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sgxEnclavePolicyBase64 = mapped
    }

    /**
     * @param value A mapping of tags which should be assigned to the Attestation Provider.
     */
    @JvmName("bsthhyaelspvdspp")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags which should be assigned to the Attestation Provider.
     */
    @JvmName("couewtkhhfvntwee")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value Specifies the base64 URI Encoded RFC 7519 JWT that should be used for the Attestation Policy.
     */
    @JvmName("phxgoywvpapgpnnn")
    public suspend fun tpmPolicyBase64(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tpmPolicyBase64 = mapped
    }

    internal fun build(): ProviderArgs = ProviderArgs(
        location = location,
        name = name,
        openEnclavePolicyBase64 = openEnclavePolicyBase64,
        policies = policies,
        policySigningCertificateData = policySigningCertificateData,
        resourceGroupName = resourceGroupName,
        sevSnpPolicyBase64 = sevSnpPolicyBase64,
        sgxEnclavePolicyBase64 = sgxEnclavePolicyBase64,
        tags = tags,
        tpmPolicyBase64 = tpmPolicyBase64,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy