1. Packages
  2. Okta
  3. API Docs
  4. UserAdminRoles
Okta v4.8.0 published on Saturday, Mar 2, 2024 by Pulumi

okta.UserAdminRoles

Explore with Pulumi AI

okta logo
Okta v4.8.0 published on Saturday, Mar 2, 2024 by Pulumi

    Resource to manage a set of admin 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

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Okta = Pulumi.Okta;
    
    return await Deployment.RunAsync(() => 
    {
        var testUser = new Okta.User.User("testUser", new()
        {
            FirstName = "TestAcc",
            LastName = "Smith",
            Login = "testAcc-replace_with_uuid@example.com",
            Email = "testAcc-replace_with_uuid@example.com",
        });
    
        var testUserAdminRoles = new Okta.UserAdminRoles("testUserAdminRoles", new()
        {
            UserId = testUser.Id,
            AdminRoles = new[]
            {
                "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 {
    		testUser, err := user.NewUser(ctx, "testUser", &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, "testUserAdminRoles", &okta.UserAdminRolesArgs{
    			UserId: testUser.ID(),
    			AdminRoles: pulumi.StringArray{
    				pulumi.String("APP_ADMIN"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 testUser = new User("testUser", 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(testUser.id())
                .adminRoles("APP_ADMIN")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_okta as okta
    
    test_user = okta.user.User("testUser",
        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("testUserAdminRoles",
        user_id=test_user.id,
        admin_roles=["APP_ADMIN"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    const testUser = new okta.user.User("testUser", {
        firstName: "TestAcc",
        lastName: "Smith",
        login: "testAcc-replace_with_uuid@example.com",
        email: "testAcc-replace_with_uuid@example.com",
    });
    const testUserAdminRoles = new okta.UserAdminRoles("testUserAdminRoles", {
        userId: testUser.id,
        adminRoles: ["APP_ADMIN"],
    });
    
    resources:
      testUser:
        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
        properties:
          userId: ${testUser.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.

    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
    Okta user ID.
    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
    Okta user ID.
    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
    Okta user ID.
    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
    Okta user ID.
    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
    Okta user ID.
    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
    Okta user ID.
    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
    Okta user ID.
    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
    Okta user ID.
    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
    Okta user ID.
    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
    Okta user ID.
    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
    Okta user ID.
    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
    Okta user ID.

    Import

    Existing user admin roles can be imported via the Okta User ID.

    $ pulumi import okta:index/userAdminRoles:UserAdminRoles example &#60;user 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.0 published on Saturday, Mar 2, 2024 by Pulumi