1. Packages
  2. Okta
  3. API Docs
  4. policy
  5. getDefaultPolicy
Okta v4.8.0 published on Saturday, Mar 2, 2024 by Pulumi

okta.policy.getDefaultPolicy

Explore with Pulumi AI

okta logo
Okta v4.8.0 published on Saturday, Mar 2, 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

    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 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
    	})
    }
    
    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());
    
        }
    }
    
    import pulumi
    import pulumi_okta as okta
    
    example = okta.policy.get_default_policy(type="PASSWORD")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    const example = okta.policy.getDefaultPolicy({
        type: "PASSWORD",
    });
    
    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
    Type of policy to retrieve. Valid values: OKTA_SIGN_ON, PASSWORD, MFA_ENROLL, IDP_DISCOVERY "IDP_DISCOVERY", "ACCESS_POLICY" (only available as a part of the Identity Engine), "PROFILE_ENROLLMENT" (only available as a part of the Identity Engine)
    Type string
    Type of policy to retrieve. Valid values: OKTA_SIGN_ON, PASSWORD, MFA_ENROLL, IDP_DISCOVERY "IDP_DISCOVERY", "ACCESS_POLICY" (only available as a part of the Identity Engine), "PROFILE_ENROLLMENT" (only available as a part of the Identity Engine)
    type String
    Type of policy to retrieve. Valid values: OKTA_SIGN_ON, PASSWORD, MFA_ENROLL, IDP_DISCOVERY "IDP_DISCOVERY", "ACCESS_POLICY" (only available as a part of the Identity Engine), "PROFILE_ENROLLMENT" (only available as a part of the Identity Engine)
    type string
    Type of policy to retrieve. Valid values: OKTA_SIGN_ON, PASSWORD, MFA_ENROLL, IDP_DISCOVERY "IDP_DISCOVERY", "ACCESS_POLICY" (only available as a part of the Identity Engine), "PROFILE_ENROLLMENT" (only available as a part of the Identity Engine)
    type str
    Type of policy to retrieve. Valid values: OKTA_SIGN_ON, PASSWORD, MFA_ENROLL, IDP_DISCOVERY "IDP_DISCOVERY", "ACCESS_POLICY" (only available as a part of the Identity Engine), "PROFILE_ENROLLMENT" (only available as a part of the Identity Engine)
    type String
    Type of policy to retrieve. Valid values: OKTA_SIGN_ON, PASSWORD, MFA_ENROLL, IDP_DISCOVERY "IDP_DISCOVERY", "ACCESS_POLICY" (only available as a part of the Identity Engine), "PROFILE_ENROLLMENT" (only available as a part of the Identity Engine)

    getDefaultPolicy Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Type string
    type of policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Type string
    type of policy.
    id String
    The provider-assigned unique ID for this managed resource.
    type String
    type of policy.
    id string
    The provider-assigned unique ID for this managed resource.
    type string
    type of policy.
    id str
    The provider-assigned unique ID for this managed resource.
    type str
    type of policy.
    id String
    The provider-assigned unique ID for this managed resource.
    type String
    type of policy.

    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.8.0 published on Saturday, Mar 2, 2024 by Pulumi