1. Packages
  2. Okta Provider
  3. API Docs
  4. auth
  5. ServerPolicy
Okta v4.16.0 published on Wednesday, Apr 9, 2025 by Pulumi

okta.auth.ServerPolicy

Explore with Pulumi AI

Creates an Authorization Server Policy. This resource allows you to create and configure an Authorization Server Policy.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as okta from "@pulumi/okta";

const example = new okta.auth.ServerPolicy("example", {
    authServerId: "<auth server id>",
    status: "ACTIVE",
    name: "example",
    description: "example",
    priority: 1,
    clientWhitelists: ["ALL_CLIENTS"],
});
Copy
import pulumi
import pulumi_okta as okta

example = okta.auth.ServerPolicy("example",
    auth_server_id="<auth server id>",
    status="ACTIVE",
    name="example",
    description="example",
    priority=1,
    client_whitelists=["ALL_CLIENTS"])
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := auth.NewServerPolicy(ctx, "example", &auth.ServerPolicyArgs{
			AuthServerId: pulumi.String("<auth server id>"),
			Status:       pulumi.String("ACTIVE"),
			Name:         pulumi.String("example"),
			Description:  pulumi.String("example"),
			Priority:     pulumi.Int(1),
			ClientWhitelists: pulumi.StringArray{
				pulumi.String("ALL_CLIENTS"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Okta = Pulumi.Okta;

return await Deployment.RunAsync(() => 
{
    var example = new Okta.Auth.ServerPolicy("example", new()
    {
        AuthServerId = "<auth server id>",
        Status = "ACTIVE",
        Name = "example",
        Description = "example",
        Priority = 1,
        ClientWhitelists = new[]
        {
            "ALL_CLIENTS",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.okta.auth.ServerPolicy;
import com.pulumi.okta.auth.ServerPolicyArgs;
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 ServerPolicy("example", ServerPolicyArgs.builder()
            .authServerId("<auth server id>")
            .status("ACTIVE")
            .name("example")
            .description("example")
            .priority(1)
            .clientWhitelists("ALL_CLIENTS")
            .build());

    }
}
Copy
resources:
  example:
    type: okta:auth:ServerPolicy
    properties:
      authServerId: <auth server id>
      status: ACTIVE
      name: example
      description: example
      priority: 1
      clientWhitelists:
        - ALL_CLIENTS
Copy

Create ServerPolicy Resource

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

Constructor syntax

new ServerPolicy(name: string, args: ServerPolicyArgs, opts?: CustomResourceOptions);
@overload
def ServerPolicy(resource_name: str,
                 args: ServerPolicyArgs,
                 opts: Optional[ResourceOptions] = None)

@overload
def ServerPolicy(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 auth_server_id: Optional[str] = None,
                 client_whitelists: Optional[Sequence[str]] = None,
                 description: Optional[str] = None,
                 priority: Optional[int] = None,
                 name: Optional[str] = None,
                 status: Optional[str] = None)
func NewServerPolicy(ctx *Context, name string, args ServerPolicyArgs, opts ...ResourceOption) (*ServerPolicy, error)
public ServerPolicy(string name, ServerPolicyArgs args, CustomResourceOptions? opts = null)
public ServerPolicy(String name, ServerPolicyArgs args)
public ServerPolicy(String name, ServerPolicyArgs args, CustomResourceOptions options)
type: okta:auth:ServerPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ServerPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ServerPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ServerPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ServerPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ServerPolicyArgs
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 serverPolicyResource = new Okta.Auth.ServerPolicy("serverPolicyResource", new()
{
    AuthServerId = "string",
    ClientWhitelists = new[]
    {
        "string",
    },
    Description = "string",
    Priority = 0,
    Name = "string",
    Status = "string",
});
Copy
example, err := auth.NewServerPolicy(ctx, "serverPolicyResource", &auth.ServerPolicyArgs{
	AuthServerId: pulumi.String("string"),
	ClientWhitelists: pulumi.StringArray{
		pulumi.String("string"),
	},
	Description: pulumi.String("string"),
	Priority:    pulumi.Int(0),
	Name:        pulumi.String("string"),
	Status:      pulumi.String("string"),
})
Copy
var serverPolicyResource = new ServerPolicy("serverPolicyResource", ServerPolicyArgs.builder()
    .authServerId("string")
    .clientWhitelists("string")
    .description("string")
    .priority(0)
    .name("string")
    .status("string")
    .build());
Copy
server_policy_resource = okta.auth.ServerPolicy("serverPolicyResource",
    auth_server_id="string",
    client_whitelists=["string"],
    description="string",
    priority=0,
    name="string",
    status="string")
Copy
const serverPolicyResource = new okta.auth.ServerPolicy("serverPolicyResource", {
    authServerId: "string",
    clientWhitelists: ["string"],
    description: "string",
    priority: 0,
    name: "string",
    status: "string",
});
Copy
type: okta:auth:ServerPolicy
properties:
    authServerId: string
    clientWhitelists:
        - string
    description: string
    name: string
    priority: 0
    status: string
Copy

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

AuthServerId This property is required. string
The ID of the Auth Server.
ClientWhitelists This property is required. List<string>
The clients to whitelist the policy for. [ALL_CLIENTS] is a special value that can be used to whitelist all clients, otherwise it is a list of client ids.
Description This property is required. string
The description of the Auth Server Policy.
Priority This property is required. int
Priority of the auth server policy
Name string
The name of the Auth Server Policy.
Status string
Default to ACTIVE
AuthServerId This property is required. string
The ID of the Auth Server.
ClientWhitelists This property is required. []string
The clients to whitelist the policy for. [ALL_CLIENTS] is a special value that can be used to whitelist all clients, otherwise it is a list of client ids.
Description This property is required. string
The description of the Auth Server Policy.
Priority This property is required. int
Priority of the auth server policy
Name string
The name of the Auth Server Policy.
Status string
Default to ACTIVE
authServerId This property is required. String
The ID of the Auth Server.
clientWhitelists This property is required. List<String>
The clients to whitelist the policy for. [ALL_CLIENTS] is a special value that can be used to whitelist all clients, otherwise it is a list of client ids.
description This property is required. String
The description of the Auth Server Policy.
priority This property is required. Integer
Priority of the auth server policy
name String
The name of the Auth Server Policy.
status String
Default to ACTIVE
authServerId This property is required. string
The ID of the Auth Server.
clientWhitelists This property is required. string[]
The clients to whitelist the policy for. [ALL_CLIENTS] is a special value that can be used to whitelist all clients, otherwise it is a list of client ids.
description This property is required. string
The description of the Auth Server Policy.
priority This property is required. number
Priority of the auth server policy
name string
The name of the Auth Server Policy.
status string
Default to ACTIVE
auth_server_id This property is required. str
The ID of the Auth Server.
client_whitelists This property is required. Sequence[str]
The clients to whitelist the policy for. [ALL_CLIENTS] is a special value that can be used to whitelist all clients, otherwise it is a list of client ids.
description This property is required. str
The description of the Auth Server Policy.
priority This property is required. int
Priority of the auth server policy
name str
The name of the Auth Server Policy.
status str
Default to ACTIVE
authServerId This property is required. String
The ID of the Auth Server.
clientWhitelists This property is required. List<String>
The clients to whitelist the policy for. [ALL_CLIENTS] is a special value that can be used to whitelist all clients, otherwise it is a list of client ids.
description This property is required. String
The description of the Auth Server Policy.
priority This property is required. Number
Priority of the auth server policy
name String
The name of the Auth Server Policy.
status String
Default to ACTIVE

Outputs

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

Get an existing ServerPolicy 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?: ServerPolicyState, opts?: CustomResourceOptions): ServerPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        auth_server_id: Optional[str] = None,
        client_whitelists: Optional[Sequence[str]] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        priority: Optional[int] = None,
        status: Optional[str] = None) -> ServerPolicy
func GetServerPolicy(ctx *Context, name string, id IDInput, state *ServerPolicyState, opts ...ResourceOption) (*ServerPolicy, error)
public static ServerPolicy Get(string name, Input<string> id, ServerPolicyState? state, CustomResourceOptions? opts = null)
public static ServerPolicy get(String name, Output<String> id, ServerPolicyState state, CustomResourceOptions options)
resources:  _:    type: okta:auth:ServerPolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
AuthServerId string
The ID of the Auth Server.
ClientWhitelists List<string>
The clients to whitelist the policy for. [ALL_CLIENTS] is a special value that can be used to whitelist all clients, otherwise it is a list of client ids.
Description string
The description of the Auth Server Policy.
Name string
The name of the Auth Server Policy.
Priority int
Priority of the auth server policy
Status string
Default to ACTIVE
AuthServerId string
The ID of the Auth Server.
ClientWhitelists []string
The clients to whitelist the policy for. [ALL_CLIENTS] is a special value that can be used to whitelist all clients, otherwise it is a list of client ids.
Description string
The description of the Auth Server Policy.
Name string
The name of the Auth Server Policy.
Priority int
Priority of the auth server policy
Status string
Default to ACTIVE
authServerId String
The ID of the Auth Server.
clientWhitelists List<String>
The clients to whitelist the policy for. [ALL_CLIENTS] is a special value that can be used to whitelist all clients, otherwise it is a list of client ids.
description String
The description of the Auth Server Policy.
name String
The name of the Auth Server Policy.
priority Integer
Priority of the auth server policy
status String
Default to ACTIVE
authServerId string
The ID of the Auth Server.
clientWhitelists string[]
The clients to whitelist the policy for. [ALL_CLIENTS] is a special value that can be used to whitelist all clients, otherwise it is a list of client ids.
description string
The description of the Auth Server Policy.
name string
The name of the Auth Server Policy.
priority number
Priority of the auth server policy
status string
Default to ACTIVE
auth_server_id str
The ID of the Auth Server.
client_whitelists Sequence[str]
The clients to whitelist the policy for. [ALL_CLIENTS] is a special value that can be used to whitelist all clients, otherwise it is a list of client ids.
description str
The description of the Auth Server Policy.
name str
The name of the Auth Server Policy.
priority int
Priority of the auth server policy
status str
Default to ACTIVE
authServerId String
The ID of the Auth Server.
clientWhitelists List<String>
The clients to whitelist the policy for. [ALL_CLIENTS] is a special value that can be used to whitelist all clients, otherwise it is a list of client ids.
description String
The description of the Auth Server Policy.
name String
The name of the Auth Server Policy.
priority Number
Priority of the auth server policy
status String
Default to ACTIVE

Import

$ pulumi import okta:auth/serverPolicy:ServerPolicy example <auth_server_id>/<policy_id>
Copy

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.