# InstanceInitiatedShutdownBehavior

Provides the options for specifying the instance initiated shutdown behavior.

- Source: [`aws-ec2/lib/launch-template.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-ec2/lib/launch-template.ts#L67)

## Example

```ts
declare const vpc: ec2.Vpc;

new ec2.Instance(this, 'Instance', {
  vpc,
  instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.NANO),
  machineImage: new ec2.AmazonLinuxImage({ generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2 }),
  instanceInitiatedShutdownBehavior: ec2.InstanceInitiatedShutdownBehavior.TERMINATE, // default is STOP
});
```

## Members

| Member | Description |
| --- | --- |
| `STOP` | The instance will stop when it initiates a shutdown. |
| `TERMINATE` | The instance will be terminated when it initiates a shutdown. |

## Referenced by

- [`InstanceProps`](/v2/docs/aws-cdk-lib.aws_ec2.InstanceProps).instanceInitiatedShutdownBehavior
- [`LaunchTemplateProps`](/v2/docs/aws-cdk-lib.aws_ec2.LaunchTemplateProps).instanceInitiatedShutdownBehavior
