Header menu logo FsCDK

EC2InstanceConfig Type

High-level EC2 Instance builder following AWS security best practices. **Default Security Settings:** - Instance type = t3.micro (cost-effective for dev/test) - Detailed monitoring = disabled (opt-in via monitoring operation) - IMDSv2 required = true (enhanced security for instance metadata) - EBS encryption = enabled by default **Rationale:** These defaults follow AWS Well-Architected Framework: - t3.micro provides good balance of compute/cost for many workloads - IMDSv2 prevents SSRF attacks against instance metadata - EBS encryption protects data at rest - Minimal IAM permissions follow least-privilege principle **Escape Hatch:** Access the underlying CDK Instance via the `Instance` property on the returned resource for advanced scenarios not covered by this builder.

Record fields

Record Field Description

BlockDevices

Full Usage: BlockDevices

Field type: IBlockDevice list
Field type: IBlockDevice list

ConstructId

Full Usage: ConstructId

Field type: string option
Field type: string option

DetailedMonitoring

Full Usage: DetailedMonitoring

Field type: bool option
Field type: bool option

InstanceName

Full Usage: InstanceName

Field type: string
Field type: string

InstanceType

Full Usage: InstanceType

Field type: InstanceType option
Field type: InstanceType option

KeyPair

Full Usage: KeyPair

Field type: IKeyPair option
Field type: IKeyPair option

KeyPairName

Full Usage: KeyPairName

Field type: string option
Field type: string option

MachineImage

Full Usage: MachineImage

Field type: IMachineImage option
Field type: IMachineImage option

RequireImdsv2

Full Usage: RequireImdsv2

Field type: bool option
Field type: bool option

Role

Full Usage: Role

Field type: IRole option
Field type: IRole option

SecurityGroup

Full Usage: SecurityGroup

Field type: ISecurityGroup option
Field type: ISecurityGroup option

UserData

Full Usage: UserData

Field type: UserData option
Field type: UserData option

Vpc

Full Usage: Vpc

Field type: IVpc option
Field type: IVpc option

VpcSubnets

Full Usage: VpcSubnets

Field type: SubnetSelection option
Field type: SubnetSelection option

Type something to start searching.