Skip to content

Commit b677b3b

Browse files
committed
feat: add audit object store policy, log target object store, and policy member resources
Implement three new Terraform resources for FlashBlade audit logging: - flashblade_audit_object_store_policy: manages audit policies for object store operations with log target assignment - flashblade_log_target_object_store: manages log targets that store audit logs in a bucket with prefix and rotation settings - flashblade_audit_object_store_policy_member: assigns buckets as members of audit object store policies (CRD-only) Each resource includes data source, mock handlers, client CRUD with generics, full test coverage (779 tests, +25), HCL examples, and generated documentation.
1 parent 0db1043 commit b677b3b

32 files changed

Lines changed: 3784 additions & 5 deletions

CONVENTIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ func nullXxxDSConfig() map[string]tftypes.Value
448448
449449
### Coverage rules
450450
451-
- **Total test count MUST NOT decrease.** Current baseline: **754 tests**.
451+
- **Total test count MUST NOT decrease.** Current baseline: **779 tests**.
452452
- Every new resource adds at minimum **8 tests** (4 client + 3 resource + 1 data source).
453453
- Every state upgrader adds at minimum **1 test**.
454454
- Run `make test` and `make lint` before every commit. Both must be clean.

ROADMAP.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
FlashBlade REST API v2.22 (Purity//FB 4.6.7) coverage status for terraform-provider-flashblade.
44

5-
**Last updated:** 2026-04-08
5+
**Last updated:** 2026-04-09
66
**Provider version:** v2.2
7-
**Total API sections:** 84 | **Covered:** ~39 | **Coverage of IaC-relevant CRUD:** ~70%
7+
**Total API sections:** 84 | **Covered:** ~41 | **Coverage of IaC-relevant CRUD:** ~72%
88

99
## Coverage Legend
1010

@@ -97,6 +97,14 @@ FlashBlade REST API v2.22 (Purity//FB 4.6.7) coverage status for terraform-provi
9797
| SMTP | `flashblade_array_smtp` | Yes | Done | Singleton |
9898
| Syslog Servers | `flashblade_syslog_server` | Yes | Done | Full CRUD |
9999

100+
### Audit
101+
102+
| API Section | Resource | Data Source | Status | Notes |
103+
|-------------|----------|:----------:|--------|-------|
104+
| Audit Policies (Object Store) | `flashblade_audit_object_store_policy` | Yes | Done | Object store audit logging policies with log targets |
105+
| Audit Policies (Object Store) Members | `flashblade_audit_object_store_policy_member` | No | Done | Bucket-to-policy assignment (CRD) |
106+
| Log Targets (Object Store) | `flashblade_log_target_object_store` | Yes | Done | Audit log target to bucket with prefix + rotation |
107+
100108
### Quotas
101109

102110
| API Section | Resource | Data Source | Status | Notes |
@@ -156,8 +164,8 @@ FlashBlade REST API v2.22 (Purity//FB 4.6.7) coverage status for terraform-provi
156164
| SSH CA Policies | Resource | Full CRUD | SSH certificate authority management | Deferred |
157165
| Data Eviction Policies | Resource | Full CRUD + FS members | Automatic data eviction | Deferred |
158166
| Audit Policies (FS) | Resource | Full CRUD + members | File system audit logging policies | Deferred |
159-
| Audit Policies (Object Store) | Resource | Full CRUD + members | Object store audit logging policies | Deferred |
160-
| Log Targets | Resource | Full CRUD | Audit log target configuration | Deferred |
167+
| Audit Policies (FS) members | Resource | Members endpoint | File system audit policy-to-FS association | Deferred |
168+
| Log Targets (File Systems) | Resource | Full CRUD | File system audit log target configuration | Deferred |
161169

162170
### Not Applicable for Terraform
163171

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "flashblade_audit_object_store_policy Data Source - flashblade"
4+
subcategory: ""
5+
description: |-
6+
Reads an existing FlashBlade audit object store policy.
7+
---
8+
9+
# flashblade_audit_object_store_policy (Data Source)
10+
11+
Reads an existing FlashBlade audit object store policy.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "flashblade_audit_object_store_policy" "example" {
17+
name = "my-audit-policy"
18+
}
19+
```
20+
21+
<!-- schema generated by tfplugindocs -->
22+
## Schema
23+
24+
### Required
25+
26+
- `name` (String) The name of the audit object store policy to look up.
27+
28+
### Read-Only
29+
30+
- `enabled` (Boolean) Whether the audit object store policy is enabled.
31+
- `id` (String) The unique identifier of the audit object store policy.
32+
- `is_local` (Boolean) Whether the policy is defined on the local array.
33+
- `log_targets` (List of String) List of log target names configured for this policy.
34+
- `policy_type` (String) The type of the policy (e.g. 'audit').
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "flashblade_log_target_object_store Data Source - flashblade"
4+
subcategory: ""
5+
description: |-
6+
Reads an existing FlashBlade log target object store.
7+
---
8+
9+
# flashblade_log_target_object_store (Data Source)
10+
11+
Reads an existing FlashBlade log target object store.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "flashblade_log_target_object_store" "example" {
17+
name = "my-log-target"
18+
}
19+
```
20+
21+
<!-- schema generated by tfplugindocs -->
22+
## Schema
23+
24+
### Required
25+
26+
- `name` (String) The name of the log target object store to look up.
27+
28+
### Read-Only
29+
30+
- `bucket_name` (String) The name of the bucket where audit logs are stored.
31+
- `id` (String) The unique identifier of the log target object store.
32+
- `log_name_prefix` (String) The prefix of audit log object names in the bucket.
33+
- `log_rotate_duration` (Number) The rotation interval for audit logs in milliseconds.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "flashblade_audit_object_store_policy Resource - flashblade"
4+
subcategory: ""
5+
description: |-
6+
Manages a FlashBlade audit object store policy that controls audit logging for object store operations.
7+
---
8+
9+
# flashblade_audit_object_store_policy (Resource)
10+
11+
Manages a FlashBlade audit object store policy that controls audit logging for object store operations.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "flashblade_audit_object_store_policy" "example" {
17+
name = "my-audit-policy"
18+
enabled = true
19+
20+
log_targets = ["my-log-target"]
21+
}
22+
```
23+
24+
<!-- schema generated by tfplugindocs -->
25+
## Schema
26+
27+
### Required
28+
29+
- `name` (String) The name of the audit object store policy. Not renameable; changing forces replacement.
30+
31+
### Optional
32+
33+
- `enabled` (Boolean) Whether the audit object store policy is enabled.
34+
- `log_targets` (List of String) List of log target names to receive audit events from this policy.
35+
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
36+
37+
### Read-Only
38+
39+
- `id` (String) The unique identifier of the audit object store policy.
40+
- `is_local` (Boolean) Whether the policy is defined on the local array (read-only).
41+
- `policy_type` (String) The type of the policy (e.g. 'audit'). Read-only, set by the array.
42+
43+
<a id="nestedatt--timeouts"></a>
44+
### Nested Schema for `timeouts`
45+
46+
Optional:
47+
48+
- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
49+
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
50+
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
51+
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
52+
53+
## Import
54+
55+
Import is supported using the following syntax:
56+
57+
The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
58+
59+
```shell
60+
terraform import flashblade_audit_object_store_policy.example my-audit-policy
61+
```
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "flashblade_audit_object_store_policy_member Resource - flashblade"
4+
subcategory: ""
5+
description: |-
6+
Assigns a bucket as a member of a FlashBlade audit object store policy.
7+
---
8+
9+
# flashblade_audit_object_store_policy_member (Resource)
10+
11+
Assigns a bucket as a member of a FlashBlade audit object store policy.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "flashblade_audit_object_store_policy_member" "example" {
17+
policy_name = "my-audit-policy"
18+
member_name = "my-bucket"
19+
}
20+
```
21+
22+
<!-- schema generated by tfplugindocs -->
23+
## Schema
24+
25+
### Required
26+
27+
- `member_name` (String) The name of the bucket to assign to the policy. Changing this forces a new resource.
28+
- `policy_name` (String) The name of the audit object store policy. Changing this forces a new resource.
29+
30+
### Optional
31+
32+
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
33+
34+
<a id="nestedatt--timeouts"></a>
35+
### Nested Schema for `timeouts`
36+
37+
Optional:
38+
39+
- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
40+
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
41+
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
42+
43+
## Import
44+
45+
Import is supported using the following syntax:
46+
47+
The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
48+
49+
```shell
50+
terraform import flashblade_audit_object_store_policy_member.example my-audit-policy/my-bucket
51+
```
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "flashblade_log_target_object_store Resource - flashblade"
4+
subcategory: ""
5+
description: |-
6+
Manages a FlashBlade log target object store that stores audit logs in a bucket.
7+
---
8+
9+
# flashblade_log_target_object_store (Resource)
10+
11+
Manages a FlashBlade log target object store that stores audit logs in a bucket.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "flashblade_log_target_object_store" "example" {
17+
name = "my-log-target"
18+
bucket_name = "audit-logs"
19+
log_name_prefix = "audit"
20+
log_rotate_duration = 86400000
21+
}
22+
```
23+
24+
<!-- schema generated by tfplugindocs -->
25+
## Schema
26+
27+
### Required
28+
29+
- `bucket_name` (String) The name of the bucket where audit logs will be stored.
30+
- `name` (String) The name of the log target object store. Not renameable; changing forces replacement.
31+
32+
### Optional
33+
34+
- `log_name_prefix` (String) The prefix of audit log object names in the bucket.
35+
- `log_rotate_duration` (Number) The rotation interval for audit logs in milliseconds.
36+
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
37+
38+
### Read-Only
39+
40+
- `id` (String) The unique identifier of the log target object store.
41+
42+
<a id="nestedatt--timeouts"></a>
43+
### Nested Schema for `timeouts`
44+
45+
Optional:
46+
47+
- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
48+
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
49+
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
50+
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
51+
52+
## Import
53+
54+
Import is supported using the following syntax:
55+
56+
The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
57+
58+
```shell
59+
terraform import flashblade_log_target_object_store.example my-log-target
60+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data "flashblade_audit_object_store_policy" "example" {
2+
name = "my-audit-policy"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data "flashblade_log_target_object_store" "example" {
2+
name = "my-log-target"
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
terraform import flashblade_audit_object_store_policy.example my-audit-policy

0 commit comments

Comments
 (0)