Configuration options for the [[GuEc2App]] pattern.

To grant EC2 instances additional IAM permissions, use the roleConfiguration prop. For example, to allow your app to write to DynamoDB:

// other props
roleConfiguration: {
additionalPolicies: [new GuDynamoDBWritePolicy(stack, "DynamoTable", { tableName: "my-dynamo-table" })],
}

To create alarms (recommended), use:

// other props
monitoringConfiguration: {
snsTopicName: "alerts-topic-for-my-team",
http5xxAlarm: {
tolerated5xxPercentage: 1,
},
unhealthyInstancesAlarm: true,
}

To opt out of creating alarms, use:

// other props
monitoringConfiguration: { noMonitoring: true }

To automatically ship application logs from stdout to ELK, use:

{
// other props
applicationLogging: { enabled: true }
}

For more details on the requirements for application log shipping, see [[ApplicationLoggingProps]].

To enable access logging for your load balancer, you can specify the prefix to write the logs to. The S3 bucket used to hold these access logs must be specified in SSM at /account/services/access-logging/bucket You must specify a region in your stack declaration if you are to use this prop, as specified here: https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-elasticloadbalancingv2.ApplicationLoadBalancer.html#logwbraccesswbrlogsbucket-prefix For example:

{
// other props
accessLogging: {
enabled: true,
prefix: "my-application-logs"
}
}

If you would like to enable access logging at the root of the S3 bucket (ie without a prefix), you can omit the prefix
For example:
```typescript
{
// other props
accessLogging: {
enabled: true,
}
}

Hierarchy

Properties

access: AppAccess
accessLogging?: AccessLoggingProps
app: string
applicationLogging?: ApplicationLoggingProps
applicationPort: number
blockDevices?: BlockDevice[]
certificateProps: GuDomainName
imageRecipe?: string | AmigoProps
instanceType: InstanceType
monitoringConfiguration: NoMonitoring | Alarms
privateSubnets?: ISubnet[]
publicSubnets?: ISubnet[]
roleConfiguration?: GuInstanceRoleProps
scaling: GuAsgCapacity
userData: string | GuUserDataProps
vpc?: IVpc
withoutImdsv2?: boolean

Generated using TypeDoc