# InstanceRequireImdsv2Aspect

Aspect that applies IMDS configuration on EC2 Instance constructs.

This aspect configures IMDS on an EC2 instance by creating a Launch Template with the
IMDS configuration and associating that Launch Template with the instance. If an Instance
is already associated with a Launch Template, a warning will (optionally) be added to the
construct node and it will be skipped.

To cover Instances already associated with Launch Templates, use `LaunchTemplateImdsAspect`.

Extends: InstanceRequireImdsv2Aspect
Implements: IAspect

- Source: [`aws-ec2/lib/aspects/require-imdsv2-aspect.ts`](https://github.com/aws/aws-cdk/blob/v2.273.0/packages/aws-cdk-lib/aws-ec2/lib/aspects/require-imdsv2-aspect.ts#L71)

## Example

```ts
const aspect = new ec2.InstanceRequireImdsv2Aspect();
Aspects.of(this).add(aspect);
```

## Initializer

```ts
new InstanceRequireImdsv2Aspect(props?: InstanceRequireImdsv2AspectProps)
```

## Methods

- `visit(node: IConstruct): void` — All aspects can visit an IConstruct.
