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

com.pulumi.cloudflare.kotlin.ZeroTrustAccessApplication.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.ZeroTrustAccessApplicationCorsHeader
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessApplicationFooterLink
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessApplicationLandingPageDesign
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessApplicationSaasApp
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessApplicationScimConfig
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessApplicationTargetCriteria
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.ZeroTrustAccessApplicationCorsHeader.Companion.toKotlin as zeroTrustAccessApplicationCorsHeaderToKotlin
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessApplicationFooterLink.Companion.toKotlin as zeroTrustAccessApplicationFooterLinkToKotlin
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessApplicationLandingPageDesign.Companion.toKotlin as zeroTrustAccessApplicationLandingPageDesignToKotlin
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessApplicationSaasApp.Companion.toKotlin as zeroTrustAccessApplicationSaasAppToKotlin
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessApplicationScimConfig.Companion.toKotlin as zeroTrustAccessApplicationScimConfigToKotlin
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessApplicationTargetCriteria.Companion.toKotlin as zeroTrustAccessApplicationTargetCriteriaToKotlin

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

    public var args: ZeroTrustAccessApplicationArgs = ZeroTrustAccessApplicationArgs()

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

/**
 * Provides a Cloudflare Access Application resource. Access
 * Applications are used to restrict access to a whole application using an
 * authorisation gateway managed by Cloudflare.
 * > 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.
 * ## Import
 * ```sh
 * $ pulumi import cloudflare:index/zeroTrustAccessApplication:ZeroTrustAccessApplication example /
 * ```
 */
public class ZeroTrustAccessApplication internal constructor(
    override val javaResource: com.pulumi.cloudflare.ZeroTrustAccessApplication,
) : KotlinCustomResource(javaResource, ZeroTrustAccessApplicationMapper) {
    /**
     * 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 to this application using their WARP session. When set to false this application will always require direct IdP authentication. This setting always overrides the organization setting for WARP authentication.
     */
    public val allowAuthenticateViaWarp: Output?
        get() = javaResource.allowAuthenticateViaWarp().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The identity providers selected for the application.
     */
    public val allowedIdps: Output>?
        get() = javaResource.allowedIdps().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * The logo URL of the app launcher.
     */
    public val appLauncherLogoUrl: Output?
        get() = javaResource.appLauncherLogoUrl().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Option to show/hide applications in App Launcher. Defaults to `true`.
     */
    public val appLauncherVisible: Output?
        get() = javaResource.appLauncherVisible().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Application Audience (AUD) Tag of the application.
     */
    public val aud: Output
        get() = javaResource.aud().applyValue({ args0 -> args0 })

    /**
     * Option to skip identity provider selection if only one is configured in `allowed_idps`. Defaults to `false`.
     */
    public val autoRedirectToIdentity: Output?
        get() = javaResource.autoRedirectToIdentity().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The background color of the app launcher.
     */
    public val bgColor: Output?
        get() = javaResource.bgColor().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * CORS configuration for the Access Application. See below for reference structure.
     */
    public val corsHeaders: Output>?
        get() = javaResource.corsHeaders().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> zeroTrustAccessApplicationCorsHeaderToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * Option that returns a custom error message when a user is denied access to the application.
     */
    public val customDenyMessage: Output?
        get() = javaResource.customDenyMessage().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Option that redirects to a custom URL when a user is denied access to the application via identity based rules.
     */
    public val customDenyUrl: Output?
        get() = javaResource.customDenyUrl().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Option that redirects to a custom URL when a user is denied access to the application via non identity rules.
     */
    public val customNonIdentityDenyUrl: Output?
        get() = javaResource.customNonIdentityDenyUrl().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The custom pages selected for the application.
     */
    public val customPages: Output>?
        get() = javaResource.customPages().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * The primary hostname and path that Access will secure. If the app is visible in the App Launcher dashboard, this is the domain that will be displayed.
     */
    public val domain: Output
        get() = javaResource.domain().applyValue({ args0 -> args0 })

    /**
     * Option to provide increased security against compromised authorization tokens and CSRF attacks by requiring an additional "binding" cookie on requests. Defaults to `false`.
     */
    public val enableBindingCookie: Output?
        get() = javaResource.enableBindingCookie().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The footer links of the app launcher.
     */
    public val footerLinks: Output>?
        get() = javaResource.footerLinks().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> zeroTrustAccessApplicationFooterLinkToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The background color of the header bar in the app launcher.
     */
    public val headerBgColor: Output?
        get() = javaResource.headerBgColor().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Option to add the `HttpOnly` cookie flag to access tokens.
     */
    public val httpOnlyCookieAttribute: Output?
        get() = javaResource.httpOnlyCookieAttribute().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The landing page design of the app launcher.
     */
    public val landingPageDesign: Output?
        get() = javaResource.landingPageDesign().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    zeroTrustAccessApplicationLandingPageDesignToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Image URL for the logo shown in the app launcher dashboard.
     */
    public val logoUrl: Output?
        get() = javaResource.logoUrl().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Friendly name of the Access Application.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. Defaults to `false`.
     */
    public val optionsPreflightBypass: Output?
        get() = javaResource.optionsPreflightBypass().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The policies associated with the application, in ascending order of precedence. Warning: Do not use this field while you still have this application ID referenced as `application_id` in any `cloudflare.AccessPolicy` resource, as it can result in an inconsistent state.
     */
    public val policies: Output>?
        get() = javaResource.policies().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * SaaS configuration for the Access Application.
     */
    public val saasApp: Output?
        get() = javaResource.saasApp().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    zeroTrustAccessApplicationSaasAppToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Defines the same-site cookie setting for access tokens. Available values: `none`, `lax`, `strict`.
     */
    public val sameSiteCookieAttribute: Output?
        get() = javaResource.sameSiteCookieAttribute().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Configuration for provisioning to this application via SCIM. This is currently in closed beta.
     */
    public val scimConfig: Output?
        get() = javaResource.scimConfig().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    zeroTrustAccessApplicationScimConfigToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * List of domains that access will secure. Only present for self_hosted, vnc, and ssh applications. Always includes the value set as `domain`.
     */
    public val selfHostedDomains: Output>?
        get() = javaResource.selfHostedDomains().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Option to return a 401 status code in service authentication rules on failed requests. Defaults to `false`.
     */
    public val serviceAuth401Redirect: Output?
        get() = javaResource.serviceAuth401Redirect().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

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

    /**
     * Option to skip the App Launcher landing page. Defaults to `false`.
     */
    public val skipAppLauncherLoginPage: Output?
        get() = javaResource.skipAppLauncherLoginPage().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Option to skip the authorization interstitial when using the CLI. Defaults to `false`.
     */
    public val skipInterstitial: Output?
        get() = javaResource.skipInterstitial().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The itags associated with the application.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * A list of mappings to apply to SCIM resources before provisioning them in this application. These can transform or filter the resources to be provisioned.
     */
    public val targetCriterias: Output>?
        get() = javaResource.targetCriterias().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        zeroTrustAccessApplicationTargetCriteriaToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * The application type. Available values: `app_launcher`, `bookmark`, `biso`, `dash_sso`, `saas`, `self_hosted`, `ssh`, `vnc`, `warp`, `infrastructure`. Defaults to `self_hosted`.
     */
    public val type: Output?
        get() = javaResource.type().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 ZeroTrustAccessApplicationMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.cloudflare.ZeroTrustAccessApplication::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy