1. Packages
  2. Okta Provider
  3. API Docs
  4. inline
  5. Hook
Okta v4.16.0 published on Wednesday, Apr 9, 2025 by Pulumi

okta.inline.Hook

Explore with Pulumi AI

Creates an inline hook. This resource allows you to create and configure an inline hook.

Example Usage

HTTP Auth

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

const example = new okta.inline.Hook("example", {
    name: "example",
    version: "1.0.0",
    type: "com.okta.oauth2.tokens.transform",
    channel: {
        version: "1.0.0",
        uri: "https://example.com/test",
        method: "POST",
    },
    auth: {
        key: "Authorization",
        type: "HEADER",
        value: "secret",
    },
});
Copy
import pulumi
import pulumi_okta as okta

example = okta.inline.Hook("example",
    name="example",
    version="1.0.0",
    type="com.okta.oauth2.tokens.transform",
    channel={
        "version": "1.0.0",
        "uri": "https://example.com/test",
        "method": "POST",
    },
    auth={
        "key": "Authorization",
        "type": "HEADER",
        "value": "secret",
    })
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := inline.NewHook(ctx, "example", &inline.HookArgs{
			Name:    pulumi.String("example"),
			Version: pulumi.String("1.0.0"),
			Type:    pulumi.String("com.okta.oauth2.tokens.transform"),
			Channel: pulumi.StringMap{
				"version": pulumi.String("1.0.0"),
				"uri":     pulumi.String("https://example.com/test"),
				"method":  pulumi.String("POST"),
			},
			Auth: pulumi.StringMap{
				"key":   pulumi.String("Authorization"),
				"type":  pulumi.String("HEADER"),
				"value": pulumi.String("secret"),
			},
		})
		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.Inline.Hook("example", new()
    {
        Name = "example",
        Version = "1.0.0",
        Type = "com.okta.oauth2.tokens.transform",
        Channel = 
        {
            { "version", "1.0.0" },
            { "uri", "https://example.com/test" },
            { "method", "POST" },
        },
        Auth = 
        {
            { "key", "Authorization" },
            { "type", "HEADER" },
            { "value", "secret" },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.okta.inline.Hook;
import com.pulumi.okta.inline.HookArgs;
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 Hook("example", HookArgs.builder()
            .name("example")
            .version("1.0.0")
            .type("com.okta.oauth2.tokens.transform")
            .channel(Map.ofEntries(
                Map.entry("version", "1.0.0"),
                Map.entry("uri", "https://example.com/test"),
                Map.entry("method", "POST")
            ))
            .auth(Map.ofEntries(
                Map.entry("key", "Authorization"),
                Map.entry("type", "HEADER"),
                Map.entry("value", "secret")
            ))
            .build());

    }
}
Copy
resources:
  example:
    type: okta:inline:Hook
    properties:
      name: example
      version: 1.0.0
      type: com.okta.oauth2.tokens.transform
      channel:
        version: 1.0.0
        uri: https://example.com/test
        method: POST
      auth:
        key: Authorization
        type: HEADER
        value: secret
Copy

OAuth2.0 Auth

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

const example = new okta.inline.Hook("example", {
    name: "example",
    version: "1.0.0",
    type: "com.okta.saml.tokens.transform",
    status: "ACTIVE",
    channelJson: `{
        "type": "OAUTH",
        "version": "1.0.0",
        "config": {
            "headers": [
                {
                    "key": "Field 1",
                    "value": "Value 1"
                },
                {
                    "key": "Field 2",
                    "value": "Value 2"
                }
            ],
            "method": "POST",
            "authType": "client_secret_post",
            "uri": "https://example.com/service",
            "clientId": "abc123",
            "clientSecret": "fake-secret",
            "tokenUrl": "https://example.com/token",
            "scope": "api"
        }
}
`,
});
Copy
import pulumi
import pulumi_okta as okta

example = okta.inline.Hook("example",
    name="example",
    version="1.0.0",
    type="com.okta.saml.tokens.transform",
    status="ACTIVE",
    channel_json="""{
        "type": "OAUTH",
        "version": "1.0.0",
        "config": {
            "headers": [
                {
                    "key": "Field 1",
                    "value": "Value 1"
                },
                {
                    "key": "Field 2",
                    "value": "Value 2"
                }
            ],
            "method": "POST",
            "authType": "client_secret_post",
            "uri": "https://example.com/service",
            "clientId": "abc123",
            "clientSecret": "fake-secret",
            "tokenUrl": "https://example.com/token",
            "scope": "api"
        }
}
""")
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := inline.NewHook(ctx, "example", &inline.HookArgs{
			Name:    pulumi.String("example"),
			Version: pulumi.String("1.0.0"),
			Type:    pulumi.String("com.okta.saml.tokens.transform"),
			Status:  pulumi.String("ACTIVE"),
			ChannelJson: pulumi.String(`{
        "type": "OAUTH",
        "version": "1.0.0",
        "config": {
            "headers": [
                {
                    "key": "Field 1",
                    "value": "Value 1"
                },
                {
                    "key": "Field 2",
                    "value": "Value 2"
                }
            ],
            "method": "POST",
            "authType": "client_secret_post",
            "uri": "https://example.com/service",
            "clientId": "abc123",
            "clientSecret": "fake-secret",
            "tokenUrl": "https://example.com/token",
            "scope": "api"
        }
}
`),
		})
		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.Inline.Hook("example", new()
    {
        Name = "example",
        Version = "1.0.0",
        Type = "com.okta.saml.tokens.transform",
        Status = "ACTIVE",
        ChannelJson = @"{
        ""type"": ""OAUTH"",
        ""version"": ""1.0.0"",
        ""config"": {
            ""headers"": [
                {
                    ""key"": ""Field 1"",
                    ""value"": ""Value 1""
                },
                {
                    ""key"": ""Field 2"",
                    ""value"": ""Value 2""
                }
            ],
            ""method"": ""POST"",
            ""authType"": ""client_secret_post"",
            ""uri"": ""https://example.com/service"",
            ""clientId"": ""abc123"",
            ""clientSecret"": ""fake-secret"",
            ""tokenUrl"": ""https://example.com/token"",
            ""scope"": ""api""
        }
}
",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.okta.inline.Hook;
import com.pulumi.okta.inline.HookArgs;
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 Hook("example", HookArgs.builder()
            .name("example")
            .version("1.0.0")
            .type("com.okta.saml.tokens.transform")
            .status("ACTIVE")
            .channelJson("""
{
        "type": "OAUTH",
        "version": "1.0.0",
        "config": {
            "headers": [
                {
                    "key": "Field 1",
                    "value": "Value 1"
                },
                {
                    "key": "Field 2",
                    "value": "Value 2"
                }
            ],
            "method": "POST",
            "authType": "client_secret_post",
            "uri": "https://example.com/service",
            "clientId": "abc123",
            "clientSecret": "fake-secret",
            "tokenUrl": "https://example.com/token",
            "scope": "api"
        }
}
            """)
            .build());

    }
}
Copy
resources:
  example:
    type: okta:inline:Hook
    properties:
      name: example
      version: 1.0.0
      type: com.okta.saml.tokens.transform
      status: ACTIVE
      channelJson: |
        {
                "type": "OAUTH",
                "version": "1.0.0",
                "config": {
                    "headers": [
                        {
                            "key": "Field 1",
                            "value": "Value 1"
                        },
                        {
                            "key": "Field 2",
                            "value": "Value 2"
                        }
                    ],
                    "method": "POST",
                    "authType": "client_secret_post",
                    "uri": "https://example.com/service",
                    "clientId": "abc123",
                    "clientSecret": "fake-secret",
                    "tokenUrl": "https://example.com/token",
                    "scope": "api"
                }
        }        
