Cloudflare

v4.13.0 published on Monday, Nov 28, 2022 by Pulumi

DevicePostureRule

Provides a Cloudflare Device Posture Rule resource. Device posture rules configure security policies for device posture checks.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var eaxmple = new Cloudflare.DevicePostureRule("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.DevicePostureRuleMatchArgs
            {
                Platform = "linux",
            },
        },
        Inputs = new[]
        {
            new Cloudflare.Inputs.DevicePostureRuleInputArgs
            {
                Id = cloudflare_teams_list.Corporate_devices.Id,
                Version = "1.0.0",
                Operator = "<",
                OsDistroName = "ubuntu",
                OsDistroRevision = "1.0.0",
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-cloudflare/sdk/v4/go/cloudflare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudflare.NewDevicePostureRule(ctx, "eaxmple", &cloudflare.DevicePostureRuleArgs{
			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: DevicePostureRuleMatchArray{
				&DevicePostureRuleMatchArgs{
					Platform: pulumi.String("linux"),
				},
			},
			Inputs: DevicePostureRuleInputTypeArray{
				&DevicePostureRuleInputTypeArgs{
					Id:               pulumi.Any(cloudflare_teams_list.Corporate_devices.Id),
					Version:          pulumi.String("1.0.0"),
					Operator:         pulumi.String("<"),
					OsDistroName:     pulumi.String("ubuntu"),
					OsDistroRevision: pulumi.String("1.0.0"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.DevicePostureRule;
import com.pulumi.cloudflare.DevicePostureRuleArgs;
import com.pulumi.cloudflare.inputs.DevicePostureRuleMatchArgs;
import com.pulumi.cloudflare.inputs.DevicePostureRuleInputArgs;
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 DevicePostureRule("eaxmple", DevicePostureRuleArgs.builder()        
            .accountId("f037e56e89293a057740de681ac9abbe")
            .name("Corporate devices posture rule")
            .type("os_version")
            .description("Device posture rule for corporate devices.")
            .schedule("24h")
            .expiration("24h")
            .matches(DevicePostureRuleMatchArgs.builder()
                .platform("linux")
                .build())
            .inputs(DevicePostureRuleInputArgs.builder()
                .id(cloudflare_teams_list.corporate_devices().id())
                .version("1.0.0")
                .operator("<")
                .osDistroName("ubuntu")
                .osDistroRevision("1.0.0")
                .build())
            .build());

    }
}
import pulumi
import pulumi_cloudflare as cloudflare

eaxmple = cloudflare.DevicePostureRule("eaxmple",
    account_id="f037e56e89293a057740de681ac9abbe",
    name="Corporate devices posture rule",
    type="os_version",
    description="Device posture rule for corporate devices.",
    schedule="24h",
    expiration="24h",
    matches=[cloudflare.DevicePostureRuleMatchArgs(
        platform="linux",
    )],
    inputs=[cloudflare.DevicePostureRuleInputArgs(
        id=cloudflare_teams_list["corporate_devices"]["id"],
        version="1.0.0",
        operator="<",
        os_distro_name="ubuntu",
        os_distro_revision="1.0.0",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const eaxmple = new cloudflare.DevicePostureRule("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: cloudflare_teams_list.corporate_devices.id,
        version: "1.0.0",
        operator: "<",
        osDistroName: "ubuntu",
        osDistroRevision: "1.0.0",
    }],
});
resources:
  eaxmple:
    type: cloudflare:DevicePostureRule
    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: ${cloudflare_teams_list.corporate_devices.id}
          version: 1.0.0
          operator: <
          osDistroName: ubuntu
          osDistroRevision: 1.0.0

Create DevicePostureRule Resource

new DevicePostureRule(name: string, args: DevicePostureRuleArgs, opts?: CustomResourceOptions);
@overload
def DevicePostureRule(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      account_id: Optional[str] = None,
                      description: Optional[str] = None,
                      expiration: Optional[str] = None,
                      inputs: Optional[Sequence[DevicePostureRuleInputArgs]] = None,
                      matches: Optional[Sequence[DevicePostureRuleMatchArgs]] = None,
                      name: Optional[str] = None,
                      schedule: Optional[str] = None,
                      type: Optional[str] = None)
@overload
def DevicePostureRule(resource_name: str,
                      args: DevicePostureRuleArgs,
                      opts: Optional[ResourceOptions] = None)
func NewDevicePostureRule(ctx *Context, name string, args DevicePostureRuleArgs, opts ...ResourceOption) (*DevicePostureRule, error)
public DevicePostureRule(string name, DevicePostureRuleArgs args, CustomResourceOptions? opts = null)
public DevicePostureRule(String name, DevicePostureRuleArgs args)
public DevicePostureRule(String name, DevicePostureRuleArgs args, CustomResourceOptions options)
type: cloudflare:DevicePostureRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args DevicePostureRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args DevicePostureRuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DevicePostureRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DevicePostureRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DevicePostureRuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

DevicePostureRule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The DevicePostureRule resource accepts the following input properties:

AccountId string

The account identifier to target for the resource.

Type string

The device posture rule type. Available values: serial_number, file, application, gateway, warp, domain_joined, os_version, disk_encryption, firewall, workspace_one, unique_client_id.

Description string
Expiration string

Expire posture results after the specified amount of time. Must be in the format 1h or 30m. Valid units are h and m.

Inputs List<DevicePostureRuleInputArgs>
Matches List<DevicePostureRuleMatchArgs>

The conditions that the client must match to run the rule.

Name string

Name of the device posture rule.

Schedule string

Tells the client when to run the device posture check. Must be in the format 1h or 30m. Valid units are h and m.

AccountId string

The account identifier to target for the resource.

Type string

The device posture rule type. Available values: serial_number, file, application, gateway, warp, domain_joined, os_version, disk_encryption, firewall, workspace_one, unique_client_id.

Description string
Expiration string

Expire posture results after the specified amount of time. Must be in the format 1h or 30m. Valid units are h and m.

Inputs []DevicePostureRuleInputTypeArgs
Matches []DevicePostureRuleMatchArgs

The conditions that the client must match to run the rule.

Name string

Name of the device posture rule.

Schedule string

Tells the client when to run the device posture check. Must be in the format 1h or 30m. Valid units are h and m.

accountId String

The account identifier to target for the resource.

type String

The device posture rule type. Available values: serial_number, file, application, gateway, warp, domain_joined, os_version, disk_encryption, firewall, workspace_one, unique_client_id.

description String
expiration String

Expire posture results after the specified amount of time. Must be in the format 1h or 30m. Valid units are h and m.

inputs List<DevicePostureRuleInputArgs>
matches List<DevicePostureRuleMatchArgs>

The conditions that the client must match to run the rule.

name String

Name of the device posture rule.

schedule String

Tells the client when to run the device posture check. Must be in the format 1h or 30m. Valid units are h and m.

accountId string

The account identifier to target for the resource.

type string

The device posture rule type. Available values: serial_number, file, application, gateway, warp, domain_joined, os_version, disk_encryption, firewall, workspace_one, unique_client_id.

description string
expiration string

Expire posture results after the specified amount of time. Must be in the format 1h or 30m. Valid units are h and m.

inputs DevicePostureRuleInputArgs[]
matches DevicePostureRuleMatchArgs[]

The conditions that the client must match to run the rule.

name string

Name of the device posture rule.

schedule string

Tells the client when to run the device posture check. Must be in the format 1h or 30m. Valid units are h and m.

account_id str

The account identifier to target for the resource.

type str

The device posture rule type. Available values: serial_number, file, application, gateway, warp, domain_joined, os_version, disk_encryption, firewall, workspace_one, unique_client_id.

description str
expiration str

Expire posture results after the specified amount of time. Must be in the format 1h or 30m. Valid units are h and m.

inputs Sequence[DevicePostureRuleInputArgs]
matches Sequence[DevicePostureRuleMatchArgs]

The conditions that the client must match to run the rule.

name str

Name of the device posture rule.

schedule str

Tells the client when to run the device posture check. Must be in the format 1h or 30m. Valid units are h and m.

accountId String

The account identifier to target for the resource.

type String

The device posture rule type. Available values: serial_number, file, application, gateway, warp, domain_joined, os_version, disk_encryption, firewall, workspace_one, unique_client_id.

description String
expiration String

Expire posture results after the specified amount of time. Must be in the format 1h or 30m. Valid units are h and m.

inputs List<Property Map>
matches List<Property Map>

The conditions that the client must match to run the rule.

name String

Name of the device posture rule.

schedule String

Tells the client when to run the device posture check. Must be in the format 1h or 30m. Valid units are h and m.

Outputs

All input properties are implicitly available as output properties. Additionally, the DevicePostureRule resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing DevicePostureRule Resource

Get an existing DevicePostureRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DevicePostureRuleState, opts?: CustomResourceOptions): DevicePostureRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        description: Optional[str] = None,
        expiration: Optional[str] = None,
        inputs: Optional[Sequence[DevicePostureRuleInputArgs]] = None,
        matches: Optional[Sequence[DevicePostureRuleMatchArgs]] = None,
        name: Optional[str] = None,
        schedule: Optional[str] = None,
        type: Optional[str] = None) -> DevicePostureRule
func GetDevicePostureRule(ctx *Context, name string, id IDInput, state *DevicePostureRuleState, opts ...ResourceOption) (*DevicePostureRule, error)
public static DevicePostureRule Get(string name, Input<string> id, DevicePostureRuleState? state, CustomResourceOptions? opts = null)
public static DevicePostureRule get(String name, Output<String> id, DevicePostureRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AccountId string

The account identifier to target for the resource.

Description string
Expiration string

Expire posture results after the specified amount of time. Must be in the format 1h or 30m. Valid units are h and m.

Inputs List<DevicePostureRuleInputArgs>
Matches List<DevicePostureRuleMatchArgs>

The conditions that the client must match to run the rule.

Name string

Name of the device posture rule.

Schedule string

Tells the client when to run the device posture check. Must be in the format 1h or 30m. Valid units are h and m.

Type string

The device posture rule type. Available values: serial_number, file, application, gateway, warp, domain_joined, os_version, disk_encryption, firewall, workspace_one, unique_client_id.

AccountId string

The account identifier to target for the resource.

Description string
Expiration string

Expire posture results after the specified amount of time. Must be in the format 1h or 30m. Valid units are h and m.

Inputs []DevicePostureRuleInputTypeArgs
Matches []DevicePostureRuleMatchArgs

The conditions that the client must match to run the rule.

Name string

Name of the device posture rule.

Schedule string

Tells the client when to run the device posture check. Must be in the format 1h or 30m. Valid units are h and m.

Type string

The device posture rule type. Available values: serial_number, file, application, gateway, warp, domain_joined, os_version, disk_encryption, firewall, workspace_one, unique_client_id.

accountId String

The account identifier to target for the resource.

description String
expiration String

Expire posture results after the specified amount of time. Must be in the format 1h or 30m. Valid units are h and m.

inputs List<DevicePostureRuleInputArgs>
matches List<DevicePostureRuleMatchArgs>

The conditions that the client must match to run the rule.

name String

Name of the device posture rule.

schedule String

Tells the client when to run the device posture check. Must be in the format 1h or 30m. Valid units are h and m.

type String

The device posture rule type. Available values: serial_number, file, application, gateway, warp, domain_joined, os_version, disk_encryption, firewall, workspace_one, unique_client_id.

accountId string

The account identifier to target for the resource.

description string
expiration string

Expire posture results after the specified amount of time. Must be in the format 1h or 30m. Valid units are h and m.

inputs DevicePostureRuleInputArgs[]
matches DevicePostureRuleMatchArgs[]

The conditions that the client must match to run the rule.

name string

Name of the device posture rule.

schedule string

Tells the client when to run the device posture check. Must be in the format 1h or 30m. Valid units are h and m.

type string

The device posture rule type. Available values: serial_number, file, application, gateway, warp, domain_joined, os_version, disk_encryption, firewall, workspace_one, unique_client_id.

account_id str

The account identifier to target for the resource.

description str
expiration str

Expire posture results after the specified amount of time. Must be in the format 1h or 30m. Valid units are h and m.

inputs Sequence[DevicePostureRuleInputArgs]
matches Sequence[DevicePostureRuleMatchArgs]

The conditions that the client must match to run the rule.

name str

Name of the device posture rule.

schedule str

Tells the client when to run the device posture check. Must be in the format 1h or 30m. Valid units are h and m.

type str

The device posture rule type. Available values: serial_number, file, application, gateway, warp, domain_joined, os_version, disk_encryption, firewall, workspace_one, unique_client_id.

accountId String

The account identifier to target for the resource.

description String
expiration String

Expire posture results after the specified amount of time. Must be in the format 1h or 30m. Valid units are h and m.

inputs List<Property Map>
matches List<Property Map>

The conditions that the client must match to run the rule.

name String

Name of the device posture rule.

schedule String

Tells the client when to run the device posture check. Must be in the format 1h or 30m. Valid units are h and m.

type String

The device posture rule type. Available values: serial_number, file, application, gateway, warp, domain_joined, os_version, disk_encryption, firewall, workspace_one, unique_client_id.

Supporting Types

DevicePostureRuleInput

ComplianceStatus string

The workspace one device compliance status.

ConnectionId string

The workspace one connection id.

Domain string

The domain that the client must join.

Enabled bool

True if the firewall must be enabled.

Exists bool

Checks if the file should exist.

Id string

The Teams List id.

Operator string

The version comparison operator.

OsDistroName string

The operating system excluding version information.

OsDistroRevision string

The operating system version excluding OS name information or release name.

Path string

The path to the file.

RequireAll bool

True if all drives must be encrypted.

Running bool

Checks if the application should be running.

Sha256 string

The sha256 hash of the file.

Thumbprint string

The thumbprint of the file certificate.

Version string

The operating system semantic version.

ComplianceStatus string

The workspace one device compliance status.

ConnectionId string

The workspace one connection id.

Domain string

The domain that the client must join.

Enabled bool

True if the firewall must be enabled.

Exists bool

Checks if the file should exist.

Id string

The Teams List id.

Operator string

The version comparison operator.

OsDistroName string

The operating system excluding version information.

OsDistroRevision string

The operating system version excluding OS name information or release name.

Path string

The path to the file.

RequireAll bool

True if all drives must be encrypted.

Running bool

Checks if the application should be running.

Sha256 string

The sha256 hash of the file.

Thumbprint string

The thumbprint of the file certificate.

Version string

The operating system semantic version.

complianceStatus String

The workspace one device compliance status.

connectionId String

The workspace one connection id.

domain String

The domain that the client must join.

enabled Boolean

True if the firewall must be enabled.

exists Boolean

Checks if the file should exist.

id String

The Teams List id.

operator String

The version comparison operator.

osDistroName String

The operating system excluding version information.

osDistroRevision String

The operating system version excluding OS name information or release name.

path String

The path to the file.

requireAll Boolean

True if all drives must be encrypted.

running Boolean

Checks if the application should be running.

sha256 String

The sha256 hash of the file.

thumbprint String

The thumbprint of the file certificate.

version String

The operating system semantic version.

complianceStatus string

The workspace one device compliance status.

connectionId string

The workspace one connection id.

domain string

The domain that the client must join.

enabled boolean

True if the firewall must be enabled.

exists boolean

Checks if the file should exist.

id string

The Teams List id.

operator string

The version comparison operator.

osDistroName string

The operating system excluding version information.

osDistroRevision string

The operating system version excluding OS name information or release name.

path string

The path to the file.

requireAll boolean

True if all drives must be encrypted.

running boolean

Checks if the application should be running.

sha256 string

The sha256 hash of the file.

thumbprint string

The thumbprint of the file certificate.

version string

The operating system semantic version.

compliance_status str

The workspace one device compliance status.

connection_id str

The workspace one connection id.

domain str

The domain that the client must join.

enabled bool

True if the firewall must be enabled.

exists bool

Checks if the file should exist.

id str

The Teams List id.

operator str

The version comparison operator.

os_distro_name str

The operating system excluding version information.

os_distro_revision str

The operating system version excluding OS name information or release name.

path str

The path to the file.

require_all bool

True if all drives must be encrypted.

running bool

Checks if the application should be running.

sha256 str

The sha256 hash of the file.

thumbprint str

The thumbprint of the file certificate.

version str

The operating system semantic version.

complianceStatus String

The workspace one device compliance status.

connectionId String

The workspace one connection id.

domain String

The domain that the client must join.

enabled Boolean

True if the firewall must be enabled.

exists Boolean

Checks if the file should exist.

id String

The Teams List id.

operator String

The version comparison operator.

osDistroName String

The operating system excluding version information.

osDistroRevision String

The operating system version excluding OS name information or release name.

path String

The path to the file.

requireAll Boolean

True if all drives must be encrypted.

running Boolean

Checks if the application should be running.

sha256 String

The sha256 hash of the file.

thumbprint String

The thumbprint of the file certificate.

version String

The operating system semantic version.

DevicePostureRuleMatch

Platform string

The platform of the device. Available values: windows, mac, linux, android, ios, chromeos.

Platform string

The platform of the device. Available values: windows, mac, linux, android, ios, chromeos.

platform String

The platform of the device. Available values: windows, mac, linux, android, ios, chromeos.

platform string

The platform of the device. Available values: windows, mac, linux, android, ios, chromeos.

platform str

The platform of the device. Available values: windows, mac, linux, android, ios, chromeos.

platform String

The platform of the device. Available values: windows, mac, linux, android, ios, chromeos.

Import

 $ pulumi import cloudflare:index/devicePostureRule:DevicePostureRule example <account_id>/<device_posture_rule_id>

Package Details

Repository
https://github.com/pulumi/pulumi-cloudflare
License
Apache-2.0
Notes

This Pulumi package is based on the cloudflare Terraform Provider.