Data source to retrieve all actions that are using a specific Auth0 action module.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as auth0 from "@pulumi/auth0";
// Example: Retrieve all actions using a specific action module
// Create and publish an action module
const myModule = new auth0.ActionModule("my_module", {
name: "My Shared Module",
publish: true,
code: `module.exports = {
greet: function(name) {
return \\"Hello, \\" + name + \\"!\\";
}
};
`,
});
// Get the published versions of the module
const myModuleVersions = auth0.getActionModuleVersionsOutput({
moduleId: myModule.id,
});
// Create an action that uses the module
const myAction1 = new auth0.Action("my_action_1", {
name: "My Action Using Module 1",
deploy: true,
code: `const myModule = require('my-module');
exports.onExecutePostLogin = async (event, api) => {
console.log(myModule.greet(event.user.name));
};
`,
supportedTriggers: {
id: "post-login",
version: "v3",
},
modules: [{
moduleId: myModule.id,
moduleVersionId: myModuleVersions.apply(myModuleVersions => myModuleVersions.versions?.[0]?.id),
}],
});
// Create another action that uses the same module
const myAction2 = new auth0.Action("my_action_2", {
name: "My Action Using Module 2",
deploy: true,
code: `const myModule = require('my-module');
exports.onExecutePostLogin = async (event, api) => {
api.idToken.setCustomClaim(\\"greeting\\", myModule.greet(event.user.name));
};
`,
supportedTriggers: {
id: "post-login",
version: "v3",
},
modules: [{
moduleId: myModule.id,
moduleVersionId: myModuleVersions.apply(myModuleVersions => myModuleVersions.versions?.[0]?.id),
}],
});
// Retrieve all actions that are using this module
const myModuleActions = auth0.getActionModuleActionsOutput({
moduleId: myModule.id,
});
export const actionsUsingModule = myModuleActions.apply(myModuleActions => myModuleActions.total);
export const actionNames = myModuleActions.apply(myModuleActions => .map(action => (action.actionName)));
import pulumi
import pulumi_auth0 as auth0
# Example: Retrieve all actions using a specific action module
# Create and publish an action module
my_module = auth0.ActionModule("my_module",
name="My Shared Module",
publish=True,
code="""module.exports = {
greet: function(name) {
return \"Hello, \" + name + \"!\";
}
};
""")
# Get the published versions of the module
my_module_versions = auth0.get_action_module_versions_output(module_id=my_module.id)
# Create an action that uses the module
my_action1 = auth0.Action("my_action_1",
name="My Action Using Module 1",
deploy=True,
code="""const myModule = require('my-module');
exports.onExecutePostLogin = async (event, api) => {
console.log(myModule.greet(event.user.name));
};
""",
supported_triggers={
"id": "post-login",
"version": "v3",
},
modules=[{
"module_id": my_module.id,
"module_version_id": my_module_versions.versions[0].id,
}])
# Create another action that uses the same module
my_action2 = auth0.Action("my_action_2",
name="My Action Using Module 2",
deploy=True,
code="""const myModule = require('my-module');
exports.onExecutePostLogin = async (event, api) => {
api.idToken.setCustomClaim(\"greeting\", myModule.greet(event.user.name));
};
""",
supported_triggers={
"id": "post-login",
"version": "v3",
},
modules=[{
"module_id": my_module.id,
"module_version_id": my_module_versions.versions[0].id,
}])
# Retrieve all actions that are using this module
my_module_actions = auth0.get_action_module_actions_output(module_id=my_module.id)
pulumi.export("actionsUsingModule", my_module_actions.total)
pulumi.export("actionNames", my_module_actions.apply(lambda my_module_actions: [action.action_name for action in my_module_actions.actions]))
Example coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Auth0 = Pulumi.Auth0;
return await Deployment.RunAsync(() =>
{
// Example: Retrieve all actions using a specific action module
// Create and publish an action module
var myModule = new Auth0.ActionModule("my_module", new()
{
Name = "My Shared Module",
Publish = true,
Code = @"module.exports = {
greet: function(name) {
return \""Hello, \"" + name + \""!\"";
}
};
",
});
// Get the published versions of the module
var myModuleVersions = Auth0.GetActionModuleVersions.Invoke(new()
{
ModuleId = myModule.Id,
});
// Create an action that uses the module
var myAction1 = new Auth0.Action("my_action_1", new()
{
Name = "My Action Using Module 1",
Deploy = true,
Code = @"const myModule = require('my-module');
exports.onExecutePostLogin = async (event, api) => {
console.log(myModule.greet(event.user.name));
};
",
SupportedTriggers = new Auth0.Inputs.ActionSupportedTriggersArgs
{
Id = "post-login",
Version = "v3",
},
Modules = new[]
{
new Auth0.Inputs.ActionModuleArgs
{
ModuleId = myModule.Id,
ModuleVersionId = myModuleVersions.Apply(getActionModuleVersionsResult => getActionModuleVersionsResult.Versions[0]?.Id),
},
},
});
// Create another action that uses the same module
var myAction2 = new Auth0.Action("my_action_2", new()
{
Name = "My Action Using Module 2",
Deploy = true,
Code = @"const myModule = require('my-module');
exports.onExecutePostLogin = async (event, api) => {
api.idToken.setCustomClaim(\""greeting\"", myModule.greet(event.user.name));
};
",
SupportedTriggers = new Auth0.Inputs.ActionSupportedTriggersArgs
{
Id = "post-login",
Version = "v3",
},
Modules = new[]
{
new Auth0.Inputs.ActionModuleArgs
{
ModuleId = myModule.Id,
ModuleVersionId = myModuleVersions.Apply(getActionModuleVersionsResult => getActionModuleVersionsResult.Versions[0]?.Id),
},
},
});
// Retrieve all actions that are using this module
var myModuleActions = Auth0.GetActionModuleActions.Invoke(new()
{
ModuleId = myModule.Id,
});
return new Dictionary<string, object?>
{
["actionsUsingModule"] = myModuleActions.Apply(getActionModuleActionsResult => getActionModuleActionsResult.Total),
["actionNames"] = .Select(action =>
{
return action.ActionName;
}).ToList(),
};
});
Example coming soon!
Example coming soon!
Using getActionModuleActions
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getActionModuleActions(args: GetActionModuleActionsArgs, opts?: InvokeOptions): Promise<GetActionModuleActionsResult>
function getActionModuleActionsOutput(args: GetActionModuleActionsOutputArgs, opts?: InvokeOptions): Output<GetActionModuleActionsResult>def get_action_module_actions(module_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetActionModuleActionsResult
def get_action_module_actions_output(module_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetActionModuleActionsResult]func GetActionModuleActions(ctx *Context, args *GetActionModuleActionsArgs, opts ...InvokeOption) (*GetActionModuleActionsResult, error)
func GetActionModuleActionsOutput(ctx *Context, args *GetActionModuleActionsOutputArgs, opts ...InvokeOption) GetActionModuleActionsResultOutput> Note: This function is named GetActionModuleActions in the Go SDK.
public static class GetActionModuleActions
{
public static Task<GetActionModuleActionsResult> InvokeAsync(GetActionModuleActionsArgs args, InvokeOptions? opts = null)
public static Output<GetActionModuleActionsResult> Invoke(GetActionModuleActionsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetActionModuleActionsResult> getActionModuleActions(GetActionModuleActionsArgs args, InvokeOptions options)
public static Output<GetActionModuleActionsResult> getActionModuleActions(GetActionModuleActionsArgs args, InvokeOptions options)
fn::invoke:
function: auth0:index/getActionModuleActions:getActionModuleActions
arguments:
# arguments dictionaryThe following arguments are supported:
- Module
Id string - The ID of the action module.
- Module
Id string - The ID of the action module.
- module
Id String - The ID of the action module.
- module
Id string - The ID of the action module.
- module_
id str - The ID of the action module.
- module
Id String - The ID of the action module.
getActionModuleActions Result
The following output properties are available:
- Actions
List<Get
Action Module Actions Action> - List of actions using this module.
- Id string
- The provider-assigned unique ID for this managed resource.
- Module
Id string - The ID of the action module.
- Total int
- The total number of actions using this module.
- Actions
[]Get
Action Module Actions Action - List of actions using this module.
- Id string
- The provider-assigned unique ID for this managed resource.
- Module
Id string - The ID of the action module.
- Total int
- The total number of actions using this module.
- actions
List<Get
Action Module Actions Action> - List of actions using this module.
- id String
- The provider-assigned unique ID for this managed resource.
- module
Id String - The ID of the action module.
- total Integer
- The total number of actions using this module.
- actions
Get
Action Module Actions Action[] - List of actions using this module.
- id string
- The provider-assigned unique ID for this managed resource.
- module
Id string - The ID of the action module.
- total number
- The total number of actions using this module.
- actions
Sequence[Get
Action Module Actions Action] - List of actions using this module.
- id str
- The provider-assigned unique ID for this managed resource.
- module_
id str - The ID of the action module.
- total int
- The total number of actions using this module.
- actions List<Property Map>
- List of actions using this module.
- id String
- The provider-assigned unique ID for this managed resource.
- module
Id String - The ID of the action module.
- total Number
- The total number of actions using this module.
Supporting Types
GetActionModuleActionsAction
- Action
Id string - The ID of the action.
- Action
Name string - The name of the action.
- Module
Version stringId - The ID of the module version this action is using.
- Module
Version intNumber - The version number of the module this action is using.
- Supported
Triggers List<GetAction Module Actions Action Supported Trigger> - The triggers that this action supports.
- Action
Id string - The ID of the action.
- Action
Name string - The name of the action.
- Module
Version stringId - The ID of the module version this action is using.
- Module
Version intNumber - The version number of the module this action is using.
- Supported
Triggers []GetAction Module Actions Action Supported Trigger - The triggers that this action supports.
- action
Id String - The ID of the action.
- action
Name String - The name of the action.
- module
Version StringId - The ID of the module version this action is using.
- module
Version IntegerNumber - The version number of the module this action is using.
- supported
Triggers List<GetAction Module Actions Action Supported Trigger> - The triggers that this action supports.
- action
Id string - The ID of the action.
- action
Name string - The name of the action.
- module
Version stringId - The ID of the module version this action is using.
- module
Version numberNumber - The version number of the module this action is using.
- supported
Triggers GetAction Module Actions Action Supported Trigger[] - The triggers that this action supports.
- action_
id str - The ID of the action.
- action_
name str - The name of the action.
- module_
version_ strid - The ID of the module version this action is using.
- module_
version_ intnumber - The version number of the module this action is using.
- supported_
triggers Sequence[GetAction Module Actions Action Supported Trigger] - The triggers that this action supports.
- action
Id String - The ID of the action.
- action
Name String - The name of the action.
- module
Version StringId - The ID of the module version this action is using.
- module
Version NumberNumber - The version number of the module this action is using.
- supported
Triggers List<Property Map> - The triggers that this action supports.
GetActionModuleActionsActionSupportedTrigger
Package Details
- Repository
- Auth0 pulumi/pulumi-auth0
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
auth0Terraform Provider.
