Skip to content

Commit

Permalink
Add documentation for teams list and device posture rule resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin-Holmes committed May 20, 2021
1 parent 2af63e8 commit 883b9b5
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cloudflare/resource_cloudflare_device_posture_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func resourceCloudflareDevicePostureRule() *schema.Resource {
},
"name": {
Type: schema.TypeString,
Required: true,
Optional: true,
},
"description": {
Type: schema.TypeString,
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/access_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ conditions which can be applied. The conditions are:
Custom values are also supported. Example: `auth_method = ["swk"]`
* `geo` - (Optional) A list of country codes. Example: `geo = ["US"]`
* `login_method` - (Optional) A list of identity provider ids. Example: `login_method = [cloudflare_access_identity_provider.my_idp.id]`
* `device_posture` - (Optional) A list of device_posture integration_uids. Example: `device_posture = [cloudflare_access_device_posture.demo.id]`
* `device_posture` - (Optional) A list of device_posture integration_uids. Example: `device_posture = [cloudflare_device_posture_rule.my_posture_rule.id]`
* `gsuite` - (Optional) Use GSuite as the authentication mechanism. Example:

```hcl
Expand Down
85 changes: 85 additions & 0 deletions website/docs/r/device_posture_rule.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
layout: "cloudflare"
page_title: "Cloudflare: cloudflare_device_posture_rule"
sidebar_current: "docs-cloudflare-resource-device-posture-rule"
description: |-
Provides a Cloudflare Device Posture Rule resource.
---

# cloudflare_device_posture_rule

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

## Example Usage

```hcl
resource "cloudflare_device_posture_rule" "corporate_devices_posture_rule" {
account_id = "1d5fdc9e88c8a8c4518b068cd94331fe"
name = "Corporate devices posture rule"
type = "serial_number"
description = "Device posture rule for corporate devices."
schedule = "24h"
match {
platform = "mac"
}
input {
id = cloudflare_teams_list.corporate_devices.id
}
}
```

## Argument Reference

The following arguments are supported:

* `account_id` - (Required) The account to which the device posture rule should be added.
* `type` - (Required) The device posture rule type. Valid values are `file`, `application`, and `serial_number`.
* `input` - (Required) The value to be checked against. See below for reference
structure.
* `name` - (Optional) Name of the device posture rule.
* `schedule` - (Optional) Tells the client when to run the device posture check.
Must be in the format `"1h"` or `"30m"`. Valid units are `h` and `m`.
* `description` - (Optional) The description of the device posture rule.
* `match` - (Optional) The conditions that the client must match to run the rule. See below for reference structure.

### Match argument

The match structure allows the following:

* `platform` - (Required) The platform of the device. Valid values are `windows`, `mac`, `linux`, `android`, and `ios`.

### Input argument

The input structure depends on the device posture rule type.

**serial_number** allows the following:

* `id` - (Required) The Teams List id.

**file** allows the following:

* `path` - (Required) The path to the file.
* `exists` - (Optional) Checks if the file should exist.
* `thumbprint` - (Optional) The thumbprint of the file certificate.
* `sha256` - (Optional) The sha256 hash of the file.

**application** allows the following:

* `path` - (Required) The path to the application.
* `thumbprint` - (Optional) The thumbprint of the application certificate.
* `running` - (Optional) Checks if the application should be running.

## Attributes Reference

The following additional attributes are exported:

* `id` - ID of the device posture rule.

## Import

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

```
$ terraform import cloudflare_device_posture_rule.corporate_devices cb029e245cfdd66dc8d2e570d5dd3322/d41d8cd98f00b204e9800998ecf8427e
```
48 changes: 48 additions & 0 deletions website/docs/r/teams_list.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
layout: "cloudflare"
page_title: "Cloudflare: cloudflare_teams_list"
sidebar_current: "docs-cloudflare-resource-teams-list"
description: |-
Provides a Cloudflare Teams List resource.
---

# cloudflare_teams_list

Provides a Cloudflare Teams List resource. Teams lists are referenced when creating secure web gateway policies or device posture rules.

## Example Usage

```hcl
resource "cloudflare_teams_list" "corporate_devices" {
account_id = "1d5fdc9e88c8a8c4518b068cd94331fe"
name = "Corporate devices"
type = "SERIAL"
description = "Serial numbers for all corporate devices."
items = ["8GE8721REF", "5RE8543EGG", "1YE2880LNP"]
}
```

## Argument Reference

The following arguments are supported:

* `account_id` - (Required) The account to which the teams list should be added.
* `name` - (Required) Name of the teams list.
* `type` - (Required) The teams list type. Valid values are `SERIAL`, `URL`, `DOMAIN`, and `EMAIL`.
* `items` - (Required) The items of the teams list.
* `description` - (Optional) The description of the teams list.

## Attributes Reference

The following additional attributes are exported:

* `id` - ID of the teams list.

## Import

Teams lists can be imported using a composite ID formed of account
ID and teams list ID.

```
$ terraform import cloudflare_teams_list.corporate_devices cb029e245cfdd66dc8d2e570d5dd3322/d41d8cd98f00b204e9800998ecf8427e
```

0 comments on commit 883b9b5

Please sign in to comment.