Class InstanceRequireImdsv2Aspect
Aspect that applies IMDS configuration on EC2 Instance constructs.
Implements
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class InstanceRequireImdsv2Aspect : DeputyBase, IAspect
Syntax (vb)
Public Class InstanceRequireImdsv2Aspect Inherits DeputyBase Implements IAspect
Remarks
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.
ExampleMetadata: infused
Examples
var aspect = new InstanceRequireImdsv2Aspect();
Aspects.Of(this).Add(aspect);
Synopsis
Constructors
| InstanceRequireImdsv2Aspect(IInstanceRequireImdsv2AspectProps?) | Aspect that applies IMDS configuration on EC2 Instance constructs. |
Properties
| SuppressWarnings | Aspect that applies IMDS configuration on EC2 Instance constructs. |
Methods
| Visit(IConstruct) | All aspects can visit an IConstruct. |
| Warn(IConstruct, string) | Adds a warning annotation to a node, unless |
Constructors
InstanceRequireImdsv2Aspect(IInstanceRequireImdsv2AspectProps?)
Aspect that applies IMDS configuration on EC2 Instance constructs.
public InstanceRequireImdsv2Aspect(IInstanceRequireImdsv2AspectProps? props = null)
Parameters
Remarks
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.
ExampleMetadata: infused
Examples
var aspect = new InstanceRequireImdsv2Aspect();
Aspects.Of(this).Add(aspect);
Properties
SuppressWarnings
Aspect that applies IMDS configuration on EC2 Instance constructs.
protected virtual bool SuppressWarnings { get; }
Property Value
Remarks
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.
ExampleMetadata: infused
Examples
var aspect = new InstanceRequireImdsv2Aspect();
Aspects.Of(this).Add(aspect);
Methods
Visit(IConstruct)
All aspects can visit an IConstruct.
public virtual void Visit(IConstruct node)
Parameters
- node IConstruct
Remarks
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.
ExampleMetadata: infused
Warn(IConstruct, string)
Adds a warning annotation to a node, unless suppressWarnings is true.
protected virtual void Warn(IConstruct node, string message)
Parameters
- node IConstruct
- message string
Remarks
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.
ExampleMetadata: infused