Copy

Create Hook Resource

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

Constructor syntax

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

@overload
def Hook(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         type: Optional[str] = None,
         version: Optional[str] = None,
         auth: Optional[Mapping[str, str]] = None,
         channel: Optional[Mapping[str, str]] = None,
         channel_json: Optional[str] = None,
         headers: Optional[Sequence[HookHeaderArgs]] = None,
         name: Optional[str] = None,
         status: Optional[str] = None)
func NewHook(ctx *Context, name string, args HookArgs, opts ...ResourceOption) (*Hook, error)
public Hook(string name, HookArgs args, CustomResourceOptions? opts = null)
public Hook(String name, HookArgs args)
public Hook(String name, HookArgs args, CustomResourceOptions options)
type: okta:inline:Hook
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. HookArgs
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. HookArgs
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. HookArgs
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. HookArgs
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. HookArgs
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 hookResource = new Okta.Inline.Hook("hookResource", new()
{
    Type = "string",
    Version = "string",
    Auth = 
    {
        { "string", "string" },
    },
    Channel = 
    {
        { "string", "string" },
    },
    ChannelJson = "string",
    Headers = new[]
    {
        new Okta.Inline.Inputs.HookHeaderArgs
        {
            Key = "string",
            Value = "string",
        },
    },
    Name = "string",
    Status = "string",
});
Copy
example, err := inline.NewHook(ctx, "hookResource", &inline.HookArgs{
	Type:    pulumi.String("string"),
	Version: pulumi.String("string"),
	Auth: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Channel: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	ChannelJson: pulumi.String("string"),
	Headers: inline.HookHeaderArray{
		&inline.HookHeaderArgs{
			Key:   pulumi.String("string"),
			Value: pulumi.String("string"),
		},
	},
	Name:   pulumi.String("string"),
	Status: pulumi.String("string"),
})
Copy
var hookResource = new Hook("hookResource", HookArgs.builder()
    .type("string")
    .version("string")
    .auth(Map.of("string", "string"))
    .channel(Map.of("string", "string"))
    .channelJson("string")
    .headers(HookHeaderArgs.builder()
        .key("string")
        .value("string")
        .build())
    .name("string")
    .status("string")
    .build());
