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

okta.PolicyProfileEnrollmentApps

Explore with Pulumi AI

Manages Profile Enrollment Policy Apps

WARNING: This feature is only available as a part of the Identity Engine. Contact support for further information. This resource allows you to manage the apps in the Profile Enrollment Policy. Important Notes:

  • Default Enrollment Policy can not be used in this resource since it is used as a policy to re-assign apps to when they are unassigned from this one.
  • When re-assigning the app to another policy, please use ‘depends_on’ in the policy to which the app will be assigned. This is necessary to avoid unexpected behavior, since if the app is unassigned from the policy it is just assigned to the ‘Default’ one.

Example Usage

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

const example = okta.policy.getPolicy({
    name: "My Policy",
    type: "PROFILE_ENROLLMENT",
});
const test = okta.app.getApp({
    label: "My App",
});
const examplePolicyProfileEnrollmentApps = new okta.PolicyProfileEnrollmentApps("example", {
    policyId: exampleOktaPolicy.id,
    apps: [id],
});
Copy
import pulumi
import pulumi_okta as okta

example = okta.policy.get_policy(name="My Policy",
    type="PROFILE_ENROLLMENT")
test = okta.app.get_app(label="My App")
example_policy_profile_enrollment_apps = okta.PolicyProfileEnrollmentApps("example",
    policy_id=example_okta_policy["id"],
    apps=[id])
Copy
package main

import (
	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta"
	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta/app"
	"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: "My Policy",
			Type: "PROFILE_ENROLLMENT",
		}, nil)
		if err != nil {
			return err
		}
		_, err = app.GetApp(ctx, &app.GetAppArgs{
			Label: pulumi.StringRef("My App"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = okta.NewPolicyProfileEnrollmentApps(ctx, "example", &okta.PolicyProfileEnrollmentAppsArgs{
			PolicyId: pulumi.Any(exampleOktaPolicy.Id),
			Apps: pulumi.StringArray{
				id,
			},
		})
		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 = Okta.Policy.GetPolicy.Invoke(new()
    {
        Name = "My Policy",
        Type = "PROFILE_ENROLLMENT",
    });

    var test = Okta.App.GetApp.Invoke(new()
    {
        Label = "My App",
    });

    var examplePolicyProfileEnrollmentApps = new Okta.PolicyProfileEnrollmentApps("example", new()
    {
        PolicyId = exampleOktaPolicy.Id,
        Apps = new[]
        {
            id,
        },
    });

});
Copy
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 com.pulumi.okta.app.AppFunctions;
import com.pulumi.okta.app.inputs.GetAppArgs;
import com.pulumi.okta.PolicyProfileEnrollmentApps;
import com.pulumi.okta.PolicyProfileEnrollmentAppsArgs;
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("My Policy")
            .type("PROFILE_ENROLLMENT")
            .build());

        final var test = AppFunctions.getApp(GetAppArgs.builder()
            .label("My App")
            .build());

        var examplePolicyProfileEnrollmentApps = new PolicyProfileEnrollmentApps("examplePolicyProfileEnrollmentApps", PolicyProfileEnrollmentAppsArgs.builder()
            .policyId(exampleOktaPolicy.id())
            .apps(id)
            .build());

    }
}
Copy
resources:
  examplePolicyProfileEnrollmentApps:
    type: okta:PolicyProfileEnrollmentApps
    name: example
    properties:
      policyId: ${exampleOktaPolicy.id}
      apps:
        - ${id}
variables:
  example:
    fn::invoke:
      function: okta:policy:getPolicy
      arguments:
        name: My Policy
        type: PROFILE_ENROLLMENT
  test:
    fn::invoke:
      function: okta:app:getApp
      arguments:
        label: My App
Copy

Create PolicyProfileEnrollmentApps Resource

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

Constructor syntax

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

@overload
def PolicyProfileEnrollmentApps(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                policy_id: Optional[str] = None,
                                apps: Optional[Sequence[str]] = None)
