Okta v4.9.2 published on Tuesday, Jun 25, 2024 by Pulumi
okta.policy.getPolicy
Explore with Pulumi AI
Get a policy from Okta.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as okta from "@pulumi/okta";
const example = okta.policy.getPolicy({
name: "Password Policy Example",
type: "PASSWORD",
});
import pulumi
import pulumi_okta as okta
example = okta.policy.get_policy(name="Password Policy Example",
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.GetPolicy(ctx, &policy.GetPolicyArgs{
Name: "Password Policy Example",
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.GetPolicy.Invoke(new()
{
Name = "Password Policy Example",
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.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());
}
}
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:
getPolicy Result
The following output properties are available:
Package Details
- Repository
- Okta pulumi/pulumi-okta
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
okta
Terraform Provider.