Copy
hook_resource = okta.inline.Hook("hookResource",
    type="string",
    version="string",
    auth={
        "string": "string",
    },
    channel={
        "string": "string",
    },
    channel_json="string",
    headers=[{
        "key": "string",
        "value": "string",
    }],
    name="string",
    status="string")
Copy
const hookResource = new okta.inline.Hook("hookResource", {
    type: "string",
    version: "string",
    auth: {
        string: "string",
    },
    channel: {
        string: "string",
    },
    channelJson: "string",
    headers: [{
        key: "string",
        value: "string",
    }],
    name: "string",
    status: "string",
});
Copy
type: okta:inline:Hook
properties:
    auth:
        string: string
    channel:
        string: string
    channelJson: string
    headers:
        - key: string
          value: string
    name: string
    status: string
    type: string
    version: string
Copy

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

Type
This property is required.
Changes to this property will trigger replacement.
string
The type of hook to create. See here for supported types.
Version This property is required. string
The version of the hook. The currently-supported version is 1.0.0.
Auth Dictionary<string, string>
Channel Dictionary<string, string>
ChannelJson string
true channel object for the inline hook API contract
Headers List<HookHeader>
Map of headers to send along in inline hook request.
Name string
The inline hook display name.
Status string
Default to ACTIVE
Type
This property is required.
Changes to this property will trigger replacement.
string
The type of hook to create. See here for supported types.
Version This property is required. string
The version of the hook. The currently-supported version is 1.0.0.
Auth map[string]string
Channel map[string]string
ChannelJson string
true channel object for the inline hook API contract
Headers []HookHeaderArgs
Map of headers to send along in inline hook request.
Name string
The inline hook display name.
Status string
Default to ACTIVE
type
This property is required.
Changes to this property will trigger replacement.
String
The type of hook to create. See here for supported types.
version This property is required. String
The version of the hook. The currently-supported version is 1.0.0.
auth Map<String,String>
channel Map<String,String>
channelJson String
true channel object for the inline hook API contract
headers List<HookHeader>
Map of headers to send along in inline hook request.
name String
The inline hook display name.
status String
Default to ACTIVE
type
This property is required.
Changes to this property will trigger replacement.
string
The type of hook to create. See here for supported types.
version This property is required. string
The version of the hook. The currently-supported version is 1.0.0.
auth {[key: string]: string}
channel {[key: string]: string}
channelJson string
true channel object for the inline hook API contract
headers HookHeader[]
Map of headers to send along in inline hook request.
name string
The inline hook display name.
status string
Default to ACTIVE
type
This property is required.
Changes to this property will trigger replacement.
str
The type of hook to create. See here for supported types.
version This property is required. str
The version of the hook. The currently-supported version is 1.0.0.
auth Mapping[str, str]
channel Mapping[str, str]
channel_json str
true channel object for the inline hook API contract
headers Sequence[HookHeaderArgs]
Map of headers to send along in inline hook request.
name str
The inline hook display name.
status str
Default to ACTIVE
type
This property is required.
Changes to this property will trigger replacement.
String
The type of hook to create. See here for supported types.
version This property is required. String
The version of the hook. The currently-supported version is 1.0.0.
auth Map<String>
channel Map<String>
channelJson String
true channel object for the inline hook API contract
headers List<Property Map>
Map of headers to send along in inline hook request.
name String
The inline hook display name.
status String
Default to ACTIVE

