![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.cloudflare.kotlin.ZeroTrustAccessPolicy.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.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.cloudflare.kotlin
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessPolicyApprovalGroup
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessPolicyConnectionRules
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessPolicyExclude
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessPolicyInclude
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessPolicyRequire
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessPolicyApprovalGroup.Companion.toKotlin as zeroTrustAccessPolicyApprovalGroupToKotlin
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessPolicyConnectionRules.Companion.toKotlin as zeroTrustAccessPolicyConnectionRulesToKotlin
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessPolicyExclude.Companion.toKotlin as zeroTrustAccessPolicyExcludeToKotlin
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessPolicyInclude.Companion.toKotlin as zeroTrustAccessPolicyIncludeToKotlin
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustAccessPolicyRequire.Companion.toKotlin as zeroTrustAccessPolicyRequireToKotlin
/**
* Builder for [ZeroTrustAccessPolicy].
*/
@PulumiTagMarker
public class ZeroTrustAccessPolicyResourceBuilder internal constructor() {
public var name: String? = null
public var args: ZeroTrustAccessPolicyArgs = ZeroTrustAccessPolicyArgs()
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 ZeroTrustAccessPolicyArgsBuilder.() -> Unit) {
val builder = ZeroTrustAccessPolicyArgsBuilder()
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(): ZeroTrustAccessPolicy {
val builtJavaResource = com.pulumi.cloudflare.ZeroTrustAccessPolicy(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return ZeroTrustAccessPolicy(builtJavaResource)
}
}
/**
* Provides a Cloudflare Access Policy resource. Access Policies are
* used in conjunction with Access Applications to restrict access to
* a particular resource.
* > 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.
* If 'application_id' is omitted, the policy created can be reused by multiple access applications.
* Any cloudflare.AccessApplication resource can reference reusable policies through its `policies` argument.
* To destroy a reusable policy and remove it from all applications' policies lists on the same apply, preemptively set the
* lifecycle option `create_before_destroy` to true on the 'cloudflare_access_policy' resource.
* ## Import
* ```sh
* $ pulumi import cloudflare:index/zeroTrustAccessPolicy:ZeroTrustAccessPolicy example account///
* ```
*/
public class ZeroTrustAccessPolicy internal constructor(
override val javaResource: com.pulumi.cloudflare.ZeroTrustAccessPolicy,
) : KotlinCustomResource(javaResource, ZeroTrustAccessPolicyMapper) {
/**
* The account identifier to target for the resource. Conflicts with `zone_id`.
*/
public val accountId: Output?
get() = javaResource.accountId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The ID of the application the policy is associated with. Required when using `precedence`. **Modifying this attribute will force creation of a new resource.**
*/
public val applicationId: Output?
get() = javaResource.applicationId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
public val approvalGroups: Output>?
get() = javaResource.approvalGroups().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
zeroTrustAccessPolicyApprovalGroupToKotlin(args0)
})
})
}).orElse(null)
})
public val approvalRequired: Output?
get() = javaResource.approvalRequired().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The rules that define how users may connect to the targets secured by your application.
*/
public val connectionRules: Output?
get() = javaResource.connectionRules().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> zeroTrustAccessPolicyConnectionRulesToKotlin(args0) })
}).orElse(null)
})
/**
* Defines the action Access will take if the policy matches the user. Available values: `allow`, `deny`, `non_identity`, `bypass`.
*/
public val decision: Output
get() = javaResource.decision().applyValue({ args0 -> args0 })
/**
* A series of access conditions, see Access Groups.
*/
public val excludes: Output>?
get() = javaResource.excludes().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> zeroTrustAccessPolicyExcludeToKotlin(args0) })
})
}).orElse(null)
})
/**
* A series of access conditions, see Access Groups.
*/
public val includes: Output>
get() = javaResource.includes().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
zeroTrustAccessPolicyIncludeToKotlin(args0)
})
})
})
/**
* Require this application to be served in an isolated browser for users matching this policy.
*/
public val isolationRequired: Output?
get() = javaResource.isolationRequired().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Friendly name of the Access Policy.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The unique precedence for policies on a single application. Required when using `application_id`.
*/
public val precedence: Output?
get() = javaResource.precedence().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The prompt to display to the user for a justification for accessing the resource. Required when using `purpose_justification_required`.
*/
public val purposeJustificationPrompt: Output?
get() = javaResource.purposeJustificationPrompt().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Whether to prompt the user for a justification for accessing the resource.
*/
public val purposeJustificationRequired: Output?
get() = javaResource.purposeJustificationRequired().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A series of access conditions, see Access Groups.
*/
public val requires: Output>?
get() = javaResource.requires().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> zeroTrustAccessPolicyRequireToKotlin(args0) })
})
}).orElse(null)
})
/**
* 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)
})
/**
* The zone identifier to target for the resource. Conflicts with `account_id`.
*/
public val zoneId: Output?
get() = javaResource.zoneId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}
public object ZeroTrustAccessPolicyMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.cloudflare.ZeroTrustAccessPolicy::class == javaResource::class
override fun map(javaResource: Resource): ZeroTrustAccessPolicy =
ZeroTrustAccessPolicy(javaResource as com.pulumi.cloudflare.ZeroTrustAccessPolicy)
}
/**
* @see [ZeroTrustAccessPolicy].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [ZeroTrustAccessPolicy].
*/
public suspend fun zeroTrustAccessPolicy(
name: String,
block: suspend ZeroTrustAccessPolicyResourceBuilder.() -> Unit,
): ZeroTrustAccessPolicy {
val builder = ZeroTrustAccessPolicyResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [ZeroTrustAccessPolicy].
* @param name The _unique_ name of the resulting resource.
*/
public fun zeroTrustAccessPolicy(name: String): ZeroTrustAccessPolicy {
val builder = ZeroTrustAccessPolicyResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy