1. Packages
  2. CTFd Provider
  3. API Docs
  4. Solution
CTFd v2.3.0 published on Thursday, Sep 11, 2025 by CTFer.io

ctfd.Solution

Explore with Pulumi AI

ctfd logo
CTFd v2.3.0 published on Thursday, Sep 11, 2025 by CTFer.io

    The solution to a challenge.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ctfd from "@ctfer-io/pulumi-ctfd";
    
    const example = new ctfd.ChallengeStandard("example", {
        category: "test",
        description: "Example challenge description...",
        value: 500,
    });
    const wu = new ctfd.Solution("wu", {
        challengeId: example.id,
        content: "Here is how to solve the challenge: ...",
        state: "visible",
    });
    
    import pulumi
    import ctfer-io_pulumi-ctfd as ctfd
    
    example = ctfd.ChallengeStandard("example",
        category="test",
        description="Example challenge description...",
        value=500)
    wu = ctfd.Solution("wu",
        challenge_id=example.id,
        content="Here is how to solve the challenge: ...",
        state="visible")
    
    package main
    
    import (
    	"github.com/ctfer-io/pulumi-ctfd/sdk/v2/go/ctfd"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := ctfd.NewChallengeStandard(ctx, "example", &ctfd.ChallengeStandardArgs{
    			Category:    pulumi.String("test"),
    			Description: pulumi.String("Example challenge description..."),
    			Value:       pulumi.Int(500),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ctfd.NewSolution(ctx, "wu", &ctfd.SolutionArgs{
    			ChallengeId: example.ID(),
    			Content:     pulumi.String("Here is how to solve the challenge: ..."),
    			State:       pulumi.String("visible"),
    		})
    		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 example = new Ctfd.ChallengeStandard("example", new()
        {
            Category = "test",
            Description = "Example challenge description...",
            Value = 500,
        });
    
        var wu = new Ctfd.Solution("wu", new()
        {
            ChallengeId = example.Id,
            Content = "Here is how to solve the challenge: ...",
            State = "visible",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ctfd.ChallengeStandard;
    import com.pulumi.ctfd.ChallengeStandardArgs;
    import com.pulumi.ctfd.Solution;
    import com.pulumi.ctfd.SolutionArgs;
    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 example = new ChallengeStandard("example", ChallengeStandardArgs.builder()
                .category("test")
                .description("Example challenge description...")
                .value(500)
                .build());
    
            var wu = new Solution("wu", SolutionArgs.builder()
                .challengeId(example.id())
                .content("Here is how to solve the challenge: ...")
                .state("visible")
                .build());
    
        }
    }
    
    resources:
      example:
        type: ctfd:ChallengeStandard
        properties:
          category: test
          description: Example challenge description...
          value: 500
      wu:
        type: ctfd:Solution
        properties:
          challengeId: ${example.id}
          content: 'Here is how to solve the challenge: ...'
          state: visible
    

    Create Solution Resource

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

    Constructor syntax

    new Solution(name: string, args: SolutionArgs, opts?: CustomResourceOptions);
    @overload
    def Solution(resource_name: str,
                 args: SolutionArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Solution(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 challenge_id: Optional[str] = None,
                 content: Optional[str] = None,
                 state: Optional[str] = None)
    func NewSolution(ctx *Context, name string, args SolutionArgs, opts ...ResourceOption) (*Solution, error)
    public Solution(string name, SolutionArgs args, CustomResourceOptions? opts = null)
    public Solution(String name, SolutionArgs args)
    public Solution(String name, SolutionArgs args, CustomResourceOptions options)
    
    type: ctfd:Solution
    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 SolutionArgs
    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 SolutionArgs
    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 SolutionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SolutionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SolutionArgs
    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 solutionResource = new Ctfd.Solution("solutionResource", new()
    {
        ChallengeId = "string",
        Content = "string",
        State = "string",
    });
    
    example, err := ctfd.NewSolution(ctx, "solutionResource", &ctfd.SolutionArgs{
    	ChallengeId: pulumi.String("string"),
    	Content:     pulumi.String("string"),
    	State:       pulumi.String("string"),
    })
    
    var solutionResource = new Solution("solutionResource", SolutionArgs.builder()
        .challengeId("string")
        .content("string")
        .state("string")
        .build());
    
    solution_resource = ctfd.Solution("solutionResource",
        challenge_id="string",
        content="string",
        state="string")
    
    const solutionResource = new ctfd.Solution("solutionResource", {
        challengeId: "string",
        content: "string",
        state: "string",
    });
    
    type: ctfd:Solution
    properties:
        challengeId: string
        content: string
        state: string
    

    Solution Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Solution resource accepts the following input properties:

    ChallengeId string
    Challenge of the solution.
    Content string
    The solution to the challenge, in markdown.
    State string
    State of the solution, either hidden or visible.
    ChallengeId string
    Challenge of the solution.
    Content string
    The solution to the challenge, in markdown.
    State string
    State of the solution, either hidden or visible.
    challengeId String
    Challenge of the solution.
    content String
    The solution to the challenge, in markdown.
    state String
    State of the solution, either hidden or visible.
    challengeId string
    Challenge of the solution.
    content string
    The solution to the challenge, in markdown.
    state string
    State of the solution, either hidden or visible.
    challenge_id str
    Challenge of the solution.
    content str
    The solution to the challenge, in markdown.
    state str
    State of the solution, either hidden or visible.
    challengeId String
    Challenge of the solution.
    content String
    The solution to the challenge, in markdown.
    state String
    State of the solution, either hidden or visible.

    Outputs

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

    Get an existing Solution 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?: SolutionState, opts?: CustomResourceOptions): Solution
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            challenge_id: Optional[str] = None,
            content: Optional[str] = None,
            state: Optional[str] = None) -> Solution
    func GetSolution(ctx *Context, name string, id IDInput, state *SolutionState, opts ...ResourceOption) (*Solution, error)
    public static Solution Get(string name, Input<string> id, SolutionState? state, CustomResourceOptions? opts = null)
    public static Solution get(String name, Output<String> id, SolutionState state, CustomResourceOptions options)
    resources:  _:    type: ctfd:Solution    get:      id: ${id}
    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 solution.
    Content string
    The solution to the challenge, in markdown.
    State string
    State of the solution, either hidden or visible.
    ChallengeId string
    Challenge of the solution.
    Content string
    The solution to the challenge, in markdown.
    State string
    State of the solution, either hidden or visible.
    challengeId String
    Challenge of the solution.
    content String
    The solution to the challenge, in markdown.
    state String
    State of the solution, either hidden or visible.
    challengeId string
    Challenge of the solution.
    content string
    The solution to the challenge, in markdown.
    state string
    State of the solution, either hidden or visible.
    challenge_id str
    Challenge of the solution.
    content str
    The solution to the challenge, in markdown.
    state str
    State of the solution, either hidden or visible.
    challengeId String
    Challenge of the solution.
    content String
    The solution to the challenge, in markdown.
    state String
    State of the solution, either hidden or visible.

    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 v2.3.0 published on Thursday, Sep 11, 2025 by CTFer.io