InstanceRequireImdsv2Aspect(*, suppress_launch_template_warning=None, suppress_warnings=None)¶
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
aspect = ec2.InstanceRequireImdsv2Aspect() Aspects.of(self).add(aspect)
bool]) – Whether warnings that would be raised when an Instance is associated with an existing Launch Template should be suppressed or not. You can set this to
LaunchTemplateImdsAspectis being used alongside this Aspect to suppress false-positive warnings because any Launch Templates associated with Instances will still be covered. Default: - false
bool]) – Whether warning annotations from this Aspect should be suppressed or not. Default: - false