func NewPolicyProfileEnrollmentApps(ctx *Context, name string, args PolicyProfileEnrollmentAppsArgs, opts ...ResourceOption) (*PolicyProfileEnrollmentApps, error)
public PolicyProfileEnrollmentApps(string name, PolicyProfileEnrollmentAppsArgs args, CustomResourceOptions? opts = null)
public PolicyProfileEnrollmentApps(String name, PolicyProfileEnrollmentAppsArgs args)
public PolicyProfileEnrollmentApps(String name, PolicyProfileEnrollmentAppsArgs args, CustomResourceOptions options)
type: okta:PolicyProfileEnrollmentApps
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. PolicyProfileEnrollmentAppsArgs
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. PolicyProfileEnrollmentAppsArgs
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. PolicyProfileEnrollmentAppsArgs
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. PolicyProfileEnrollmentAppsArgs
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. PolicyProfileEnrollmentAppsArgs
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 policyProfileEnrollmentAppsResource = new Okta.PolicyProfileEnrollmentApps("policyProfileEnrollmentAppsResource", new()
{
    PolicyId = "string",
    Apps = new[]
    {
        "string",
    },
});
Copy
example, err := okta.NewPolicyProfileEnrollmentApps(ctx, "policyProfileEnrollmentAppsResource", &okta.PolicyProfileEnrollmentAppsArgs{
	PolicyId: pulumi.String("string"),
	Apps: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var policyProfileEnrollmentAppsResource = new PolicyProfileEnrollmentApps("policyProfileEnrollmentAppsResource", PolicyProfileEnrollmentAppsArgs.builder()
    .policyId("string")
    .apps("string")
    .build());
Copy
policy_profile_enrollment_apps_resource = okta.PolicyProfileEnrollmentApps("policyProfileEnrollmentAppsResource",
    policy_id="string",
    apps=["string"])
Copy
const policyProfileEnrollmentAppsResource = new okta.PolicyProfileEnrollmentApps("policyProfileEnrollmentAppsResource", {
    policyId: "string",
    apps: ["string"],
});
Copy
type: okta:PolicyProfileEnrollmentApps
properties:
    apps:
        - string
    policyId: string
Copy

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

PolicyId
This property is required.
Changes to this property will trigger replacement.
string
ID of the enrollment policy.
Apps List<string>
List of app IDs to be added to this policy
PolicyId
This property is required.
Changes to this property will trigger replacement.
string
ID of the enrollment policy.
Apps []string
List of app IDs to be added to this policy
policyId
This property is required.
Changes to this property will trigger replacement.
String
ID of the enrollment policy.
apps List<String>
List of app IDs to be added to this policy
policyId
This property is required.
Changes to this property will trigger replacement.
string
ID of the enrollment policy.
apps string[]
List of app IDs to be added to this policy
policy_id
This property is required.
Changes to this property will trigger replacement.
str
ID of the enrollment policy.
apps Sequence[str]
List of app IDs to be added to this policy
policyId
This property is required.
Changes to this property will trigger replacement.
String
ID of the enrollment policy.
apps List<String>
List of app IDs to be added to this policy

Outputs

All input properties are implicitly available as output properties. Additionally, the PolicyProfileEnrollmentApps resource produces the following output properties:

DefaultPolicyId string
ID of the Default Enrollment Policy. This policy is used as a policy to re-assign apps to when they are unassigned from this one
Id string
The provider-assigned unique ID for this managed resource.
DefaultPolicyId string
ID of the Default Enrollment Policy. This policy is used as a policy to re-assign apps to when they are unassigned from this one
Id string
The provider-assigned unique ID for this managed resource.
defaultPolicyId String
ID of the Default Enrollment Policy. This policy is used as a policy to re-assign apps to when they are unassigned from this one
id String
The provider-assigned unique ID for this managed resource.
defaultPolicyId string
ID of the Default Enrollment Policy. This policy is used as a policy to re-assign apps to when they are unassigned from this one
id string
The provider-assigned unique ID for this managed resource.
default_policy_id str
ID of the Default Enrollment Policy. This policy is used as a policy to re-assign apps to when they are unassigned from this one
id str
The provider-assigned unique ID for this managed resource.
defaultPolicyId String
ID of the Default Enrollment Policy. This policy is used as a policy to re-assign apps to when they are unassigned from this one
id String
The provider-assigned unique ID for this managed resource.

Look up Existing PolicyProfileEnrollmentApps Resource

Get an existing PolicyProfileEnrollmentApps 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?: PolicyProfileEnrollmentAppsState, opts?: CustomResourceOptions): PolicyProfileEnrollmentApps
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        apps: Optional[Sequence[str]] = None,
        default_policy_id: Optional[str] = None,
        policy_id: Optional[str] = None) -> PolicyProfileEnrollmentApps
func GetPolicyProfileEnrollmentApps(ctx *Context, name string, id IDInput, state *PolicyProfileEnrollmentAppsState, opts ...ResourceOption) (*PolicyProfileEnrollmentApps, error)
public static PolicyProfileEnrollmentApps Get(string name, Input<string> id, PolicyProfileEnrollmentAppsState? state, CustomResourceOptions? opts = null)
public static PolicyProfileEnrollmentApps get(String name, Output<String> id, PolicyProfileEnrollmentAppsState state, CustomResourceOptions options)
resources:  _:    type: okta:PolicyProfileEnrollmentApps    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:
Apps List<string>
List of app IDs to be added to this policy
DefaultPolicyId string
ID of the Default Enrollment Policy. This policy is used as a policy to re-assign apps to when they are unassigned from this one
PolicyId Changes to this property will trigger replacement. string
ID of the enrollment policy.
Apps []string
List of app IDs to be added to this policy
DefaultPolicyId string
ID of the Default Enrollment Policy. This policy is used as a policy to re-assign apps to when they are unassigned from this one
PolicyId Changes to this property will trigger replacement. string
ID of the enrollment policy.
apps List<String>
List of app IDs to be added to this policy
defaultPolicyId String
ID of the Default Enrollment Policy. This policy is used as a policy to re-assign apps to when they are unassigned from this one
policyId Changes to this property will trigger replacement. String
ID of the enrollment policy.
apps string[]
List of app IDs to be added to this policy
defaultPolicyId string
ID of the Default Enrollment Policy. This policy is used as a policy to re-assign apps to when they are unassigned from this one
policyId Changes to this property will trigger replacement. string
ID of the enrollment policy.
apps Sequence[str]
List of app IDs to be added to this policy
default_policy_id str
ID of the Default Enrollment Policy. This policy is used as a policy to re-assign apps to when they are unassigned from this one
policy_id Changes to this property will trigger replacement. str
ID of the enrollment policy.
apps List<String>
List of app IDs to be added to this policy
defaultPolicyId String
ID of the Default Enrollment Policy. This policy is used as a policy to re-assign apps to when they are unassigned from this one
policyId Changes to this property will trigger replacement. String
ID of the enrollment policy.

Import

$ pulumi import okta:index/policyProfileEnrollmentApps:PolicyProfileEnrollmentApps example <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.