Skip to content
v2.278.0

InitUserOptions Struct ​

Optional parameters used when creating a user.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const initUserOptions: ec2.InitUserOptions = {
  groups: ['groups'],
  homeDir: 'homeDir',
  userId: 123,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

init_user_options = ec2.InitUserOptions(
    groups=["groups"],
    home_dir="homeDir",
    user_id=123
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;

InitUserOptions initUserOptions = InitUserOptions.builder()
        .groups(List.of("groups"))
        .homeDir("homeDir")
        .userId(123)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;

var initUserOptions = new InitUserOptions {
    Groups = new [] { "groups" },
    HomeDir = "homeDir",
    UserId = 123
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

initUserOptions := &InitUserOptions{
	Groups: []*string{
		jsii.String("groups"),
	},
	HomeDir: jsii.String("homeDir"),
	UserId: jsii.Number(123),
}

Properties ​

groupsoptionalstring[]groupsoptionaltyping.List[str]groupsoptionalList<String>Groupsoptionalstring[]Groupsoptional*[]*string #
A list of group names.

Default: the user is not associated with any groups.

The user will be added to each group in the list.

homeDiroptionalstringhome_diroptionalstrhomeDiroptionalStringHomeDiroptionalstringHomeDiroptional*string #
The user's home directory.

Default: assigned by the OS

userIdoptionalnumberuser_idoptionalint | floatuserIdoptionalNumberUserIdoptionaldoubleUserIdoptional*float64 #
A user ID.

Default: assigned by the OS

The creation process fails if the user name exists with a different user ID. If the user ID is already assigned to an existing user the operating system may reject the creation request.