com.pulumi.cloudflare.kotlin.ZeroTrustAccessShortLivedCertificate.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-cloudflare-kotlin Show documentation
Show all versions of pulumi-cloudflare-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.cloudflare.kotlin
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.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [ZeroTrustAccessShortLivedCertificate].
*/
@PulumiTagMarker
public class ZeroTrustAccessShortLivedCertificateResourceBuilder internal constructor() {
public var name: String? = null
public var args: ZeroTrustAccessShortLivedCertificateArgs =
ZeroTrustAccessShortLivedCertificateArgs()
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 ZeroTrustAccessShortLivedCertificateArgsBuilder.() -> Unit) {
val builder = ZeroTrustAccessShortLivedCertificateArgsBuilder()
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(): ZeroTrustAccessShortLivedCertificate {
val builtJavaResource =
com.pulumi.cloudflare.ZeroTrustAccessShortLivedCertificate(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return ZeroTrustAccessShortLivedCertificate(builtJavaResource)
}
}
/**
* Cloudflare Access can replace traditional SSH key models with
* short-lived certificates issued to your users based on the token
* generated by their Access login.
* > It's required that an `account_id` or `zone_id` is provided and in
* most cases using either is fine. However, if you're using a scoped
* access token, you must provide the argument that matches the token's
* scope. For example, an access token that is scoped to the "example.com"
* zone needs to use the `zone_id` argument.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as cloudflare from "@pulumi/cloudflare";
* // account level
* const example = new cloudflare.ZeroTrustAccessShortLivedCertificate("example", {
* accountId: "f037e56e89293a057740de681ac9abbe",
* applicationId: "6cd6cea3-3ef2-4542-9aea-85a0bbcd5414",
* });
* // zone level
* const anotherExample = new cloudflare.ZeroTrustAccessShortLivedCertificate("another_example", {
* zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
* applicationId: "fe2be0ff-7f13-4350-8c8e-a9b9795fe3c2",
* });
* ```
* ```python
* import pulumi
* import pulumi_cloudflare as cloudflare
* # account level
* example = cloudflare.ZeroTrustAccessShortLivedCertificate("example",
* account_id="f037e56e89293a057740de681ac9abbe",
* application_id="6cd6cea3-3ef2-4542-9aea-85a0bbcd5414")
* # zone level
* another_example = cloudflare.ZeroTrustAccessShortLivedCertificate("another_example",
* zone_id="0da42c8d2132a9ddaf714f9e7c920711",
* application_id="fe2be0ff-7f13-4350-8c8e-a9b9795fe3c2")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Cloudflare = Pulumi.Cloudflare;
* return await Deployment.RunAsync(() =>
* {
* // account level
* var example = new Cloudflare.ZeroTrustAccessShortLivedCertificate("example", new()
* {
* AccountId = "f037e56e89293a057740de681ac9abbe",
* ApplicationId = "6cd6cea3-3ef2-4542-9aea-85a0bbcd5414",
* });
* // zone level
* var anotherExample = new Cloudflare.ZeroTrustAccessShortLivedCertificate("another_example", new()
* {
* ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
* ApplicationId = "fe2be0ff-7f13-4350-8c8e-a9b9795fe3c2",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* // account level
* _, err := cloudflare.NewZeroTrustAccessShortLivedCertificate(ctx, "example", &cloudflare.ZeroTrustAccessShortLivedCertificateArgs{
* AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
* ApplicationId: pulumi.String("6cd6cea3-3ef2-4542-9aea-85a0bbcd5414"),
* })
* if err != nil {
* return err
* }
* // zone level
* _, err = cloudflare.NewZeroTrustAccessShortLivedCertificate(ctx, "another_example", &cloudflare.ZeroTrustAccessShortLivedCertificateArgs{
* ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
* ApplicationId: pulumi.String("fe2be0ff-7f13-4350-8c8e-a9b9795fe3c2"),
* })
* 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.cloudflare.ZeroTrustAccessShortLivedCertificate;
* import com.pulumi.cloudflare.ZeroTrustAccessShortLivedCertificateArgs;
* 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) {
* // account level
* var example = new ZeroTrustAccessShortLivedCertificate("example", ZeroTrustAccessShortLivedCertificateArgs.builder()
* .accountId("f037e56e89293a057740de681ac9abbe")
* .applicationId("6cd6cea3-3ef2-4542-9aea-85a0bbcd5414")
* .build());
* // zone level
* var anotherExample = new ZeroTrustAccessShortLivedCertificate("anotherExample", ZeroTrustAccessShortLivedCertificateArgs.builder()
* .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
* .applicationId("fe2be0ff-7f13-4350-8c8e-a9b9795fe3c2")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* # account level
* example:
* type: cloudflare:ZeroTrustAccessShortLivedCertificate
* properties:
* accountId: f037e56e89293a057740de681ac9abbe
* applicationId: 6cd6cea3-3ef2-4542-9aea-85a0bbcd5414
* # zone level
* anotherExample:
* type: cloudflare:ZeroTrustAccessShortLivedCertificate
* name: another_example
* properties:
* zoneId: 0da42c8d2132a9ddaf714f9e7c920711
* applicationId: fe2be0ff-7f13-4350-8c8e-a9b9795fe3c2
* ```
*
* ## Import
* Account level CA certificate import.
* ```sh
* $ pulumi import cloudflare:index/zeroTrustAccessShortLivedCertificate:ZeroTrustAccessShortLivedCertificate example account//
* ```
* Zone level CA certificate import.
* ```sh
* $ pulumi import cloudflare:index/zeroTrustAccessShortLivedCertificate:ZeroTrustAccessShortLivedCertificate example account//
* ```
*/
public class ZeroTrustAccessShortLivedCertificate internal constructor(
override val javaResource: com.pulumi.cloudflare.ZeroTrustAccessShortLivedCertificate,
) : KotlinCustomResource(javaResource, ZeroTrustAccessShortLivedCertificateMapper) {
/**
* The account identifier to target for the resource. Conflicts with `zone_id`.
*/
public val accountId: Output
get() = javaResource.accountId().applyValue({ args0 -> args0 })
/**
* The Access Application ID to associate with the CA certificate.
*/
public val applicationId: Output
get() = javaResource.applicationId().applyValue({ args0 -> args0 })
/**
* Application Audience (AUD) Tag of the CA certificate.
*/
public val aud: Output
get() = javaResource.aud().applyValue({ args0 -> args0 })
/**
* Cryptographic public key of the generated CA certificate.
*/
public val publicKey: Output
get() = javaResource.publicKey().applyValue({ args0 -> args0 })
/**
* The zone identifier to target for the resource. Conflicts with `account_id`.
*/
public val zoneId: Output
get() = javaResource.zoneId().applyValue({ args0 -> args0 })
}
public object ZeroTrustAccessShortLivedCertificateMapper :
ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.cloudflare.ZeroTrustAccessShortLivedCertificate::class == javaResource::class
override fun map(javaResource: Resource): ZeroTrustAccessShortLivedCertificate =
ZeroTrustAccessShortLivedCertificate(
javaResource as
com.pulumi.cloudflare.ZeroTrustAccessShortLivedCertificate,
)
}
/**
* @see [ZeroTrustAccessShortLivedCertificate].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [ZeroTrustAccessShortLivedCertificate].
*/
public suspend fun zeroTrustAccessShortLivedCertificate(
name: String,
block: suspend ZeroTrustAccessShortLivedCertificateResourceBuilder.() -> Unit,
): ZeroTrustAccessShortLivedCertificate {
val builder = ZeroTrustAccessShortLivedCertificateResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [ZeroTrustAccessShortLivedCertificate].
* @param name The _unique_ name of the resulting resource.
*/
public fun zeroTrustAccessShortLivedCertificate(name: String): ZeroTrustAccessShortLivedCertificate {
val builder = ZeroTrustAccessShortLivedCertificateResourceBuilder()
builder.name(name)
return builder.build()
}