# InitUserOptions

Optional parameters used when creating a user.

Used as props by: [InitUser](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.InitUser.html)
Used as argument in: [InitUser.fromName](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.InitUser.html#fromname)

- Source: [`aws-ec2/lib/cfn-init-elements.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ec2/lib/cfn-init-elements.ts#L548)

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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
};
```

Golang:

```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

- `groups`: 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.

- `homeDir`: string — The user's home directory.

  **Default:** assigned by the OS

- `userId`: number — 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.
