1. Packages
  2. CTFd Provider
  3. API Docs
  4. Hint
CTFd v1.0.0 published on Monday, Jun 3, 2024 by CTFer.io

ctfd.Hint

Explore with Pulumi AI

ctfd logo
CTFd v1.0.0 published on Monday, Jun 3, 2024 by CTFer.io

    A hint for a challenge to help players solve it.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ctfd from "@ctfer-io/pulumi-ctfd";
    
    const http = new ctfd.Challenge("http", {
        category: "misc",
        description: "...",
        value: 500,
        decay: 100,
        minimum: 50,
        state: "visible",
        "function": "logarithmic",
        topics: ["Misc"],
        tags: [
            "misc",
            "basic",
        ],
    });
    const httpFlag = new ctfd.Flag("httpFlag", {
        challengeId: http.id,
        content: "CTF{some_flag}",
    });
    const httpHint = new ctfd.Hint("httpHint", {
        challengeId: http.id,
        content: "Some super-helpful hint",
        cost: 50,
    });
    const httpHint2 = new ctfd.Hint("httpHint2", {
        challengeId: http.id,
        content: "Even more helpful hint !",
        cost: 50,
        requirements: [ctfd_hint.http_hint_1.id],
    });
    
    import pulumi
    import ctfer-io_pulumi-ctfd as ctfd
    
    http = ctfd.Challenge("http",
        category="misc",
        description="...",
        value=500,
        decay=100,
        minimum=50,
        state="visible",
        function="logarithmic",
        topics=["Misc"],
        tags=[
            "misc",
            "basic",
        ])
    http_flag = ctfd.Flag("httpFlag",
        challenge_id=http.id,
        content="CTF{some_flag}")
    http_hint = ctfd.Hint("httpHint",
        challenge_id=http.id,
        content="Some super-helpful hint",
        cost=50)
    http_hint2 = ctfd.Hint("httpHint2",
        challenge_id=http.id,
        content="Even more helpful hint !",
        cost=50,
        requirements=[ctfd_hint["http_hint_1"]["id"]])
    
    package main
    
    import (
    	"github.com/ctfer-io/pulumi-ctfd/sdk/go/ctfd"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		http, err := ctfd.NewChallenge(ctx, "http", &ctfd.ChallengeArgs{
    			Category:    pulumi.String("misc"),
    			Description: pulumi.String("..."),
    			Value:       pulumi.Int(500),
    			Decay:       pulumi.Int(100),
    			Minimum:     pulumi.Int(50),
    			State:       pulumi.String("visible"),
    			Function:    pulumi.String("logarithmic"),
    			Topics: pulumi.StringArray{
    				pulumi.String("Misc"),
    			},
    			Tags: pulumi.StringArray{
    				pulumi.String("misc"),
    				pulumi.String("basic"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ctfd.NewFlag(ctx, "httpFlag", &ctfd.FlagArgs{
    			ChallengeId: http.ID(),
    			Content:     pulumi.String("CTF{some_flag}"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ctfd.NewHint(ctx, "httpHint", &ctfd.HintArgs{
    			ChallengeId: http.ID(),
    			Content:     pulumi.String("Some super-helpful hint"),
    			Cost:        pulumi.Int(50),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ctfd.NewHint(ctx, "httpHint2", &ctfd.HintArgs{
    			ChallengeId: http.ID(),
    			Content:     pulumi.String("Even more helpful hint !"),
    			Cost:        pulumi.Int(50),
    			Requirements: pulumi.StringArray{
    				ctfd_hint.Http_hint_1.Id,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ctfd = CTFerio.Ctfd;
    
    return await Deployment.RunAsync(() => 
    {
        var http = new Ctfd.Challenge("http", new()
        {
            Category = "misc",
            Description = "...",
            Value = 500,
            Decay = 100,
            Minimum = 50,
            State = "visible",
            Function = "logarithmic",
            Topics = new[]
            {
                "Misc",
            },
            Tags = new[]
            {
                "misc",
                "basic",
            },
        });
    
        var httpFlag = new Ctfd.Flag("httpFlag", new()
        {
            ChallengeId = http.Id,
            Content = "CTF{some_flag}",
        });
    
        var httpHint = new Ctfd.Hint("httpHint", new()
        {
            ChallengeId = http.Id,
            Content = "Some super-helpful hint",
            Cost = 50,
        });
    
        var httpHint2 = new Ctfd.Hint("httpHint2", new()
        {
            ChallengeId = http.Id,
            Content = "Even more helpful hint !",
            Cost = 50,
            Requirements = new[]
            {
                ctfd_hint.Http_hint_1.Id,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ctfd.Challenge;
    import com.pulumi.ctfd.ChallengeArgs;
    import com.pulumi.ctfd.Flag;
    import com.pulumi.ctfd.FlagArgs;
    import com.pulumi.ctfd.Hint;
    import com.pulumi.ctfd.HintArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var http = new Challenge("http", ChallengeArgs.builder()
                .category("misc")
                .description("...")
                .value(500)
                .decay(100)
                .minimum(50)
                .state("visible")
                .function("logarithmic")
                .topics("Misc")
                .tags(            
                    "misc",
                    "basic")
                .build());
    
            var httpFlag = new Flag("httpFlag", FlagArgs.builder()
                .challengeId(http.id())
                .content("CTF{some_flag}")
                .build());
    
            var httpHint = new Hint("httpHint", HintArgs.builder()
                .challengeId(http.id())
                .content("Some super-helpful hint")
                .cost(50)
                .build());
    
            var httpHint2 = new Hint("httpHint2", HintArgs.builder()
                .challengeId(http.id())
                .content("Even more helpful hint !")
                .cost(50)
                .requirements(ctfd_hint.http_hint_1().id())
                .build());
    
        }
    }
    
    resources:
      http:
        type: ctfd:Challenge
        properties:
          category: misc
          description: '...'
          value: 500
          decay: 100
          minimum: 50
          state: visible
          function: logarithmic
          topics:
            - Misc
          tags:
            - misc
            - basic
      httpFlag:
        type: ctfd:Flag
        properties:
          challengeId: ${http.id}
          content: CTF{some_flag}
      httpHint:
        type: ctfd:Hint
        properties:
          challengeId: ${http.id}
          content: Some super-helpful hint
          cost: 50
      httpHint2:
        type: ctfd:Hint
        properties:
          challengeId: ${http.id}
          content: Even more helpful hint !
          cost: 50
          requirements:
            - ${ctfd_hint.http_hint_1.id}
    

    Create Hint Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Hint(name: string, args: HintArgs, opts?: CustomResourceOptions);
    @overload
    def Hint(resource_name: str,
             args: HintArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Hint(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             challenge_id: Optional[str] = None,
             content: Optional[str] = None,
             cost: Optional[int] = None,
             requirements: Optional[Sequence[str]] = None)
    func NewHint(ctx *Context, name string, args HintArgs, opts ...ResourceOption) (*Hint, error)
    public Hint(string name, HintArgs args, CustomResourceOptions? opts = null)
    public Hint(String name, HintArgs args)
    public Hint(String name, HintArgs args, CustomResourceOptions options)
    
    type: ctfd:Hint
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args HintArgs
    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 HintArgs
    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 HintArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args HintArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args HintArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var hintResource = new Ctfd.Hint("hintResource", new()
    {
        ChallengeId = "string",
        Content = "string",
        Cost = 0,
        Requirements = new[]
        {
            "string",
        },
    });
    
    example, err := ctfd.NewHint(ctx, "hintResource", &ctfd.HintArgs{
    	ChallengeId: pulumi.String("string"),
    	Content:     pulumi.String("string"),
    	Cost:        pulumi.Int(0),
    	Requirements: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var hintResource = new Hint("hintResource", HintArgs.builder()
        .challengeId("string")
        .content("string")
        .cost(0)
        .requirements("string")
        .build());
    
    hint_resource = ctfd.Hint("hintResource",
        challenge_id="string",
        content="string",
        cost=0,
        requirements=["string"])
    
    const hintResource = new ctfd.Hint("hintResource", {
        challengeId: "string",
        content: "string",
        cost: 0,
        requirements: ["string"],
    });
    
    type: ctfd:Hint
    properties:
        challengeId: string
        content: string
        cost: 0
        requirements:
            - string
    

    Hint 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 Hint resource accepts the following input properties:

    ChallengeId string
    Challenge of the hint.
    Content string
    Content of the hint as displayed to the end-user.
    Cost int
    Cost of the hint, and if any specified, the end-user will consume its own (or team) points to get it.
    Requirements List<string>
    List of the other hints it depends on.
    ChallengeId string
    Challenge of the hint.
    Content string
    Content of the hint as displayed to the end-user.
    Cost int
    Cost of the hint, and if any specified, the end-user will consume its own (or team) points to get it.
    Requirements []string
    List of the other hints it depends on.
    challengeId String
    Challenge of the hint.
    content String
    Content of the hint as displayed to the end-user.
    cost Integer
    Cost of the hint, and if any specified, the end-user will consume its own (or team) points to get it.
    requirements List<String>
    List of the other hints it depends on.
    challengeId string
    Challenge of the hint.
    content string
    Content of the hint as displayed to the end-user.
    cost number
    Cost of the hint, and if any specified, the end-user will consume its own (or team) points to get it.
    requirements string[]
    List of the other hints it depends on.
    challenge_id str
    Challenge of the hint.
    content str
    Content of the hint as displayed to the end-user.
    cost int
    Cost of the hint, and if any specified, the end-user will consume its own (or team) points to get it.
    requirements Sequence[str]
    List of the other hints it depends on.
    challengeId String
    Challenge of the hint.
    content String
    Content of the hint as displayed to the end-user.
    cost Number
    Cost of the hint, and if any specified, the end-user will consume its own (or team) points to get it.
    requirements List<String>
    List of the other hints it depends on.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Hint 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 Existing Hint Resource

    Get an existing Hint 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?: HintState, opts?: CustomResourceOptions): Hint
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            challenge_id: Optional[str] = None,
            content: Optional[str] = None,
            cost: Optional[int] = None,
            requirements: Optional[Sequence[str]] = None) -> Hint
    func GetHint(ctx *Context, name string, id IDInput, state *HintState, opts ...ResourceOption) (*Hint, error)
    public static Hint Get(string name, Input<string> id, HintState? state, CustomResourceOptions? opts = null)
    public static Hint get(String name, Output<String> id, HintState 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:
    ChallengeId string
    Challenge of the hint.
    Content string
    Content of the hint as displayed to the end-user.
    Cost int
    Cost of the hint, and if any specified, the end-user will consume its own (or team) points to get it.
    Requirements List<string>
    List of the other hints it depends on.
    ChallengeId string
    Challenge of the hint.
    Content string
    Content of the hint as displayed to the end-user.
    Cost int
    Cost of the hint, and if any specified, the end-user will consume its own (or team) points to get it.
    Requirements []string
    List of the other hints it depends on.
    challengeId String
    Challenge of the hint.
    content String
    Content of the hint as displayed to the end-user.
    cost Integer
    Cost of the hint, and if any specified, the end-user will consume its own (or team) points to get it.
    requirements List<String>
    List of the other hints it depends on.
    challengeId string
    Challenge of the hint.
    content string
    Content of the hint as displayed to the end-user.
    cost number
    Cost of the hint, and if any specified, the end-user will consume its own (or team) points to get it.
    requirements string[]
    List of the other hints it depends on.
    challenge_id str
    Challenge of the hint.
    content str
    Content of the hint as displayed to the end-user.
    cost int
    Cost of the hint, and if any specified, the end-user will consume its own (or team) points to get it.
    requirements Sequence[str]
    List of the other hints it depends on.
    challengeId String
    Challenge of the hint.
    content String
    Content of the hint as displayed to the end-user.
    cost Number
    Cost of the hint, and if any specified, the end-user will consume its own (or team) points to get it.
    requirements List<String>
    List of the other hints it depends on.

    Package Details

    Repository
    ctfd ctfer-io/pulumi-ctfd
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ctfd Terraform Provider.
    ctfd logo
    CTFd v1.0.0 published on Monday, Jun 3, 2024 by CTFer.io