onelogin

v0.3.0 published on Wednesday, Jun 1, 2022 by Pulumi

SmartHook

Manage SmartHook resources.

This resource allows you to create and configure SmartHooks.

Example Usage

using Pulumi;
using Onelogin = Pulumi.Onelogin;

class MyStack : Stack
{
    public MyStack()
    {
        var basicTest = new Onelogin.SmartHook("basicTest", new Onelogin.SmartHookArgs
        {
            Disabled = false,
            EnvVars = 
            {
                "API_KEY",
            },
            Function = "CQlmdW5jdGlvbiBteUZ1bmMoKSB7CgkJCWxldCBhID0gMTsKCQkJbGV0IGIgPSAxOwoJCQlsZXQgYyA9IGEgKyBiOwoJCSAgY29uc29sZS5sb2coIkRpbmcgRG9uZyIsIGEsIGIsIGMpOwoJCX0K",
            Options = 
            {
                new Onelogin.Inputs.SmartHookOptionArgs
                {
                    LocationEnabled = false,
                    RiskEnabled = false,
                },
            },
            Packages = 
            {
                { "mysql", "^2.18.1" },
            },
            Retries = 0,
            Timeout = 2,
            Type = "pre-authentication",
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := onelogin.NewSmartHook(ctx, "basicTest", &onelogin.SmartHookArgs{
			Disabled: pulumi.Bool(false),
			EnvVars: pulumi.StringArray{
				pulumi.String("API_KEY"),
			},
			Function: pulumi.String("CQlmdW5jdGlvbiBteUZ1bmMoKSB7CgkJCWxldCBhID0gMTsKCQkJbGV0IGIgPSAxOwoJCQlsZXQgYyA9IGEgKyBiOwoJCSAgY29uc29sZS5sb2coIkRpbmcgRG9uZyIsIGEsIGIsIGMpOwoJCX0K"),
			Options: SmartHookOptionArray{
				&SmartHookOptionArgs{
					LocationEnabled: pulumi.Bool(false),
					RiskEnabled:     pulumi.Bool(false),
				},
			},
			Packages: pulumi.StringMap{
				"mysql": pulumi.String("^2.18.1"),
			},
			Retries: pulumi.Int(0),
			Timeout: pulumi.Int(2),
			Type:    pulumi.String("pre-authentication"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_onelogin as onelogin

basic_test = onelogin.SmartHook("basicTest",
    disabled=False,
    env_vars=["API_KEY"],
    function="CQlmdW5jdGlvbiBteUZ1bmMoKSB7CgkJCWxldCBhID0gMTsKCQkJbGV0IGIgPSAxOwoJCQlsZXQgYyA9IGEgKyBiOwoJCSAgY29uc29sZS5sb2coIkRpbmcgRG9uZyIsIGEsIGIsIGMpOwoJCX0K",
    options=[onelogin.SmartHookOptionArgs(
        location_enabled=False,
        risk_enabled=False,
    )],
    packages={
        "mysql": "^2.18.1",
    },
    retries=0,
    timeout=2,
    type="pre-authentication")
import * as pulumi from "@pulumi/pulumi";
import * as onelogin from "@pulumi/onelogin";

const basicTest = new onelogin.SmartHook("basic_test", {
    disabled: false,
    envVars: ["API_KEY"],
    function: "CQlmdW5jdGlvbiBteUZ1bmMoKSB7CgkJCWxldCBhID0gMTsKCQkJbGV0IGIgPSAxOwoJCQlsZXQgYyA9IGEgKyBiOwoJCSAgY29uc29sZS5sb2coIkRpbmcgRG9uZyIsIGEsIGIsIGMpOwoJCX0K",
    options: [{
        locationEnabled: false,
        riskEnabled: false,
    }],
    packages: {
        mysql: "^2.18.1",
    },
    retries: 0,
    timeout: 2,
    type: "pre-authentication",
});

Coming soon!

Create SmartHook Resource

new SmartHook(name: string, args: SmartHookArgs, opts?: CustomResourceOptions);
@overload
def SmartHook(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              conditions: Optional[Sequence[SmartHookConditionArgs]] = None,
              context_version: Optional[str] = None,
              disabled: Optional[bool] = None,
              env_vars: Optional[Sequence[str]] = None,
              function: Optional[str] = None,
              options: Optional[Sequence[SmartHookOptionArgs]] = None,
              packages: Optional[Mapping[str, str]] = None,
              retries: Optional[int] = None,
              runtime: Optional[str] = None,
              timeout: Optional[int] = None,
              type: Optional[str] = None)
@overload
def SmartHook(resource_name: str,
              args: SmartHookArgs,
              opts: Optional[ResourceOptions] = None)
func NewSmartHook(ctx *Context, name string, args SmartHookArgs, opts ...ResourceOption) (*SmartHook, error)
public SmartHook(string name, SmartHookArgs args, CustomResourceOptions? opts = null)
public SmartHook(String name, SmartHookArgs args)
public SmartHook(String name, SmartHookArgs args, CustomResourceOptions options)
type: onelogin:SmartHook
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

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

Disabled bool

Indicates if function is available for execution or not. Default true

EnvVars List<string>

An array of predefined environment variables to be supplied to the function at runtime.

Function string

A base64 encoded blob, or Heredoc string containing the javascript function code.

Packages Dictionary<string, string>

A list of public npm packages than will be installed as part of the function build process. These packages names must be on our allowlist. See Node Modules section of this doc. Packages can be any version and support the semantic versioning syntax used by NPM.

Retries int

Number of retries if execution fails. Default 0, Max 4

Runtime string
Timeout int

The number of milliseconds to allow before timeout. Default 1000, Max 10000

Type string

The name of the hook. Must be one of: user-migration pre-authentication pre-user-create post-user-create pre-user-update post-user-update

Conditions List<SmartHookConditionArgs>
ContextVersion string
Options List<SmartHookOptionArgs>

A list of options for the hook

Disabled bool

Indicates if function is available for execution or not. Default true

EnvVars []string

An array of predefined environment variables to be supplied to the function at runtime.

Function string

A base64 encoded blob, or Heredoc string containing the javascript function code.

Packages map[string]string

A list of public npm packages than will be installed as part of the function build process. These packages names must be on our allowlist. See Node Modules section of this doc. Packages can be any version and support the semantic versioning syntax used by NPM.

Retries int

Number of retries if execution fails. Default 0, Max 4

Runtime string
Timeout int

The number of milliseconds to allow before timeout. Default 1000, Max 10000

Type string

The name of the hook. Must be one of: user-migration pre-authentication pre-user-create post-user-create pre-user-update post-user-update

Conditions []SmartHookConditionArgs
ContextVersion string
Options []SmartHookOptionArgs

A list of options for the hook

disabled Boolean

Indicates if function is available for execution or not. Default true

envVars List<String>

An array of predefined environment variables to be supplied to the function at runtime.

function String

A base64 encoded blob, or Heredoc string containing the javascript function code.

packages Map<String,String>

A list of public npm packages than will be installed as part of the function build process. These packages names must be on our allowlist. See Node Modules section of this doc. Packages can be any version and support the semantic versioning syntax used by NPM.

retries Integer

Number of retries if execution fails. Default 0, Max 4

runtime String
timeout Integer

The number of milliseconds to allow before timeout. Default 1000, Max 10000

type String

The name of the hook. Must be one of: user-migration pre-authentication pre-user-create post-user-create pre-user-update post-user-update

conditions List<SmartHookConditionArgs>
contextVersion String
options List<SmartHookOptionArgs>

A list of options for the hook

disabled boolean

Indicates if function is available for execution or not. Default true

envVars string[]

An array of predefined environment variables to be supplied to the function at runtime.

function string

A base64 encoded blob, or Heredoc string containing the javascript function code.

packages {[key: string]: string}

A list of public npm packages than will be installed as part of the function build process. These packages names must be on our allowlist. See Node Modules section of this doc. Packages can be any version and support the semantic versioning syntax used by NPM.

retries number

Number of retries if execution fails. Default 0, Max 4

runtime string
timeout number

The number of milliseconds to allow before timeout. Default 1000, Max 10000

type string

The name of the hook. Must be one of: user-migration pre-authentication pre-user-create post-user-create pre-user-update post-user-update

conditions SmartHookConditionArgs[]
contextVersion string
options SmartHookOptionArgs[]

A list of options for the hook

disabled bool

Indicates if function is available for execution or not. Default true

env_vars Sequence[str]

An array of predefined environment variables to be supplied to the function at runtime.

function str

A base64 encoded blob, or Heredoc string containing the javascript function code.

packages Mapping[str, str]

A list of public npm packages than will be installed as part of the function build process. These packages names must be on our allowlist. See Node Modules section of this doc. Packages can be any version and support the semantic versioning syntax used by NPM.

retries int

Number of retries if execution fails. Default 0, Max 4

runtime str
timeout int

The number of milliseconds to allow before timeout. Default 1000, Max 10000

type str

The name of the hook. Must be one of: user-migration pre-authentication pre-user-create post-user-create pre-user-update post-user-update

conditions Sequence[SmartHookConditionArgs]
context_version str
options Sequence[SmartHookOptionArgs]

A list of options for the hook

disabled Boolean

Indicates if function is available for execution or not. Default true

envVars List<String>

An array of predefined environment variables to be supplied to the function at runtime.

function String

A base64 encoded blob, or Heredoc string containing the javascript function code.

packages Map<String>

A list of public npm packages than will be installed as part of the function build process. These packages names must be on our allowlist. See Node Modules section of this doc. Packages can be any version and support the semantic versioning syntax used by NPM.

retries Number

Number of retries if execution fails. Default 0, Max 4

runtime String
timeout Number

The number of milliseconds to allow before timeout. Default 1000, Max 10000

type String

The name of the hook. Must be one of: user-migration pre-authentication pre-user-create post-user-create pre-user-update post-user-update

conditions List<Property Map>
contextVersion String
options List<Property Map>

A list of options for the hook

Outputs

All input properties are implicitly available as output properties. Additionally, the SmartHook resource produces the following output properties:

CreatedAt string

Timestamp for smarthook's last update

Id string

The provider-assigned unique ID for this managed resource.

Status string

The smarthook's status.

UpdatedAt string

Timestamp for smarthook's last update

CreatedAt string

Timestamp for smarthook's last update

Id string

The provider-assigned unique ID for this managed resource.

Status string

The smarthook's status.

UpdatedAt string

Timestamp for smarthook's last update

createdAt String

Timestamp for smarthook's last update

id String

The provider-assigned unique ID for this managed resource.

status String

The smarthook's status.

updatedAt String

Timestamp for smarthook's last update

createdAt string

Timestamp for smarthook's last update

id string

The provider-assigned unique ID for this managed resource.

status string

The smarthook's status.

updatedAt string

Timestamp for smarthook's last update

created_at str

Timestamp for smarthook's last update

id str

The provider-assigned unique ID for this managed resource.

status str

The smarthook's status.

updated_at str

Timestamp for smarthook's last update

createdAt String

Timestamp for smarthook's last update

id String

The provider-assigned unique ID for this managed resource.

status String

The smarthook's status.

updatedAt String

Timestamp for smarthook's last update

Look up Existing SmartHook Resource

Get an existing SmartHook 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?: SmartHookState, opts?: CustomResourceOptions): SmartHook
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        conditions: Optional[Sequence[SmartHookConditionArgs]] = None,
        context_version: Optional[str] = None,
        created_at: Optional[str] = None,
        disabled: Optional[bool] = None,
        env_vars: Optional[Sequence[str]] = None,
        function: Optional[str] = None,
        options: Optional[Sequence[SmartHookOptionArgs]] = None,
        packages: Optional[Mapping[str, str]] = None,
        retries: Optional[int] = None,
        runtime: Optional[str] = None,
        status: Optional[str] = None,
        timeout: Optional[int] = None,
        type: Optional[str] = None,
        updated_at: Optional[str] = None) -> SmartHook
func GetSmartHook(ctx *Context, name string, id IDInput, state *SmartHookState, opts ...ResourceOption) (*SmartHook, error)
public static SmartHook Get(string name, Input<string> id, SmartHookState? state, CustomResourceOptions? opts = null)
public static SmartHook get(String name, Output<String> id, SmartHookState 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:
Conditions List<SmartHookConditionArgs>
ContextVersion string
CreatedAt string

Timestamp for smarthook's last update

Disabled bool

Indicates if function is available for execution or not. Default true

EnvVars List<string>

An array of predefined environment variables to be supplied to the function at runtime.

Function string

A base64 encoded blob, or Heredoc string containing the javascript function code.

Options List<SmartHookOptionArgs>

A list of options for the hook

Packages Dictionary<string, string>

A list of public npm packages than will be installed as part of the function build process. These packages names must be on our allowlist. See Node Modules section of this doc. Packages can be any version and support the semantic versioning syntax used by NPM.

Retries int

Number of retries if execution fails. Default 0, Max 4

Runtime string
Status string

The smarthook's status.

Timeout int

The number of milliseconds to allow before timeout. Default 1000, Max 10000

Type string

The name of the hook. Must be one of: user-migration pre-authentication pre-user-create post-user-create pre-user-update post-user-update

UpdatedAt string

Timestamp for smarthook's last update

Conditions []SmartHookConditionArgs
ContextVersion string
CreatedAt string

Timestamp for smarthook's last update

Disabled bool

Indicates if function is available for execution or not. Default true

EnvVars []string

An array of predefined environment variables to be supplied to the function at runtime.

Function string

A base64 encoded blob, or Heredoc string containing the javascript function code.

Options []SmartHookOptionArgs

A list of options for the hook

Packages map[string]string

A list of public npm packages than will be installed as part of the function build process. These packages names must be on our allowlist. See Node Modules section of this doc. Packages can be any version and support the semantic versioning syntax used by NPM.

Retries int

Number of retries if execution fails. Default 0, Max 4

Runtime string
Status string

The smarthook's status.

Timeout int

The number of milliseconds to allow before timeout. Default 1000, Max 10000

Type string

The name of the hook. Must be one of: user-migration pre-authentication pre-user-create post-user-create pre-user-update post-user-update

UpdatedAt string

Timestamp for smarthook's last update

conditions List<SmartHookConditionArgs>
contextVersion String
createdAt String

Timestamp for smarthook's last update

disabled Boolean

Indicates if function is available for execution or not. Default true

envVars List<String>

An array of predefined environment variables to be supplied to the function at runtime.

function String

A base64 encoded blob, or Heredoc string containing the javascript function code.

options List<SmartHookOptionArgs>

A list of options for the hook

packages Map<String,String>

A list of public npm packages than will be installed as part of the function build process. These packages names must be on our allowlist. See Node Modules section of this doc. Packages can be any version and support the semantic versioning syntax used by NPM.

retries Integer

Number of retries if execution fails. Default 0, Max 4

runtime String
status String

The smarthook's status.

timeout Integer

The number of milliseconds to allow before timeout. Default 1000, Max 10000

type String

The name of the hook. Must be one of: user-migration pre-authentication pre-user-create post-user-create pre-user-update post-user-update

updatedAt String

Timestamp for smarthook's last update

conditions SmartHookConditionArgs[]
contextVersion string
createdAt string

Timestamp for smarthook's last update

disabled boolean

Indicates if function is available for execution or not. Default true

envVars string[]

An array of predefined environment variables to be supplied to the function at runtime.

function string

A base64 encoded blob, or Heredoc string containing the javascript function code.

options SmartHookOptionArgs[]

A list of options for the hook

packages {[key: string]: string}

A list of public npm packages than will be installed as part of the function build process. These packages names must be on our allowlist. See Node Modules section of this doc. Packages can be any version and support the semantic versioning syntax used by NPM.

retries number

Number of retries if execution fails. Default 0, Max 4

runtime string
status string

The smarthook's status.

timeout number

The number of milliseconds to allow before timeout. Default 1000, Max 10000

type string

The name of the hook. Must be one of: user-migration pre-authentication pre-user-create post-user-create pre-user-update post-user-update

updatedAt string

Timestamp for smarthook's last update

conditions Sequence[SmartHookConditionArgs]
context_version str
created_at str

Timestamp for smarthook's last update

disabled bool

Indicates if function is available for execution or not. Default true

env_vars Sequence[str]

An array of predefined environment variables to be supplied to the function at runtime.

function str

A base64 encoded blob, or Heredoc string containing the javascript function code.

options Sequence[SmartHookOptionArgs]

A list of options for the hook

packages Mapping[str, str]

A list of public npm packages than will be installed as part of the function build process. These packages names must be on our allowlist. See Node Modules section of this doc. Packages can be any version and support the semantic versioning syntax used by NPM.

retries int

Number of retries if execution fails. Default 0, Max 4

runtime str
status str

The smarthook's status.

timeout int

The number of milliseconds to allow before timeout. Default 1000, Max 10000

type str

The name of the hook. Must be one of: user-migration pre-authentication pre-user-create post-user-create pre-user-update post-user-update

updated_at str

Timestamp for smarthook's last update

conditions List<Property Map>
contextVersion String
createdAt String

Timestamp for smarthook's last update

disabled Boolean

Indicates if function is available for execution or not. Default true

envVars List<String>

An array of predefined environment variables to be supplied to the function at runtime.

function String

A base64 encoded blob, or Heredoc string containing the javascript function code.

options List<Property Map>

A list of options for the hook

packages Map<String>

A list of public npm packages than will be installed as part of the function build process. These packages names must be on our allowlist. See Node Modules section of this doc. Packages can be any version and support the semantic versioning syntax used by NPM.

retries Number

Number of retries if execution fails. Default 0, Max 4

runtime String
status String

The smarthook's status.

timeout Number

The number of milliseconds to allow before timeout. Default 1000, Max 10000

type String

The name of the hook. Must be one of: user-migration pre-authentication pre-user-create post-user-create pre-user-update post-user-update

updatedAt String

Timestamp for smarthook's last update

Supporting Types

SmartHookCondition

Operator string
Source string
Value string
Operator string
Source string
Value string
operator String
source String
value String
operator string
source string
value string
operator String
source String
value String

SmartHookOption

LocationEnabled bool

When true an ip to location lookup is done and the location info is passed in the context. Only applies authentication time hooks. E.g. pre-authentication, user-migration. Default false

MfaDeviceInfoEnabled bool
RiskEnabled bool

When true a risk score and risk reasons will be passed in the context. Only applies authentication time hooks. E.g. pre-authentication, user-migration. Default false

LocationEnabled bool

When true an ip to location lookup is done and the location info is passed in the context. Only applies authentication time hooks. E.g. pre-authentication, user-migration. Default false

MfaDeviceInfoEnabled bool
RiskEnabled bool

When true a risk score and risk reasons will be passed in the context. Only applies authentication time hooks. E.g. pre-authentication, user-migration. Default false

locationEnabled Boolean

When true an ip to location lookup is done and the location info is passed in the context. Only applies authentication time hooks. E.g. pre-authentication, user-migration. Default false

mfaDeviceInfoEnabled Boolean
riskEnabled Boolean

When true a risk score and risk reasons will be passed in the context. Only applies authentication time hooks. E.g. pre-authentication, user-migration. Default false

locationEnabled boolean

When true an ip to location lookup is done and the location info is passed in the context. Only applies authentication time hooks. E.g. pre-authentication, user-migration. Default false

mfaDeviceInfoEnabled boolean
riskEnabled boolean

When true a risk score and risk reasons will be passed in the context. Only applies authentication time hooks. E.g. pre-authentication, user-migration. Default false

location_enabled bool

When true an ip to location lookup is done and the location info is passed in the context. Only applies authentication time hooks. E.g. pre-authentication, user-migration. Default false

mfa_device_info_enabled bool
risk_enabled bool

When true a risk score and risk reasons will be passed in the context. Only applies authentication time hooks. E.g. pre-authentication, user-migration. Default false

locationEnabled Boolean

When true an ip to location lookup is done and the location info is passed in the context. Only applies authentication time hooks. E.g. pre-authentication, user-migration. Default false

mfaDeviceInfoEnabled Boolean
riskEnabled Boolean

When true a risk score and risk reasons will be passed in the context. Only applies authentication time hooks. E.g. pre-authentication, user-migration. Default false

Import

A SmartHook can be imported via the OneLogin SmartHook.

 $ pulumi import onelogin:index/smartHook:SmartHook example <smarthook_id>

Package Details

Repository
https://github.com/pulumi/pulumi-onelogin
License
Apache-2.0
Notes

This Pulumi package is based on the onelogin Terraform Provider.