1. Packages
  2. Azure Classic
  3. API Docs
  4. lab
  5. User

We recommend using Azure Native.

Azure Classic v5.73.0 published on Monday, Apr 22, 2024 by Pulumi

azure.lab.User

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.73.0 published on Monday, Apr 22, 2024 by Pulumi

    Manages a Lab Service User.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const exampleLab = new azure.lab.Lab("example", {
        name: "example-lab",
        resourceGroupName: example.name,
        location: example.location,
        title: "Test Title",
        security: {
            openAccessEnabled: false,
        },
        virtualMachine: {
            adminUser: {
                username: "testadmin",
                password: "Password1234!",
            },
            imageReference: {
                publisher: "Canonical",
                offer: "0001-com-ubuntu-server-jammy",
                sku: "22_04-lts",
                version: "latest",
            },
            sku: {
                name: "Classic_Fsv2_2_4GB_128_S_SSD",
                capacity: 1,
            },
        },
    });
    const exampleUser = new azure.lab.User("example", {
        name: "example-labuser",
        labId: exampleLab.id,
        email: "terraform-acctest@example.com",
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    example_lab = azure.lab.Lab("example",
        name="example-lab",
        resource_group_name=example.name,
        location=example.location,
        title="Test Title",
        security=azure.lab.LabSecurityArgs(
            open_access_enabled=False,
        ),
        virtual_machine=azure.lab.LabVirtualMachineArgs(
            admin_user=azure.lab.LabVirtualMachineAdminUserArgs(
                username="testadmin",
                password="Password1234!",
            ),
            image_reference=azure.lab.LabVirtualMachineImageReferenceArgs(
                publisher="Canonical",
                offer="0001-com-ubuntu-server-jammy",
                sku="22_04-lts",
                version="latest",
            ),
            sku=azure.lab.LabVirtualMachineSkuArgs(
                name="Classic_Fsv2_2_4GB_128_S_SSD",
                capacity=1,
            ),
        ))
    example_user = azure.lab.User("example",
        name="example-labuser",
        lab_id=example_lab.id,
        email="terraform-acctest@example.com")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lab"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleLab, err := lab.NewLab(ctx, "example", &lab.LabArgs{
    			Name:              pulumi.String("example-lab"),
    			ResourceGroupName: example.Name,
    			Location:          example.Location,
    			Title:             pulumi.String("Test Title"),
    			Security: &lab.LabSecurityArgs{
    				OpenAccessEnabled: pulumi.Bool(false),
    			},
    			VirtualMachine: &lab.LabVirtualMachineArgs{
    				AdminUser: &lab.LabVirtualMachineAdminUserArgs{
    					Username: pulumi.String("testadmin"),
    					Password: pulumi.String("Password1234!"),
    				},
    				ImageReference: &lab.LabVirtualMachineImageReferenceArgs{
    					Publisher: pulumi.String("Canonical"),
    					Offer:     pulumi.String("0001-com-ubuntu-server-jammy"),
    					Sku:       pulumi.String("22_04-lts"),
    					Version:   pulumi.String("latest"),
    				},
    				Sku: &lab.LabVirtualMachineSkuArgs{
    					Name:     pulumi.String("Classic_Fsv2_2_4GB_128_S_SSD"),
    					Capacity: pulumi.Int(1),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = lab.NewUser(ctx, "example", &lab.UserArgs{
    			Name:  pulumi.String("example-labuser"),
    			LabId: exampleLab.ID(),
    			Email: pulumi.String("terraform-acctest@example.com"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var exampleLab = new Azure.Lab.Lab("example", new()
        {
            Name = "example-lab",
            ResourceGroupName = example.Name,
            Location = example.Location,
            Title = "Test Title",
            Security = new Azure.Lab.Inputs.LabSecurityArgs
            {
                OpenAccessEnabled = false,
            },
            VirtualMachine = new Azure.Lab.Inputs.LabVirtualMachineArgs
            {
                AdminUser = new Azure.Lab.Inputs.LabVirtualMachineAdminUserArgs
                {
                    Username = "testadmin",
                    Password = "Password1234!",
                },
                ImageReference = new Azure.Lab.Inputs.LabVirtualMachineImageReferenceArgs
                {
                    Publisher = "Canonical",
                    Offer = "0001-com-ubuntu-server-jammy",
                    Sku = "22_04-lts",
                    Version = "latest",
                },
                Sku = new Azure.Lab.Inputs.LabVirtualMachineSkuArgs
                {
                    Name = "Classic_Fsv2_2_4GB_128_S_SSD",
                    Capacity = 1,
                },
            },
        });
    
        var exampleUser = new Azure.Lab.User("example", new()
        {
            Name = "example-labuser",
            LabId = exampleLab.Id,
            Email = "terraform-acctest@example.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.lab.Lab;
    import com.pulumi.azure.lab.LabArgs;
    import com.pulumi.azure.lab.inputs.LabSecurityArgs;
    import com.pulumi.azure.lab.inputs.LabVirtualMachineArgs;
    import com.pulumi.azure.lab.inputs.LabVirtualMachineAdminUserArgs;
    import com.pulumi.azure.lab.inputs.LabVirtualMachineImageReferenceArgs;
    import com.pulumi.azure.lab.inputs.LabVirtualMachineSkuArgs;
    import com.pulumi.azure.lab.User;
    import com.pulumi.azure.lab.UserArgs;
    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 ResourceGroup("example", ResourceGroupArgs.builder()        
                .name("example-resources")
                .location("West Europe")
                .build());
    
            var exampleLab = new Lab("exampleLab", LabArgs.builder()        
                .name("example-lab")
                .resourceGroupName(example.name())
                .location(example.location())
                .title("Test Title")
                .security(LabSecurityArgs.builder()
                    .openAccessEnabled(false)
                    .build())
                .virtualMachine(LabVirtualMachineArgs.builder()
                    .adminUser(LabVirtualMachineAdminUserArgs.builder()
                        .username("testadmin")
                        .password("Password1234!")
                        .build())
                    .imageReference(LabVirtualMachineImageReferenceArgs.builder()
                        .publisher("Canonical")
                        .offer("0001-com-ubuntu-server-jammy")
                        .sku("22_04-lts")
                        .version("latest")
                        .build())
                    .sku(LabVirtualMachineSkuArgs.builder()
                        .name("Classic_Fsv2_2_4GB_128_S_SSD")
                        .capacity(1)
                        .build())
                    .build())
                .build());
    
            var exampleUser = new User("exampleUser", UserArgs.builder()        
                .name("example-labuser")
                .labId(exampleLab.id())
                .email("terraform-acctest@example.com")
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      exampleLab:
        type: azure:lab:Lab
        name: example
        properties:
          name: example-lab
          resourceGroupName: ${example.name}
          location: ${example.location}
          title: Test Title
          security:
            openAccessEnabled: false
          virtualMachine:
            adminUser:
              username: testadmin
              password: Password1234!
            imageReference:
              publisher: Canonical
              offer: 0001-com-ubuntu-server-jammy
              sku: 22_04-lts
              version: latest
            sku:
              name: Classic_Fsv2_2_4GB_128_S_SSD
              capacity: 1
      exampleUser:
        type: azure:lab:User
        name: example
        properties:
          name: example-labuser
          labId: ${exampleLab.id}
          email: terraform-acctest@example.com
    

    Create User Resource

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

    Constructor syntax

    new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
    @overload
    def User(resource_name: str,
             args: UserArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def User(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             email: Optional[str] = None,
             lab_id: Optional[str] = None,
             additional_usage_quota: Optional[str] = None,
             name: Optional[str] = None)
    func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
    public User(string name, UserArgs args, CustomResourceOptions? opts = null)
    public User(String name, UserArgs args)
    public User(String name, UserArgs args, CustomResourceOptions options)
    
    type: azure:lab:User
    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 UserArgs
    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 UserArgs
    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 UserArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserArgs
    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 azureUserResource = new Azure.Lab.User("azureUserResource", new()
    {
        Email = "string",
        LabId = "string",
        AdditionalUsageQuota = "string",
        Name = "string",
    });
    
    example, err := lab.NewUser(ctx, "azureUserResource", &lab.UserArgs{
    	Email:                pulumi.String("string"),
    	LabId:                pulumi.String("string"),
    	AdditionalUsageQuota: pulumi.String("string"),
    	Name:                 pulumi.String("string"),
    })
    
    var azureUserResource = new User("azureUserResource", UserArgs.builder()        
        .email("string")
        .labId("string")
        .additionalUsageQuota("string")
        .name("string")
        .build());
    
    azure_user_resource = azure.lab.User("azureUserResource",
        email="string",
        lab_id="string",
        additional_usage_quota="string",
        name="string")
    
    const azureUserResource = new azure.lab.User("azureUserResource", {
        email: "string",
        labId: "string",
        additionalUsageQuota: "string",
        name: "string",
    });
    
    type: azure:lab:User
    properties:
        additionalUsageQuota: string
        email: string
        labId: string
        name: string
    

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

    Email string
    The email address of the Lab Service User. Changing this forces a new resource to be created.
    LabId string
    The resource ID of the Lab Service Lab. Changing this forces a new resource to be created.
    AdditionalUsageQuota string
    The amount of usage quota time the Lab Service User gets in addition to the lab usage quota. Defaults to PT0S.
    Name string
    The name which should be used for this Lab Service User. Changing this forces a new resource to be created.
    Email string
    The email address of the Lab Service User. Changing this forces a new resource to be created.
    LabId string
    The resource ID of the Lab Service Lab. Changing this forces a new resource to be created.
    AdditionalUsageQuota string
    The amount of usage quota time the Lab Service User gets in addition to the lab usage quota. Defaults to PT0S.
    Name string
    The name which should be used for this Lab Service User. Changing this forces a new resource to be created.
    email String
    The email address of the Lab Service User. Changing this forces a new resource to be created.
    labId String
    The resource ID of the Lab Service Lab. Changing this forces a new resource to be created.
    additionalUsageQuota String
    The amount of usage quota time the Lab Service User gets in addition to the lab usage quota. Defaults to PT0S.
    name String
    The name which should be used for this Lab Service User. Changing this forces a new resource to be created.
    email string
    The email address of the Lab Service User. Changing this forces a new resource to be created.
    labId string
    The resource ID of the Lab Service Lab. Changing this forces a new resource to be created.
    additionalUsageQuota string
    The amount of usage quota time the Lab Service User gets in addition to the lab usage quota. Defaults to PT0S.
    name string
    The name which should be used for this Lab Service User. Changing this forces a new resource to be created.
    email str
    The email address of the Lab Service User. Changing this forces a new resource to be created.
    lab_id str
    The resource ID of the Lab Service Lab. Changing this forces a new resource to be created.
    additional_usage_quota str
    The amount of usage quota time the Lab Service User gets in addition to the lab usage quota. Defaults to PT0S.
    name str
    The name which should be used for this Lab Service User. Changing this forces a new resource to be created.
    email String
    The email address of the Lab Service User. Changing this forces a new resource to be created.
    labId String
    The resource ID of the Lab Service Lab. Changing this forces a new resource to be created.
    additionalUsageQuota String
    The amount of usage quota time the Lab Service User gets in addition to the lab usage quota. Defaults to PT0S.
    name String
    The name which should be used for this Lab Service User. Changing this forces a new resource to be created.

    Outputs

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

    Get an existing User 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?: UserState, opts?: CustomResourceOptions): User
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            additional_usage_quota: Optional[str] = None,
            email: Optional[str] = None,
            lab_id: Optional[str] = None,
            name: Optional[str] = None) -> User
    func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
    public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
    public static User get(String name, Output<String> id, UserState 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:
    AdditionalUsageQuota string
    The amount of usage quota time the Lab Service User gets in addition to the lab usage quota. Defaults to PT0S.
    Email string
    The email address of the Lab Service User. Changing this forces a new resource to be created.
    LabId string
    The resource ID of the Lab Service Lab. Changing this forces a new resource to be created.
    Name string
    The name which should be used for this Lab Service User. Changing this forces a new resource to be created.
    AdditionalUsageQuota string
    The amount of usage quota time the Lab Service User gets in addition to the lab usage quota. Defaults to PT0S.
    Email string
    The email address of the Lab Service User. Changing this forces a new resource to be created.
    LabId string
    The resource ID of the Lab Service Lab. Changing this forces a new resource to be created.
    Name string
    The name which should be used for this Lab Service User. Changing this forces a new resource to be created.
    additionalUsageQuota String
    The amount of usage quota time the Lab Service User gets in addition to the lab usage quota. Defaults to PT0S.
    email String
    The email address of the Lab Service User. Changing this forces a new resource to be created.
    labId String
    The resource ID of the Lab Service Lab. Changing this forces a new resource to be created.
    name String
    The name which should be used for this Lab Service User. Changing this forces a new resource to be created.
    additionalUsageQuota string
    The amount of usage quota time the Lab Service User gets in addition to the lab usage quota. Defaults to PT0S.
    email string
    The email address of the Lab Service User. Changing this forces a new resource to be created.
    labId string
    The resource ID of the Lab Service Lab. Changing this forces a new resource to be created.
    name string
    The name which should be used for this Lab Service User. Changing this forces a new resource to be created.
    additional_usage_quota str
    The amount of usage quota time the Lab Service User gets in addition to the lab usage quota. Defaults to PT0S.
    email str
    The email address of the Lab Service User. Changing this forces a new resource to be created.
    lab_id str
    The resource ID of the Lab Service Lab. Changing this forces a new resource to be created.
    name str
    The name which should be used for this Lab Service User. Changing this forces a new resource to be created.
    additionalUsageQuota String
    The amount of usage quota time the Lab Service User gets in addition to the lab usage quota. Defaults to PT0S.
    email String
    The email address of the Lab Service User. Changing this forces a new resource to be created.
    labId String
    The resource ID of the Lab Service Lab. Changing this forces a new resource to be created.
    name String
    The name which should be used for this Lab Service User. Changing this forces a new resource to be created.

    Import

    Lab Service Users can be imported using the resource id, e.g.

    $ pulumi import azure:lab/user:User example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.LabServices/labs/lab1/users/user1
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.73.0 published on Monday, Apr 22, 2024 by Pulumi