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

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

package com.pulumi.azure.attestation.kotlin

import com.pulumi.azure.attestation.kotlin.outputs.ProviderPolicy
import com.pulumi.azure.attestation.kotlin.outputs.ProviderPolicy.Companion.toKotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
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.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map

/**
 * Builder for [Provider].
 */
@PulumiTagMarker
public class ProviderResourceBuilder 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(): Provider {
        val builtJavaResource = com.pulumi.azure.attestation.Provider(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Provider(builtJavaResource)
    }
}

/**
 * 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: 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
 * ```
 */
public class Provider internal constructor(
    override val javaResource: com.pulumi.azure.attestation.Provider,
) : KotlinCustomResource(javaResource, ProviderMapper) {
    /**
     * The URI of the Attestation Service.
     */
    public val attestationUri: Output
        get() = javaResource.attestationUri().applyValue({ args0 -> args0 })

    /**
     * The Azure Region where the Attestation Provider should exist. Changing this forces a new resource to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * The name which should be used for this Attestation Provider. Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Specifies the base64 URI Encoded RFC 7519 JWT that should be used for the Attestation Policy.
     */
    public val openEnclavePolicyBase64: Output?
        get() = javaResource.openEnclavePolicyBase64().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(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>?
        get() = javaResource.policies().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> toKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * 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.
     */
    public val policySigningCertificateData: Output?
        get() = javaResource.policySigningCertificateData().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the Resource Group where the attestation provider should exist. Changing this forces a new resource to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * 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).
     */
    public val sevSnpPolicyBase64: Output?
        get() = javaResource.sevSnpPolicyBase64().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies the base64 URI Encoded RFC 7519 JWT that should be used for the Attestation Policy.
     */
    public val sgxEnclavePolicyBase64: Output?
        get() = javaResource.sgxEnclavePolicyBase64().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A mapping of tags which should be assigned to the Attestation Provider.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * Specifies the base64 URI Encoded RFC 7519 JWT that should be used for the Attestation Policy.
     */
    public val tpmPolicyBase64: Output?
        get() = javaResource.tpmPolicyBase64().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Trust model used for the Attestation Service.
     */
    public val trustModel: Output
        get() = javaResource.trustModel().applyValue({ args0 -> args0 })
}

public object ProviderMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.attestation.Provider::class == javaResource::class

    override fun map(javaResource: Resource): Provider = Provider(
        javaResource as
            com.pulumi.azure.attestation.Provider,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy