1. Packages
  2. Okta Provider
  3. API Docs
  4. user
  5. Risk
Viewing docs for Okta v6.5.0
published on Tuesday, Apr 21, 2026 by Pulumi
okta logo
Viewing docs for Okta v6.5.0
published on Tuesday, Apr 21, 2026 by Pulumi

    Manages a user’s risk level in Okta. This resource allows you to set and manage the risk level for a specific user.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    const example = new okta.user.Risk("example", {
        userId: exampleOktaUser.id,
        riskLevel: "HIGH",
    });
    
    import pulumi
    import pulumi_okta as okta
    
    example = okta.user.Risk("example",
        user_id=example_okta_user["id"],
        risk_level="HIGH")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-okta/sdk/v6/go/okta/user"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := user.NewRisk(ctx, "example", &user.RiskArgs{
    			UserId:    pulumi.Any(exampleOktaUser.Id),
    			RiskLevel: pulumi.String("HIGH"),
    		})
    		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.User.Risk("example", new()
        {
            UserId = exampleOktaUser.Id,
            RiskLevel = "HIGH",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.okta.user.Risk;
    import com.pulumi.okta.user.RiskArgs;
    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 Risk("example", RiskArgs.builder()
                .userId(exampleOktaUser.id())
                .riskLevel("HIGH")
                .build());
    
        }
    }
    
    resources:
      example:
        type: okta:user:Risk
        properties:
          userId: ${exampleOktaUser.id}
          riskLevel: HIGH
    

    Create Risk Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Risk(name: string, args: RiskArgs, opts?: CustomResourceOptions);
    @overload
    def Risk(resource_name: str,
             args: RiskArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Risk(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             risk_level: Optional[str] = None,
             user_id: Optional[str] = None)
    func NewRisk(ctx *Context, name string, args RiskArgs, opts ...ResourceOption) (*Risk, error)
    public Risk(string name, RiskArgs args, CustomResourceOptions? opts = null)
    public Risk(String name, RiskArgs args)
    public Risk(String name, RiskArgs args, CustomResourceOptions options)
    
    type: okta:user:Risk
    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 RiskArgs
    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 RiskArgs
    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 RiskArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RiskArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RiskArgs
    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 riskResource = new Okta.User.Risk("riskResource", new()
    {
        RiskLevel = "string",
        UserId = "string",
    });
    
    example, err := user.NewRisk(ctx, "riskResource", &user.RiskArgs{
    	RiskLevel: pulumi.String("string"),
    	UserId:    pulumi.String("string"),
    })
    
    var riskResource = new Risk("riskResource", RiskArgs.builder()
        .riskLevel("string")
        .userId("string")
        .build());
    
    risk_resource = okta.user.Risk("riskResource",
        risk_level="string",
        user_id="string")
    
    const riskResource = new okta.user.Risk("riskResource", {
        riskLevel: "string",
        userId: "string",
    });
    
    type: okta:user:Risk
    properties:
        riskLevel: string
        userId: string
    

    Risk 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 Risk resource accepts the following input properties:

    RiskLevel string
    Risk level of the user. Valid values: HIGH, LOW.
    UserId string
    ID of the user.
    RiskLevel string
    Risk level of the user. Valid values: HIGH, LOW.
    UserId string
    ID of the user.
    riskLevel String
    Risk level of the user. Valid values: HIGH, LOW.
    userId String
    ID of the user.
    riskLevel string
    Risk level of the user. Valid values: HIGH, LOW.
    userId string
    ID of the user.
    risk_level str
    Risk level of the user. Valid values: HIGH, LOW.
    user_id str
    ID of the user.
    riskLevel String
    Risk level of the user. Valid values: HIGH, LOW.
    userId String
    ID of the user.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Risk 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 Risk Resource

    Get an existing Risk 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?: RiskState, opts?: CustomResourceOptions): Risk
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            risk_level: Optional[str] = None,
            user_id: Optional[str] = None) -> Risk
    func GetRisk(ctx *Context, name string, id IDInput, state *RiskState, opts ...ResourceOption) (*Risk, error)
    public static Risk Get(string name, Input<string> id, RiskState? state, CustomResourceOptions? opts = null)
    public static Risk get(String name, Output<String> id, RiskState state, CustomResourceOptions options)
    resources:  _:    type: okta:user:Risk    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.
    The following state arguments are supported:
    RiskLevel string
    Risk level of the user. Valid values: HIGH, LOW.
    UserId string
    ID of the user.
    RiskLevel string
    Risk level of the user. Valid values: HIGH, LOW.
    UserId string
    ID of the user.
    riskLevel String
    Risk level of the user. Valid values: HIGH, LOW.
    userId String
    ID of the user.
    riskLevel string
    Risk level of the user. Valid values: HIGH, LOW.
    userId string
    ID of the user.
    risk_level str
    Risk level of the user. Valid values: HIGH, LOW.
    user_id str
    ID of the user.
    riskLevel String
    Risk level of the user. Valid values: HIGH, LOW.
    userId String
    ID of the user.

    Import

    $ pulumi import okta:user/risk:Risk example <user_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.
    okta logo
    Viewing docs for Okta v6.5.0
    published on Tuesday, Apr 21, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.