1. Packages
  2. Okta
  3. API Docs
  4. PolicyProfileEnrollmentApps
Okta v4.8.1 published on Thursday, Apr 18, 2024 by Pulumi

okta.PolicyProfileEnrollmentApps

Explore with Pulumi AI

okta logo
Okta v4.8.1 published on Thursday, Apr 18, 2024 by Pulumi

    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 examplePolicy = okta.policy.getPolicy({
        name: "My Policy",
        type: "PROFILE_ENROLLMENT",
    });
    const test = okta.app.getApp({
        label: "My App",
    });
    const examplePolicyProfileEnrollmentApps = new okta.PolicyProfileEnrollmentApps("examplePolicyProfileEnrollmentApps", {
        policyId: okta_policy.example.id,
        apps: [data.okta_app.id],
    });
    
    import pulumi
    import pulumi_okta as okta
    
    example_policy = 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("examplePolicyProfileEnrollmentApps",
        policy_id=okta_policy["example"]["id"],
        apps=[data["okta_app"]["id"]])
    
    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, "examplePolicyProfileEnrollmentApps", &okta.PolicyProfileEnrollmentAppsArgs{
    			PolicyId: pulumi.Any(okta_policy.Example.Id),
    			Apps: pulumi.StringArray{
    				data.Okta_app.Id,
    			},
    		})
    		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 examplePolicy = 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("examplePolicyProfileEnrollmentApps", new()
        {
            PolicyId = okta_policy.Example.Id,
            Apps = new[]
            {
                data.Okta_app.Id,
            },
        });
    
    });
    
    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 examplePolicy = 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(okta_policy.example().id())
                .apps(data.okta_app().id())
                .build());
    
        }
    }
    
    resources:
      examplePolicyProfileEnrollmentApps:
        type: okta:PolicyProfileEnrollmentApps
        properties:
          policyId: ${okta_policy.example.id}
          apps:
            - ${data.okta_app.id}
    variables:
      examplePolicy:
        fn::invoke:
          Function: okta:policy:getPolicy
          Arguments:
            name: My Policy
            type: PROFILE_ENROLLMENT
      test:
        fn::invoke:
          Function: okta:app:getApp
          Arguments:
            label: My App
    

    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 string
    The unique name of the resource.
    args PolicyProfileEnrollmentAppsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args PolicyProfileEnrollmentAppsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PolicyProfileEnrollmentAppsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PolicyProfileEnrollmentAppsArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var policyProfileEnrollmentAppsResource = new Okta.PolicyProfileEnrollmentApps("policyProfileEnrollmentAppsResource", new()
    {
        PolicyId = "string",
        Apps = new[]
        {
            "string",
        },
    });
    
    example, err := okta.NewPolicyProfileEnrollmentApps(ctx, "policyProfileEnrollmentAppsResource", &okta.PolicyProfileEnrollmentAppsArgs{
    	PolicyId: pulumi.String("string"),
    	Apps: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var policyProfileEnrollmentAppsResource = new PolicyProfileEnrollmentApps("policyProfileEnrollmentAppsResource", PolicyProfileEnrollmentAppsArgs.builder()        
        .policyId("string")
        .apps("string")
        .build());
    
    policy_profile_enrollment_apps_resource = okta.PolicyProfileEnrollmentApps("policyProfileEnrollmentAppsResource",
        policy_id="string",
        apps=["string"])
    
    const policyProfileEnrollmentAppsResource = new okta.PolicyProfileEnrollmentApps("policyProfileEnrollmentAppsResource", {
        policyId: "string",
        apps: ["string"],
    });
    
    type: okta:PolicyProfileEnrollmentApps
    properties:
        apps:
            - string
        policyId: string
    

    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

    The PolicyProfileEnrollmentApps resource accepts the following input properties:

    PolicyId string
    ID of the enrollment policy.
    Apps List<string>
    List of app IDs to be added to this policy.
    PolicyId string
    ID of the enrollment policy.
    Apps []string
    List of app IDs to be added to this policy.
    policyId String
    ID of the enrollment policy.
    apps List<String>
    List of app IDs to be added to this policy.
    policyId string
    ID of the enrollment policy.
    apps string[]
    List of app IDs to be added to this policy.
    policy_id str
    ID of the enrollment policy.
    apps Sequence[str]
    List of app IDs to be added to this policy.
    policyId 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.
    Id string
    The provider-assigned unique ID for this managed resource.
    DefaultPolicyId string
    ID of the default enrollment policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    defaultPolicyId String
    ID of the default enrollment policy.
    id String
    The provider-assigned unique ID for this managed resource.
    defaultPolicyId string
    ID of the default enrollment policy.
    id string
    The provider-assigned unique ID for this managed resource.
    default_policy_id str
    ID of the default enrollment policy.
    id str
    The provider-assigned unique ID for this managed resource.
    defaultPolicyId String
    ID of the default enrollment policy.
    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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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.
    PolicyId 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.
    PolicyId 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.
    policyId 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.
    policyId 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.
    policy_id 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.
    policyId String
    ID of the enrollment policy.

    Import

    A Profile Enrollment Policy Apps can be imported via the Okta ID.

    $ pulumi import okta:index/policyProfileEnrollmentApps:PolicyProfileEnrollmentApps example &#60;policy id&#62;
    

    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.
    okta logo
    Okta v4.8.1 published on Thursday, Apr 18, 2024 by Pulumi