Okta

Pulumi Official
Package maintained by Pulumi
v3.14.0 published on Thursday, Aug 4, 2022 by Pulumi

getPolicy

Use this data source to retrieve a policy from Okta.

Example Usage

using Pulumi;
using Okta = Pulumi.Okta;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Okta.Policy.GetPolicy.InvokeAsync(new Okta.Policy.GetPolicyArgs
        {
            Name = "Password Policy Example",
            Type = "PASSWORD",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-okta/sdk/v3/go/okta/policy"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := policy.GetPolicy(ctx, &policy.GetPolicyArgs{
			Name: "Password Policy Example",
			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.GetPolicyArgs;
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.getPolicy(GetPolicyArgs.builder()
            .name("Password Policy Example")
            .type("PASSWORD")
            .build());

    }
}
import pulumi
import pulumi_okta as okta

example = okta.policy.get_policy(name="Password Policy Example",
    type="PASSWORD")
import * as pulumi from "@pulumi/pulumi";
import * as okta from "@pulumi/okta";

const example = pulumi.output(okta.policy.getPolicy({
    name: "Password Policy Example",
    type: "PASSWORD",
}));
variables:
  example:
    Fn::Invoke:
      Function: okta:policy:getPolicy
      Arguments:
        name: Password Policy Example
        type: PASSWORD

Using getPolicy

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 getPolicy(args: GetPolicyArgs, opts?: InvokeOptions): Promise<GetPolicyResult>
function getPolicyOutput(args: GetPolicyOutputArgs, opts?: InvokeOptions): Output<GetPolicyResult>
def get_policy(name: Optional[str] = None,
               type: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetPolicyResult
def get_policy_output(name: Optional[pulumi.Input[str]] = None,
               type: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetPolicyResult]
func GetPolicy(ctx *Context, args *GetPolicyArgs, opts ...InvokeOption) (*GetPolicyResult, error)
func GetPolicyOutput(ctx *Context, args *GetPolicyOutputArgs, opts ...InvokeOption) GetPolicyResultOutput

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

public static class GetPolicy 
{
    public static Task<GetPolicyResult> InvokeAsync(GetPolicyArgs args, InvokeOptions? opts = null)
    public static Output<GetPolicyResult> Invoke(GetPolicyInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPolicyResult> getPolicy(GetPolicyArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: okta:policy/getPolicy:getPolicy
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Name string

Name of policy to retrieve.

Type string

Type of policy to retrieve. Valid values: "OKTA_SIGN_ON", "PASSWORD", "MFA_ENROLL", "IDP_DISCOVERY", "ACCESS_POLICY" (only available as a part of the Identity Engine), "PROFILE_ENROLLMENT" (only available as a part of the Identity Engine)

Name string

Name of policy to retrieve.

Type string

Type of policy to retrieve. Valid values: "OKTA_SIGN_ON", "PASSWORD", "MFA_ENROLL", "IDP_DISCOVERY", "ACCESS_POLICY" (only available as a part of the Identity Engine), "PROFILE_ENROLLMENT" (only available as a part of the Identity Engine)

name String

Name of policy to retrieve.

type String

Type of policy to retrieve. Valid values: "OKTA_SIGN_ON", "PASSWORD", "MFA_ENROLL", "IDP_DISCOVERY", "ACCESS_POLICY" (only available as a part of the Identity Engine), "PROFILE_ENROLLMENT" (only available as a part of the Identity Engine)

name string

Name of policy to retrieve.

type string

Type of policy to retrieve. Valid values: "OKTA_SIGN_ON", "PASSWORD", "MFA_ENROLL", "IDP_DISCOVERY", "ACCESS_POLICY" (only available as a part of the Identity Engine), "PROFILE_ENROLLMENT" (only available as a part of the Identity Engine)

name str

Name of policy to retrieve.

type str

Type of policy to retrieve. Valid values: "OKTA_SIGN_ON", "PASSWORD", "MFA_ENROLL", "IDP_DISCOVERY", "ACCESS_POLICY" (only available as a part of the Identity Engine), "PROFILE_ENROLLMENT" (only available as a part of the Identity Engine)

name String

Name of policy to retrieve.

type String

Type of policy to retrieve. Valid values: "OKTA_SIGN_ON", "PASSWORD", "MFA_ENROLL", "IDP_DISCOVERY", "ACCESS_POLICY" (only available as a part of the Identity Engine), "PROFILE_ENROLLMENT" (only available as a part of the Identity Engine)

getPolicy Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Name string

name of policy.

Status string
Type string

type of policy.

Id string

The provider-assigned unique ID for this managed resource.

Name string

name of policy.

Status string
Type string

type of policy.

id String

The provider-assigned unique ID for this managed resource.

name String

name of policy.

status String
type String

type of policy.

id string

The provider-assigned unique ID for this managed resource.

name string

name of policy.

status string
type string

type of policy.

id str

The provider-assigned unique ID for this managed resource.

name str

name of policy.

status str
type str

type of policy.

id String

The provider-assigned unique ID for this managed resource.

name String

name of policy.

status String
type String

type of policy.

Package Details

Repository
https://github.com/pulumi/pulumi-okta
License
Apache-2.0
Notes

This Pulumi package is based on the okta Terraform Provider.