# InitFileOptions

Options for InitFile.

Extends: InitFileOptions
Used as props by: InitFile

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

## Example

```ts
declare const myBucket: s3.Bucket;

const handle = new ec2.InitServiceRestartHandle();

ec2.CloudFormationInit.fromElements(
  ec2.InitFile.fromString('/etc/nginx/nginx.conf', '...', { serviceRestartHandles: [handle] }),
  ec2.InitSource.fromS3Object('/var/www/html', myBucket, 'html.zip', { serviceRestartHandles: [handle] }),
  ec2.InitService.enable('nginx', {
    serviceRestartHandle: handle,
  })
);
```

## Properties

- `base64Encoded`: boolean = false — True if the inlined content (from a string or file) should be treated as base64 encoded.

  Only applicable for inlined string and file content.

- `group`: string = 'root' — The name of the owning group for this file.

  Not supported for Windows systems.

- `mode`: string = '000644' — A six-digit octal value representing the mode for this file.

  Use the first three digits for symlinks and the last three digits for
  setting permissions. To create a symlink, specify 120xxx, where xxx
  defines the permissions of the target file. To specify permissions for a
  file, use the last three digits, such as 000644.

  Not supported for Windows systems.

- `owner`: string = 'root' — The name of the owning user for this file.

  Not supported for Windows systems.

- `serviceRestartHandles`: [InitServiceRestartHandle](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.InitServiceRestartHandle.html)[] = Do not restart any service — Restart the given service after this file has been written.