Outputs

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

Get an existing Hook 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?: HookState, opts?: CustomResourceOptions): Hook
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        auth: Optional[Mapping[str, str]] = None,
        channel: Optional[Mapping[str, str]] = None,
        channel_json: Optional[str] = None,
        headers: Optional[Sequence[HookHeaderArgs]] = None,
        name: Optional[str] = None,
        status: Optional[str] = None,
        type: Optional[str] = None,
        version: Optional[str] = None) -> Hook
func GetHook(ctx *Context, name string, id IDInput, state *HookState, opts ...ResourceOption) (*Hook, error)
public static Hook Get(string name, Input<string> id, HookState? state, CustomResourceOptions? opts = null)
public static Hook get(String name, Output<String> id, HookState state, CustomResourceOptions options)
resources:  _:    type: okta:inline:Hook    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:
Auth Dictionary<string, string>
Channel Dictionary<string, string>
ChannelJson string
true channel object for the inline hook API contract
Headers List<HookHeader>
Map of headers to send along in inline hook request.
Name string
The inline hook display name.
Status string
Default to ACTIVE
Type Changes to this property will trigger replacement. string
The type of hook to create. See here for supported types.
Version string
The version of the hook. The currently-supported version is 1.0.0.
Auth map[string]string
Channel map[string]string
ChannelJson string
true channel object for the inline hook API contract
Headers []HookHeaderArgs
Map of headers to send along in inline hook request.
Name string
The inline hook display name.
Status string
Default to ACTIVE
Type Changes to this property will trigger replacement. string
The type of hook to create. See here for supported types.
Version string
The version of the hook. The currently-supported version is 1.0.0.
auth Map<String,String>
channel Map<String,String>
channelJson String
true channel object for the inline hook API contract
headers List<HookHeader>
Map of headers to send along in inline hook request.
name String
The inline hook display name.
status String
Default to ACTIVE
type Changes to this property will trigger replacement. String
The type of hook to create. See here for supported types.
version String
The version of the hook. The currently-supported version is 1.0.0.
auth {[key: string]: string}
channel {[key: string]: string}
channelJson string
true channel object for the inline hook API contract
headers HookHeader[]
Map of headers to send along in inline hook request.
name string
The inline hook display name.
status string
Default to ACTIVE
type Changes to this property will trigger replacement. string
The type of hook to create. See here for supported types.
version string
The version of the hook. The currently-supported version is 1.0.0.
auth Mapping[str, str]
channel Mapping[str, str]
channel_json str
true channel object for the inline hook API contract
headers Sequence[HookHeaderArgs]
Map of headers to send along in inline hook request.
name str
The inline hook display name.
status str
Default to ACTIVE
type Changes to this property will trigger replacement. str
The type of hook to create. See here for supported types.
version str
The version of the hook. The currently-supported version is 1.0.0.
auth Map<String>
channel Map<String>
channelJson String
true channel object for the inline hook API contract
headers List<Property Map>
Map of headers to send along in inline hook request.
name String
The inline hook display name.
status String
Default to ACTIVE
type Changes to this property will trigger replacement. String
The type of hook to create. See here for supported types.
version String
The version of the hook. The currently-supported version is 1.0.0.

Supporting Types

HookHeader
, HookHeaderArgs

Key string
Value string
Key string
Value string
key String
value String
key string
value string
key str
value str
key String
value String

Import

$ pulumi import okta:inline/hook:Hook example <hook_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.