RuleConfig

With Auth0, you can create custom Javascript snippets that run in a secure, isolated sandbox as part of your authentication pipeline, which are otherwise known as rules. This resource allows you to create and manage variables that are available to all rules via Auth0’s global configuration object. Used in conjunction with configured rules.

Example Usage

using Pulumi;
using Auth0 = Pulumi.Auth0;

class MyStack : Stack
{
    public MyStack()
    {
        var myRule = new Auth0.Rule("myRule", new Auth0.RuleArgs
        {
            Enabled = true,
            Script = @"function (user, context, callback) {
  callback(null, user, context);
}

",
        });
        var myRuleConfig = new Auth0.RuleConfig("myRuleConfig", new Auth0.RuleConfigArgs
        {
            Key = "foo",
            Value = "bar",
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-auth0/sdk/v2/go/auth0"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := auth0.NewRule(ctx, "myRule", &auth0.RuleArgs{
			Enabled: pulumi.Bool(true),
			Script:  pulumi.String(fmt.Sprintf("%v%v%v%v", "function (user, context, callback) {\n", "  callback(null, user, context);\n", "}\n", "\n")),
		})
		if err != nil {
			return err
		}
		_, err = auth0.NewRuleConfig(ctx, "myRuleConfig", &auth0.RuleConfigArgs{
			Key:   pulumi.String("foo"),
			Value: pulumi.String("bar"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_auth0 as auth0

my_rule = auth0.Rule("myRule",
    enabled=True,
    script="""function (user, context, callback) {
  callback(null, user, context);
}

""")
my_rule_config = auth0.RuleConfig("myRuleConfig",
    key="foo",
    value="bar")
import * as pulumi from "@pulumi/pulumi";
import * as auth0 from "@pulumi/auth0";

const myRule = new auth0.Rule("my_rule", {
    enabled: true,
    script: `function (user, context, callback) {
  callback(null, user, context);
}
`,
});
const myRuleConfig = new auth0.RuleConfig("my_rule_config", {
    key: "foo",
    value: "bar",
});

Create a RuleConfig Resource

new RuleConfig(name: string, args: RuleConfigArgs, opts?: CustomResourceOptions);
@overload
def RuleConfig(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               key: Optional[str] = None,
               value: Optional[str] = None)
@overload
def RuleConfig(resource_name: str,
               args: RuleConfigArgs,
               opts: Optional[ResourceOptions] = None)
func NewRuleConfig(ctx *Context, name string, args RuleConfigArgs, opts ...ResourceOption) (*RuleConfig, error)
public RuleConfig(string name, RuleConfigArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args RuleConfigArgs
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 RuleConfigArgs
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 RuleConfigArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RuleConfigArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

RuleConfig Resource Properties

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

Inputs

The RuleConfig resource accepts the following input properties:

Key string
String. Key for a rules configuration variable.
Value string
String, Case-sensitive. Value for a rules configuration variable.
Key string
String. Key for a rules configuration variable.
Value string
String, Case-sensitive. Value for a rules configuration variable.
key string
String. Key for a rules configuration variable.
value string
String, Case-sensitive. Value for a rules configuration variable.
key str
String. Key for a rules configuration variable.
value str
String, Case-sensitive. Value for a rules configuration variable.

Outputs

All input properties are implicitly available as output properties. Additionally, the RuleConfig 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing RuleConfig Resource

Get an existing RuleConfig 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?: RuleConfigState, opts?: CustomResourceOptions): RuleConfig
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        key: Optional[str] = None,
        value: Optional[str] = None) -> RuleConfig
func GetRuleConfig(ctx *Context, name string, id IDInput, state *RuleConfigState, opts ...ResourceOption) (*RuleConfig, error)
public static RuleConfig Get(string name, Input<string> id, RuleConfigState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Key string
String. Key for a rules configuration variable.
Value string
String, Case-sensitive. Value for a rules configuration variable.
Key string
String. Key for a rules configuration variable.
Value string
String, Case-sensitive. Value for a rules configuration variable.
key string
String. Key for a rules configuration variable.
value string
String, Case-sensitive. Value for a rules configuration variable.
key str
String. Key for a rules configuration variable.
value str
String, Case-sensitive. Value for a rules configuration variable.

Package Details

Repository
https://github.com/pulumi/pulumi-auth0
License
Apache-2.0
Notes
This Pulumi package is based on the auth0 Terraform Provider.