provider

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ChallengeDynamicIaCResourceAttributes = utils.BlindMerge(tfctfd.ChallengeDynamicResourceAttributes, map[string]schema.Attribute{
		"shared": schema.BoolAttribute{
			MarkdownDescription: "Whether the instance will be shared between all players.",
			Optional:            true,
			Computed:            true,
			Default:             defaults.Bool(booldefault.StaticBool(false)),
		},
		"destroy_on_flag": schema.BoolAttribute{
			MarkdownDescription: "Whether to destroy the instance once flagged.",
			Optional:            true,
			Computed:            true,
			Default:             defaults.Bool(booldefault.StaticBool(false)),
		},
		"mana_cost": schema.Int64Attribute{
			MarkdownDescription: "The cost (in mana) of the challenge once an instance is deployed.",
			Optional:            true,
			Computed:            true,
			Default:             defaults.Int64(int64default.StaticInt64(0)),
		},
		"scenario_id": schema.StringAttribute{
			MarkdownDescription: "The file's ID of the scenario.",
			Required:            true,
		},
		"timeout": schema.Int64Attribute{
			MarkdownDescription: "The timeout (in seconds) after which the instance will be janitored.",
			Optional:            true,
			Computed:            true,
			Default:             nil,
		},
		"until": schema.StringAttribute{
			MarkdownDescription: "The date until the instance could run before being janitored.",
			Optional:            true,
			Computed:            true,
			Default:             nil,
		},
	})
)

Functions

func New

func New(version string) func() provider.Provider

func NewChallengeDynamicIaCResource

func NewChallengeDynamicIaCResource() resource.Resource

Types

type CTFdCMProvider

type CTFdCMProvider struct {
	*tfctfd.CTFdProvider
	// contains filtered or unexported fields
}

func (*CTFdCMProvider) DataSources

func (p *CTFdCMProvider) DataSources(ctx context.Context) []func() datasource.DataSource

func (*CTFdCMProvider) Metadata

func (*CTFdCMProvider) Resources

func (p *CTFdCMProvider) Resources(ctx context.Context) []func() resource.Resource

type ChallengeDynamicIaCResourceModel

type ChallengeDynamicIaCResourceModel struct {
	tfctfd.ChallengeDynamicResourceModel

	Shared        types.Bool   `tfsdk:"shared"`
	DestroyOnFlag types.Bool   `tfsdk:"destroy_on_flag"`
	ManaCost      types.Int64  `tfsdk:"mana_cost"`
	ScenarioID    types.String `tfsdk:"scenario_id"`
	Timeout       types.Int64  `tfsdk:"timeout"`
	Until         types.String `tfsdk:"until"`
}

func (*ChallengeDynamicIaCResourceModel) Read

func (chall *ChallengeDynamicIaCResourceModel) Read(ctx context.Context, client *ctfd.Client, diags diag.Diagnostics)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL