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

com.pulumi.cloudflare.kotlin.AccessOrganization.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.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin

import com.pulumi.cloudflare.kotlin.outputs.AccessOrganizationCustomPage
import com.pulumi.cloudflare.kotlin.outputs.AccessOrganizationLoginDesign
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
import kotlin.collections.List
import com.pulumi.cloudflare.kotlin.outputs.AccessOrganizationCustomPage.Companion.toKotlin as accessOrganizationCustomPageToKotlin
import com.pulumi.cloudflare.kotlin.outputs.AccessOrganizationLoginDesign.Companion.toKotlin as accessOrganizationLoginDesignToKotlin

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

    public var args: AccessOrganizationArgs = AccessOrganizationArgs()

    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 AccessOrganizationArgsBuilder.() -> Unit) {
        val builder = AccessOrganizationArgsBuilder()
        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(): AccessOrganization {
        val builtJavaResource = com.pulumi.cloudflare.AccessOrganization(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return AccessOrganization(builtJavaResource)
    }
}

/**
 * A Zero Trust organization defines the user login experience.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as cloudflare from "@pulumi/cloudflare";
 * const example = new cloudflare.AccessOrganization("example", {
 *     accountId: "f037e56e89293a057740de681ac9abbe",
 *     name: "example.cloudflareaccess.com",
 *     authDomain: "example.cloudflareaccess.com",
 *     isUiReadOnly: false,
 *     userSeatExpirationInactiveTime: "720h",
 *     autoRedirectToIdentity: false,
 *     loginDesigns: [{
 *         backgroundColor: "#ffffff",
 *         textColor: "#000000",
 *         logoPath: "https://example.com/logo.png",
 *         headerText: "My header text",
 *         footerText: "My footer text",
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_cloudflare as cloudflare
 * example = cloudflare.AccessOrganization("example",
 *     account_id="f037e56e89293a057740de681ac9abbe",
 *     name="example.cloudflareaccess.com",
 *     auth_domain="example.cloudflareaccess.com",
 *     is_ui_read_only=False,
 *     user_seat_expiration_inactive_time="720h",
 *     auto_redirect_to_identity=False,
 *     login_designs=[{
 *         "background_color": "#ffffff",
 *         "text_color": "#000000",
 *         "logo_path": "https://example.com/logo.png",
 *         "header_text": "My header text",
 *         "footer_text": "My footer text",
 *     }])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Cloudflare = Pulumi.Cloudflare;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Cloudflare.AccessOrganization("example", new()
 *     {
 *         AccountId = "f037e56e89293a057740de681ac9abbe",
 *         Name = "example.cloudflareaccess.com",
 *         AuthDomain = "example.cloudflareaccess.com",
 *         IsUiReadOnly = false,
 *         UserSeatExpirationInactiveTime = "720h",
 *         AutoRedirectToIdentity = false,
 *         LoginDesigns = new[]
 *         {
 *             new Cloudflare.Inputs.AccessOrganizationLoginDesignArgs
 *             {
 *                 BackgroundColor = "#ffffff",
 *                 TextColor = "#000000",
 *                 LogoPath = "https://example.com/logo.png",
 *                 HeaderText = "My header text",
 *                 FooterText = "My footer text",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```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 {
 * 		_, err := cloudflare.NewAccessOrganization(ctx, "example", &cloudflare.AccessOrganizationArgs{
 * 			AccountId:                      pulumi.String("f037e56e89293a057740de681ac9abbe"),
 * 			Name:                           pulumi.String("example.cloudflareaccess.com"),
 * 			AuthDomain:                     pulumi.String("example.cloudflareaccess.com"),
 * 			IsUiReadOnly:                   pulumi.Bool(false),
 * 			UserSeatExpirationInactiveTime: pulumi.String("720h"),
 * 			AutoRedirectToIdentity:         pulumi.Bool(false),
 * 			LoginDesigns: cloudflare.AccessOrganizationLoginDesignArray{
 * 				&cloudflare.AccessOrganizationLoginDesignArgs{
 * 					BackgroundColor: pulumi.String("#ffffff"),
 * 					TextColor:       pulumi.String("#000000"),
 * 					LogoPath:        pulumi.String("https://example.com/logo.png"),
 * 					HeaderText:      pulumi.String("My header text"),
 * 					FooterText:      pulumi.String("My footer text"),
 * 				},
 * 			},
 * 		})
 * 		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.AccessOrganization;
 * import com.pulumi.cloudflare.AccessOrganizationArgs;
 * import com.pulumi.cloudflare.inputs.AccessOrganizationLoginDesignArgs;
 * 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 AccessOrganization("example", AccessOrganizationArgs.builder()
 *             .accountId("f037e56e89293a057740de681ac9abbe")
 *             .name("example.cloudflareaccess.com")
 *             .authDomain("example.cloudflareaccess.com")
 *             .isUiReadOnly(false)
 *             .userSeatExpirationInactiveTime("720h")
 *             .autoRedirectToIdentity(false)
 *             .loginDesigns(AccessOrganizationLoginDesignArgs.builder()
 *                 .backgroundColor("#ffffff")
 *                 .textColor("#000000")
 *                 .logoPath("https://example.com/logo.png")
 *                 .headerText("My header text")
 *                 .footerText("My footer text")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: cloudflare:AccessOrganization
 *     properties:
 *       accountId: f037e56e89293a057740de681ac9abbe
 *       name: example.cloudflareaccess.com
 *       authDomain: example.cloudflareaccess.com
 *       isUiReadOnly: false
 *       userSeatExpirationInactiveTime: 720h
 *       autoRedirectToIdentity: false
 *       loginDesigns:
 *         - backgroundColor: '#ffffff'
 *           textColor: '#000000'
 *           logoPath: https://example.com/logo.png
 *           headerText: My header text
 *           footerText: My footer text
 * ```
 * 
 * ## Import
 * ```sh
 * $ pulumi import cloudflare:index/accessOrganization:AccessOrganization example 
 * ```
 */
public class AccessOrganization internal constructor(
    override val javaResource: com.pulumi.cloudflare.AccessOrganization,
) : KotlinCustomResource(javaResource, AccessOrganizationMapper) {
    /**
     * The account identifier to target for the resource. Conflicts with `zone_id`.
     */
    public val accountId: Output
        get() = javaResource.accountId().applyValue({ args0 -> args0 })

    /**
     * When set to true, users can authenticate via WARP for any application in your organization. Application settings will take precedence over this value.
     */
    public val allowAuthenticateViaWarp: Output?
        get() = javaResource.allowAuthenticateViaWarp().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The unique subdomain assigned to your Zero Trust organization.
     */
    public val authDomain: Output
        get() = javaResource.authDomain().applyValue({ args0 -> args0 })

    /**
     * When set to true, users skip the identity provider selection step during login.
     */
    public val autoRedirectToIdentity: Output?
        get() = javaResource.autoRedirectToIdentity().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Custom pages for your Zero Trust organization.
     */
    public val customPages: Output>?
        get() = javaResource.customPages().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> accessOrganizationCustomPageToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * When set to true, this will disable all editing of Access resources via the Zero Trust Dashboard.
     */
    public val isUiReadOnly: Output?
        get() = javaResource.isUiReadOnly().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    public val loginDesigns: Output>?
        get() = javaResource.loginDesigns().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> accessOrganizationLoginDesignToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The name of your Zero Trust organization.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * How often a user will be forced to re-authorise. Must be in the format `48h` or `2h45m`.
     */
    public val sessionDuration: Output?
        get() = javaResource.sessionDuration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A description of the reason why the UI read only field is being toggled.
     */
    public val uiReadOnlyToggleReason: Output?
        get() = javaResource.uiReadOnlyToggleReason().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The amount of time a user seat is inactive before it expires. When the user seat exceeds the set time of inactivity, the user is removed as an active seat and no longer counts against your Teams seat count. Must be in the format `300ms` or `2h45m`.
     */
    public val userSeatExpirationInactiveTime: Output?
        get() = javaResource.userSeatExpirationInactiveTime().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The amount of time that tokens issued for applications will be valid. Must be in the format 30m or 2h45m. Valid time units are: m, h.
     */
    public val warpAuthSessionDuration: Output?
        get() = javaResource.warpAuthSessionDuration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The zone identifier to target for the resource. Conflicts with `account_id`.
     */
    public val zoneId: Output
        get() = javaResource.zoneId().applyValue({ args0 -> args0 })
}

public object AccessOrganizationMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.cloudflare.AccessOrganization::class == javaResource::class

    override fun map(javaResource: Resource): AccessOrganization = AccessOrganization(
        javaResource as
            com.pulumi.cloudflare.AccessOrganization,
    )
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy