1. Packages
  2. Okta
  3. API Docs
  4. policy
  5. getDefaultPolicy
Okta v4.11.0 published on Tuesday, Sep 17, 2024 by Pulumi

okta.policy.getDefaultPolicy

Explore with Pulumi AI

okta logo
Okta v4.11.0 published on Tuesday, Sep 17, 2024 by Pulumi

    Use this data source to retrieve a default policy from Okta. This same thing can be achieved using the okta.policy.getPolicy with default names, this is simply a shortcut.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    const example = okta.policy.getDefaultPolicy({
        type: "PASSWORD",
    });
    
    import pulumi
    import pulumi_okta as okta
    
    example = okta.policy.get_default_policy(type="PASSWORD")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta/policy"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := policy.GetDefaultPolicy(ctx, &policy.GetDefaultPolicyArgs{
    			Type: "PASSWORD",
    		}, nil)
    		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 = Okta.Policy.GetDefaultPolicy.Invoke(new()
        {
            Type = "PASSWORD",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.okta.policy.PolicyFunctions;
    import com.pulumi.okta.policy.inputs.GetDefaultPolicyArgs;
    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) {
            final var example = PolicyFunctions.getDefaultPolicy(GetDefaultPolicyArgs.builder()
                .type("PASSWORD")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: okta:policy:getDefaultPolicy
          Arguments:
            type: PASSWORD
    

    Using getDefaultPolicy

    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 getDefaultPolicy(args: GetDefaultPolicyArgs, opts?: InvokeOptions): Promise<GetDefaultPolicyResult>
    function getDefaultPolicyOutput(args: GetDefaultPolicyOutputArgs, opts?: InvokeOptions): Output<GetDefaultPolicyResult>
    def get_default_policy(type: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetDefaultPolicyResult
    def get_default_policy_output(type: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetDefaultPolicyResult]
    func GetDefaultPolicy(ctx *Context, args *GetDefaultPolicyArgs, opts ...InvokeOption) (*GetDefaultPolicyResult, error)
    func GetDefaultPolicyOutput(ctx *Context, args *GetDefaultPolicyOutputArgs, opts ...InvokeOption) GetDefaultPolicyResultOutput

    > Note: This function is named GetDefaultPolicy in the Go SDK.

    public static class GetDefaultPolicy 
    {
        public static Task<GetDefaultPolicyResult> InvokeAsync(GetDefaultPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetDefaultPolicyResult> Invoke(GetDefaultPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDefaultPolicyResult> getDefaultPolicy(GetDefaultPolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: okta:policy/getDefaultPolicy:getDefaultPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Type string
    Policy type: OKTASIGNON, PASSWORD, MFAENROLL, or IDPDISCOVERY
    Type string
    Policy type: OKTASIGNON, PASSWORD, MFAENROLL, or IDPDISCOVERY
    type String
    Policy type: OKTASIGNON, PASSWORD, MFAENROLL, or IDPDISCOVERY
    type string
    Policy type: OKTASIGNON, PASSWORD, MFAENROLL, or IDPDISCOVERY
    type str
    Policy type: OKTASIGNON, PASSWORD, MFAENROLL, or IDPDISCOVERY
    type String
    Policy type: OKTASIGNON, PASSWORD, MFAENROLL, or IDPDISCOVERY

    getDefaultPolicy Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Type string
    Policy type: OKTASIGNON, PASSWORD, MFAENROLL, or IDPDISCOVERY
    Id string
    The provider-assigned unique ID for this managed resource.
    Type string
    Policy type: OKTASIGNON, PASSWORD, MFAENROLL, or IDPDISCOVERY
    id String
    The provider-assigned unique ID for this managed resource.
    type String
    Policy type: OKTASIGNON, PASSWORD, MFAENROLL, or IDPDISCOVERY
    id string
    The provider-assigned unique ID for this managed resource.
    type string
    Policy type: OKTASIGNON, PASSWORD, MFAENROLL, or IDPDISCOVERY
    id str
    The provider-assigned unique ID for this managed resource.
    type str
    Policy type: OKTASIGNON, PASSWORD, MFAENROLL, or IDPDISCOVERY
    id String
    The provider-assigned unique ID for this managed resource.
    type String
    Policy type: OKTASIGNON, PASSWORD, MFAENROLL, or IDPDISCOVERY

    Package Details

    Repository
    Okta pulumi/pulumi-okta
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the okta Terraform Provider.
    okta logo
    Okta v4.11.0 published on Tuesday, Sep 17, 2024 by Pulumi