Documentation
¶
Index ¶
- func GenerateCRUDHandlerCode(operation string) string
- type APIKeyAuthorizer
- type APIKeyAuthorizerProps
- type AlarmConfig
- type AlarmThresholds
- type AuditLevel
- type AuditingConstruct
- type AuditingProps
- type ComplianceFramework
- type ComplianceStack
- type ComplianceStackProps
- type ConnectionTable
- type ConnectionTableProps
- type DynamORMEventStore
- func (e *DynamORMEventStore) GetArchivalBucket() awss3.IBucket
- func (e *DynamORMEventStore) GetEnvironmentVariables() *map[string]*string
- func (e *DynamORMEventStore) GetEventReaderRole() awsiam.Role
- func (e *DynamORMEventStore) GetEventStoreMetrics() map[string]awscloudwatch.Metric
- func (e *DynamORMEventStore) GetEventTable() *LiftTable
- func (e *DynamORMEventStore) GetEventWriterRole() awsiam.Role
- func (e *DynamORMEventStore) GetSnapshotManagerRole() awsiam.Role
- func (e *DynamORMEventStore) GetSnapshotTable() *LiftTable
- func (e *DynamORMEventStore) GrantEventReaderAccess(grantee awslambda.IFunction)
- func (e *DynamORMEventStore) GrantEventWriterAccess(grantee awslambda.IFunction)
- func (e *DynamORMEventStore) GrantFullAccess(grantee awslambda.IFunction)
- func (e *DynamORMEventStore) GrantSnapshotManagerAccess(grantee awslambda.IFunction)
- type DynamORMEventStoreProps
- type DynamoStreamProcessor
- func (d *DynamoStreamProcessor) AddEnvironmentVariable(key string, value string)
- func (d *DynamoStreamProcessor) GetDeadLetterQueueUrl() *string
- func (d *DynamoStreamProcessor) GetStreamArn() *string
- func (d *DynamoStreamProcessor) GetTableArn() *string
- func (d *DynamoStreamProcessor) GetTableName() *string
- func (d *DynamoStreamProcessor) GrantReadData(grantee awslambda.IFunction)
- func (d *DynamoStreamProcessor) GrantReadWriteData(grantee awslambda.IFunction)
- func (d *DynamoStreamProcessor) GrantStreamRead(grantee awslambda.IFunction)
- func (d *DynamoStreamProcessor) GrantWriteData(grantee awslambda.IFunction)
- type DynamoStreamProcessorProps
- type EnhancedMonitoring
- func (m *EnhancedMonitoring) AddCustomAlarm(name string, alarm awscloudwatch.IAlarm)
- func (m *EnhancedMonitoring) AddCustomMetric(name string, metric awscloudwatch.IMetric)
- func (m *EnhancedMonitoring) GetAlarm(name string) awscloudwatch.IAlarm
- func (m *EnhancedMonitoring) GetMetric(name string) awscloudwatch.IMetric
- type EnhancedMonitoringProps
- type EnhancedSecurity
- func (s *EnhancedSecurity) AddCustomSecurityRule(rule SecurityRule, direction string)
- func (s *EnhancedSecurity) GetSecret(name string) awssecretsmanager.Secret
- func (s *EnhancedSecurity) GetSecurityGroup() awsec2.ISecurityGroup
- func (s *EnhancedSecurity) GetSecurityMetric(name string) awscloudwatch.IMetric
- func (s *EnhancedSecurity) GetVPCEndpoint(name string) awsec2.InterfaceVpcEndpoint
- func (s *EnhancedSecurity) GetWAF() awswafv2.CfnWebACL
- type EnhancedSecurityProps
- type EventBridgeHandler
- func (e *EventBridgeHandler) AddEnvironmentVariable(key string, value string)
- func (e *EventBridgeHandler) AddEventPattern(eventPattern *awsevents.EventPattern) error
- func (e *EventBridgeHandler) DisableRule() error
- func (e *EventBridgeHandler) EnableRule() error
- func (e *EventBridgeHandler) GetEventBusArn() *string
- func (e *EventBridgeHandler) GetEventBusName() *string
- func (e *EventBridgeHandler) GetRuleArn() *string
- func (e *EventBridgeHandler) GetRuleName() *string
- func (e *EventBridgeHandler) GrantPutEvents(grantee awslambda.IFunction)
- type EventBridgeHandlerProps
- type EventRoutingTable
- type EventRoutingTableProps
- type EventStoreAlertThresholds
- type EventStorePattern
- type IdempotencyTableProps
- type IdempotentFunction
- type IdempotentFunctionProps
- type IdempotentKeyExtractor
- type KinesisProcessor
- func (k *KinesisProcessor) AddConsumer(id *string, consumerName *string) awskinesis.IStreamConsumer
- func (k *KinesisProcessor) GetDLQUrl() *string
- func (k *KinesisProcessor) GetStreamArn() *string
- func (k *KinesisProcessor) GetStreamName() *string
- func (k *KinesisProcessor) GrantRead(grantee awsiam.IGrantable) awsiam.Grant
- func (k *KinesisProcessor) GrantReadWrite(grantee awsiam.IGrantable) awsiam.Grant
- func (k *KinesisProcessor) GrantWrite(grantee awsiam.IGrantable) awsiam.Grant
- func (k *KinesisProcessor) Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func (k *KinesisProcessor) MetricGetRecords(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func (k *KinesisProcessor) MetricPutRecords(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- type KinesisProcessorProps
- type LiftAPI
- func (api *LiftAPI) AddLambdaRoute(path *string, method awsapigatewayv2.HttpMethod, fn awslambda.IFunction)
- func (api *LiftAPI) AddLambdaRouteWithOptions(path *string, method awsapigatewayv2.HttpMethod, fn awslambda.IFunction, ...)
- func (api *LiftAPI) AddRoutes(routes map[string]map[string]awslambda.IFunction)
- func (api *LiftAPI) EnableApiKeyAuth() awsapigatewayv2.IHttpRouteAuthorizer
- func (api *LiftAPI) GetArn() *string
- func (l *LiftAPI) GetResourceName() *string
- func (api *LiftAPI) GetUrl() *string
- func (api *LiftAPI) GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant
- type LiftAPIProps
- type LiftFunction
- func (f *LiftFunction) AddEnvironment(key *string, value *string)
- func (f *LiftFunction) AddEventSource(source awslambda.IEventSource)
- func (f *LiftFunction) AddToRolePolicy(statement awsiam.PolicyStatement)
- func (f *LiftFunction) ConfigureDynamORM(tableName *string, debug *bool)
- func (f *LiftFunction) GetDeadLetterQueue() awssqs.IQueue
- func (f *LiftFunction) GetFunction() awslambda.Function
- func (l *LiftFunction) GetResourceName() *string
- func (f *LiftFunction) GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant
- func (f *LiftFunction) Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- type LiftFunctionProps
- type LiftTable
- type LiftTableProps
- type MetricConfiguration
- type MonitorableResource
- type MonitoredFunction
- func (f *MonitoredFunction) AddCommonLogInsightsQueries()
- func (f *MonitoredFunction) AddCustomMetric(metricName *string, namespace *string, dimensions *map[string]*string) awscloudwatch.Metric
- func (f *MonitoredFunction) AddLogInsightsQuery(queryName *string, queryString *string)
- func (f *MonitoredFunction) GetAlarm(name string) awscloudwatch.Alarm
- func (f *MonitoredFunction) GetDashboard() awscloudwatch.Dashboard
- func (f *MonitoredFunction) GetFunction() awslambda.Function
- type MonitoredFunctionProps
- type RateLimitTableProps
- type RateLimitType
- type RateLimitedFunction
- type RateLimitedFunctionProps
- type RequestTrackingTable
- type RequestTrackingTableProps
- type RequestValidator
- type RouteOptions
- type S3EventFilter
- type S3Processor
- func (s *S3Processor) AddCorsRule(rule *awss3.CorsRule)
- func (s *S3Processor) AddEnvironmentVariable(key string, value string)
- func (s *S3Processor) EnableCORS(rules []*awss3.CorsRule)
- func (s *S3Processor) GetBucketArn() *string
- func (s *S3Processor) GetBucketDomainName() *string
- func (s *S3Processor) GetBucketName() *string
- func (s *S3Processor) GrantDelete(grantee awslambda.IFunction)
- func (s *S3Processor) GrantRead(grantee awslambda.IFunction)
- func (s *S3Processor) GrantReadWrite(grantee awslambda.IFunction)
- func (s *S3Processor) GrantWrite(grantee awslambda.IFunction)
- func (s *S3Processor) SetBucketPolicy(policy map[string]interface{})
- type S3ProcessorProps
- type SNSProcessor
- func (s *SNSProcessor) AddSubscription(subscription awssns.ITopicSubscription) awssns.Subscription
- func (s *SNSProcessor) GetDLQUrl() *string
- func (s *SNSProcessor) GetTopicArn() *string
- func (s *SNSProcessor) GetTopicName() *string
- func (s *SNSProcessor) GrantPublish(grantee awsiam.IGrantable) awsiam.Grant
- func (s *SNSProcessor) GrantSubscribe(grantee awsiam.IGrantable) awsiam.Grant
- type SNSProcessorProps
- type SQSProcessor
- func (s *SQSProcessor) AddEnvironmentVariable(key string, value string)
- func (s *SQSProcessor) GetQueueArn() *string
- func (s *SQSProcessor) GetQueueName() *string
- func (s *SQSProcessor) GetQueueUrl() *string
- func (s *SQSProcessor) GrantConsumeMessages(grantee awslambda.IFunction)
- func (s *SQSProcessor) GrantSendMessages(grantee awslambda.IFunction)
- type SQSProcessorProps
- type SecretConfig
- type SecureFunction
- func (f *SecureFunction) AddVPCEndpoint(service awsec2.InterfaceVpcEndpointAwsService) awsec2.InterfaceVpcEndpoint
- func (f *SecureFunction) EnableSecretsManagerAccess()
- func (f *SecureFunction) GetFunction() awslambda.Function
- func (f *SecureFunction) GetKmsKey() awskms.IKey
- func (f *SecureFunction) GetSecurityGroup() awsec2.ISecurityGroup
- func (f *SecureFunction) RestrictInboundAccess()
- type SecureFunctionProps
- type SecurityRule
- type SnapshotStrategy
- type StreamProcessor
- type StreamProcessorProps
- type StreamingTable
- type StreamingTableProps
- type WAFCustomRule
- type WAFRuleConfig
- type WebSocketAPI
- func (w *WebSocketAPI) AddEnvironmentVariable(key string, value string)
- func (w *WebSocketAPI) AddRoute(routeKey string, function awslambda.IFunction, config *WebSocketRouteConfig) awsapigatewayv2.WebSocketRoute
- func (w *WebSocketAPI) GetConnectionTableName() *string
- func (w *WebSocketAPI) GetWebSocketURL() *string
- func (w *WebSocketAPI) GrantApiInvoke(grantee awsiam.IGrantable) awsiam.Grant
- func (w *WebSocketAPI) GrantConnectionManagement(grantee awsiam.IGrantable) awsiam.Grant
- type WebSocketAPIProps
- type WebSocketRouteConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCRUDHandlerCode ¶
GenerateCRUDHandlerCode generates the Lambda handler code for a CRUD operation This is exported for use in CDK constructs
Types ¶
type APIKeyAuthorizer ¶
type APIKeyAuthorizer struct {
constructs.Construct
Authorizer awsapigatewayv2.IHttpRouteAuthorizer
ValidatorFunction awslambda.IFunction
}
APIKeyAuthorizer provides API key authentication for HTTP APIs
func NewAPIKeyAuthorizer ¶
func NewAPIKeyAuthorizer(scope constructs.Construct, id *string, props *APIKeyAuthorizerProps) *APIKeyAuthorizer
NewAPIKeyAuthorizer creates a new API key authorizer
type APIKeyAuthorizerProps ¶
type APIKeyAuthorizerProps struct {
// API key parameter source (header or query)
APIKeySource *string `json:"apiKeySource"`
// Parameter name (e.g., "X-API-Key" for header or "apiKey" for query)
APIKeyParameter *string `json:"apiKeyParameter"`
// Optional function to validate API keys (if not provided, creates one)
ValidatorFunction awslambda.IFunction `json:"validatorFunction"`
// DynamoDB table name for storing API keys (optional)
APIKeyTableName *string `json:"apiKeyTableName"`
// Cache results for this many seconds (0-3600)
ResultsCacheTtl *float64 `json:"resultsCacheTtl"`
}
APIKeyAuthorizerProps defines properties for the API key authorizer
type AlarmConfig ¶
type AlarmConfig struct {
// Enable error rate alarm
EnableErrorAlarm *bool
// Error rate threshold (percentage)
ErrorRateThreshold *float64
// Enable latency alarm
EnableLatencyAlarm *bool
// Latency threshold in milliseconds
LatencyThreshold *float64
// Enable throttle alarm
EnableThrottleAlarm *bool
// Throttle count threshold
ThrottleThreshold *float64
// Enable concurrent executions alarm
EnableConcurrentAlarm *bool
// Concurrent executions threshold
ConcurrentThreshold *float64
// SNS topic for alarm notifications
AlarmTopic awssns.ITopic
}
AlarmConfig defines configuration for CloudWatch alarms
type AlarmThresholds ¶
type AlarmThresholds struct {
// Error rate threshold (percentage)
ErrorRate *float64
// Latency threshold (milliseconds)
LatencyP99 *float64
// Throttle count threshold
ThrottleCount *float64
// Concurrent executions threshold
ConcurrentExecutions *float64
// Custom thresholds
CustomThresholds *map[string]*float64
}
AlarmThresholds defines threshold configuration for alarms
type AuditLevel ¶
type AuditLevel string
AuditLevel defines the level of audit logging
const ( // AuditLevelBasic provides basic audit logging AuditLevelBasic AuditLevel = "BASIC" // AuditLevelDetailed provides detailed audit logging AuditLevelDetailed AuditLevel = "DETAILED" // AuditLevelComprehensive provides comprehensive audit logging AuditLevelComprehensive AuditLevel = "COMPREHENSIVE" )
type AuditingConstruct ¶
type AuditingConstruct struct {
constructs.Construct
AuditBucket awss3.Bucket
EncryptionKey awskms.Key
CloudTrail awscloudtrail.Trail
ApplicationLogGroup awslogs.LogGroup
DatabaseLogGroup awslogs.LogGroup
AuditLogGroup awslogs.LogGroup
LogProcessingFunction awslambda.Function
LogStream awskinesis.Stream
FirehoseDeliveryStream awskinesisfirehose.CfnDeliveryStream
AuditDashboard awscloudwatch.Dashboard
AuditAlarms []awscloudwatch.Alarm
IntegrityFunction awslambda.Function
ComplianceFunction awslambda.Function
}
AuditingConstruct creates comprehensive audit logging infrastructure
func NewAuditingConstruct ¶
func NewAuditingConstruct(scope constructs.Construct, id string, props *AuditingProps) *AuditingConstruct
NewAuditingConstruct creates a new auditing construct
func (*AuditingConstruct) AddCustomAuditRule ¶
func (a *AuditingConstruct) AddCustomAuditRule(ruleId string, logGroup awslogs.LogGroup, filterPattern string)
AddCustomAuditRule adds a custom audit rule
func (*AuditingConstruct) EnableSIEMIntegration ¶
func (a *AuditingConstruct) EnableSIEMIntegration(endpoint string)
EnableSIEMIntegration enables SIEM integration for audit logs
func (*AuditingConstruct) GetAuditStatus ¶
func (a *AuditingConstruct) GetAuditStatus() map[string]interface{}
GetAuditStatus returns the current audit status
type AuditingProps ¶
type AuditingProps struct {
// Application name for resource naming
AppName *string
// Audit level - determines the scope of audit logging
AuditLevel AuditLevel
// Enable CloudTrail for API audit logging
EnableCloudTrail *bool
// Enable application-level audit logging
EnableApplicationLogs *bool
// Enable database audit logging
EnableDatabaseLogs *bool
// Enable real-time log processing
EnableRealTimeProcessing *bool
// Enable tamper protection for logs
EnableTamperProtection *bool
// Enable log aggregation across multiple regions
EnableLogAggregation *bool
// Log retention period in days
LogRetentionDays *float64
// Enable SIEM integration
EnableSIEMIntegration *bool
// SIEM endpoint URL for log forwarding
SIEMEndpoint *string
// Enable log analysis and anomaly detection
EnableLogAnalysis *bool
// Enable compliance reporting
EnableComplianceReporting *bool
// Environment for audit logging (dev, staging, prod)
Environment *string
// Enable log encryption
EnableEncryption *bool
// Custom KMS key for encryption
EncryptionKey awskms.IKey
// Custom S3 bucket for audit logs
AuditBucket awss3.IBucket
// Enable cross-account log sharing
EnableCrossAccountAccess *bool
// Cross-account role ARNs for log access
CrossAccountRoleArns *[]*string
// Enable audit trail integrity checking
EnableIntegrityChecking *bool
// Enable audit dashboard
EnableDashboard *bool
// Enable audit alerting
EnableAlerting *bool
// SNS topic ARN for audit alerts
AlertTopicArn *string
// Enable immutable audit logs
EnableImmutableLogs *bool
// Enable regulatory compliance features
EnableRegulatoryCompliance *bool
// Compliance frameworks to support
ComplianceFrameworks *[]string
}
AuditingProps defines properties for the Auditing construct
type ComplianceFramework ¶
type ComplianceFramework string
ComplianceFramework defines the compliance framework to implement
const ( // SOC2 Service Organization Control 2 SOC2 ComplianceFramework = "SOC2" // HIPAA Health Insurance Portability and Accountability Act HIPAA ComplianceFramework = "HIPAA" // PCI_DSS Payment Card Industry Data Security Standard PCI_DSS ComplianceFramework = "PCI_DSS" // ISO27001 Information Security Management System ISO27001 ComplianceFramework = "ISO27001" // FedRAMP Federal Risk and Authorization Management Program FedRAMP ComplianceFramework = "FedRAMP" // GDPR General Data Protection Regulation GDPR ComplianceFramework = "GDPR" )
type ComplianceStack ¶
type ComplianceStack struct {
constructs.Construct
CloudTrail awscloudtrail.Trail
ConfigRecorder awsconfig.CfnConfigurationRecorder
GuardDutyDetector awsguardduty.CfnDetector
SecurityHub awssecurityhub.CfnHub
ComplianceBucket awss3.Bucket
EncryptionKey awskms.Key
ComplianceLogGroup awslogs.LogGroup
ComplianceFunction awslambda.Function
}
ComplianceStack creates a comprehensive compliance stack
func NewComplianceStack ¶
func NewComplianceStack(scope constructs.Construct, id string, props *ComplianceStackProps) *ComplianceStack
NewComplianceStack creates a new compliance stack construct
func (*ComplianceStack) AddComplianceRule ¶
func (c *ComplianceStack) AddComplianceRule(ruleId string, ruleName string)
AddComplianceRule adds a new compliance rule to the stack
func (*ComplianceStack) GetComplianceStatus ¶
func (c *ComplianceStack) GetComplianceStatus() map[string]interface{}
GetComplianceStatus returns the current compliance status
type ComplianceStackProps ¶
type ComplianceStackProps struct {
// Application name for resource naming
AppName *string
// Compliance frameworks to implement
ComplianceFrameworks *[]ComplianceFramework
// Enable CloudTrail logging
EnableCloudTrail *bool
// Enable AWS Config rules
EnableConfig *bool
// Enable GuardDuty threat detection
EnableGuardDuty *bool
// Enable Security Hub
EnableSecurityHub *bool
// Enable data encryption at rest
EnableEncryption *bool
// Data retention period in days
DataRetentionDays *float64
// Enable compliance reports
EnableComplianceReports *bool
// S3 bucket for compliance data
ComplianceBucket awss3.IBucket
// KMS key for encryption
EncryptionKey awskms.IKey
// CloudWatch log group for compliance logs
ComplianceLogGroup awslogs.ILogGroup
// Enable detailed access logging
EnableDetailedLogging *bool
// Enable audit trail
EnableAuditTrail *bool
// Environment for compliance (dev, staging, prod)
Environment *string
// Organization ID for multi-account setup
OrganizationId *string
// Enable compliance automation
EnableAutomation *bool
// Notification topic ARN for compliance alerts
NotificationTopicArn *string
}
ComplianceStackProps defines properties for ComplianceStack
type ConnectionTable ¶
type ConnectionTable struct {
*LiftTable
// contains filtered or unexported fields
}
ConnectionTable is a table for managing WebSocket connections
func NewConnectionTable ¶
func NewConnectionTable(scope constructs.Construct, id *string, props *ConnectionTableProps) *ConnectionTable
NewConnectionTable creates a new connection management table The table uses pk/sk for connection_id and metadata storage GSIs should be defined in your DynamORM model structs
func (*ConnectionTable) GrantConnectionManagement ¶
func (c *ConnectionTable) GrantConnectionManagement(grantee awsiam.IGrantable)
GrantConnectionManagement grants permissions to manage WebSocket connections
type ConnectionTableProps ¶
type ConnectionTableProps struct {
// Table name
TableName *string
// Enable TTL for automatic connection cleanup
TimeToLiveAttribute *string
}
ConnectionTableProps defines properties for the WebSocket connection table
type DynamORMEventStore ¶
type DynamORMEventStore struct {
constructs.Construct
// Event table for storing events
EventTable *LiftTable
// Snapshot table for storing snapshots
SnapshotTable *LiftTable
// S3 bucket for archival (if enabled)
ArchivalBucket awss3.IBucket
// CloudWatch metrics
Metrics map[string]awscloudwatch.Metric
// IAM roles for different access patterns
EventReaderRole awsiam.Role
EventWriterRole awsiam.Role
SnapshotManagerRole awsiam.Role
// contains filtered or unexported fields
}
DynamORMEventStore provides event sourcing capabilities using DynamORM
func NewDynamORMEventStore ¶
func NewDynamORMEventStore(scope constructs.Construct, id *string, props *DynamORMEventStoreProps) *DynamORMEventStore
NewDynamORMEventStore creates a new DynamORM event store construct
func (*DynamORMEventStore) GetArchivalBucket ¶
func (e *DynamORMEventStore) GetArchivalBucket() awss3.IBucket
GetArchivalBucket returns the archival bucket
func (*DynamORMEventStore) GetEnvironmentVariables ¶
func (e *DynamORMEventStore) GetEnvironmentVariables() *map[string]*string
GetEnvironmentVariables returns environment variables for Lambda functions
func (*DynamORMEventStore) GetEventReaderRole ¶
func (e *DynamORMEventStore) GetEventReaderRole() awsiam.Role
GetEventReaderRole returns the event reader IAM role
func (*DynamORMEventStore) GetEventStoreMetrics ¶
func (e *DynamORMEventStore) GetEventStoreMetrics() map[string]awscloudwatch.Metric
GetEventStoreMetrics returns event store CloudWatch metrics
func (*DynamORMEventStore) GetEventTable ¶
func (e *DynamORMEventStore) GetEventTable() *LiftTable
GetEventTable returns the event table
func (*DynamORMEventStore) GetEventWriterRole ¶
func (e *DynamORMEventStore) GetEventWriterRole() awsiam.Role
GetEventWriterRole returns the event writer IAM role
func (*DynamORMEventStore) GetSnapshotManagerRole ¶
func (e *DynamORMEventStore) GetSnapshotManagerRole() awsiam.Role
GetSnapshotManagerRole returns the snapshot manager IAM role
func (*DynamORMEventStore) GetSnapshotTable ¶
func (e *DynamORMEventStore) GetSnapshotTable() *LiftTable
GetSnapshotTable returns the snapshot table
func (*DynamORMEventStore) GrantEventReaderAccess ¶
func (e *DynamORMEventStore) GrantEventReaderAccess(grantee awslambda.IFunction)
GrantEventReaderAccess grants event reader access to a Lambda function
func (*DynamORMEventStore) GrantEventWriterAccess ¶
func (e *DynamORMEventStore) GrantEventWriterAccess(grantee awslambda.IFunction)
GrantEventWriterAccess grants event writer access to a Lambda function
func (*DynamORMEventStore) GrantFullAccess ¶
func (e *DynamORMEventStore) GrantFullAccess(grantee awslambda.IFunction)
GrantFullAccess grants full event store access to a Lambda function
func (*DynamORMEventStore) GrantSnapshotManagerAccess ¶
func (e *DynamORMEventStore) GrantSnapshotManagerAccess(grantee awslambda.IFunction)
GrantSnapshotManagerAccess grants snapshot manager access to a Lambda function
type DynamORMEventStoreProps ¶
type DynamORMEventStoreProps struct {
// Event store pattern
Pattern EventStorePattern
// Table configuration
EventTableName *string
SnapshotTableName *string
// Multi-tenant configuration
EnableMultiTenant *bool
TenantAttribute *string
// Event configuration
EnableEventVersioning *bool
EnableEventEncryption *bool
EnableEventCompression *bool
EventTTL awscdk.Duration // TTL for old events
// Snapshot configuration
SnapshotStrategy SnapshotStrategy
SnapshotFrequency *int // Number of events between snapshots
SnapshotSizeLimit *int // Size limit in KB for snapshots
SnapshotTimeInterval awscdk.Duration // Time interval for snapshots
SnapshotRetention awscdk.Duration // How long to keep snapshots
// Performance configuration
EventStreamEnabled *bool // Enable DynamoDB streams for events
SnapshotStreamEnabled *bool // Enable DynamoDB streams for snapshots
EnableAutoScaling *bool // Enable auto-scaling
ReadCapacity *float64 // Read capacity units
WriteCapacity *float64 // Write capacity units
// Archival configuration
EnableArchival *bool // Enable event archival to S3
ArchivalBucket awss3.IBucket // S3 bucket for archival
ArchivalAfter awscdk.Duration // Archive events after this duration
// Monitoring configuration
EnableMetrics *bool // Enable CloudWatch metrics
EnableDetailedMetrics *bool // Enable detailed monitoring
AlertThresholds *EventStoreAlertThresholds
// Security configuration
EnableEncryption *bool // Enable encryption at rest
KMSKey *string // KMS key for encryption
// Query optimization
EnableGSIs *bool // Enable Global Secondary Indexes
ProjectionQueries []string // Queries for projection views
// Tags
Tags *map[string]*string
}
DynamORMEventStoreProps defines properties for DynamORM event store
type DynamoStreamProcessor ¶
type DynamoStreamProcessor struct {
constructs.Construct
// The Lambda function processing DynamoDB stream records
Function *LiftFunction
// The DynamORM streaming table
StreamingTable *StreamingTable
// Dead letter queue (if enabled)
DeadLetterQueue awssqs.IQueue
// Event source mapping
EventSource awslambdaeventsources.DynamoEventSource
}
DynamoStreamProcessor represents a DynamoDB table with stream processor using DynamORM
func NewDynamoStreamProcessor ¶
func NewDynamoStreamProcessor(scope constructs.Construct, id *string, props *DynamoStreamProcessorProps) *DynamoStreamProcessor
NewDynamoStreamProcessor creates a new DynamoDB stream processor construct using DynamORM
func (*DynamoStreamProcessor) AddEnvironmentVariable ¶
func (d *DynamoStreamProcessor) AddEnvironmentVariable(key string, value string)
AddEnvironmentVariable adds an environment variable to the Lambda function
func (*DynamoStreamProcessor) GetDeadLetterQueueUrl ¶
func (d *DynamoStreamProcessor) GetDeadLetterQueueUrl() *string
GetDeadLetterQueueUrl returns the DLQ URL if enabled
func (*DynamoStreamProcessor) GetStreamArn ¶
func (d *DynamoStreamProcessor) GetStreamArn() *string
GetStreamArn returns the DynamoDB stream ARN
func (*DynamoStreamProcessor) GetTableArn ¶
func (d *DynamoStreamProcessor) GetTableArn() *string
GetTableArn returns the table ARN
func (*DynamoStreamProcessor) GetTableName ¶
func (d *DynamoStreamProcessor) GetTableName() *string
GetTableName returns the table name
func (*DynamoStreamProcessor) GrantReadData ¶
func (d *DynamoStreamProcessor) GrantReadData(grantee awslambda.IFunction)
GrantReadData grants permission to read data from the table
func (*DynamoStreamProcessor) GrantReadWriteData ¶
func (d *DynamoStreamProcessor) GrantReadWriteData(grantee awslambda.IFunction)
GrantReadWriteData grants permission to read and write data to the table
func (*DynamoStreamProcessor) GrantStreamRead ¶
func (d *DynamoStreamProcessor) GrantStreamRead(grantee awslambda.IFunction)
GrantStreamRead grants permission to read from the DynamoDB stream
func (*DynamoStreamProcessor) GrantWriteData ¶
func (d *DynamoStreamProcessor) GrantWriteData(grantee awslambda.IFunction)
GrantWriteData grants permission to write data to the table
type DynamoStreamProcessorProps ¶
type DynamoStreamProcessorProps struct {
// Lambda function properties
FunctionProps awslambda.FunctionProps
// DynamORM Streaming table properties (creates new table if not provided)
StreamingTableProps *StreamingTableProps
// Dead letter queue properties (optional)
DeadLetterQueueProps *awssqs.QueueProps
// Enable dead letter queue (default: true)
EnableDeadLetterQueue *bool
// DynamoDB Streams event source configuration
EventSourceProps *awslambdaeventsources.DynamoEventSourceProps
// Additional DynamoDB stream processor settings
BatchSize *float64 // Default: 10
MaxBatchingWindow awscdk.Duration // Default: 5 seconds
StartingPosition awslambda.StartingPosition // Default: LATEST
MaxRecordAge awscdk.Duration // Default: 24 hours
BisectBatchOnError *bool // Default: false
RetryAttempts *float64 // Default: 10000
ReportBatchItemFailures *bool // Default: true
TumblingWindow awscdk.Duration // For tumbling window processing
ParallelizationFactor *float64 // Default: 1
// Lift-specific settings
EnableTracing *bool
EnableMultiTenant *bool
EnableMonitoring *bool
}
DynamoStreamProcessorProps defines properties for a DynamoDB stream processor
type EnhancedMonitoring ¶
type EnhancedMonitoring struct {
constructs.Construct
Metrics map[string]awscloudwatch.IMetric
Alarms map[string]awscloudwatch.IAlarm
Dashboard awscloudwatch.Dashboard
LogGroup awslogs.LogGroup
MetricFilters map[string]awslogs.MetricFilter
}
EnhancedMonitoring provides comprehensive monitoring with real CloudWatch metrics
func NewEnhancedMonitoring ¶
func NewEnhancedMonitoring(scope constructs.Construct, id *string, props *EnhancedMonitoringProps) *EnhancedMonitoring
NewEnhancedMonitoring creates a comprehensive monitoring construct
func (*EnhancedMonitoring) AddCustomAlarm ¶
func (m *EnhancedMonitoring) AddCustomAlarm(name string, alarm awscloudwatch.IAlarm)
AddCustomAlarm adds a custom alarm to the monitoring
func (*EnhancedMonitoring) AddCustomMetric ¶
func (m *EnhancedMonitoring) AddCustomMetric(name string, metric awscloudwatch.IMetric)
AddCustomMetric adds a custom metric to the monitoring
func (*EnhancedMonitoring) GetAlarm ¶
func (m *EnhancedMonitoring) GetAlarm(name string) awscloudwatch.IAlarm
GetAlarm returns a specific alarm by name
func (*EnhancedMonitoring) GetMetric ¶
func (m *EnhancedMonitoring) GetMetric(name string) awscloudwatch.IMetric
GetMetric returns a specific metric by name
type EnhancedMonitoringProps ¶
type EnhancedMonitoringProps struct {
// Resource to monitor
Resource MonitorableResource
// Custom namespace for metrics
Namespace *string
// Alert configuration
AlertTopic awssns.ITopic
// Dashboard configuration
DashboardName *string
// Metric configuration
MetricConfig *MetricConfiguration
// Alarm thresholds
AlarmThresholds *AlarmThresholds
// Enable real-time streaming
EnableRealTimeStreaming *bool
// Environment tag
Environment *string
}
EnhancedMonitoringProps defines properties for enhanced monitoring
type EnhancedSecurity ¶
type EnhancedSecurity struct {
constructs.Construct
SecurityGroup awsec2.SecurityGroup
WAF awswafv2.CfnWebACL
Secrets map[string]awssecretsmanager.Secret
VPCFlowLogsGroup awslogs.LogGroup
SecurityMetrics map[string]awscloudwatch.IMetric
VPCEndpoints map[string]awsec2.InterfaceVpcEndpoint
}
EnhancedSecurity provides comprehensive security features
func NewEnhancedSecurity ¶
func NewEnhancedSecurity(scope constructs.Construct, id *string, props *EnhancedSecurityProps) *EnhancedSecurity
NewEnhancedSecurity creates a comprehensive security construct
func (*EnhancedSecurity) AddCustomSecurityRule ¶
func (s *EnhancedSecurity) AddCustomSecurityRule(rule SecurityRule, direction string)
AddCustomSecurityRule adds a custom security rule to the security group
func (*EnhancedSecurity) GetSecret ¶
func (s *EnhancedSecurity) GetSecret(name string) awssecretsmanager.Secret
GetSecret returns a specific secret by name
func (*EnhancedSecurity) GetSecurityGroup ¶
func (s *EnhancedSecurity) GetSecurityGroup() awsec2.ISecurityGroup
GetSecurityGroup returns the security group
func (*EnhancedSecurity) GetSecurityMetric ¶
func (s *EnhancedSecurity) GetSecurityMetric(name string) awscloudwatch.IMetric
GetSecurityMetric returns a specific security metric by name
func (*EnhancedSecurity) GetVPCEndpoint ¶
func (s *EnhancedSecurity) GetVPCEndpoint(name string) awsec2.InterfaceVpcEndpoint
GetVPCEndpoint returns a specific VPC endpoint by name
func (*EnhancedSecurity) GetWAF ¶
func (s *EnhancedSecurity) GetWAF() awswafv2.CfnWebACL
GetWAF returns the WAF Web ACL
type EnhancedSecurityProps ¶
type EnhancedSecurityProps struct {
// VPC configuration
Vpc awsec2.IVpc
// Allowed ingress rules
IngressRules []SecurityRule
// Allowed egress rules
EgressRules []SecurityRule
// WAF configuration
EnableWAF *bool
WAFConfig *WAFRuleConfig
// Secrets to create
Secrets []SecretConfig
// Enable VPC Flow Logs
EnableVPCFlowLogs *bool
// Enable GuardDuty integration
EnableGuardDuty *bool
// Enable Security Hub integration
EnableSecurityHub *bool
// Enable Config rules
EnableConfigRules *bool
// Environment tag
Environment *string
// Application name
ApplicationName *string
}
EnhancedSecurityProps defines properties for enhanced security
type EventBridgeHandler ¶
type EventBridgeHandler struct {
constructs.Construct
// The Lambda function handling events
Function *LiftFunction
// The EventBridge rule
Rule awsevents.Rule
// The event bus (default or custom)
EventBus awsevents.IEventBus
// Dead letter queue (if enabled)
DeadLetterQueue awssqs.IQueue
// Lambda target
Target awseventstargets.LambdaFunction
}
EventBridgeHandler represents an EventBridge rule with Lambda handler
func NewEventBridgeHandler ¶
func NewEventBridgeHandler(scope constructs.Construct, id *string, props *EventBridgeHandlerProps) (*EventBridgeHandler, error)
NewEventBridgeHandler creates a new EventBridge handler construct
func (*EventBridgeHandler) AddEnvironmentVariable ¶
func (e *EventBridgeHandler) AddEnvironmentVariable(key string, value string)
AddEnvironmentVariable adds an environment variable to the Lambda function
func (*EventBridgeHandler) AddEventPattern ¶
func (e *EventBridgeHandler) AddEventPattern(eventPattern *awsevents.EventPattern) error
AddEventPattern adds an event pattern to the rule Note: This method is deprecated as EventBridge patterns cannot be modified after rule creation. Create a new EventBridgeHandler with the desired pattern instead.
func (*EventBridgeHandler) DisableRule ¶
func (e *EventBridgeHandler) DisableRule() error
DisableRule disables the EventBridge rule Note: This method provides guidance for disabling the rule after deployment. To change rule state after deployment, use AWS CLI or AWS Console.
func (*EventBridgeHandler) EnableRule ¶
func (e *EventBridgeHandler) EnableRule() error
EnableRule enables the EventBridge rule Note: This method configures the rule to be enabled during deployment. To change rule state after deployment, use AWS CLI or AWS Console.
func (*EventBridgeHandler) GetEventBusArn ¶
func (e *EventBridgeHandler) GetEventBusArn() *string
GetEventBusArn returns the event bus ARN
func (*EventBridgeHandler) GetEventBusName ¶
func (e *EventBridgeHandler) GetEventBusName() *string
GetEventBusName returns the event bus name
func (*EventBridgeHandler) GetRuleArn ¶
func (e *EventBridgeHandler) GetRuleArn() *string
GetRuleArn returns the rule ARN
func (*EventBridgeHandler) GetRuleName ¶
func (e *EventBridgeHandler) GetRuleName() *string
GetRuleName returns the rule name
func (*EventBridgeHandler) GrantPutEvents ¶
func (e *EventBridgeHandler) GrantPutEvents(grantee awslambda.IFunction)
GrantPutEvents grants permission to put events to the event bus
type EventBridgeHandlerProps ¶
type EventBridgeHandlerProps struct {
// Lambda function properties
FunctionProps awslambda.FunctionProps
// Event rule properties (optional - creates new rule if not provided)
RuleProps *awsevents.RuleProps
// Existing rule to use (optional - creates new if not provided)
ExistingRule awsevents.Rule
// Existing event bus to use (optional - uses default if not provided)
ExistingEventBus awsevents.IEventBus
// Event bus properties for creating a custom event bus
EventBusProps *awsevents.EventBusProps
// Event pattern for filtering events
EventPattern *awsevents.EventPattern
// Schedule expression for scheduled events (conflicts with EventPattern)
ScheduleExpression *string
// Lambda target properties
TargetProps *awseventstargets.LambdaFunctionProps
// Dead letter queue properties (optional)
DeadLetterQueueProps *awssqs.QueueProps
// Enable dead letter queue (default: true)
EnableDeadLetterQueue *bool
// Maximum event age in seconds (default: 3600)
MaxEventAge awscdk.Duration
// Retry attempts for failed invocations (default: 3)
RetryAttempts *float64
// Enable input transformation
InputTransformation *awsevents.RuleTargetInput
// Lift-specific settings
EnableTracing *bool
EnableMultiTenant *bool
EnableMonitoring *bool
// Cross-account event bus support
CrossAccountEventBusArn *string
}
EventBridgeHandlerProps defines properties for an EventBridge handler
type EventRoutingTable ¶
type EventRoutingTable struct {
*LiftTable
// contains filtered or unexported fields
}
EventRoutingTable is a table for managing event routing
func NewEventRoutingTable ¶
func NewEventRoutingTable(scope constructs.Construct, id *string, props *EventRoutingTableProps) *EventRoutingTable
NewEventRoutingTable creates a new event routing table The table uses standard pk/sk attributes - GSIs should be defined in DynamORM models
func (*EventRoutingTable) GrantEventManagement ¶
func (e *EventRoutingTable) GrantEventManagement(grantee awsiam.IGrantable)
GrantEventManagement grants permissions to manage events
type EventRoutingTableProps ¶
type EventRoutingTableProps struct {
// Table name
TableName *string
// TTL attribute name for automatic cleanup
TimeToLiveAttribute *string
}
EventRoutingTableProps defines properties for the event routing table
type EventStoreAlertThresholds ¶
type EventStoreAlertThresholds struct {
HighEventRate *float64 // Events per second threshold
HighErrorRate *float64 // Error rate threshold
HighLatency *float64 // Latency threshold (ms)
LowSnapshotFrequency *float64 // Minimum snapshot frequency
HighStorageUsage *float64 // Storage usage threshold (GB)
}
EventStoreAlertThresholds defines alert thresholds for event store monitoring
type EventStorePattern ¶
type EventStorePattern string
EventStorePattern defines the event store pattern to use
const ( EventStorePattern_SINGLE_TABLE EventStorePattern = "SINGLE_TABLE" EventStorePattern_MULTI_TABLE EventStorePattern = "MULTI_TABLE" EventStorePattern_AGGREGATE_TABLE EventStorePattern = "AGGREGATE_TABLE" )
type IdempotencyTableProps ¶
type IdempotencyTableProps struct {
// Table name
TableName *string
// TTL attribute name for automatic cleanup
TimeToLiveAttribute *string
}
IdempotencyTableProps defines properties for creating an idempotency table
type IdempotentFunction ¶
type IdempotentFunction struct {
constructs.Construct
Function *LiftFunction
IdempotencyTable *LiftTable
}
IdempotentFunction is a Lambda function with built-in idempotency support using DynamORM
func NewIdempotentFunction ¶
func NewIdempotentFunction(scope constructs.Construct, id *string, props *IdempotentFunctionProps) *IdempotentFunction
NewIdempotentFunction creates a Lambda function with idempotency capabilities
func (*IdempotentFunction) AddIdempotencyMetrics ¶
func (f *IdempotentFunction) AddIdempotencyMetrics(namespace *string)
AddIdempotencyMetrics adds CloudWatch metrics for idempotency operations
func (*IdempotentFunction) EnableTransactionSupport ¶
func (f *IdempotentFunction) EnableTransactionSupport()
EnableTransactionSupport adds permissions for DynamoDB transactions
func (*IdempotentFunction) GetFunction ¶
func (f *IdempotentFunction) GetFunction() awslambda.Function
GetFunction returns the underlying Lambda function
func (*IdempotentFunction) GetTable ¶
func (f *IdempotentFunction) GetTable() *LiftTable
GetTable returns the idempotency tracking table
type IdempotentFunctionProps ¶
type IdempotentFunctionProps struct {
LiftFunctionProps
// How to extract the idempotency key
KeyExtractor IdempotentKeyExtractor
// Field name for key extraction (e.g., header name, body field, path param)
KeyField *string
// TTL for idempotency records in seconds (default 24 hours)
TTLSeconds *float64
// DynamoDB table name for idempotency tracking (optional - will create if not provided)
TableName *string
// Enable response caching
EnableResponseCaching *bool
// Maximum response size to cache in KB (default 400KB)
MaxResponseSizeKB *float64
}
IdempotentFunctionProps extends LiftFunctionProps with idempotency configuration
type IdempotentKeyExtractor ¶
type IdempotentKeyExtractor string
IdempotentKeyExtractor defines how to extract idempotency keys
const ( // Extract from X-Idempotency-Key header IdempotentKeyHeader IdempotentKeyExtractor = "HEADER" // Extract from request body field IdempotentKeyBody IdempotentKeyExtractor = "BODY" // Extract from path parameter IdempotentKeyPath IdempotentKeyExtractor = "PATH" // Custom extraction logic in Lambda IdempotentKeyCustom IdempotentKeyExtractor = "CUSTOM" )
type KinesisProcessor ¶
type KinesisProcessor struct {
constructs.Construct
Stream awskinesis.IStream
Function LiftFunction
DLQ awssqs.IQueue
Consumer awskinesis.IStreamConsumer
}
KinesisProcessor creates a Kinesis stream with Lambda processor
func NewKinesisProcessor ¶
func NewKinesisProcessor(scope constructs.Construct, id *string, props *KinesisProcessorProps) *KinesisProcessor
NewKinesisProcessor creates a new Kinesis processor with Lambda function
func (*KinesisProcessor) AddConsumer ¶
func (k *KinesisProcessor) AddConsumer(id *string, consumerName *string) awskinesis.IStreamConsumer
AddConsumer adds an enhanced fan-out consumer to the stream
func (*KinesisProcessor) GetDLQUrl ¶
func (k *KinesisProcessor) GetDLQUrl() *string
GetDLQUrl returns the DLQ URL if DLQ is enabled
func (*KinesisProcessor) GetStreamArn ¶
func (k *KinesisProcessor) GetStreamArn() *string
GetStreamArn returns the Kinesis stream ARN
func (*KinesisProcessor) GetStreamName ¶
func (k *KinesisProcessor) GetStreamName() *string
GetStreamName returns the Kinesis stream name
func (*KinesisProcessor) GrantRead ¶
func (k *KinesisProcessor) GrantRead(grantee awsiam.IGrantable) awsiam.Grant
GrantRead grants read permissions to the stream
func (*KinesisProcessor) GrantReadWrite ¶
func (k *KinesisProcessor) GrantReadWrite(grantee awsiam.IGrantable) awsiam.Grant
GrantReadWrite grants read and write permissions to the stream
func (*KinesisProcessor) GrantWrite ¶
func (k *KinesisProcessor) GrantWrite(grantee awsiam.IGrantable) awsiam.Grant
GrantWrite grants write permissions to the stream
func (*KinesisProcessor) Metric ¶
func (k *KinesisProcessor) Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric returns a metric for the stream
func (*KinesisProcessor) MetricGetRecords ¶
func (k *KinesisProcessor) MetricGetRecords(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
MetricGetRecords returns the GetRecords metric
func (*KinesisProcessor) MetricPutRecords ¶
func (k *KinesisProcessor) MetricPutRecords(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
MetricPutRecords returns the PutRecords metric
type KinesisProcessorProps ¶
type KinesisProcessorProps struct {
// The Lambda function configuration
FunctionProps *LiftFunctionProps `field:"required"`
// Optional: Stream configuration
StreamProps *awskinesis.StreamProps `field:"optional"`
// Optional: Use an existing stream instead of creating a new one
ExistingStream awskinesis.IStream `field:"optional"`
// Optional: Event source configuration
EventSourceProps *awslambdaeventsources.KinesisEventSourceProps `field:"optional"`
// Optional: Enable dead letter queue for failed records
EnableDLQ *bool `field:"optional"`
// Optional: DLQ configuration
DLQProps *awssqs.QueueProps `field:"optional"`
// Optional: Stream mode (provisioned or on-demand)
StreamMode *awskinesis.StreamMode `field:"optional"`
// Optional: Number of shards (for provisioned mode)
ShardCount *float64 `field:"optional"`
// Optional: Data retention period in hours (24-8760 hours)
RetentionPeriodHours *float64 `field:"optional"`
// Optional: Enable encryption
Encryption *awskinesis.StreamEncryption `field:"optional"`
// Optional: Enable enhanced fan-out
EnableEnhancedFanOut *bool `field:"optional"`
// Optional: Consumer name for enhanced fan-out
ConsumerName *string `field:"optional"`
// Optional: Batch size for processing (1-10000)
BatchSize *float64 `field:"optional"`
// Optional: Maximum batching window in seconds
MaxBatchingWindowSeconds *float64 `field:"optional"`
// Optional: Parallelization factor (1-10)
ParallelizationFactor *float64 `field:"optional"`
// Optional: Starting position
StartingPosition *awslambda.StartingPosition `field:"optional"`
// Optional: Maximum record age in seconds
MaxRecordAgeSeconds *float64 `field:"optional"`
// Optional: Bisect batch on function error
BisectBatchOnError *bool `field:"optional"`
// Optional: Maximum retry attempts
RetryAttempts *float64 `field:"optional"`
// Optional: Tumbling window in seconds
TumblingWindowSeconds *float64 `field:"optional"`
// Optional: Report batch item failures
ReportBatchItemFailures *bool `field:"optional"`
}
KinesisProcessorProps defines the properties for creating a Kinesis processor
type LiftAPI ¶
type LiftAPI struct {
constructs.Construct
HttpAPI awsapigatewayv2.HttpApi
Stage awsapigatewayv2.IHttpStage
LogGroup awslogs.ILogGroup
}
LiftAPI is an API Gateway HTTP API construct for Lift applications
func NewLiftAPI ¶
func NewLiftAPI(scope constructs.Construct, id *string, props *LiftAPIProps) *LiftAPI
NewLiftAPI creates a new API Gateway HTTP API optimized for Lift
func (*LiftAPI) AddLambdaRoute ¶
func (api *LiftAPI) AddLambdaRoute(path *string, method awsapigatewayv2.HttpMethod, fn awslambda.IFunction)
AddLambdaRoute adds a Lambda function as a route to the API
func (*LiftAPI) AddLambdaRouteWithOptions ¶
func (api *LiftAPI) AddLambdaRouteWithOptions(path *string, method awsapigatewayv2.HttpMethod, fn awslambda.IFunction, options *RouteOptions)
AddLambdaRouteWithOptions adds a Lambda function as a route with additional options
func (*LiftAPI) EnableApiKeyAuth ¶
func (api *LiftAPI) EnableApiKeyAuth() awsapigatewayv2.IHttpRouteAuthorizer
EnableApiKeyAuth enables API key authentication for the API
func (*LiftAPI) GetResourceName ¶
GetResourceName returns the API name
func (*LiftAPI) GrantInvoke ¶
func (api *LiftAPI) GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant
GrantInvoke grants invoke permissions to a principal
type LiftAPIProps ¶
type LiftAPIProps struct {
// Name of the API
Name *string
// Description of the API
Description *string
// Enable CORS
EnableCORS *bool
// Custom domain name
DomainName *string
// Certificate ARN for custom domain
CertificateArn *string
// Enable access logging
EnableAccessLogging *bool
// CloudWatch log group for access logs
AccessLogGroup awslogs.ILogGroup
// Throttle settings
ThrottleRateLimit *float64
ThrottleBurstLimit *float64
// Stage name (defaults to $default)
StageName *string
// Enable detailed CloudWatch metrics
EnableDetailedMetrics *bool
// API Key configuration
RequireApiKey *bool
// Request/Response validation models
RequestValidators map[string]*RequestValidator
// Default authorizer for all routes
DefaultAuthorizer awsapigatewayv2.IHttpRouteAuthorizer
}
LiftAPIProps defines properties for creating a Lift API Gateway
type LiftFunction ¶
type LiftFunction struct {
constructs.Construct
Function awslambda.Function
DeadLetterQueue awssqs.IQueue
}
LiftFunction is a Lambda function construct optimized for Lift applications
func NewLiftFunction ¶
func NewLiftFunction(scope constructs.Construct, id *string, props *LiftFunctionProps) *LiftFunction
NewLiftFunction creates a new Lift Lambda function with optimized defaults
func (*LiftFunction) AddEnvironment ¶
func (f *LiftFunction) AddEnvironment(key *string, value *string)
AddEnvironment adds an environment variable to the function
func (*LiftFunction) AddEventSource ¶
func (f *LiftFunction) AddEventSource(source awslambda.IEventSource)
AddEventSource adds an event source to the function
func (*LiftFunction) AddToRolePolicy ¶
func (f *LiftFunction) AddToRolePolicy(statement awsiam.PolicyStatement)
AddToRolePolicy adds a policy statement to the function's role
func (*LiftFunction) ConfigureDynamORM ¶
func (f *LiftFunction) ConfigureDynamORM(tableName *string, debug *bool)
ConfigureDynamORM adds DynamORM environment variables to an existing function
func (*LiftFunction) GetDeadLetterQueue ¶
func (f *LiftFunction) GetDeadLetterQueue() awssqs.IQueue
GetDeadLetterQueue returns the dead letter queue if configured
func (*LiftFunction) GetFunction ¶
func (f *LiftFunction) GetFunction() awslambda.Function
GetFunction returns the underlying Lambda function
func (*LiftFunction) GetResourceName ¶
func (l *LiftFunction) GetResourceName() *string
GetResourceName returns the function name
func (*LiftFunction) GrantInvoke ¶
func (f *LiftFunction) GrantInvoke(grantee awsiam.IGrantable) awsiam.Grant
GrantInvoke grants invoke permissions to the given principal
func (*LiftFunction) Metric ¶
func (f *LiftFunction) Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric returns a CloudWatch metric for this function
type LiftFunctionProps ¶
type LiftFunctionProps struct {
awslambda.FunctionProps
// EnableTracing enables X-Ray tracing for the function
EnableTracing *bool
// EnableMetrics enables CloudWatch metrics
EnableMetrics *bool
// EnableMultiTenant enables multi-tenant support
EnableMultiTenant *bool
// EnableDeadLetterQueue creates a DLQ for failed invocations
EnableDeadLetterQueue *bool
// DeadLetterQueue to use (optional - will create if not provided)
DeadLetterQueue awssqs.IQueue
// DeadLetterQueueMaxReceiveCount before sending to DLQ (default: 3)
DeadLetterQueueMaxReceiveCount *float64
// ReservedConcurrentExecutions to limit concurrent executions
ReservedConcurrentExecutions *float64
// EnableDynamORM configures DynamORM environment variables
EnableDynamORM *bool
// DynamORM table name (optional - for when using DynamORM)
DynamORMTableName *string
// DynamORM debug mode
DynamORMDebug *bool
}
LiftFunctionProps extends standard Lambda function properties with Lift-specific configuration
type LiftTable ¶
type LiftTable struct {
constructs.Construct
Table awsdynamodb.Table
}
LiftTable is a DynamoDB table construct optimized for Lift applications
func NewIdempotencyTable ¶
func NewIdempotencyTable(scope constructs.Construct, id *string, props *IdempotencyTableProps) *LiftTable
NewIdempotencyTable creates a DynamoDB table for idempotency tracking The table uses standard pk/sk attributes - GSIs should be defined in DynamORM models
func NewLiftTable ¶
func NewLiftTable(scope constructs.Construct, id *string, props *LiftTableProps) *LiftTable
NewLiftTable creates a new DynamoDB table with Lift-optimized defaults
func NewRateLimitTable ¶
func NewRateLimitTable(scope constructs.Construct, id *string, props *RateLimitTableProps) *LiftTable
NewRateLimitTable creates a DynamoDB table for rate limiting The table uses standard pk/sk attributes - GSIs should be defined in DynamORM models
func (*LiftTable) GetResourceName ¶ added in v1.0.42
GetResourceName returns the resource name for monitoring (implements MonitorableResource interface)
func (*LiftTable) GetStreamArn ¶ added in v1.0.42
GetStreamArn returns the DynamoDB stream ARN if streams are enabled
func (*LiftTable) GetTableArn ¶ added in v1.0.42
GetTableArn returns the table ARN
func (*LiftTable) GetTableName ¶ added in v1.0.42
GetTableName returns the table name
func (*LiftTable) GrantReadWrite ¶
GrantReadWrite grants read/write permissions to a Lambda function
type LiftTableProps ¶
type LiftTableProps struct {
// Table name
TableName *string
// Partition key attribute name (defaults to field name from DynamORM model)
PartitionKeyName *string
// Sort key attribute name (optional, defaults to field name from DynamORM model)
SortKeyName *string
// Enable point-in-time recovery
EnablePointInTimeRecovery *bool
// Enable DynamoDB Streams
EnableStreams *bool
// Stream view type
StreamViewType awsdynamodb.StreamViewType
// Time to live attribute name
TimeToLiveAttribute *string
// Enable auto-scaling
EnableAutoScaling *bool
// Read capacity (for provisioned mode)
ReadCapacity *float64
// Write capacity (for provisioned mode)
WriteCapacity *float64
}
LiftTableProps extends DynamoDB table properties with Lift-specific configuration
type MetricConfiguration ¶
type MetricConfiguration struct {
// Enable detailed metrics
DetailedMetrics *bool
// Custom dimensions
Dimensions *map[string]*string
// Metric resolution (1 or 60 seconds)
Resolution *float64
// Percentiles to track
Percentiles *[]*float64
// Enable custom business metrics
EnableBusinessMetrics *bool
}
MetricConfiguration defines advanced metric configuration
type MonitorableResource ¶
type MonitorableResource interface {
// GetResourceName returns the name of the resource
GetResourceName() *string
}
MonitorableResource interface for resources that can be monitored
type MonitoredFunction ¶
type MonitoredFunction struct {
constructs.Construct
Function *LiftFunction
Dashboard awscloudwatch.Dashboard
Alarms map[string]awscloudwatch.Alarm
}
MonitoredFunction is a Lambda function with comprehensive monitoring
func NewMonitoredFunction ¶
func NewMonitoredFunction(scope constructs.Construct, id *string, props *MonitoredFunctionProps) *MonitoredFunction
NewMonitoredFunction creates a Lambda function with comprehensive monitoring
func (*MonitoredFunction) AddCommonLogInsightsQueries ¶
func (f *MonitoredFunction) AddCommonLogInsightsQueries()
AddCommonLogInsightsQueries adds common CloudWatch Logs Insights queries
func (*MonitoredFunction) AddCustomMetric ¶
func (f *MonitoredFunction) AddCustomMetric(metricName *string, namespace *string, dimensions *map[string]*string) awscloudwatch.Metric
AddCustomMetric adds a custom metric to the dashboard
func (*MonitoredFunction) AddLogInsightsQuery ¶
func (f *MonitoredFunction) AddLogInsightsQuery(queryName *string, queryString *string)
AddLogInsightsQuery adds a CloudWatch Logs Insights query to the dashboard
func (*MonitoredFunction) GetAlarm ¶
func (f *MonitoredFunction) GetAlarm(name string) awscloudwatch.Alarm
GetAlarm returns a specific alarm by name
func (*MonitoredFunction) GetDashboard ¶
func (f *MonitoredFunction) GetDashboard() awscloudwatch.Dashboard
GetDashboard returns the CloudWatch dashboard
func (*MonitoredFunction) GetFunction ¶
func (f *MonitoredFunction) GetFunction() awslambda.Function
GetFunction returns the underlying Lambda function
type MonitoredFunctionProps ¶
type MonitoredFunctionProps struct {
LiftFunctionProps
// Enable CloudWatch dashboard
EnableDashboard *bool
// Dashboard name (optional - will generate if not provided)
DashboardName *string
// Alarm configuration
AlarmConfig *AlarmConfig
// Custom metrics namespace
MetricsNamespace *string
// Enable enhanced monitoring (Lambda Insights)
EnableLambdaInsights *bool
// Log level (ERROR, WARN, INFO, DEBUG)
LogLevel *string
// Enable CloudWatch Logs Insights queries
EnableLogInsightsQueries *bool
}
MonitoredFunctionProps extends LiftFunctionProps with monitoring configuration
type RateLimitTableProps ¶
type RateLimitTableProps struct {
// Table name
TableName *string
// TTL attribute name for automatic cleanup
TimeToLiveAttribute *string
}
RateLimitTableProps defines properties for creating a rate limit table
type RateLimitType ¶
type RateLimitType string
RateLimitType defines the type of rate limiting
const ( RateLimitTypeIP RateLimitType = "IP" RateLimitTypeUser RateLimitType = "USER" RateLimitTypeTenant RateLimitType = "TENANT" )
type RateLimitedFunction ¶
type RateLimitedFunction struct {
constructs.Construct
Function *LiftFunction
RateTable *LiftTable
// contains filtered or unexported fields
}
RateLimitedFunction is a Lambda function with built-in rate limiting using DynamORM
func NewRateLimitedFunction ¶
func NewRateLimitedFunction(scope constructs.Construct, id *string, props *RateLimitedFunctionProps) *RateLimitedFunction
NewRateLimitedFunction creates a Lambda function with rate limiting capabilities
func (*RateLimitedFunction) AddRateLimitAlarm ¶
func (f *RateLimitedFunction) AddRateLimitAlarm(alarmName *string, threshold *float64) awscloudwatch.IAlarm
AddRateLimitAlarm adds a CloudWatch alarm for rate limit violations
func (*RateLimitedFunction) GetFunction ¶
func (f *RateLimitedFunction) GetFunction() awslambda.Function
GetFunction returns the underlying Lambda function
func (*RateLimitedFunction) GetTable ¶
func (f *RateLimitedFunction) GetTable() *LiftTable
GetTable returns the rate limiting table
type RateLimitedFunctionProps ¶
type RateLimitedFunctionProps struct {
LiftFunctionProps
// Type of rate limiting (IP, User, or Tenant based)
RateLimitType RateLimitType
// Rate limit window in seconds
WindowSeconds *float64
// Maximum requests allowed in the window
Limit *float64
// DynamoDB table name for rate tracking (optional - will create if not provided)
TableName *string
// Enable CloudWatch metrics for rate limiting
EnableMetrics *bool
}
RateLimitedFunctionProps extends LiftFunctionProps with rate limiting configuration
type RequestTrackingTable ¶
type RequestTrackingTable struct {
*LiftTable
// contains filtered or unexported fields
}
RequestTrackingTable is a table for tracking API requests and their async processing
func NewRequestTrackingTable ¶
func NewRequestTrackingTable(scope constructs.Construct, id *string, props *RequestTrackingTableProps) *RequestTrackingTable
NewRequestTrackingTable creates a new request tracking table The table uses standard pk/sk attributes - GSIs should be defined in DynamORM models
type RequestTrackingTableProps ¶
type RequestTrackingTableProps struct {
// Table name
TableName *string
// TTL attribute name for automatic cleanup
TimeToLiveAttribute *string
}
RequestTrackingTableProps defines properties for the request tracking table
type RequestValidator ¶
type RequestValidator struct {
// Validate request body
ValidateBody *bool
// Validate request parameters
ValidateParameters *bool
// JSON schema for body validation
BodySchema interface{}
}
RequestValidator defines validation rules for API requests
type RouteOptions ¶
type RouteOptions struct {
// Authorizer for this route
Authorizer awsapigatewayv2.IHttpRouteAuthorizer
// Request validation
RequestValidator *RequestValidator
// Route-specific throttling
ThrottleRateLimit *float64
ThrottleBurstLimit *float64
}
RouteOptions defines options for API routes
type S3EventFilter ¶
S3EventFilter defines event filtering options
type S3Processor ¶
type S3Processor struct {
constructs.Construct
// The Lambda function processing S3 events
Function *LiftFunction
// The S3 bucket
Bucket awss3.IBucket
// Dead letter queue (if enabled)
DeadLetterQueue awssqs.IQueue
// Event source mapping
EventSource awslambdaeventsources.S3EventSource
// Replication bucket (if cross-region replication is enabled)
ReplicationBucket awss3.IBucket
}
S3Processor represents an S3 bucket with Lambda processor
func NewS3Processor ¶
func NewS3Processor(scope constructs.Construct, id *string, props *S3ProcessorProps) *S3Processor
NewS3Processor creates a new S3 processor construct
func (*S3Processor) AddCorsRule ¶
func (s *S3Processor) AddCorsRule(rule *awss3.CorsRule)
AddCorsRule adds a CORS rule to the bucket
func (*S3Processor) AddEnvironmentVariable ¶
func (s *S3Processor) AddEnvironmentVariable(key string, value string)
AddEnvironmentVariable adds an environment variable to the Lambda function
func (*S3Processor) EnableCORS ¶
func (s *S3Processor) EnableCORS(rules []*awss3.CorsRule)
EnableCORS enables CORS on the bucket
func (*S3Processor) GetBucketArn ¶
func (s *S3Processor) GetBucketArn() *string
GetBucketArn returns the bucket ARN
func (*S3Processor) GetBucketDomainName ¶
func (s *S3Processor) GetBucketDomainName() *string
GetBucketDomainName returns the bucket domain name
func (*S3Processor) GetBucketName ¶
func (s *S3Processor) GetBucketName() *string
GetBucketName returns the bucket name
func (*S3Processor) GrantDelete ¶
func (s *S3Processor) GrantDelete(grantee awslambda.IFunction)
GrantDelete grants permission to delete objects from the bucket
func (*S3Processor) GrantRead ¶
func (s *S3Processor) GrantRead(grantee awslambda.IFunction)
GrantRead grants permission to read from the bucket
func (*S3Processor) GrantReadWrite ¶
func (s *S3Processor) GrantReadWrite(grantee awslambda.IFunction)
GrantReadWrite grants permission to read and write to the bucket
func (*S3Processor) GrantWrite ¶
func (s *S3Processor) GrantWrite(grantee awslambda.IFunction)
GrantWrite grants permission to write to the bucket
func (*S3Processor) SetBucketPolicy ¶
func (s *S3Processor) SetBucketPolicy(policy map[string]interface{})
SetBucketPolicy sets a bucket policy
type S3ProcessorProps ¶
type S3ProcessorProps struct {
// Lambda function properties
FunctionProps awslambda.FunctionProps
// S3 bucket properties (optional - creates new bucket if not provided)
BucketProps *awss3.BucketProps
// Existing bucket to use (optional - creates new if not provided)
ExistingBucket awss3.IBucket
// S3 event types to process (default: ObjectCreated)
EventTypes *[]awss3.EventType
// Key prefix filter for S3 events (optional)
KeyPrefix *string
// Key suffix filter for S3 events (optional)
KeySuffix *string
// Dead letter queue properties (optional)
DeadLetterQueueProps *awssqs.QueueProps
// Enable dead letter queue (default: true)
EnableDeadLetterQueue *bool
// S3 event source configuration
EventSourceProps *awslambdaeventsources.S3EventSourceProps
// Additional S3 processor settings
BatchSize *float64 // Default: 10
MaxBatchingWindow awscdk.Duration // Default: 5 seconds
// Multi-region support
CrossRegionReplication *bool
ReplicationBucket awss3.IBucket
// Lifecycle rules
EnableLifecycleRules *bool
LifecycleRules *[]*awss3.LifecycleRule
// External bucket support
ExternalBucket awss3.IBucket
// Event filtering
EventFilter *S3EventFilter
// Access logging
EnableAccessLogging *bool
AccessLogsBucket awss3.IBucket
AccessLogsPrefix *string
// Versioning and backup
EnableVersioning *bool
EnableBackup *bool
// Lift-specific settings
EnableTracing *bool
EnableMultiTenant *bool
EnableMonitoring *bool
}
S3ProcessorProps defines properties for an S3 processor
type SNSProcessor ¶
type SNSProcessor struct {
constructs.Construct
Topic awssns.ITopic
Function LiftFunction
DLQ awssqs.IQueue
}
SNSProcessor creates an SNS topic with Lambda processor and optional DLQ
func NewSNSProcessor ¶
func NewSNSProcessor(scope constructs.Construct, id *string, props *SNSProcessorProps) *SNSProcessor
NewSNSProcessor creates a new SNS processor with Lambda function
func (*SNSProcessor) AddSubscription ¶
func (s *SNSProcessor) AddSubscription(subscription awssns.ITopicSubscription) awssns.Subscription
AddSubscription adds a new subscription to the topic
func (*SNSProcessor) GetDLQUrl ¶
func (s *SNSProcessor) GetDLQUrl() *string
GetDLQUrl returns the DLQ URL if DLQ is enabled
func (*SNSProcessor) GetTopicArn ¶
func (s *SNSProcessor) GetTopicArn() *string
GetTopicArn returns the SNS topic ARN
func (*SNSProcessor) GetTopicName ¶
func (s *SNSProcessor) GetTopicName() *string
GetTopicName returns the SNS topic name
func (*SNSProcessor) GrantPublish ¶
func (s *SNSProcessor) GrantPublish(grantee awsiam.IGrantable) awsiam.Grant
GrantPublish grants SNS publish permissions to a principal
func (*SNSProcessor) GrantSubscribe ¶
func (s *SNSProcessor) GrantSubscribe(grantee awsiam.IGrantable) awsiam.Grant
GrantSubscribe grants SNS subscribe permissions to a principal
type SNSProcessorProps ¶
type SNSProcessorProps struct {
// The Lambda function configuration
FunctionProps *LiftFunctionProps `field:"required"`
// Optional: Topic configuration
TopicProps *awssns.TopicProps `field:"optional"`
// Optional: Use an existing topic instead of creating a new one
ExistingTopic awssns.ITopic `field:"optional"`
// Optional: SNS subscription configuration
SubscriptionProps *awslambdaeventsources.SnsEventSourceProps `field:"optional"`
// Optional: Enable dead letter queue for failed messages
EnableDLQ *bool `field:"optional"`
// Optional: DLQ configuration
DLQProps *awssqs.QueueProps `field:"optional"`
// Optional: Message filtering policy
FilterPolicy *map[string]awssns.SubscriptionFilter `field:"optional"`
// Optional: Enable FIFO topic
EnableFifo *bool `field:"optional"`
// Optional: Enable content-based deduplication
ContentBasedDeduplication *bool `field:"optional"`
// Optional: Message retention period in seconds (1 hour to 14 days)
MessageRetentionSeconds *float64 `field:"optional"`
// Optional: Display name for the topic
DisplayName *string `field:"optional"`
// Optional: Subscription protocol (defaults to lambda)
Protocol *string `field:"optional"`
// Optional: Raw message delivery
RawMessageDelivery *bool `field:"optional"`
}
SNSProcessorProps defines the properties for creating an SNS processor
type SQSProcessor ¶
type SQSProcessor struct {
constructs.Construct
// The Lambda function processing SQS messages
Function *LiftFunction
// The SQS queue
Queue awssqs.IQueue
// Dead letter queue (if enabled)
DeadLetterQueue awssqs.IQueue
// Event source mapping
EventSource awslambdaeventsources.SqsEventSource
}
SQSProcessor represents an SQS queue with Lambda processor
func NewSQSProcessor ¶
func NewSQSProcessor(scope constructs.Construct, id *string, props *SQSProcessorProps) *SQSProcessor
NewSQSProcessor creates a new SQS processor construct
func (*SQSProcessor) AddEnvironmentVariable ¶
func (s *SQSProcessor) AddEnvironmentVariable(key string, value string)
AddEnvironmentVariable adds an environment variable to the Lambda function
func (*SQSProcessor) GetQueueArn ¶
func (s *SQSProcessor) GetQueueArn() *string
GetQueueArn returns the queue ARN
func (*SQSProcessor) GetQueueName ¶
func (s *SQSProcessor) GetQueueName() *string
GetQueueName returns the queue name
func (*SQSProcessor) GetQueueUrl ¶
func (s *SQSProcessor) GetQueueUrl() *string
GetQueueUrl returns the queue URL
func (*SQSProcessor) GrantConsumeMessages ¶
func (s *SQSProcessor) GrantConsumeMessages(grantee awslambda.IFunction)
GrantConsumeMessages grants permission to consume messages from the queue
func (*SQSProcessor) GrantSendMessages ¶
func (s *SQSProcessor) GrantSendMessages(grantee awslambda.IFunction)
GrantSendMessages grants permission to send messages to the queue
type SQSProcessorProps ¶
type SQSProcessorProps struct {
// Lambda function properties
FunctionProps awslambda.FunctionProps
// SQS queue properties (optional - creates new queue if not provided)
QueueProps *awssqs.QueueProps
// Existing queue to use (optional - creates new if not provided)
ExistingQueue awssqs.IQueue
// Dead letter queue properties (optional)
DeadLetterQueueProps *awssqs.QueueProps
// Enable dead letter queue (default: true)
EnableDeadLetterQueue *bool
// SQS event source configuration
EventSourceProps *awslambdaeventsources.SqsEventSourceProps
// Additional SQS processor settings
BatchSize *float64 // Default: 10
MaxBatchingWindow awscdk.Duration // Default: 5 seconds
VisibilityTimeout awscdk.Duration // Default: 6 times function timeout
MessageRetentionPeriod awscdk.Duration // Default: 14 days
MaxReceiveCount *float64 // Default: 3
EnableContentBasedDeduplication *bool // For FIFO queues
FifoQueue *bool // Default: false
ReceiveMessageWaitTimeSeconds *float64 // For long polling (0-20)
// Lift-specific settings
EnableTracing *bool
EnableMultiTenant *bool
EnableMonitoring *bool
}
SQSProcessorProps defines properties for an SQS processor
type SecretConfig ¶
type SecretConfig struct {
Name string
Description string
Template string
GenerateKey string
ExcludeChars string
Length float64
EnableRotation bool
RotationLambda awslambda.IFunction
RotationSchedule *awssecretsmanager.RotationScheduleOptions
}
SecretConfig defines configuration for secrets
type SecureFunction ¶
type SecureFunction struct {
constructs.Construct
Function *LiftFunction
SecurityGroup awsec2.ISecurityGroup
KmsKey awskms.IKey
Vpc awsec2.IVpc
VpcEndpoints map[string]awsec2.InterfaceVpcEndpoint
}
SecureFunction is a Lambda function with enhanced security features
func NewSecureFunction ¶
func NewSecureFunction(scope constructs.Construct, id *string, props *SecureFunctionProps) *SecureFunction
NewSecureFunction creates a Lambda function with enhanced security
func (*SecureFunction) AddVPCEndpoint ¶
func (f *SecureFunction) AddVPCEndpoint(service awsec2.InterfaceVpcEndpointAwsService) awsec2.InterfaceVpcEndpoint
AddVPCEndpoint adds a VPC endpoint for an AWS service
func (*SecureFunction) EnableSecretsManagerAccess ¶
func (f *SecureFunction) EnableSecretsManagerAccess()
EnableSecretsManagerAccess adds VPC endpoint and permissions for Secrets Manager
func (*SecureFunction) GetFunction ¶
func (f *SecureFunction) GetFunction() awslambda.Function
GetFunction returns the underlying Lambda function
func (*SecureFunction) GetKmsKey ¶
func (f *SecureFunction) GetKmsKey() awskms.IKey
GetKmsKey returns the KMS key used for encryption
func (*SecureFunction) GetSecurityGroup ¶
func (f *SecureFunction) GetSecurityGroup() awsec2.ISecurityGroup
GetSecurityGroup returns the security group
func (*SecureFunction) RestrictInboundAccess ¶
func (f *SecureFunction) RestrictInboundAccess()
RestrictInboundAccess removes all inbound rules from the security group
type SecureFunctionProps ¶
type SecureFunctionProps struct {
LiftFunctionProps
// VPC to deploy the function in (optional - will create if not provided)
Vpc awsec2.IVpc
// VPC subnets to use (defaults to private subnets)
VpcSubnets *awsec2.SubnetSelection
// Security group IDs to attach
SecurityGroupIds *[]*string
// Enable KMS encryption for environment variables
EnableKMSEncryption *bool
// KMS key for encryption (optional - will create if not provided)
KmsKey awskms.IKey
// Secrets to inject from Secrets Manager
Secrets *map[string]awssecretsmanager.ISecret
// Enable private endpoints only (no internet access)
PrivateOnly *bool
// Additional security policies to attach
AdditionalPolicies *[]awsiam.PolicyStatement
}
SecureFunctionProps extends LiftFunctionProps with security configuration
type SecurityRule ¶
type SecurityRule struct {
Port float64
Protocol awsec2.Protocol
Source awsec2.IPeer
Description string
RuleAction string // "allow" or "deny"
}
SecurityRule defines a network security rule
type SnapshotStrategy ¶
type SnapshotStrategy string
SnapshotStrategy defines how snapshots are handled
const ( SnapshotStrategy_DISABLED SnapshotStrategy = "DISABLED" SnapshotStrategy_FREQUENCY SnapshotStrategy = "FREQUENCY" SnapshotStrategy_SIZE_BASED SnapshotStrategy = "SIZE_BASED" SnapshotStrategy_TIME_BASED SnapshotStrategy = "TIME_BASED" )
type StreamProcessor ¶ added in v1.0.42
type StreamProcessor struct {
constructs.Construct
// The Lambda function processing the stream
Function *LiftFunction
// The table with streams
Table *StreamingTable
// Dead letter queue (if enabled)
DeadLetterQueue awssqs.IQueue
// Event source mapping
EventSource awslambdaeventsources.DynamoEventSource
}
StreamProcessor processes DynamoDB streams with Lambda
func NewStreamProcessor ¶ added in v1.0.42
func NewStreamProcessor(scope constructs.Construct, id *string, props *StreamProcessorProps) *StreamProcessor
NewStreamProcessor creates a new stream processor construct
type StreamProcessorProps ¶ added in v1.0.42
type StreamProcessorProps struct {
// Lambda function properties
FunctionProps awslambda.FunctionProps
// StreamingTable to attach stream processor to (required)
StreamingTable *StreamingTable
// Dead letter queue properties (optional)
DeadLetterQueueProps *awssqs.QueueProps
// Enable dead letter queue (default: true)
EnableDeadLetterQueue *bool
// DynamoDB Streams event source configuration
EventSourceProps *awslambdaeventsources.DynamoEventSourceProps
// Additional stream processor settings
BatchSize *float64 // Default: 10
MaxBatchingWindow awscdk.Duration // Default: 5 seconds
StartingPosition awslambda.StartingPosition // Default: LATEST
MaxRecordAge awscdk.Duration // Default: 24 hours
BisectBatchOnError *bool // Default: false
RetryAttempts *float64 // Default: 10000
ReportBatchItemFailures *bool // Default: true
TumblingWindow awscdk.Duration // For tumbling window processing
ParallelizationFactor *float64 // Default: 1
}
StreamProcessorProps defines properties for a stream processor
type StreamingTable ¶
type StreamingTable struct {
*LiftTable
// contains filtered or unexported fields
}
StreamingTable is a table with DynamoDB Streams enabled
func NewStreamingTable ¶
func NewStreamingTable(scope constructs.Construct, id *string, props *StreamingTableProps) *StreamingTable
NewStreamingTable creates a new DynamoDB table with streams The table uses standard pk/sk attributes - GSIs should be defined in DynamORM models
func (*StreamingTable) GetResourceName ¶ added in v1.0.42
func (s *StreamingTable) GetResourceName() *string
GetResourceName returns the resource name for monitoring (implements MonitorableResource interface)
func (*StreamingTable) GetStreamArn ¶
func (s *StreamingTable) GetStreamArn() *string
GetStreamArn returns the DynamoDB stream ARN
func (*StreamingTable) GetTableArn ¶ added in v1.0.42
func (s *StreamingTable) GetTableArn() *string
GetTableArn returns the table ARN
func (*StreamingTable) GetTableName ¶ added in v1.0.42
func (s *StreamingTable) GetTableName() *string
GetTableName returns the table name
func (*StreamingTable) GrantStreamRead ¶
func (s *StreamingTable) GrantStreamRead(grantee awsiam.IGrantable) awsiam.Grant
GrantStreamRead grants stream read permissions
type StreamingTableProps ¶
type StreamingTableProps struct {
// Table name
TableName *string
// Stream view type (NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES, KEYS_ONLY)
StreamViewType awsdynamodb.StreamViewType
// TTL attribute name for automatic cleanup
TimeToLiveAttribute *string
// Enable auto-scaling
EnableAutoScaling *bool
// Read capacity (for provisioned mode)
ReadCapacity *float64
// Write capacity (for provisioned mode)
WriteCapacity *float64
}
StreamingTableProps defines properties for creating a streaming table
type WAFCustomRule ¶
type WAFCustomRule struct {
Name string
Priority float64
Statement string
Action string
Description string
}
WAFCustomRule defines a custom WAF rule
type WAFRuleConfig ¶
type WAFRuleConfig struct {
EnableRateLimit *bool
RateLimit *float64
EnableSQLiProtection *bool
EnableXSSProtection *bool
EnableKnownBadInputs *bool
CustomRules *[]WAFCustomRule
IPWhitelist *[]*string
IPBlacklist *[]*string
GeoBlocking *[]string
}
WAFRuleConfig defines WAF rule configuration
type WebSocketAPI ¶
type WebSocketAPI struct {
constructs.Construct
// The WebSocket API
WebSocketApi awsapigatewayv2.WebSocketApi
// The stage
Stage awsapigatewayv2.WebSocketStage
// Lambda functions for different routes
ConnectFunction *LiftFunction
DisconnectFunction *LiftFunction
DefaultFunction *LiftFunction
// Connection management table (DynamORM-based)
ConnectionTable *ConnectionTable
// Routes map
Routes map[string]awsapigatewayv2.WebSocketRoute
// Access log group
AccessLogGroup awslogs.ILogGroup
}
WebSocketAPI represents a WebSocket API Gateway with Lambda integration
func NewWebSocketAPI ¶
func NewWebSocketAPI(scope constructs.Construct, id *string, props *WebSocketAPIProps) *WebSocketAPI
NewWebSocketAPI creates a new WebSocket API construct using DynamORM
func (*WebSocketAPI) AddEnvironmentVariable ¶
func (w *WebSocketAPI) AddEnvironmentVariable(key string, value string)
AddEnvironmentVariable adds an environment variable to all WebSocket functions
func (*WebSocketAPI) AddRoute ¶
func (w *WebSocketAPI) AddRoute(routeKey string, function awslambda.IFunction, config *WebSocketRouteConfig) awsapigatewayv2.WebSocketRoute
AddRoute adds a new route to the WebSocket API
func (*WebSocketAPI) GetConnectionTableName ¶
func (w *WebSocketAPI) GetConnectionTableName() *string
GetConnectionTableName returns the connection table name
func (*WebSocketAPI) GetWebSocketURL ¶
func (w *WebSocketAPI) GetWebSocketURL() *string
GetWebSocketURL returns the WebSocket URL
func (*WebSocketAPI) GrantApiInvoke ¶
func (w *WebSocketAPI) GrantApiInvoke(grantee awsiam.IGrantable) awsiam.Grant
GrantApiInvoke grants permission to invoke the WebSocket API
func (*WebSocketAPI) GrantConnectionManagement ¶
func (w *WebSocketAPI) GrantConnectionManagement(grantee awsiam.IGrantable) awsiam.Grant
GrantConnectionManagement grants permissions to manage WebSocket connections
type WebSocketAPIProps ¶
type WebSocketAPIProps struct {
// API name
ApiName *string
// API description
Description *string
// Route selection expression (default: "$request.body.action")
RouteSelectionExpression *string
// Lambda function properties for handlers
FunctionProps awslambda.FunctionProps
// Connection management table properties (uses DynamORM)
ConnectionTableProps *ConnectionTableProps
// Enable automatic connection management
EnableConnectionManagement *bool
// WebSocket route configurations
Routes []*WebSocketRouteConfig
// Default route function (for unmatched routes)
DefaultRouteFunction awslambda.IFunction
// Connect route function ($connect)
ConnectRouteFunction awslambda.IFunction
// Disconnect route function ($disconnect)
DisconnectRouteFunction awslambda.IFunction
// Stage configuration
StageName *string
// Auto deploy stage
AutoDeploy *bool
// Access logging
EnableAccessLogging *bool
AccessLogGroup awslogs.ILogGroup
// Throttling
ThrottleRateLimit *float64
ThrottleBurstLimit *float64
// Default authorizer for all routes
DefaultAuthorizer awsapigatewayv2.IWebSocketRouteAuthorizer
// Lift-specific settings
EnableTracing *bool
EnableMultiTenant *bool
EnableMonitoring *bool
EnableDeadLetterQueue *bool
}
WebSocketAPIProps defines properties for a WebSocket API
type WebSocketRouteConfig ¶
type WebSocketRouteConfig struct {
// Route key (e.g., "$connect", "$disconnect", "$default", "custom")
RouteKey *string
// Lambda function for this route
Function awslambda.IFunction
// Whether this route requires authorization
RequireAuthorization *bool
// Custom authorizer for this route
Authorizer awsapigatewayv2.IWebSocketRouteAuthorizer
}
WebSocketRouteConfig defines configuration for WebSocket routes
Source Files
¶
- api.go
- api_key_authorizer.go
- auditing.go
- compliance_stack.go
- connection_table.go
- dynamo_stream_processor.go
- dynamodb.go
- dynamorm_crud_handlers.go
- dynamorm_event_store.go
- event_routing_table.go
- eventbridge_handler.go
- helpers.go
- idempotency_table.go
- idempotent.go
- kinesis_processor.go
- lambda.go
- monitored.go
- monitoring_enhanced.go
- ratelimit_table.go
- ratelimited.go
- request_tracking_table.go
- s3_processor.go
- secure.go
- security_enhanced.go
- sns_processor.go
- sqs_processor.go
- stream_processor.go
- streaming_table.go
- websocket_api.go