okta.group.Rule
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as okta from "@pulumi/okta";
const example = new okta.group.Rule("example", {
name: "example",
status: "ACTIVE",
groupAssignments: ["<group id>"],
expressionType: "urn:okta:expression:1.0",
expressionValue: "String.startsWith(user.firstName,\"andy\")",
});
import pulumi
import pulumi_okta as okta
example = okta.group.Rule("example",
name="example",
status="ACTIVE",
group_assignments=["<group id>"],
expression_type="urn:okta:expression:1.0",
expression_value="String.startsWith(user.firstName,\"andy\")")
package main
import (
"github.com/pulumi/pulumi-okta/sdk/v4/go/okta/group"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := group.NewRule(ctx, "example", &group.RuleArgs{
Name: pulumi.String("example"),
Status: pulumi.String("ACTIVE"),
GroupAssignments: pulumi.StringArray{
pulumi.String("<group id>"),
},
ExpressionType: pulumi.String("urn:okta:expression:1.0"),
ExpressionValue: pulumi.String("String.startsWith(user.firstName,\"andy\")"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Okta = Pulumi.Okta;
return await Deployment.RunAsync(() =>
{
var example = new Okta.Group.Rule("example", new()
{
Name = "example",
Status = "ACTIVE",
GroupAssignments = new[]
{
"<group id>",
},
ExpressionType = "urn:okta:expression:1.0",
ExpressionValue = "String.startsWith(user.firstName,\"andy\")",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.okta.group.Rule;
import com.pulumi.okta.group.RuleArgs;
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 Rule("example", RuleArgs.builder()
.name("example")
.status("ACTIVE")
.groupAssignments("<group id>")
.expressionType("urn:okta:expression:1.0")
.expressionValue("String.startsWith(user.firstName,\"andy\")")
.build());
}
}
resources:
example:
type: okta:group:Rule
properties:
name: example
status: ACTIVE
groupAssignments:
- <group id>
expressionType: urn:okta:expression:1.0
expressionValue: String.startsWith(user.firstName,"andy")
Create Rule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Rule(name: string, args: RuleArgs, opts?: CustomResourceOptions);
@overload
def Rule(resource_name: str,
args: RuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Rule(resource_name: str,
opts: Optional[ResourceOptions] = None,
expression_value: Optional[str] = None,
group_assignments: Optional[Sequence[str]] = None,
expression_type: Optional[str] = None,
name: Optional[str] = None,
remove_assigned_users: Optional[bool] = None,
status: Optional[str] = None,
users_excludeds: Optional[Sequence[str]] = None)
func NewRule(ctx *Context, name string, args RuleArgs, opts ...ResourceOption) (*Rule, error)
public Rule(string name, RuleArgs args, CustomResourceOptions? opts = null)
type: okta:group:Rule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- 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.
- args RuleArgs
- 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 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.
- name String
- The unique name of the resource.
- args RuleArgs
- 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 ruleResource = new Okta.Group.Rule("ruleResource", new()
{
ExpressionValue = "string",
GroupAssignments = new[]
{
"string",
},
ExpressionType = "string",
Name = "string",
RemoveAssignedUsers = false,
Status = "string",
UsersExcludeds = new[]
{
"string",
},
});
example, err := group.NewRule(ctx, "ruleResource", &group.RuleArgs{
ExpressionValue: pulumi.String("string"),
GroupAssignments: pulumi.StringArray{
pulumi.String("string"),
},
ExpressionType: pulumi.String("string"),
Name: pulumi.String("string"),
RemoveAssignedUsers: pulumi.Bool(false),
Status: pulumi.String("string"),
UsersExcludeds: pulumi.StringArray{
pulumi.String("string"),
},
})
var ruleResource = new Rule("ruleResource", RuleArgs.builder()
.expressionValue("string")
.groupAssignments("string")
.expressionType("string")
.name("string")
.removeAssignedUsers(false)
.status("string")
.usersExcludeds("string")
.build());
rule_resource = okta.group.Rule("ruleResource",
expression_value="string",
group_assignments=["string"],
expression_type="string",
name="string",
remove_assigned_users=False,
status="string",
users_excludeds=["string"])
const ruleResource = new okta.group.Rule("ruleResource", {
expressionValue: "string",
groupAssignments: ["string"],
expressionType: "string",
name: "string",
removeAssignedUsers: false,
status: "string",
usersExcludeds: ["string"],
});
type: okta:group:Rule
properties:
expressionType: string
expressionValue: string
groupAssignments:
- string
name: string
removeAssignedUsers: false
status: string
usersExcludeds:
- string
Rule 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 Rule resource accepts the following input properties:
- Expression
Value string - The expression value.
- Group
Assignments List<string> - The list of group ids to assign the users to.
- Expression
Type string - The expression type to use to invoke the rule. The default is
urn:okta:expression:1.0
. - Name string
- The name of the Group Rule (min character 1; max characters 50).
- Remove
Assigned boolUsers - Remove users added by this rule from the assigned group after deleting this resource. Default is
false
- Status string
- Default to
ACTIVE
- Users
Excludeds List<string> - The list of user IDs that would be excluded when rules are processed
- Expression
Value string - The expression value.
- Group
Assignments []string - The list of group ids to assign the users to.
- Expression
Type string - The expression type to use to invoke the rule. The default is
urn:okta:expression:1.0
. - Name string
- The name of the Group Rule (min character 1; max characters 50).
- Remove
Assigned boolUsers - Remove users added by this rule from the assigned group after deleting this resource. Default is
false
- Status string
- Default to
ACTIVE
- Users
Excludeds []string - The list of user IDs that would be excluded when rules are processed
- expression
Value String - The expression value.
- group
Assignments List<String> - The list of group ids to assign the users to.
- expression
Type String - The expression type to use to invoke the rule. The default is
urn:okta:expression:1.0
. - name String
- The name of the Group Rule (min character 1; max characters 50).
- remove
Assigned BooleanUsers - Remove users added by this rule from the assigned group after deleting this resource. Default is
false
- status String
- Default to
ACTIVE
- users
Excludeds List<String> - The list of user IDs that would be excluded when rules are processed
- expression
Value string - The expression value.
- group
Assignments string[] - The list of group ids to assign the users to.
- expression
Type string - The expression type to use to invoke the rule. The default is
urn:okta:expression:1.0
. - name string
- The name of the Group Rule (min character 1; max characters 50).
- remove
Assigned booleanUsers - Remove users added by this rule from the assigned group after deleting this resource. Default is
false
- status string
- Default to
ACTIVE
- users
Excludeds string[] - The list of user IDs that would be excluded when rules are processed
- expression_
value str - The expression value.
- group_
assignments Sequence[str] - The list of group ids to assign the users to.
- expression_
type str - The expression type to use to invoke the rule. The default is
urn:okta:expression:1.0
. - name str
- The name of the Group Rule (min character 1; max characters 50).
- remove_
assigned_ boolusers - Remove users added by this rule from the assigned group after deleting this resource. Default is
false
- status str
- Default to
ACTIVE
- users_
excludeds Sequence[str] - The list of user IDs that would be excluded when rules are processed
- expression
Value String - The expression value.
- group
Assignments List<String> - The list of group ids to assign the users to.
- expression
Type String - The expression type to use to invoke the rule. The default is
urn:okta:expression:1.0
. - name String
- The name of the Group Rule (min character 1; max characters 50).
- remove
Assigned BooleanUsers - Remove users added by this rule from the assigned group after deleting this resource. Default is
false
- status String
- Default to
ACTIVE
- users
Excludeds List<String> - The list of user IDs that would be excluded when rules are processed
Outputs
All input properties are implicitly available as output properties. Additionally, the Rule 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 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): Rule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
expression_type: Optional[str] = None,
expression_value: Optional[str] = None,
group_assignments: Optional[Sequence[str]] = None,
name: Optional[str] = None,
remove_assigned_users: Optional[bool] = None,
status: Optional[str] = None,
users_excludeds: Optional[Sequence[str]] = None) -> Rule
func GetRule(ctx *Context, name string, id IDInput, state *RuleState, opts ...ResourceOption) (*Rule, error)
public static Rule Get(string name, Input<string> id, RuleState? state, CustomResourceOptions? opts = null)
public static Rule get(String name, Output<String> id, RuleState 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.
- Expression
Type string - The expression type to use to invoke the rule. The default is
urn:okta:expression:1.0
. - Expression
Value string - The expression value.
- Group
Assignments List<string> - The list of group ids to assign the users to.
- Name string
- The name of the Group Rule (min character 1; max characters 50).
- Remove
Assigned boolUsers - Remove users added by this rule from the assigned group after deleting this resource. Default is
false
- Status string
- Default to
ACTIVE
- Users
Excludeds List<string> - The list of user IDs that would be excluded when rules are processed
- Expression
Type string - The expression type to use to invoke the rule. The default is
urn:okta:expression:1.0
. - Expression
Value string - The expression value.
- Group
Assignments []string - The list of group ids to assign the users to.
- Name string
- The name of the Group Rule (min character 1; max characters 50).
- Remove
Assigned boolUsers - Remove users added by this rule from the assigned group after deleting this resource. Default is
false
- Status string
- Default to
ACTIVE
- Users
Excludeds []string - The list of user IDs that would be excluded when rules are processed
- expression
Type String - The expression type to use to invoke the rule. The default is
urn:okta:expression:1.0
. - expression
Value String - The expression value.
- group
Assignments List<String> - The list of group ids to assign the users to.
- name String
- The name of the Group Rule (min character 1; max characters 50).
- remove
Assigned BooleanUsers - Remove users added by this rule from the assigned group after deleting this resource. Default is
false
- status String
- Default to
ACTIVE
- users
Excludeds List<String> - The list of user IDs that would be excluded when rules are processed
- expression
Type string - The expression type to use to invoke the rule. The default is
urn:okta:expression:1.0
. - expression
Value string - The expression value.
- group
Assignments string[] - The list of group ids to assign the users to.
- name string
- The name of the Group Rule (min character 1; max characters 50).
- remove
Assigned booleanUsers - Remove users added by this rule from the assigned group after deleting this resource. Default is
false
- status string
- Default to
ACTIVE
- users
Excludeds string[] - The list of user IDs that would be excluded when rules are processed
- expression_
type str - The expression type to use to invoke the rule. The default is
urn:okta:expression:1.0
. - expression_
value str - The expression value.
- group_
assignments Sequence[str] - The list of group ids to assign the users to.
- name str
- The name of the Group Rule (min character 1; max characters 50).
- remove_
assigned_ boolusers - Remove users added by this rule from the assigned group after deleting this resource. Default is
false
- status str
- Default to
ACTIVE
- users_
excludeds Sequence[str] - The list of user IDs that would be excluded when rules are processed
- expression
Type String - The expression type to use to invoke the rule. The default is
urn:okta:expression:1.0
. - expression
Value String - The expression value.
- group
Assignments List<String> - The list of group ids to assign the users to.
- name String
- The name of the Group Rule (min character 1; max characters 50).
- remove
Assigned BooleanUsers - Remove users added by this rule from the assigned group after deleting this resource. Default is
false
- status String
- Default to
ACTIVE
- users
Excludeds List<String> - The list of user IDs that would be excluded when rules are processed
Import
$ pulumi import okta:group/rule:Rule example <group_rule_id>
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.