# WindowsUserDataOptions

Options when constructing UserData for Windows.

- Source: [`aws-ec2/lib/user-data.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-ec2/lib/user-data.ts#L22)
- Type last changed: v2.46.0 · 13 Oct 2022

## Example

```ts
const windowsUserData = ec2.UserData.forWindows({ persist: true });
```

## Properties

- `persist`: boolean = false — Set to true to set this userdata to persist through an instance reboot;

  allowing
  it to run on every instance start.
  By default, UserData is run only once during the first instance launch.

  For more information, see:
  https://aws.amazon.com/premiumsupport/knowledge-center/execute-user-data-ec2/
  https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-windows-user-data.html#user-data-scripts
