Skip to content

Commit

Permalink
docs: fix alignement with v2 model in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
pandatix committed Jan 31, 2025
1 parent 2a6ea04 commit d45407e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ We recommend setting the environment variable `CTFD_API_KEY` to enable the provi

Then, you could use a `ctfd_challenge_standard` resource to setup your CTFd challenges, with for instance the following configuration.
```hcl
resource "ctfd_challenge" "my_challenge" {
resource "ctfd_challenge_standard" "my_challenge" {
name = "My Challenge"
category = "Some category"
description = <<-EOT
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A CTFd file for a challenge.
## Example Usage

```terraform
resource "ctfd_challenge" "http" {
resource "ctfd_challenge_dynamic" "http" {
name = "My Challenge"
category = "misc"
description = "..."
Expand All @@ -33,7 +33,7 @@ resource "ctfd_challenge" "http" {
}
resource "ctfd_file" "http_file" {
challenge_id = ctfd_challenge.http.id
challenge_id = ctfd_challenge_dynamic.http.id
name = "image.png"
contentb64 = filebase64(".../image.png")
}
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/flag.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A flag to solve the challenge.
## Example Usage

```terraform
resource "ctfd_challenge" "http" {
resource "ctfd_challenge_dynamic" "http" {
name = "My Challenge"
category = "misc"
description = "..."
Expand All @@ -33,7 +33,7 @@ resource "ctfd_challenge" "http" {
}
resource "ctfd_flag" "http_flag" {
challenge_id = ctfd_challenge.http.id
challenge_id = ctfd_challenge_dynamic.http.id
content = "CTF{some_flag}"
}
```
Expand Down
8 changes: 4 additions & 4 deletions docs/resources/hint.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A hint for a challenge to help players solve it.
## Example Usage

```terraform
resource "ctfd_challenge" "http" {
resource "ctfd_challenge_dynamic" "http" {
name = "My Challenge"
category = "misc"
description = "..."
Expand All @@ -33,18 +33,18 @@ resource "ctfd_challenge" "http" {
}
resource "ctfd_flag" "http_flag" {
challenge_id = ctfd_challenge.http.id
challenge_id = ctfd_challenge_dynamic.http.id
content = "CTF{some_flag}"
}
resource "ctfd_hint" "http_hint" {
challenge_id = ctfd_challenge.http.id
challenge_id = ctfd_challenge_dynamic.http.id
content = "Some super-helpful hint"
cost = 50
}
resource "ctfd_hint" "http_hint_2" {
challenge_id = ctfd_challenge.http.id
challenge_id = ctfd_challenge_dynamic.http.id
content = "Even more helpful hint !"
cost = 50
requirements = [ctfd_hint.http_hint_1.id]
Expand Down
4 changes: 2 additions & 2 deletions examples/resources/ctfd_file/resource.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "ctfd_challenge" "http" {
resource "ctfd_challenge_dynamic" "http" {
name = "My Challenge"
category = "misc"
description = "..."
Expand All @@ -18,7 +18,7 @@ resource "ctfd_challenge" "http" {
}

resource "ctfd_file" "http_file" {
challenge_id = ctfd_challenge.http.id
challenge_id = ctfd_challenge_dynamic.http.id
name = "image.png"
contentb64 = filebase64(".../image.png")
}
4 changes: 2 additions & 2 deletions examples/resources/ctfd_flag/resource.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "ctfd_challenge" "http" {
resource "ctfd_challenge_dynamic" "http" {
name = "My Challenge"
category = "misc"
description = "..."
Expand All @@ -18,6 +18,6 @@ resource "ctfd_challenge" "http" {
}

resource "ctfd_flag" "http_flag" {
challenge_id = ctfd_challenge.http.id
challenge_id = ctfd_challenge_dynamic.http.id
content = "CTF{some_flag}"
}
8 changes: 4 additions & 4 deletions examples/resources/ctfd_hint/resource.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "ctfd_challenge" "http" {
resource "ctfd_challenge_dynamic" "http" {
name = "My Challenge"
category = "misc"
description = "..."
Expand All @@ -18,18 +18,18 @@ resource "ctfd_challenge" "http" {
}

resource "ctfd_flag" "http_flag" {
challenge_id = ctfd_challenge.http.id
challenge_id = ctfd_challenge_dynamic.http.id
content = "CTF{some_flag}"
}

resource "ctfd_hint" "http_hint" {
challenge_id = ctfd_challenge.http.id
challenge_id = ctfd_challenge_dynamic.http.id
content = "Some super-helpful hint"
cost = 50
}

resource "ctfd_hint" "http_hint_2" {
challenge_id = ctfd_challenge.http.id
challenge_id = ctfd_challenge_dynamic.http.id
content = "Even more helpful hint !"
cost = 50
requirements = [ctfd_hint.http_hint_1.id]
Expand Down

0 comments on commit d45407e

Please sign in to comment.