published on Saturday, Mar 28, 2026 by Pulumi
published on Saturday, Mar 28, 2026 by Pulumi
Manages the Post Auth Session Policy Rule. The Post Auth Session Policy has exactly one modifiable rule (non-default). This resource allows you to configure that rule.
IMPORTANT: This resource cannot be created or deleted, only imported and updated. The Post Auth Session Policy rule is pre-provisioned by Okta. You must import the existing rule before managing it with Terraform.
Example Usage
{{tffile “examples/resources/okta_post_auth_session_policy_rule/resource.tf”}}
Lifecycle
- Create: Returns an error with the import command to use
- Update: Updates the rule configuration in Okta
- Delete: Removes the rule from Terraform state only (the rule remains in Okta)
Create PostAuthSessionPolicyRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PostAuthSessionPolicyRule(name: string, args: PostAuthSessionPolicyRuleArgs, opts?: CustomResourceOptions);@overload
def PostAuthSessionPolicyRule(resource_name: str,
args: PostAuthSessionPolicyRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PostAuthSessionPolicyRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
policy_id: Optional[str] = None,
groups_excludeds: Optional[Sequence[str]] = None,
groups_includeds: Optional[Sequence[str]] = None,
name: Optional[str] = None,
status: Optional[str] = None,
terminate_session: Optional[bool] = None,
users_excludeds: Optional[Sequence[str]] = None,
workflow_id: Optional[str] = None)func NewPostAuthSessionPolicyRule(ctx *Context, name string, args PostAuthSessionPolicyRuleArgs, opts ...ResourceOption) (*PostAuthSessionPolicyRule, error)public PostAuthSessionPolicyRule(string name, PostAuthSessionPolicyRuleArgs args, CustomResourceOptions? opts = null)
public PostAuthSessionPolicyRule(String name, PostAuthSessionPolicyRuleArgs args)
public PostAuthSessionPolicyRule(String name, PostAuthSessionPolicyRuleArgs args, CustomResourceOptions options)
type: okta:PostAuthSessionPolicyRule
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 PostAuthSessionPolicyRuleArgs
- 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 PostAuthSessionPolicyRuleArgs
- 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 PostAuthSessionPolicyRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PostAuthSessionPolicyRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PostAuthSessionPolicyRuleArgs
- 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 postAuthSessionPolicyRuleResource = new Okta.Index.PostAuthSessionPolicyRule("postAuthSessionPolicyRuleResource", new()
{
PolicyId = "string",
GroupsExcludeds = new[]
{
"string",
},
GroupsIncludeds = new[]
{
"string",
},
Name = "string",
Status = "string",
TerminateSession = false,
UsersExcludeds = new[]
{
"string",
},
WorkflowId = "string",
});
example, err := okta.NewPostAuthSessionPolicyRule(ctx, "postAuthSessionPolicyRuleResource", &okta.PostAuthSessionPolicyRuleArgs{
PolicyId: pulumi.String("string"),
GroupsExcludeds: pulumi.StringArray{
pulumi.String("string"),
},
GroupsIncludeds: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
Status: pulumi.String("string"),
TerminateSession: pulumi.Bool(false),
UsersExcludeds: pulumi.StringArray{
pulumi.String("string"),
},
WorkflowId: pulumi.String("string"),
})
var postAuthSessionPolicyRuleResource = new PostAuthSessionPolicyRule("postAuthSessionPolicyRuleResource", PostAuthSessionPolicyRuleArgs.builder()
.policyId("string")
.groupsExcludeds("string")
.groupsIncludeds("string")
.name("string")
.status("string")
.terminateSession(false)
.usersExcludeds("string")
.workflowId("string")
.build());
post_auth_session_policy_rule_resource = okta.PostAuthSessionPolicyRule("postAuthSessionPolicyRuleResource",
policy_id="string",
groups_excludeds=["string"],
groups_includeds=["string"],
name="string",
status="string",
terminate_session=False,
users_excludeds=["string"],
workflow_id="string")
const postAuthSessionPolicyRuleResource = new okta.PostAuthSessionPolicyRule("postAuthSessionPolicyRuleResource", {
policyId: "string",
groupsExcludeds: ["string"],
groupsIncludeds: ["string"],
name: "string",
status: "string",
terminateSession: false,
usersExcludeds: ["string"],
workflowId: "string",
});
type: okta:PostAuthSessionPolicyRule
properties:
groupsExcludeds:
- string
groupsIncludeds:
- string
name: string
policyId: string
status: string
terminateSession: false
usersExcludeds:
- string
workflowId: string
PostAuthSessionPolicyRule 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 PostAuthSessionPolicyRule resource accepts the following input properties:
- Policy
Id string - ID of the Post Auth Session Policy. Use the
okta.getPostAuthSessionPolicydata source to get this ID. - Groups
Excludeds List<string> - List of group IDs to exclude from this rule.
- Groups
Includeds List<string> - List of group IDs to include in this rule.
- Name string
- Name of the policy rule.
- Status string
- Status of the rule:
ACTIVEorINACTIVE. Default isACTIVE. - Terminate
Session bool - When true, terminates the user's session when a policy failure is detected. Default is
false. - Users
Excludeds List<string> - List of user IDs to exclude from this rule.
- Workflow
Id string - ID of the Okta Workflow to run when a policy failure is detected.
- Policy
Id string - ID of the Post Auth Session Policy. Use the
okta.getPostAuthSessionPolicydata source to get this ID. - Groups
Excludeds []string - List of group IDs to exclude from this rule.
- Groups
Includeds []string - List of group IDs to include in this rule.
- Name string
- Name of the policy rule.
- Status string
- Status of the rule:
ACTIVEorINACTIVE. Default isACTIVE. - Terminate
Session bool - When true, terminates the user's session when a policy failure is detected. Default is
false. - Users
Excludeds []string - List of user IDs to exclude from this rule.
- Workflow
Id string - ID of the Okta Workflow to run when a policy failure is detected.
- policy
Id String - ID of the Post Auth Session Policy. Use the
okta.getPostAuthSessionPolicydata source to get this ID. - groups
Excludeds List<String> - List of group IDs to exclude from this rule.
- groups
Includeds List<String> - List of group IDs to include in this rule.
- name String
- Name of the policy rule.
- status String
- Status of the rule:
ACTIVEorINACTIVE. Default isACTIVE. - terminate
Session Boolean - When true, terminates the user's session when a policy failure is detected. Default is
false. - users
Excludeds List<String> - List of user IDs to exclude from this rule.
- workflow
Id String - ID of the Okta Workflow to run when a policy failure is detected.
- policy
Id string - ID of the Post Auth Session Policy. Use the
okta.getPostAuthSessionPolicydata source to get this ID. - groups
Excludeds string[] - List of group IDs to exclude from this rule.
- groups
Includeds string[] - List of group IDs to include in this rule.
- name string
- Name of the policy rule.
- status string
- Status of the rule:
ACTIVEorINACTIVE. Default isACTIVE. - terminate
Session boolean - When true, terminates the user's session when a policy failure is detected. Default is
false. - users
Excludeds string[] - List of user IDs to exclude from this rule.
- workflow
Id string - ID of the Okta Workflow to run when a policy failure is detected.
- policy_
id str - ID of the Post Auth Session Policy. Use the
okta.getPostAuthSessionPolicydata source to get this ID. - groups_
excludeds Sequence[str] - List of group IDs to exclude from this rule.
- groups_
includeds Sequence[str] - List of group IDs to include in this rule.
- name str
- Name of the policy rule.
- status str
- Status of the rule:
ACTIVEorINACTIVE. Default isACTIVE. - terminate_
session bool - When true, terminates the user's session when a policy failure is detected. Default is
false. - users_
excludeds Sequence[str] - List of user IDs to exclude from this rule.
- workflow_
id str - ID of the Okta Workflow to run when a policy failure is detected.
- policy
Id String - ID of the Post Auth Session Policy. Use the
okta.getPostAuthSessionPolicydata source to get this ID. - groups
Excludeds List<String> - List of group IDs to exclude from this rule.
- groups
Includeds List<String> - List of group IDs to include in this rule.
- name String
- Name of the policy rule.
- status String
- Status of the rule:
ACTIVEorINACTIVE. Default isACTIVE. - terminate
Session Boolean - When true, terminates the user's session when a policy failure is detected. Default is
false. - users
Excludeds List<String> - List of user IDs to exclude from this rule.
- workflow
Id String - ID of the Okta Workflow to run when a policy failure is detected.
Outputs
All input properties are implicitly available as output properties. Additionally, the PostAuthSessionPolicyRule 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 PostAuthSessionPolicyRule Resource
Get an existing PostAuthSessionPolicyRule 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?: PostAuthSessionPolicyRuleState, opts?: CustomResourceOptions): PostAuthSessionPolicyRule@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
groups_excludeds: Optional[Sequence[str]] = None,
groups_includeds: Optional[Sequence[str]] = None,
name: Optional[str] = None,
policy_id: Optional[str] = None,
status: Optional[str] = None,
terminate_session: Optional[bool] = None,
users_excludeds: Optional[Sequence[str]] = None,
workflow_id: Optional[str] = None) -> PostAuthSessionPolicyRulefunc GetPostAuthSessionPolicyRule(ctx *Context, name string, id IDInput, state *PostAuthSessionPolicyRuleState, opts ...ResourceOption) (*PostAuthSessionPolicyRule, error)public static PostAuthSessionPolicyRule Get(string name, Input<string> id, PostAuthSessionPolicyRuleState? state, CustomResourceOptions? opts = null)public static PostAuthSessionPolicyRule get(String name, Output<String> id, PostAuthSessionPolicyRuleState state, CustomResourceOptions options)resources: _: type: okta:PostAuthSessionPolicyRule get: id: ${id}- 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.
- Groups
Excludeds List<string> - List of group IDs to exclude from this rule.
- Groups
Includeds List<string> - List of group IDs to include in this rule.
- Name string
- Name of the policy rule.
- Policy
Id string - ID of the Post Auth Session Policy. Use the
okta.getPostAuthSessionPolicydata source to get this ID. - Status string
- Status of the rule:
ACTIVEorINACTIVE. Default isACTIVE. - Terminate
Session bool - When true, terminates the user's session when a policy failure is detected. Default is
false. - Users
Excludeds List<string> - List of user IDs to exclude from this rule.
- Workflow
Id string - ID of the Okta Workflow to run when a policy failure is detected.
- Groups
Excludeds []string - List of group IDs to exclude from this rule.
- Groups
Includeds []string - List of group IDs to include in this rule.
- Name string
- Name of the policy rule.
- Policy
Id string - ID of the Post Auth Session Policy. Use the
okta.getPostAuthSessionPolicydata source to get this ID. - Status string
- Status of the rule:
ACTIVEorINACTIVE. Default isACTIVE. - Terminate
Session bool - When true, terminates the user's session when a policy failure is detected. Default is
false. - Users
Excludeds []string - List of user IDs to exclude from this rule.
- Workflow
Id string - ID of the Okta Workflow to run when a policy failure is detected.
- groups
Excludeds List<String> - List of group IDs to exclude from this rule.
- groups
Includeds List<String> - List of group IDs to include in this rule.
- name String
- Name of the policy rule.
- policy
Id String - ID of the Post Auth Session Policy. Use the
okta.getPostAuthSessionPolicydata source to get this ID. - status String
- Status of the rule:
ACTIVEorINACTIVE. Default isACTIVE. - terminate
Session Boolean - When true, terminates the user's session when a policy failure is detected. Default is
false. - users
Excludeds List<String> - List of user IDs to exclude from this rule.
- workflow
Id String - ID of the Okta Workflow to run when a policy failure is detected.
- groups
Excludeds string[] - List of group IDs to exclude from this rule.
- groups
Includeds string[] - List of group IDs to include in this rule.
- name string
- Name of the policy rule.
- policy
Id string - ID of the Post Auth Session Policy. Use the
okta.getPostAuthSessionPolicydata source to get this ID. - status string
- Status of the rule:
ACTIVEorINACTIVE. Default isACTIVE. - terminate
Session boolean - When true, terminates the user's session when a policy failure is detected. Default is
false. - users
Excludeds string[] - List of user IDs to exclude from this rule.
- workflow
Id string - ID of the Okta Workflow to run when a policy failure is detected.
- groups_
excludeds Sequence[str] - List of group IDs to exclude from this rule.
- groups_
includeds Sequence[str] - List of group IDs to include in this rule.
- name str
- Name of the policy rule.
- policy_
id str - ID of the Post Auth Session Policy. Use the
okta.getPostAuthSessionPolicydata source to get this ID. - status str
- Status of the rule:
ACTIVEorINACTIVE. Default isACTIVE. - terminate_
session bool - When true, terminates the user's session when a policy failure is detected. Default is
false. - users_
excludeds Sequence[str] - List of user IDs to exclude from this rule.
- workflow_
id str - ID of the Okta Workflow to run when a policy failure is detected.
- groups
Excludeds List<String> - List of group IDs to exclude from this rule.
- groups
Includeds List<String> - List of group IDs to include in this rule.
- name String
- Name of the policy rule.
- policy
Id String - ID of the Post Auth Session Policy. Use the
okta.getPostAuthSessionPolicydata source to get this ID. - status String
- Status of the rule:
ACTIVEorINACTIVE. Default isACTIVE. - terminate
Session Boolean - When true, terminates the user's session when a policy failure is detected. Default is
false. - users
Excludeds List<String> - List of user IDs to exclude from this rule.
- workflow
Id String - ID of the Okta Workflow to run when a policy failure is detected.
Import
Before using this resource, you must import the existing rule:
{{codefile “shell” “examples/resources/okta_post_auth_session_policy_rule/import.sh”}}
When you run pulumi up without importing first, the error message will include the exact import command with the correct policy and rule IDs.
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
oktaTerraform Provider.
published on Saturday, Mar 28, 2026 by Pulumi
