Skip to content

Commit cc3184a

Browse files
committed
Set status attribute of token
1 parent 7c06858 commit cc3184a

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

.github/workflows/terraform.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ jobs:
99
Linting:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@v4
1313

14-
- uses: hashicorp/setup-terraform@v3
14+
- uses: hashicorp/setup-terraform@v3
1515

16-
- name: Terraform Docs
17-
run: |
18-
docker run --rm --volume "$(pwd):/terraform-docs" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.19.0 --output-check /terraform-docs
19-
20-
- name: Terraform Format Check
21-
run: |
22-
terraform fmt -check -recursive
16+
- name: Terraform Docs
17+
run: |
18+
docker run --rm --volume "$(pwd):/terraform-docs" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.20.0 --output-check /terraform-docs
19+
20+
- name: Terraform Format Check
21+
run: |
22+
terraform fmt -check -recursive
2323
2424
Terraform:
2525
runs-on: ubuntu-latest

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ No modules.
5757
| <a name="input_expires_on"></a> [expires\_on](#input\_expires\_on) | The expiration time on or after which the token MUST NOT be accepted for processing. If not specified, the token will not expire. | `string` | `""` | no |
5858
| <a name="input_jurisdiction"></a> [jurisdiction](#input\_jurisdiction) | Jurisdiction of R2 buckets | `string` | `"default"` | no |
5959
| <a name="input_not_before"></a> [not\_before](#input\_not\_before) | The time before which the token MUST NOT be accepted for processing. If not specified, the token will be valid immediately. | `string` | `""` | no |
60+
| <a name="input_status"></a> [status](#input\_status) | Status of the API token. Can be 'active' or 'disabled'. Defaults to 'active'. | `string` | `"active"` | no |
6061
| <a name="input_token_name"></a> [token\_name](#input\_token\_name) | Name of the API token.<br/>If none given then the fomart is: `R2-<comma separated names>-<Read if 'bucket-read'>-<Write if 'bucket-write'>` | `string` | `""` | no |
6162

6263
## Outputs

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ resource "cloudflare_api_token" "token" {
3636
not_in = var.condition_ip_not_in
3737
}
3838
}
39+
status = var.status
3940
}

variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,14 @@ variable "condition_ip_not_in" {
5555
description = "List of IP addresses or CIDR notation where the token should not be used from."
5656
type = list(string)
5757
default = []
58+
}
59+
60+
variable "status" {
61+
description = "Status of the API token. Can be 'active' or 'disabled'. Defaults to 'active'."
62+
type = string
63+
default = "active"
64+
validation {
65+
condition = contains(["active", "disabled"], var.status)
66+
error_message = "Status must be either 'active' or 'disabled'."
67+
}
5868
}

0 commit comments

Comments
 (0)