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

okta.AppGroupAssignments

Explore with Pulumi AI

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

    Assigns groups to an application.

    This resource allows you to create multiple App Group assignments.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    const example = new okta.AppGroupAssignments("example", {
        appId: "<app id>",
        groups: [
            {
                id: "<group id>",
                priority: 1,
            },
            {
                id: "<another group id>",
                priority: 2,
                profile: JSON.stringify({
                    "application profile field": "application profile value",
                }),
            },
        ],
    });
    
    import pulumi
    import json
    import pulumi_okta as okta
    
    example = okta.AppGroupAssignments("example",
        app_id="<app id>",
        groups=[
            okta.AppGroupAssignmentsGroupArgs(
                id="<group id>",
                priority=1,
            ),
            okta.AppGroupAssignmentsGroupArgs(
                id="<another group id>",
                priority=2,
                profile=json.dumps({
                    "application profile field": "application profile value",
                }),
            ),
        ])
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"application profile field": "application profile value",
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = okta.NewAppGroupAssignments(ctx, "example", &okta.AppGroupAssignmentsArgs{
    			AppId: pulumi.String("<app id>"),
    			Groups: okta.AppGroupAssignmentsGroupArray{
    				&okta.AppGroupAssignmentsGroupArgs{
    					Id:       pulumi.String("<group id>"),
    					Priority: pulumi.Int(1),
    				},
    				&okta.AppGroupAssignmentsGroupArgs{
    					Id:       pulumi.String("<another group id>"),
    					Priority: pulumi.Int(2),
    					Profile:  pulumi.String(json0),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Okta = Pulumi.Okta;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Okta.AppGroupAssignments("example", new()
        {
            AppId = "<app id>",
            Groups = new[]
            {
                new Okta.Inputs.AppGroupAssignmentsGroupArgs
                {
                    Id = "<group id>",
                    Priority = 1,
                },
                new Okta.Inputs.AppGroupAssignmentsGroupArgs
                {
                    Id = "<another group id>",
                    Priority = 2,
                    Profile = JsonSerializer.Serialize(new Dictionary<string, object?>
                    {
                        ["application profile field"] = "application profile value",
                    }),
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.okta.AppGroupAssignments;
    import com.pulumi.okta.AppGroupAssignmentsArgs;
    import com.pulumi.okta.inputs.AppGroupAssignmentsGroupArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    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 AppGroupAssignments("example", AppGroupAssignmentsArgs.builder()        
                .appId("<app id>")
                .groups(            
                    AppGroupAssignmentsGroupArgs.builder()
                        .id("<group id>")
                        .priority(1)
                        .build(),
                    AppGroupAssignmentsGroupArgs.builder()
                        .id("<another group id>")
                        .priority(2)
                        .profile(serializeJson(
                            jsonObject(
                                jsonProperty("application profile field", "application profile value")
                            )))
                        .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: okta:AppGroupAssignments
        properties:
          appId: <app id>
          groups:
            - id: <group id>
              priority: 1
            - id: <another group id>
              priority: 2
              profile:
                fn::toJSON:
                  application profile field: application profile value
    

    Create AppGroupAssignments Resource

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

    Constructor syntax

    new AppGroupAssignments(name: string, args: AppGroupAssignmentsArgs, opts?: CustomResourceOptions);
    @overload
    def AppGroupAssignments(resource_name: str,
                            args: AppGroupAssignmentsArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def AppGroupAssignments(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            app_id: Optional[str] = None,
                            groups: Optional[Sequence[AppGroupAssignmentsGroupArgs]] = None)
    func NewAppGroupAssignments(ctx *Context, name string, args AppGroupAssignmentsArgs, opts ...ResourceOption) (*AppGroupAssignments, error)
    public AppGroupAssignments(string name, AppGroupAssignmentsArgs args, CustomResourceOptions? opts = null)
    public AppGroupAssignments(String name, AppGroupAssignmentsArgs args)
    public AppGroupAssignments(String name, AppGroupAssignmentsArgs args, CustomResourceOptions options)
    
    type: okta:AppGroupAssignments
    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 AppGroupAssignmentsArgs
    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 AppGroupAssignmentsArgs
    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 AppGroupAssignmentsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AppGroupAssignmentsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AppGroupAssignmentsArgs
    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 appGroupAssignmentsResource = new Okta.AppGroupAssignments("appGroupAssignmentsResource", new()
    {
        AppId = "string",
        Groups = new[]
        {
            new Okta.Inputs.AppGroupAssignmentsGroupArgs
            {
                Id = "string",
                Profile = "string",
                Priority = 0,
            },
        },
    });
    
    example, err := okta.NewAppGroupAssignments(ctx, "appGroupAssignmentsResource", &okta.AppGroupAssignmentsArgs{
    	AppId: pulumi.String("string"),
    	Groups: okta.AppGroupAssignmentsGroupArray{
    		&okta.AppGroupAssignmentsGroupArgs{
    			Id:       pulumi.String("string"),
    			Profile:  pulumi.String("string"),
    			Priority: pulumi.Int(0),
    		},
    	},
    })
    
    var appGroupAssignmentsResource = new AppGroupAssignments("appGroupAssignmentsResource", AppGroupAssignmentsArgs.builder()        
        .appId("string")
        .groups(AppGroupAssignmentsGroupArgs.builder()
            .id("string")
            .profile("string")
            .priority(0)
            .build())
        .build());
    
    app_group_assignments_resource = okta.AppGroupAssignments("appGroupAssignmentsResource",
        app_id="string",
        groups=[okta.AppGroupAssignmentsGroupArgs(
            id="string",
            profile="string",
            priority=0,
        )])
    
    const appGroupAssignmentsResource = new okta.AppGroupAssignments("appGroupAssignmentsResource", {
        appId: "string",
        groups: [{
            id: "string",
            profile: "string",
            priority: 0,
        }],
    });
    
    type: okta:AppGroupAssignments
    properties:
        appId: string
        groups:
            - id: string
              priority: 0
              profile: string
    

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

    AppId string
    The ID of the application to assign a group to.
    Groups List<AppGroupAssignmentsGroup>
    A group to assign the app to.
    AppId string
    The ID of the application to assign a group to.
    Groups []AppGroupAssignmentsGroupArgs
    A group to assign the app to.
    appId String
    The ID of the application to assign a group to.
    groups List<AppGroupAssignmentsGroup>
    A group to assign the app to.
    appId string
    The ID of the application to assign a group to.
    groups AppGroupAssignmentsGroup[]
    A group to assign the app to.
    app_id str
    The ID of the application to assign a group to.
    groups Sequence[AppGroupAssignmentsGroupArgs]
    A group to assign the app to.
    appId String
    The ID of the application to assign a group to.
    groups List<Property Map>
    A group to assign the app to.

    Outputs

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

    Get an existing AppGroupAssignments 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?: AppGroupAssignmentsState, opts?: CustomResourceOptions): AppGroupAssignments
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            app_id: Optional[str] = None,
            groups: Optional[Sequence[AppGroupAssignmentsGroupArgs]] = None) -> AppGroupAssignments
    func GetAppGroupAssignments(ctx *Context, name string, id IDInput, state *AppGroupAssignmentsState, opts ...ResourceOption) (*AppGroupAssignments, error)
    public static AppGroupAssignments Get(string name, Input<string> id, AppGroupAssignmentsState? state, CustomResourceOptions? opts = null)
    public static AppGroupAssignments get(String name, Output<String> id, AppGroupAssignmentsState 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:
    AppId string
    The ID of the application to assign a group to.
    Groups List<AppGroupAssignmentsGroup>
    A group to assign the app to.
    AppId string
    The ID of the application to assign a group to.
    Groups []AppGroupAssignmentsGroupArgs
    A group to assign the app to.
    appId String
    The ID of the application to assign a group to.
    groups List<AppGroupAssignmentsGroup>
    A group to assign the app to.
    appId string
    The ID of the application to assign a group to.
    groups AppGroupAssignmentsGroup[]
    A group to assign the app to.
    app_id str
    The ID of the application to assign a group to.
    groups Sequence[AppGroupAssignmentsGroupArgs]
    A group to assign the app to.
    appId String
    The ID of the application to assign a group to.
    groups List<Property Map>
    A group to assign the app to.

    Supporting Types

    AppGroupAssignmentsGroup, AppGroupAssignmentsGroupArgs

    Id string
    ID of the group to assign.
    Profile string
    JSON document containing application profile
    Priority int
    Priority of group assignment
    Id string
    ID of the group to assign.
    Profile string
    JSON document containing application profile
    Priority int
    Priority of group assignment
    id String
    ID of the group to assign.
    profile String
    JSON document containing application profile
    priority Integer
    Priority of group assignment
    id string
    ID of the group to assign.
    profile string
    JSON document containing application profile
    priority number
    Priority of group assignment
    id str
    ID of the group to assign.
    profile str
    JSON document containing application profile
    priority int
    Priority of group assignment
    id String
    ID of the group to assign.
    profile String
    JSON document containing application profile
    priority Number
    Priority of group assignment

    Import

    An application’s group assignments can be imported via app_id.

    $ pulumi import okta:index/appGroupAssignments:AppGroupAssignments example &#60;app_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