Rule
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 rules. You can create global variable for use with rules by using the auth0..RuleConfig resource.
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",
});
}
}
Coming soon!
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 Rule Resource
new Rule(name: string, args: RuleArgs, opts?: CustomResourceOptions);def Rule(resource_name, opts=None, enabled=None, name=None, order=None, script=None, __props__=None);public Rule(string name, RuleArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Rule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Rule resource accepts the following input properties:
- Script string
String. Code to be executed when the rule runs.
- Enabled bool
Boolean. Indicates whether the rule is enabled.
- Name string
String. Name of the rule. May only contain alphanumeric characters, spaces, and hyphens. May neither start nor end with hyphens or spaces.
- Order int
Integer. Order in which the rule executes relative to other rules. Lower-valued rules execute first.
- Script string
String. Code to be executed when the rule runs.
- Enabled bool
Boolean. Indicates whether the rule is enabled.
- Name string
String. Name of the rule. May only contain alphanumeric characters, spaces, and hyphens. May neither start nor end with hyphens or spaces.
- Order int
Integer. Order in which the rule executes relative to other rules. Lower-valued rules execute first.
- script string
String. Code to be executed when the rule runs.
- enabled boolean
Boolean. Indicates whether the rule is enabled.
- name string
String. Name of the rule. May only contain alphanumeric characters, spaces, and hyphens. May neither start nor end with hyphens or spaces.
- order number
Integer. Order in which the rule executes relative to other rules. Lower-valued rules execute first.
- script str
String. Code to be executed when the rule runs.
- enabled bool
Boolean. Indicates whether the rule is enabled.
- name str
String. Name of the rule. May only contain alphanumeric characters, spaces, and hyphens. May neither start nor end with hyphens or spaces.
- order float
Integer. Order in which the rule executes relative to other rules. Lower-valued rules execute first.
Outputs
All input properties are implicitly available as output properties. Additionally, the Rule resource produces the following output properties:
Look up an Existing Rule Resource
Get an existing Rule 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?: RuleState, opts?: CustomResourceOptions): Rulestatic get(resource_name, id, opts=None, enabled=None, name=None, order=None, script=None, __props__=None);public static Rule Get(string name, Input<string> id, RuleState? 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:
- Enabled bool
Boolean. Indicates whether the rule is enabled.
- Name string
String. Name of the rule. May only contain alphanumeric characters, spaces, and hyphens. May neither start nor end with hyphens or spaces.
- Order int
Integer. Order in which the rule executes relative to other rules. Lower-valued rules execute first.
- Script string
String. Code to be executed when the rule runs.
- Enabled bool
Boolean. Indicates whether the rule is enabled.
- Name string
String. Name of the rule. May only contain alphanumeric characters, spaces, and hyphens. May neither start nor end with hyphens or spaces.
- Order int
Integer. Order in which the rule executes relative to other rules. Lower-valued rules execute first.
- Script string
String. Code to be executed when the rule runs.
- enabled boolean
Boolean. Indicates whether the rule is enabled.
- name string
String. Name of the rule. May only contain alphanumeric characters, spaces, and hyphens. May neither start nor end with hyphens or spaces.
- order number
Integer. Order in which the rule executes relative to other rules. Lower-valued rules execute first.
- script string
String. Code to be executed when the rule runs.
- enabled bool
Boolean. Indicates whether the rule is enabled.
- name str
String. Name of the rule. May only contain alphanumeric characters, spaces, and hyphens. May neither start nor end with hyphens or spaces.
- order float
Integer. Order in which the rule executes relative to other rules. Lower-valued rules execute first.
- script str
String. Code to be executed when the rule runs.
Package Details
- Repository
- https://github.com/pulumi/pulumi-auth0
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
auth0Terraform Provider.