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

com.pulumi.cloudflare.kotlin.ZeroTrustDevicePostureRuleArgs.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: 5.40.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin

import com.pulumi.cloudflare.ZeroTrustDevicePostureRuleArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.ZeroTrustDevicePostureRuleInputArgs
import com.pulumi.cloudflare.kotlin.inputs.ZeroTrustDevicePostureRuleInputArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.ZeroTrustDevicePostureRuleMatchArgs
import com.pulumi.cloudflare.kotlin.inputs.ZeroTrustDevicePostureRuleMatchArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a Cloudflare Device Posture Rule resource. Device posture rules configure security policies for device posture checks.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as cloudflare from "@pulumi/cloudflare";
 * const eaxmple = new cloudflare.ZeroTrustDevicePostureRule("eaxmple", {
 *     accountId: "f037e56e89293a057740de681ac9abbe",
 *     name: "Corporate devices posture rule",
 *     type: "os_version",
 *     description: "Device posture rule for corporate devices.",
 *     schedule: "24h",
 *     expiration: "24h",
 *     matches: [{
 *         platform: "linux",
 *     }],
 *     inputs: [{
 *         id: corporateDevices.id,
 *         version: "1.0.0",
 *         operator: "<",
 *         osDistroName: "ubuntu",
 *         osDistroRevision: "1.0.0",
 *         osVersionExtra: "(a)",
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_cloudflare as cloudflare
 * eaxmple = cloudflare.ZeroTrustDevicePostureRule("eaxmple",
 *     account_id="f037e56e89293a057740de681ac9abbe",
 *     name="Corporate devices posture rule",
 *     type="os_version",
 *     description="Device posture rule for corporate devices.",
 *     schedule="24h",
 *     expiration="24h",
 *     matches=[{
 *         "platform": "linux",
 *     }],
 *     inputs=[{
 *         "id": corporate_devices["id"],
 *         "version": "1.0.0",
 *         "operator": "<",
 *         "os_distro_name": "ubuntu",
 *         "os_distro_revision": "1.0.0",
 *         "os_version_extra": "(a)",
 *     }])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Cloudflare = Pulumi.Cloudflare;
 * return await Deployment.RunAsync(() =>
 * {
 *     var eaxmple = new Cloudflare.ZeroTrustDevicePostureRule("eaxmple", new()
 *     {
 *         AccountId = "f037e56e89293a057740de681ac9abbe",
 *         Name = "Corporate devices posture rule",
 *         Type = "os_version",
 *         Description = "Device posture rule for corporate devices.",
 *         Schedule = "24h",
 *         Expiration = "24h",
 *         Matches = new[]
 *         {
 *             new Cloudflare.Inputs.ZeroTrustDevicePostureRuleMatchArgs
 *             {
 *                 Platform = "linux",
 *             },
 *         },
 *         Inputs = new[]
 *         {
 *             new Cloudflare.Inputs.ZeroTrustDevicePostureRuleInputArgs
 *             {
 *                 Id = corporateDevices.Id,
 *                 Version = "1.0.0",
 *                 Operator = "<",
 *                 OsDistroName = "ubuntu",
 *                 OsDistroRevision = "1.0.0",
 *                 OsVersionExtra = "(a)",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```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.NewZeroTrustDevicePostureRule(ctx, "eaxmple", &cloudflare.ZeroTrustDevicePostureRuleArgs{
 * 			AccountId:   pulumi.String("f037e56e89293a057740de681ac9abbe"),
 * 			Name:        pulumi.String("Corporate devices posture rule"),
 * 			Type:        pulumi.String("os_version"),
 * 			Description: pulumi.String("Device posture rule for corporate devices."),
 * 			Schedule:    pulumi.String("24h"),
 * 			Expiration:  pulumi.String("24h"),
 * 			Matches: cloudflare.ZeroTrustDevicePostureRuleMatchArray{
 * 				&cloudflare.ZeroTrustDevicePostureRuleMatchArgs{
 * 					Platform: pulumi.String("linux"),
 * 				},
 * 			},
 * 			Inputs: cloudflare.ZeroTrustDevicePostureRuleInputTypeArray{
 * 				&cloudflare.ZeroTrustDevicePostureRuleInputTypeArgs{
 * 					Id:               pulumi.Any(corporateDevices.Id),
 * 					Version:          pulumi.String("1.0.0"),
 * 					Operator:         pulumi.String("<"),
 * 					OsDistroName:     pulumi.String("ubuntu"),
 * 					OsDistroRevision: pulumi.String("1.0.0"),
 * 					OsVersionExtra:   pulumi.String("(a)"),
 * 				},
 * 			},
 * 		})
 * 		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.ZeroTrustDevicePostureRule;
 * import com.pulumi.cloudflare.ZeroTrustDevicePostureRuleArgs;
 * import com.pulumi.cloudflare.inputs.ZeroTrustDevicePostureRuleMatchArgs;
 * import com.pulumi.cloudflare.inputs.ZeroTrustDevicePostureRuleInputArgs;
 * 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 eaxmple = new ZeroTrustDevicePostureRule("eaxmple", ZeroTrustDevicePostureRuleArgs.builder()
 *             .accountId("f037e56e89293a057740de681ac9abbe")
 *             .name("Corporate devices posture rule")
 *             .type("os_version")
 *             .description("Device posture rule for corporate devices.")
 *             .schedule("24h")
 *             .expiration("24h")
 *             .matches(ZeroTrustDevicePostureRuleMatchArgs.builder()
 *                 .platform("linux")
 *                 .build())
 *             .inputs(ZeroTrustDevicePostureRuleInputArgs.builder()
 *                 .id(corporateDevices.id())
 *                 .version("1.0.0")
 *                 .operator("<")
 *                 .osDistroName("ubuntu")
 *                 .osDistroRevision("1.0.0")
 *                 .osVersionExtra("(a)")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   eaxmple:
 *     type: cloudflare:ZeroTrustDevicePostureRule
 *     properties:
 *       accountId: f037e56e89293a057740de681ac9abbe
 *       name: Corporate devices posture rule
 *       type: os_version
 *       description: Device posture rule for corporate devices.
 *       schedule: 24h
 *       expiration: 24h
 *       matches:
 *         - platform: linux
 *       inputs:
 *         - id: ${corporateDevices.id}
 *           version: 1.0.0
 *           operator: <
 *           osDistroName: ubuntu
 *           osDistroRevision: 1.0.0
 *           osVersionExtra: (a)
 * ```
 * 
 * ## Import
 * ```sh
 * $ pulumi import cloudflare:index/zeroTrustDevicePostureRule:ZeroTrustDevicePostureRule example /
 * ```
 * @property accountId The account identifier to target for the resource.
 * @property description
 * @property expiration Expire posture results after the specified amount of time. Must be in the format `1h` or `30m`. Valid units are `h` and `m`.
 * @property inputs Required for all rule types except `warp`, `gateway`, and `tanium`.
 * @property matches The conditions that the client must match to run the rule.
 * @property name Name of the device posture rule.
 * @property schedule Tells the client when to run the device posture check. Must be in the format `1h` or `30m`. Valid units are `h` and `m`.
 * @property type The device posture rule type. Available values: `serial_number`, `file`, `application`, `gateway`, `warp`, `domain_joined`, `os_version`, `disk_encryption`, `firewall`, `client_certificate`, `workspace_one`, `unique_client_id`, `crowdstrike_s2s`, `sentinelone`, `kolide`, `tanium_s2s`, `intune`, `sentinelone_s2s`.
 */
public data class ZeroTrustDevicePostureRuleArgs(
    public val accountId: Output? = null,
    public val description: Output? = null,
    public val expiration: Output? = null,
    public val inputs: Output>? = null,
    public val matches: Output>? = null,
    public val name: Output? = null,
    public val schedule: Output? = null,
    public val type: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.ZeroTrustDevicePostureRuleArgs =
        com.pulumi.cloudflare.ZeroTrustDevicePostureRuleArgs.builder()
            .accountId(accountId?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .expiration(expiration?.applyValue({ args0 -> args0 }))
            .inputs(inputs?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .matches(
                matches?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .name(name?.applyValue({ args0 -> args0 }))
            .schedule(schedule?.applyValue({ args0 -> args0 }))
            .type(type?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ZeroTrustDevicePostureRuleArgs].
 */
@PulumiTagMarker
public class ZeroTrustDevicePostureRuleArgsBuilder internal constructor() {
    private var accountId: Output? = null

    private var description: Output? = null

    private var expiration: Output? = null

    private var inputs: Output>? = null

    private var matches: Output>? = null

    private var name: Output? = null

    private var schedule: Output? = null

    private var type: Output? = null

    /**
     * @param value The account identifier to target for the resource.
     */
    @JvmName("eaqyobayxcqvnkxx")
    public suspend fun accountId(`value`: Output) {
        this.accountId = value
    }

    /**
     * @param value
     */
    @JvmName("pchkmxinbeqqgebm")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Expire posture results after the specified amount of time. Must be in the format `1h` or `30m`. Valid units are `h` and `m`.
     */
    @JvmName("tqgpmysiiemvdhjy")
    public suspend fun expiration(`value`: Output) {
        this.expiration = value
    }

    /**
     * @param value Required for all rule types except `warp`, `gateway`, and `tanium`.
     */
    @JvmName("nuopurvjtjocrmuy")
    public suspend fun inputs(`value`: Output>) {
        this.inputs = value
    }

    @JvmName("efefjesunjhbxdvn")
    public suspend fun inputs(vararg values: Output) {
        this.inputs = Output.all(values.asList())
    }

    /**
     * @param values Required for all rule types except `warp`, `gateway`, and `tanium`.
     */
    @JvmName("fhsgprmstcymunih")
    public suspend fun inputs(values: List>) {
        this.inputs = Output.all(values)
    }

    /**
     * @param value The conditions that the client must match to run the rule.
     */
    @JvmName("xumxubqihjfekbey")
    public suspend fun matches(`value`: Output>) {
        this.matches = value
    }

    @JvmName("gdocatmdacjgqrtt")
    public suspend fun matches(vararg values: Output) {
        this.matches = Output.all(values.asList())
    }

    /**
     * @param values The conditions that the client must match to run the rule.
     */
    @JvmName("hqpqcrquyywwtjux")
    public suspend fun matches(values: List>) {
        this.matches = Output.all(values)
    }

    /**
     * @param value Name of the device posture rule.
     */
    @JvmName("tjfxhdnpemhunvgk")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Tells the client when to run the device posture check. Must be in the format `1h` or `30m`. Valid units are `h` and `m`.
     */
    @JvmName("txwumtwlwvawemkl")
    public suspend fun schedule(`value`: Output) {
        this.schedule = value
    }

    /**
     * @param value The device posture rule type. Available values: `serial_number`, `file`, `application`, `gateway`, `warp`, `domain_joined`, `os_version`, `disk_encryption`, `firewall`, `client_certificate`, `workspace_one`, `unique_client_id`, `crowdstrike_s2s`, `sentinelone`, `kolide`, `tanium_s2s`, `intune`, `sentinelone_s2s`.
     */
    @JvmName("wniqjmowsgvjrvsm")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value The account identifier to target for the resource.
     */
    @JvmName("eakuewrcsgvcoltb")
    public suspend fun accountId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.accountId = mapped
    }

    /**
     * @param value
     */
    @JvmName("wotkxeqfbitchbfh")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Expire posture results after the specified amount of time. Must be in the format `1h` or `30m`. Valid units are `h` and `m`.
     */
    @JvmName("iuraadyshffxppwi")
    public suspend fun expiration(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.expiration = mapped
    }

    /**
     * @param value Required for all rule types except `warp`, `gateway`, and `tanium`.
     */
    @JvmName("falgvuauvbwftelj")
    public suspend fun inputs(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.inputs = mapped
    }

    /**
     * @param argument Required for all rule types except `warp`, `gateway`, and `tanium`.
     */
    @JvmName("pjjhwchradgmeelu")
    public suspend fun inputs(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ZeroTrustDevicePostureRuleInputArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.inputs = mapped
    }

    /**
     * @param argument Required for all rule types except `warp`, `gateway`, and `tanium`.
     */
    @JvmName("aluwwyvkgruxtkcb")
    public suspend fun inputs(vararg argument: suspend ZeroTrustDevicePostureRuleInputArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ZeroTrustDevicePostureRuleInputArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.inputs = mapped
    }

    /**
     * @param argument Required for all rule types except `warp`, `gateway`, and `tanium`.
     */
    @JvmName("lntugbntqloeyufu")
    public suspend fun inputs(argument: suspend ZeroTrustDevicePostureRuleInputArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ZeroTrustDevicePostureRuleInputArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.inputs = mapped
    }

    /**
     * @param values Required for all rule types except `warp`, `gateway`, and `tanium`.
     */
    @JvmName("ojoapwnhfbtcbrid")
    public suspend fun inputs(vararg values: ZeroTrustDevicePostureRuleInputArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.inputs = mapped
    }

    /**
     * @param value The conditions that the client must match to run the rule.
     */
    @JvmName("hwyjlgtwjvfxbvpk")
    public suspend fun matches(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.matches = mapped
    }

    /**
     * @param argument The conditions that the client must match to run the rule.
     */
    @JvmName("takjdpnjsqvfqlue")
    public suspend fun matches(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ZeroTrustDevicePostureRuleMatchArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.matches = mapped
    }

    /**
     * @param argument The conditions that the client must match to run the rule.
     */
    @JvmName("wnoajjayxwettkuw")
    public suspend fun matches(vararg argument: suspend ZeroTrustDevicePostureRuleMatchArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ZeroTrustDevicePostureRuleMatchArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.matches = mapped
    }

    /**
     * @param argument The conditions that the client must match to run the rule.
     */
    @JvmName("qdeoepcnbltwmnrt")
    public suspend fun matches(argument: suspend ZeroTrustDevicePostureRuleMatchArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ZeroTrustDevicePostureRuleMatchArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.matches = mapped
    }

    /**
     * @param values The conditions that the client must match to run the rule.
     */
    @JvmName("jbraijbgffsgyvfd")
    public suspend fun matches(vararg values: ZeroTrustDevicePostureRuleMatchArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.matches = mapped
    }

    /**
     * @param value Name of the device posture rule.
     */
    @JvmName("gsslpekuemdxbnvj")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Tells the client when to run the device posture check. Must be in the format `1h` or `30m`. Valid units are `h` and `m`.
     */
    @JvmName("ugdfvxpjwgrbgphn")
    public suspend fun schedule(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.schedule = mapped
    }

    /**
     * @param value The device posture rule type. Available values: `serial_number`, `file`, `application`, `gateway`, `warp`, `domain_joined`, `os_version`, `disk_encryption`, `firewall`, `client_certificate`, `workspace_one`, `unique_client_id`, `crowdstrike_s2s`, `sentinelone`, `kolide`, `tanium_s2s`, `intune`, `sentinelone_s2s`.
     */
    @JvmName("ewshychgaulchpfh")
    public suspend fun type(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.type = mapped
    }

    internal fun build(): ZeroTrustDevicePostureRuleArgs = ZeroTrustDevicePostureRuleArgs(
        accountId = accountId,
        description = description,
        expiration = expiration,
        inputs = inputs,
        matches = matches,
        name = name,
        schedule = schedule,
        type = type,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy