Cloudflare

Pulumi Official
Package maintained by Pulumi
v4.9.0 published on Monday, Jul 18, 2022 by Pulumi

DevicePostureRule

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

Example Usage

using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

class MyStack : Stack
{
    public MyStack()
    {
        var corporateDevicesPostureRule = new Cloudflare.DevicePostureRule("corporateDevicesPostureRule", new Cloudflare.DevicePostureRuleArgs
        {
            AccountId = "1d5fdc9e88c8a8c4518b068cd94331fe",
            Name = "Corporate devices posture rule",
            Type = "serial_number",
            Description = "Device posture rule for corporate devices.",
            Schedule = "24h",
            Expiration = "24h",
            Matches = 
            {
                new Cloudflare.Inputs.DevicePostureRuleMatchArgs
                {
                    Platform = "mac",
                },
            },
            Inputs = 
            {
                new Cloudflare.Inputs.DevicePostureRuleInputArgs
                {
                    Id = cloudflare_teams_list.Corporate_devices.Id,
                },
            },
        });
    }

}
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, "corporateDevicesPostureRule", &cloudflare.DevicePostureRuleArgs{
			AccountId:   pulumi.String("1d5fdc9e88c8a8c4518b068cd94331fe"),
			Name:        pulumi.String("Corporate devices posture rule"),
			Type:        pulumi.String("serial_number"),
			Description: pulumi.String("Device posture rule for corporate devices."),
			Schedule:    pulumi.String("24h"),
			Expiration:  pulumi.String("24h"),
			Matches: DevicePostureRuleMatchArray{
				&DevicePostureRuleMatchArgs{
					Platform: pulumi.String("mac"),
				},
			},
			Inputs: DevicePostureRuleInputArray{
				&DevicePostureRuleInputArgs{
					Id: pulumi.Any(cloudflare_teams_list.Corporate_devices.Id),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var corporateDevicesPostureRule = new DevicePostureRule("corporateDevicesPostureRule", DevicePostureRuleArgs.builder()        
            .accountId("1d5fdc9e88c8a8c4518b068cd94331fe")
            .name("Corporate devices posture rule")
            .type("serial_number")
            .description("Device posture rule for corporate devices.")
            .schedule("24h")
            .expiration("24h")
            .matches(DevicePostureRuleMatchArgs.builder()
                .platform("mac")
                .build())
            .inputs(DevicePostureRuleInputArgs.builder()
                .id(cloudflare_teams_list.corporate_devices().id())
                .build())
            .build());

    }
}
import pulumi
import pulumi_cloudflare as cloudflare

corporate_devices_posture_rule = cloudflare.DevicePostureRule("corporateDevicesPostureRule",
    account_id="1d5fdc9e88c8a8c4518b068cd94331fe",
    name="Corporate devices posture rule",
    type="serial_number",
    description="Device posture rule for corporate devices.",
    schedule="24h",
    expiration="24h",
    matches=[cloudflare.DevicePostureRuleMatchArgs(
        platform="mac",
    )],
    inputs=[cloudflare.DevicePostureRuleInputArgs(
        id=cloudflare_teams_list["corporate_devices"]["id"],
    )])
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const corporateDevicesPostureRule = new cloudflare.DevicePostureRule("corporateDevicesPostureRule", {
    accountId: "1d5fdc9e88c8a8c4518b068cd94331fe",
    name: "Corporate devices posture rule",
    type: "serial_number",
    description: "Device posture rule for corporate devices.",
    schedule: "24h",
    expiration: "24h",
    matches: [{
        platform: "mac",
    }],
    inputs: [{
        id: cloudflare_teams_list.corporate_devices.id,
    }],
});
resources:
  corporateDevicesPostureRule:
    type: cloudflare:DevicePostureRule
    properties:
      accountId: 1d5fdc9e88c8a8c4518b068cd94331fe
      name: Corporate devices posture rule
      type: serial_number
      description: Device posture rule for corporate devices.
      schedule: 24h
      expiration: 24h
      matches:
        - platform: mac
      inputs:
        - id: ${cloudflare_teams_list.corporate_devices.id}

Create a 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 to which the device posture rule should be added.

Type string

The device posture rule type. Valid values are file, application, and serial_number.

Description string

The description of the device posture rule.

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>

The value to be checked against. See below for reference structure.

Matches List<DevicePostureRuleMatchArgs>

The conditions that the client must match to run the rule. See below for reference structure.

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 to which the device posture rule should be added.

Type string

The device posture rule type. Valid values are file, application, and serial_number.

Description string

The description of the device posture rule.

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

The value to be checked against. See below for reference structure.

Matches []DevicePostureRuleMatchArgs

The conditions that the client must match to run the rule. See below for reference structure.

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 to which the device posture rule should be added.

type String

The device posture rule type. Valid values are file, application, and serial_number.

description String

The description of the device posture rule.

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>

The value to be checked against. See below for reference structure.

matches List<DevicePostureRuleMatchArgs>

The conditions that the client must match to run the rule. See below for reference structure.

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 to which the device posture rule should be added.

type string

The device posture rule type. Valid values are file, application, and serial_number.

description string

The description of the device posture rule.

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[]

The value to be checked against. See below for reference structure.

matches DevicePostureRuleMatchArgs[]

The conditions that the client must match to run the rule. See below for reference structure.

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 to which the device posture rule should be added.

type str

The device posture rule type. Valid values are file, application, and serial_number.

description str

The description of the device posture rule.

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]

The value to be checked against. See below for reference structure.

matches Sequence[DevicePostureRuleMatchArgs]

The conditions that the client must match to run the rule. See below for reference structure.

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 to which the device posture rule should be added.

type String

The device posture rule type. Valid values are file, application, and serial_number.

description String

The description of the device posture rule.

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>

The value to be checked against. See below for reference structure.

matches List<Property Map>

The conditions that the client must match to run the rule. See below for reference structure.

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 an 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 to which the device posture rule should be added.

Description string

The description of the device posture rule.

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>

The value to be checked against. See below for reference structure.

Matches List<DevicePostureRuleMatchArgs>

The conditions that the client must match to run the rule. See below for reference structure.

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. Valid values are file, application, and serial_number.

AccountId string

The account to which the device posture rule should be added.

Description string

The description of the device posture rule.

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

The value to be checked against. See below for reference structure.

Matches []DevicePostureRuleMatchArgs

The conditions that the client must match to run the rule. See below for reference structure.

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. Valid values are file, application, and serial_number.

accountId String

The account to which the device posture rule should be added.

description String

The description of the device posture rule.

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>

The value to be checked against. See below for reference structure.

matches List<DevicePostureRuleMatchArgs>

The conditions that the client must match to run the rule. See below for reference structure.

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. Valid values are file, application, and serial_number.

accountId string

The account to which the device posture rule should be added.

description string

The description of the device posture rule.

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[]

The value to be checked against. See below for reference structure.

matches DevicePostureRuleMatchArgs[]

The conditions that the client must match to run the rule. See below for reference structure.

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. Valid values are file, application, and serial_number.

account_id str

The account to which the device posture rule should be added.

description str

The description of the device posture rule.

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]

The value to be checked against. See below for reference structure.

matches Sequence[DevicePostureRuleMatchArgs]

The conditions that the client must match to run the rule. See below for reference structure.

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. Valid values are file, application, and serial_number.

accountId String

The account to which the device posture rule should be added.

description String

The description of the device posture rule.

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>

The value to be checked against. See below for reference structure.

matches List<Property Map>

The conditions that the client must match to run the rule. See below for reference structure.

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. Valid values are file, application, and serial_number.

Supporting Types

DevicePostureRuleInput

ComplianceStatus string
ConnectionId string
Domain string

= (Required) The domain that the client must join.

Enabled bool

= (Required) True if the firewall must be enabled.

Exists bool

Checks if the file should exist.

Id string

The Teams List id.

Operator string

= (Required) The version comparison operator in (>,>=,<,<=,==)

Path string

The path to the application.

RequireAll bool

= (Required) 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 application certificate.

Version string

= (Required) The operating system semantic version.

ComplianceStatus string
ConnectionId string
Domain string

= (Required) The domain that the client must join.

Enabled bool

= (Required) True if the firewall must be enabled.

Exists bool

Checks if the file should exist.

Id string

The Teams List id.

Operator string

= (Required) The version comparison operator in (>,>=,<,<=,==)

Path string

The path to the application.

RequireAll bool

= (Required) 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 application certificate.

Version string

= (Required) The operating system semantic version.

complianceStatus String
connectionId String
domain String

= (Required) The domain that the client must join.

enabled Boolean

= (Required) True if the firewall must be enabled.

exists Boolean

Checks if the file should exist.

id String

The Teams List id.

operator String

= (Required) The version comparison operator in (>,>=,<,<=,==)

path String

The path to the application.

requireAll Boolean

= (Required) 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 application certificate.

version String

= (Required) The operating system semantic version.

complianceStatus string
connectionId string
domain string

= (Required) The domain that the client must join.

enabled boolean

= (Required) True if the firewall must be enabled.

exists boolean

Checks if the file should exist.

id string

The Teams List id.

operator string

= (Required) The version comparison operator in (>,>=,<,<=,==)

path string

The path to the application.

requireAll boolean

= (Required) 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 application certificate.

version string

= (Required) The operating system semantic version.

compliance_status str
connection_id str
domain str

= (Required) The domain that the client must join.

enabled bool

= (Required) True if the firewall must be enabled.

exists bool

Checks if the file should exist.

id str

The Teams List id.

operator str

= (Required) The version comparison operator in (>,>=,<,<=,==)

path str

The path to the application.

require_all bool

= (Required) 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 application certificate.

version str

= (Required) The operating system semantic version.

complianceStatus String
connectionId String
domain String

= (Required) The domain that the client must join.

enabled Boolean

= (Required) True if the firewall must be enabled.

exists Boolean

Checks if the file should exist.

id String

The Teams List id.

operator String

= (Required) The version comparison operator in (>,>=,<,<=,==)

path String

The path to the application.

requireAll Boolean

= (Required) 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 application certificate.

version String

= (Required) The operating system semantic version.

DevicePostureRuleMatch

Platform string

The platform of the device. Valid values are windows, mac, linux, android, and ios.

Platform string

The platform of the device. Valid values are windows, mac, linux, android, and ios.

platform String

The platform of the device. Valid values are windows, mac, linux, android, and ios.

platform string

The platform of the device. Valid values are windows, mac, linux, android, and ios.

platform str

The platform of the device. Valid values are windows, mac, linux, android, and ios.

platform String

The platform of the device. Valid values are windows, mac, linux, android, and ios.

Import

Device posture rules can be imported using a composite ID formed of account ID and device posture rule ID.

 $ pulumi import cloudflare:index/devicePostureRule:DevicePostureRule corporate_devices cb029e245cfdd66dc8d2e570d5dd3322/d41d8cd98f00b204e9800998ecf8427e

Package Details

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

This Pulumi package is based on the cloudflare Terraform Provider.