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

okta.AdminRoleTargets

Explore with Pulumi AI

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

    Manages targets for administrator roles.

    This resource allows you to define permissions for admin roles into a smaller subset of Groups or Apps within your org. You can define admin roles to target Groups, Applications, and Application Instances.

    Note 1: you have to assign a role to a user before creating this resource.
    
    Note 2: You can target a mixture of both App and App Instance targets, but can't assign permissions to manage all
            instances of an App and then a subset of that same App. For example, you can't specify that an admin has access
            to manage all instances of a Salesforce app and then also specific configurations of the Salesforce app.
    

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    const example = new okta.AdminRoleTargets("example", {
        apps: [
            "oidc_client.<app_id>",
            "facebook",
        ],
        roleType: "APP_ADMIN",
        userId: "<user_id>",
    });
    
    import pulumi
    import pulumi_okta as okta
    
    example = okta.AdminRoleTargets("example",
        apps=[
            "oidc_client.<app_id>",
            "facebook",
        ],
        role_type="APP_ADMIN",
        user_id="<user_id>")
    
    package main
    
    import (
    	"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 {
    		_, err := okta.NewAdminRoleTargets(ctx, "example", &okta.AdminRoleTargetsArgs{
    			Apps: pulumi.StringArray{
    				pulumi.String("oidc_client.<app_id>"),
    				pulumi.String("facebook"),
    			},
    			RoleType: pulumi.String("APP_ADMIN"),
    			UserId:   pulumi.String("<user_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 example = new Okta.AdminRoleTargets("example", new()
        {
            Apps = new[]
            {
                "oidc_client.<app_id>",
                "facebook",
            },
            RoleType = "APP_ADMIN",
            UserId = "<user_id>",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.okta.AdminRoleTargets;
    import com.pulumi.okta.AdminRoleTargetsArgs;
    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 AdminRoleTargets("example", AdminRoleTargetsArgs.builder()        
                .apps(            
                    "oidc_client.<app_id>",
                    "facebook")
                .roleType("APP_ADMIN")
                .userId("<user_id>")
                .build());
    
        }
    }
    
    resources:
      example:
        type: okta:AdminRoleTargets
        properties:
          apps:
            - oidc_client.<app_id>
            - facebook
          roleType: APP_ADMIN
          userId: <user_id>
    

    Create AdminRoleTargets Resource

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

    Constructor syntax

    new AdminRoleTargets(name: string, args: AdminRoleTargetsArgs, opts?: CustomResourceOptions);
    @overload
    def AdminRoleTargets(resource_name: str,
                         args: AdminRoleTargetsArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def AdminRoleTargets(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         role_type: Optional[str] = None,
                         user_id: Optional[str] = None,
                         apps: Optional[Sequence[str]] = None,
                         groups: Optional[Sequence[str]] = None)
    func NewAdminRoleTargets(ctx *Context, name string, args AdminRoleTargetsArgs, opts ...ResourceOption) (*AdminRoleTargets, error)
    public AdminRoleTargets(string name, AdminRoleTargetsArgs args, CustomResourceOptions? opts = null)
    public AdminRoleTargets(String name, AdminRoleTargetsArgs args)
    public AdminRoleTargets(String name, AdminRoleTargetsArgs args, CustomResourceOptions options)
    
    type: okta:AdminRoleTargets
    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 AdminRoleTargetsArgs
    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 AdminRoleTargetsArgs
    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 AdminRoleTargetsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AdminRoleTargetsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AdminRoleTargetsArgs
    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 adminRoleTargetsResource = new Okta.AdminRoleTargets("adminRoleTargetsResource", new()
    {
        RoleType = "string",
        UserId = "string",
        Apps = new[]
        {
            "string",
        },
        Groups = new[]
        {
            "string",
        },
    });
    
    example, err := okta.NewAdminRoleTargets(ctx, "adminRoleTargetsResource", &okta.AdminRoleTargetsArgs{
    	RoleType: pulumi.String("string"),
    	UserId:   pulumi.String("string"),
    	Apps: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Groups: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var adminRoleTargetsResource = new AdminRoleTargets("adminRoleTargetsResource", AdminRoleTargetsArgs.builder()        
        .roleType("string")
        .userId("string")
        .apps("string")
        .groups("string")
        .build());
    
    admin_role_targets_resource = okta.AdminRoleTargets("adminRoleTargetsResource",
        role_type="string",
        user_id="string",
        apps=["string"],
        groups=["string"])
    
    const adminRoleTargetsResource = new okta.AdminRoleTargets("adminRoleTargetsResource", {
        roleType: "string",
        userId: "string",
        apps: ["string"],
        groups: ["string"],
    });
    
    type: okta:AdminRoleTargets
    properties:
        apps:
            - string
        groups:
            - string
        roleType: string
        userId: string
    

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

    RoleType string
    Name of the role associated with the user. See API Docs.
    UserId string
    ID of the user.
    Apps List<string>
    List of app names (name represents set of app instances) or a combination of app name and app instance ID (like 'salesforce' or 'facebook.0oapsqQ6dv19pqyEo0g3').
    Groups List<string>
    List of group IDs. Conflicts with apps.
    RoleType string
    Name of the role associated with the user. See API Docs.
    UserId string
    ID of the user.
    Apps []string
    List of app names (name represents set of app instances) or a combination of app name and app instance ID (like 'salesforce' or 'facebook.0oapsqQ6dv19pqyEo0g3').
    Groups []string
    List of group IDs. Conflicts with apps.
    roleType String
    Name of the role associated with the user. See API Docs.
    userId String
    ID of the user.
    apps List<String>
    List of app names (name represents set of app instances) or a combination of app name and app instance ID (like 'salesforce' or 'facebook.0oapsqQ6dv19pqyEo0g3').
    groups List<String>
    List of group IDs. Conflicts with apps.
    roleType string
    Name of the role associated with the user. See API Docs.
    userId string
    ID of the user.
    apps string[]
    List of app names (name represents set of app instances) or a combination of app name and app instance ID (like 'salesforce' or 'facebook.0oapsqQ6dv19pqyEo0g3').
    groups string[]
    List of group IDs. Conflicts with apps.
    role_type str
    Name of the role associated with the user. See API Docs.
    user_id str
    ID of the user.
    apps Sequence[str]
    List of app names (name represents set of app instances) or a combination of app name and app instance ID (like 'salesforce' or 'facebook.0oapsqQ6dv19pqyEo0g3').
    groups Sequence[str]
    List of group IDs. Conflicts with apps.
    roleType String
    Name of the role associated with the user. See API Docs.
    userId String
    ID of the user.
    apps List<String>
    List of app names (name represents set of app instances) or a combination of app name and app instance ID (like 'salesforce' or 'facebook.0oapsqQ6dv19pqyEo0g3').
    groups List<String>
    List of group IDs. Conflicts with apps.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    RoleId string
    Role ID.
    Id string
    The provider-assigned unique ID for this managed resource.
    RoleId string
    Role ID.
    id String
    The provider-assigned unique ID for this managed resource.
    roleId String
    Role ID.
    id string
    The provider-assigned unique ID for this managed resource.
    roleId string
    Role ID.
    id str
    The provider-assigned unique ID for this managed resource.
    role_id str
    Role ID.
    id String
    The provider-assigned unique ID for this managed resource.
    roleId String
    Role ID.

    Look up Existing AdminRoleTargets Resource

    Get an existing AdminRoleTargets 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?: AdminRoleTargetsState, opts?: CustomResourceOptions): AdminRoleTargets
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            apps: Optional[Sequence[str]] = None,
            groups: Optional[Sequence[str]] = None,
            role_id: Optional[str] = None,
            role_type: Optional[str] = None,
            user_id: Optional[str] = None) -> AdminRoleTargets
    func GetAdminRoleTargets(ctx *Context, name string, id IDInput, state *AdminRoleTargetsState, opts ...ResourceOption) (*AdminRoleTargets, error)
    public static AdminRoleTargets Get(string name, Input<string> id, AdminRoleTargetsState? state, CustomResourceOptions? opts = null)
    public static AdminRoleTargets get(String name, Output<String> id, AdminRoleTargetsState 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 names (name represents set of app instances) or a combination of app name and app instance ID (like 'salesforce' or 'facebook.0oapsqQ6dv19pqyEo0g3').
    Groups List<string>
    List of group IDs. Conflicts with apps.
    RoleId string
    Role ID.
    RoleType string
    Name of the role associated with the user. See API Docs.
    UserId string
    ID of the user.
    Apps []string
    List of app names (name represents set of app instances) or a combination of app name and app instance ID (like 'salesforce' or 'facebook.0oapsqQ6dv19pqyEo0g3').
    Groups []string
    List of group IDs. Conflicts with apps.
    RoleId string
    Role ID.
    RoleType string
    Name of the role associated with the user. See API Docs.
    UserId string
    ID of the user.
    apps List<String>
    List of app names (name represents set of app instances) or a combination of app name and app instance ID (like 'salesforce' or 'facebook.0oapsqQ6dv19pqyEo0g3').
    groups List<String>
    List of group IDs. Conflicts with apps.
    roleId String
    Role ID.
    roleType String
    Name of the role associated with the user. See API Docs.
    userId String
    ID of the user.
    apps string[]
    List of app names (name represents set of app instances) or a combination of app name and app instance ID (like 'salesforce' or 'facebook.0oapsqQ6dv19pqyEo0g3').
    groups string[]
    List of group IDs. Conflicts with apps.
    roleId string
    Role ID.
    roleType string
    Name of the role associated with the user. See API Docs.
    userId string
    ID of the user.
    apps Sequence[str]
    List of app names (name represents set of app instances) or a combination of app name and app instance ID (like 'salesforce' or 'facebook.0oapsqQ6dv19pqyEo0g3').
    groups Sequence[str]
    List of group IDs. Conflicts with apps.
    role_id str
    Role ID.
    role_type str
    Name of the role associated with the user. See API Docs.
    user_id str
    ID of the user.
    apps List<String>
    List of app names (name represents set of app instances) or a combination of app name and app instance ID (like 'salesforce' or 'facebook.0oapsqQ6dv19pqyEo0g3').
    groups List<String>
    List of group IDs. Conflicts with apps.
    roleId String
    Role ID.
    roleType String
    Name of the role associated with the user. See API Docs.
    userId String
    ID of the user.

    Import

    Okta Admin Role Targets can be imported via the Okta ID.

    $ pulumi import okta:index/adminRoleTargets:AdminRoleTargets example &#60;user id&#62;/&#60;role type&#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