1. Packages
  2. Okta Provider
  3. API Docs
  4. Captcha
Okta v4.15.0 published on Friday, Mar 7, 2025 by Pulumi

okta.Captcha

Explore with Pulumi AI

Creates different types of captcha. > WARNING: This feature is only available as a part of the Identity Engine. Contact support for further information. This resource allows you to create and configure a CAPTCHA.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as okta from "@pulumi/okta";

const example = new okta.Captcha("example", {
    name: "My CAPTCHA",
    type: "HCAPTCHA",
    siteKey: "some_key",
    secretKey: "some_secret_key",
});
Copy
import pulumi
import pulumi_okta as okta

example = okta.Captcha("example",
    name="My CAPTCHA",
    type="HCAPTCHA",
    site_key="some_key",
    secret_key="some_secret_key")
Copy
package main

import (
	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := okta.NewCaptcha(ctx, "example", &okta.CaptchaArgs{
			Name:      pulumi.String("My CAPTCHA"),
			Type:      pulumi.String("HCAPTCHA"),
			SiteKey:   pulumi.String("some_key"),
			SecretKey: pulumi.String("some_secret_key"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Okta = Pulumi.Okta;

return await Deployment.RunAsync(() => 
{
    var example = new Okta.Captcha("example", new()
    {
        Name = "My CAPTCHA",
        Type = "HCAPTCHA",
        SiteKey = "some_key",
        SecretKey = "some_secret_key",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.okta.Captcha;
import com.pulumi.okta.CaptchaArgs;
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 Captcha("example", CaptchaArgs.builder()
            .name("My CAPTCHA")
            .type("HCAPTCHA")
            .siteKey("some_key")
            .secretKey("some_secret_key")
            .build());

    }
}
Copy
resources:
  example:
    type: okta:Captcha
    properties:
      name: My CAPTCHA
      type: HCAPTCHA
      siteKey: some_key
      secretKey: some_secret_key
Copy

Create Captcha Resource

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

Constructor syntax

new Captcha(name: string, args: CaptchaArgs, opts?: CustomResourceOptions);
@overload
def Captcha(resource_name: str,
            args: CaptchaArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def Captcha(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            secret_key: Optional[str] = None,
            site_key: Optional[str] = None,
            type: Optional[str] = None,
            name: Optional[str] = None)
func NewCaptcha(ctx *Context, name string, args CaptchaArgs, opts ...ResourceOption) (*Captcha, error)
public Captcha(string name, CaptchaArgs args, CustomResourceOptions? opts = null)
public Captcha(String name, CaptchaArgs args)
public Captcha(String name, CaptchaArgs args, CustomResourceOptions options)
type: okta:Captcha
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. CaptchaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. CaptchaArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. CaptchaArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. CaptchaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. CaptchaArgs
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 captchaResource = new Okta.Captcha("captchaResource", new()
{
    SecretKey = "string",
    SiteKey = "string",
    Type = "string",
    Name = "string",
});
Copy
example, err := okta.NewCaptcha(ctx, "captchaResource", &okta.CaptchaArgs{
	SecretKey: pulumi.String("string"),
	SiteKey:   pulumi.String("string"),
	Type:      pulumi.String("string"),
	Name:      pulumi.String("string"),
})
Copy
var captchaResource = new Captcha("captchaResource", CaptchaArgs.builder()
    .secretKey("string")
    .siteKey("string")
    .type("string")
    .name("string")
    .build());
Copy
captcha_resource = okta.Captcha("captchaResource",
    secret_key="string",
    site_key="string",
    type="string",
    name="string")
Copy
const captchaResource = new okta.Captcha("captchaResource", {
    secretKey: "string",
    siteKey: "string",
    type: "string",
    name: "string",
});
Copy
type: okta:Captcha
properties:
    name: string
    secretKey: string
    siteKey: string
    type: string
Copy

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

SecretKey This property is required. string
Secret key issued from the CAPTCHA vendor to perform server-side validation for a CAPTCHA token
SiteKey This property is required. string
Site key issued from the CAPTCHA vendor to render a CAPTCHA on a page
Type
This property is required.
Changes to this property will trigger replacement.
string
Type of the captcha. Valid values: HCAPTCHA, RECAPTCHA_V2
Name string
Name of the CAPTCHA
SecretKey This property is required. string
Secret key issued from the CAPTCHA vendor to perform server-side validation for a CAPTCHA token
SiteKey This property is required. string
Site key issued from the CAPTCHA vendor to render a CAPTCHA on a page
Type
This property is required.
Changes to this property will trigger replacement.
string
Type of the captcha. Valid values: HCAPTCHA, RECAPTCHA_V2
Name string
Name of the CAPTCHA
secretKey This property is required. String
Secret key issued from the CAPTCHA vendor to perform server-side validation for a CAPTCHA token
siteKey This property is required. String
Site key issued from the CAPTCHA vendor to render a CAPTCHA on a page
type
This property is required.
Changes to this property will trigger replacement.
String
Type of the captcha. Valid values: HCAPTCHA, RECAPTCHA_V2
name String
Name of the CAPTCHA
secretKey This property is required. string
Secret key issued from the CAPTCHA vendor to perform server-side validation for a CAPTCHA token
siteKey This property is required. string
Site key issued from the CAPTCHA vendor to render a CAPTCHA on a page
type
This property is required.
Changes to this property will trigger replacement.
string
Type of the captcha. Valid values: HCAPTCHA, RECAPTCHA_V2
name string
Name of the CAPTCHA
secret_key This property is required. str
Secret key issued from the CAPTCHA vendor to perform server-side validation for a CAPTCHA token
site_key This property is required. str
Site key issued from the CAPTCHA vendor to render a CAPTCHA on a page
type
This property is required.
Changes to this property will trigger replacement.
str
Type of the captcha. Valid values: HCAPTCHA, RECAPTCHA_V2
name str
Name of the CAPTCHA
secretKey This property is required. String
Secret key issued from the CAPTCHA vendor to perform server-side validation for a CAPTCHA token
siteKey This property is required. String
Site key issued from the CAPTCHA vendor to render a CAPTCHA on a page
type
This property is required.
Changes to this property will trigger replacement.
String
Type of the captcha. Valid values: HCAPTCHA, RECAPTCHA_V2
name String
Name of the CAPTCHA

Outputs

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

Get an existing Captcha 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?: CaptchaState, opts?: CustomResourceOptions): Captcha
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        secret_key: Optional[str] = None,
        site_key: Optional[str] = None,
        type: Optional[str] = None) -> Captcha
func GetCaptcha(ctx *Context, name string, id IDInput, state *CaptchaState, opts ...ResourceOption) (*Captcha, error)
public static Captcha Get(string name, Input<string> id, CaptchaState? state, CustomResourceOptions? opts = null)
public static Captcha get(String name, Output<String> id, CaptchaState state, CustomResourceOptions options)
resources:  _:    type: okta:Captcha    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Name string
Name of the CAPTCHA
SecretKey string
Secret key issued from the CAPTCHA vendor to perform server-side validation for a CAPTCHA token
SiteKey string
Site key issued from the CAPTCHA vendor to render a CAPTCHA on a page
Type Changes to this property will trigger replacement. string
Type of the captcha. Valid values: HCAPTCHA, RECAPTCHA_V2
Name string
Name of the CAPTCHA
SecretKey string
Secret key issued from the CAPTCHA vendor to perform server-side validation for a CAPTCHA token
SiteKey string
Site key issued from the CAPTCHA vendor to render a CAPTCHA on a page
Type Changes to this property will trigger replacement. string
Type of the captcha. Valid values: HCAPTCHA, RECAPTCHA_V2
name String
Name of the CAPTCHA
secretKey String
Secret key issued from the CAPTCHA vendor to perform server-side validation for a CAPTCHA token
siteKey String
Site key issued from the CAPTCHA vendor to render a CAPTCHA on a page
type Changes to this property will trigger replacement. String
Type of the captcha. Valid values: HCAPTCHA, RECAPTCHA_V2
name string
Name of the CAPTCHA
secretKey string
Secret key issued from the CAPTCHA vendor to perform server-side validation for a CAPTCHA token
siteKey string
Site key issued from the CAPTCHA vendor to render a CAPTCHA on a page
type Changes to this property will trigger replacement. string
Type of the captcha. Valid values: HCAPTCHA, RECAPTCHA_V2
name str
Name of the CAPTCHA
secret_key str
Secret key issued from the CAPTCHA vendor to perform server-side validation for a CAPTCHA token
site_key str
Site key issued from the CAPTCHA vendor to render a CAPTCHA on a page
type Changes to this property will trigger replacement. str
Type of the captcha. Valid values: HCAPTCHA, RECAPTCHA_V2
name String
Name of the CAPTCHA
secretKey String
Secret key issued from the CAPTCHA vendor to perform server-side validation for a CAPTCHA token
siteKey String
Site key issued from the CAPTCHA vendor to render a CAPTCHA on a page
type Changes to this property will trigger replacement. String
Type of the captcha. Valid values: HCAPTCHA, RECAPTCHA_V2

Import

$ pulumi import okta:index/captcha:Captcha example <captcha_id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Okta pulumi/pulumi-okta
License
Apache-2.0
Notes
This Pulumi package is based on the okta Terraform Provider.