1. Packages
  2. Okta
  3. API Docs
  4. UserAdminRoles
Okta v4.11.0 published on Tuesday, Sep 17, 2024 by Pulumi

okta.UserAdminRoles

Explore with Pulumi AI

okta logo
Okta v4.11.0 published on Tuesday, Sep 17, 2024 by Pulumi

    Resource to manage a set of administrator roles for a specific user. This resource allows you to manage admin roles for a single user, independent of the user schema itself.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    const test = new okta.user.User("test", {
        firstName: "TestAcc",
        lastName: "Smith",
        login: "testAcc-replace_with_uuid@example.com",
        email: "testAcc-replace_with_uuid@example.com",
    });
    const testUserAdminRoles = new okta.UserAdminRoles("test", {
        userId: test.id,
        adminRoles: ["APP_ADMIN"],
    });
    
    import pulumi
    import pulumi_okta as okta
    
    test = okta.user.User("test",
        first_name="TestAcc",
        last_name="Smith",
        login="testAcc-replace_with_uuid@example.com",
        email="testAcc-replace_with_uuid@example.com")
    test_user_admin_roles = okta.UserAdminRoles("test",
        user_id=test.id,
        admin_roles=["APP_ADMIN"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta"
    	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta/user"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		test, err := user.NewUser(ctx, "test", &user.UserArgs{
    			FirstName: pulumi.String("TestAcc"),
    			LastName:  pulumi.String("Smith"),
    			Login:     pulumi.String("testAcc-replace_with_uuid@example.com"),
    			Email:     pulumi.String("testAcc-replace_with_uuid@example.com"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = okta.NewUserAdminRoles(ctx, "test", &okta.UserAdminRolesArgs{
    			UserId: test.ID(),
    			AdminRoles: pulumi.StringArray{
    				pulumi.String("APP_ADMIN"),
    			},
    		})
    		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 test = new Okta.User.User("test", new()
        {
            FirstName = "TestAcc",
            LastName = "Smith",
            Login = "testAcc-replace_with_uuid@example.com",
            Email = "testAcc-replace_with_uuid@example.com",
        });
    
        var testUserAdminRoles = new Okta.UserAdminRoles("test", new()
        {
            UserId = test.Id,
            AdminRoles = new[]
            {
                "APP_ADMIN",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.okta.user.User;
    import com.pulumi.okta.user.UserArgs;
    import com.pulumi.okta.UserAdminRoles;
    import com.pulumi.okta.UserAdminRolesArgs;
    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 test = new User("test", UserArgs.builder()
                .firstName("TestAcc")
                .lastName("Smith")
                .login("testAcc-replace_with_uuid@example.com")
                .email("testAcc-replace_with_uuid@example.com")
                .build());
    
            var testUserAdminRoles = new UserAdminRoles("testUserAdminRoles", UserAdminRolesArgs.builder()
                .userId(test.id())
                .adminRoles("APP_ADMIN")
                .build());
    
        }
    }
    
    resources:
      test:
        type: okta:user:User
        properties:
          firstName: TestAcc
          lastName: Smith
          login: testAcc-replace_with_uuid@example.com
          email: testAcc-replace_with_uuid@example.com
      testUserAdminRoles:
        type: okta:UserAdminRoles
        name: test
        properties:
          userId: ${test.id}
          adminRoles:
            - APP_ADMIN
    

    Create UserAdminRoles Resource

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

    Constructor syntax

    new UserAdminRoles(name: string, args: UserAdminRolesArgs, opts?: CustomResourceOptions);
    @overload
    def UserAdminRoles(resource_name: str,
                       args: UserAdminRolesArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserAdminRoles(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       admin_roles: Optional[Sequence[str]] = None,
                       user_id: Optional[str] = None,
                       disable_notifications: Optional[bool] = None)
    func NewUserAdminRoles(ctx *Context, name string, args UserAdminRolesArgs, opts ...ResourceOption) (*UserAdminRoles, error)
    public UserAdminRoles(string name, UserAdminRolesArgs args, CustomResourceOptions? opts = null)
    public UserAdminRoles(String name, UserAdminRolesArgs args)
    public UserAdminRoles(String name, UserAdminRolesArgs args, CustomResourceOptions options)
    
    type: okta:UserAdminRoles
    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 UserAdminRolesArgs
    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 UserAdminRolesArgs
    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 UserAdminRolesArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserAdminRolesArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserAdminRolesArgs
    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 userAdminRolesResource = new Okta.UserAdminRoles("userAdminRolesResource", new()
    {
        AdminRoles = new[]
        {
            "string",
        },
        UserId = "string",
        DisableNotifications = false,
    });
    
    example, err := okta.NewUserAdminRoles(ctx, "userAdminRolesResource", &okta.UserAdminRolesArgs{
    	AdminRoles: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	UserId:               pulumi.String("string"),
    	DisableNotifications: pulumi.Bool(false),
    })
    
    var userAdminRolesResource = new UserAdminRoles("userAdminRolesResource", UserAdminRolesArgs.builder()
        .adminRoles("string")
        .userId("string")
        .disableNotifications(false)
        .build());
    
    user_admin_roles_resource = okta.UserAdminRoles("userAdminRolesResource",
        admin_roles=["string"],
        user_id="string",
        disable_notifications=False)
    
    const userAdminRolesResource = new okta.UserAdminRoles("userAdminRolesResource", {
        adminRoles: ["string"],
        userId: "string",
        disableNotifications: false,
    });
    
    type: okta:UserAdminRoles
    properties:
        adminRoles:
            - string
        disableNotifications: false
        userId: string
    

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

    AdminRoles List<string>
    The list of Okta user admin roles, e.g. ['APP_ADMIN', 'USER_ADMIN'] See API Docs.
    UserId string
    ID of a Okta User
    DisableNotifications bool
    When this setting is enabled, the admins won't receive any of the default Okta administrator emails. These admins also won't have access to contact Okta Support and open support cases on behalf of your org.
    AdminRoles []string
    The list of Okta user admin roles, e.g. ['APP_ADMIN', 'USER_ADMIN'] See API Docs.
    UserId string
    ID of a Okta User
    DisableNotifications bool
    When this setting is enabled, the admins won't receive any of the default Okta administrator emails. These admins also won't have access to contact Okta Support and open support cases on behalf of your org.
    adminRoles List<String>
    The list of Okta user admin roles, e.g. ['APP_ADMIN', 'USER_ADMIN'] See API Docs.
    userId String
    ID of a Okta User
    disableNotifications Boolean
    When this setting is enabled, the admins won't receive any of the default Okta administrator emails. These admins also won't have access to contact Okta Support and open support cases on behalf of your org.
    adminRoles string[]
    The list of Okta user admin roles, e.g. ['APP_ADMIN', 'USER_ADMIN'] See API Docs.
    userId string
    ID of a Okta User
    disableNotifications boolean
    When this setting is enabled, the admins won't receive any of the default Okta administrator emails. These admins also won't have access to contact Okta Support and open support cases on behalf of your org.
    admin_roles Sequence[str]
    The list of Okta user admin roles, e.g. ['APP_ADMIN', 'USER_ADMIN'] See API Docs.
    user_id str
    ID of a Okta User
    disable_notifications bool
    When this setting is enabled, the admins won't receive any of the default Okta administrator emails. These admins also won't have access to contact Okta Support and open support cases on behalf of your org.
    adminRoles List<String>
    The list of Okta user admin roles, e.g. ['APP_ADMIN', 'USER_ADMIN'] See API Docs.
    userId String
    ID of a Okta User
    disableNotifications Boolean
    When this setting is enabled, the admins won't receive any of the default Okta administrator emails. These admins also won't have access to contact Okta Support and open support cases on behalf of your org.

    Outputs

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

    Get an existing UserAdminRoles 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?: UserAdminRolesState, opts?: CustomResourceOptions): UserAdminRoles
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            admin_roles: Optional[Sequence[str]] = None,
            disable_notifications: Optional[bool] = None,
            user_id: Optional[str] = None) -> UserAdminRoles
    func GetUserAdminRoles(ctx *Context, name string, id IDInput, state *UserAdminRolesState, opts ...ResourceOption) (*UserAdminRoles, error)
    public static UserAdminRoles Get(string name, Input<string> id, UserAdminRolesState? state, CustomResourceOptions? opts = null)
    public static UserAdminRoles get(String name, Output<String> id, UserAdminRolesState 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:
    AdminRoles List<string>
    The list of Okta user admin roles, e.g. ['APP_ADMIN', 'USER_ADMIN'] See API Docs.
    DisableNotifications bool
    When this setting is enabled, the admins won't receive any of the default Okta administrator emails. These admins also won't have access to contact Okta Support and open support cases on behalf of your org.
    UserId string
    ID of a Okta User
    AdminRoles []string
    The list of Okta user admin roles, e.g. ['APP_ADMIN', 'USER_ADMIN'] See API Docs.
    DisableNotifications bool
    When this setting is enabled, the admins won't receive any of the default Okta administrator emails. These admins also won't have access to contact Okta Support and open support cases on behalf of your org.
    UserId string
    ID of a Okta User
    adminRoles List<String>
    The list of Okta user admin roles, e.g. ['APP_ADMIN', 'USER_ADMIN'] See API Docs.
    disableNotifications Boolean
    When this setting is enabled, the admins won't receive any of the default Okta administrator emails. These admins also won't have access to contact Okta Support and open support cases on behalf of your org.
    userId String
    ID of a Okta User
    adminRoles string[]
    The list of Okta user admin roles, e.g. ['APP_ADMIN', 'USER_ADMIN'] See API Docs.
    disableNotifications boolean
    When this setting is enabled, the admins won't receive any of the default Okta administrator emails. These admins also won't have access to contact Okta Support and open support cases on behalf of your org.
    userId string
    ID of a Okta User
    admin_roles Sequence[str]
    The list of Okta user admin roles, e.g. ['APP_ADMIN', 'USER_ADMIN'] See API Docs.
    disable_notifications bool
    When this setting is enabled, the admins won't receive any of the default Okta administrator emails. These admins also won't have access to contact Okta Support and open support cases on behalf of your org.
    user_id str
    ID of a Okta User
    adminRoles List<String>
    The list of Okta user admin roles, e.g. ['APP_ADMIN', 'USER_ADMIN'] See API Docs.
    disableNotifications Boolean
    When this setting is enabled, the admins won't receive any of the default Okta administrator emails. These admins also won't have access to contact Okta Support and open support cases on behalf of your org.
    userId String
    ID of a Okta User

    Import

    $ pulumi import okta:index/userAdminRoles:UserAdminRoles example <user_id>
    

    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.11.0 published on Tuesday, Sep 17, 2024 by Pulumi