Overview
This guide provides Terraform configuration examples for setting up the AWS infrastructure required for Meter’s SIEM integration. You’ll create a Kinesis Data Stream and IAM role that allows Meter to securely write security events to your AWS account.Prerequisites
- Terraform installed (version 1.0 or later recommended)
- AWS account with permissions to create IAM roles, policies, and Kinesis streams
- AWS credentials configured for Terraform (via environment variables, AWS CLI, or IAM role)
- Basic familiarity with Terraform and AWS IAM concepts
Use cases
- Automate SIEM integration infrastructure deployment across multiple AWS accounts
- Maintain infrastructure-as-code for audit and compliance requirements
- Quickly replicate SIEM setup for dev, staging, and production environments
- Version control your security integration configuration
Minimal configuration
This minimal example creates the required AWS resources with secure defaults.Variables
Define these variables in your Terraform configuration:Provider configuration
Kinesis Data Stream
Create a Kinesis stream to receive events from Meter:IAM role for Meter
Create an IAM role that Meter can assume to write to your Kinesis stream:IAM policy for Kinesis write access
Create a policy that grants write permissions to the Kinesis stream:Attach policy to role
Outputs
Export the values needed for Dashboard configuration:Configuration options
Kinesis stream settings
| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | Required | Name of the Kinesis stream |
shard_count | number | 1 | Number of shards (each shard: 1 MB/sec in, 2 MB/sec out) |
retention_period | number | 24 | Data retention in hours (24-8760) |
stream_mode | string | ”PROVISIONED” | Use “PROVISIONED” for predictable costs, “ON_DEMAND” for variable traffic |
shard_level_metrics | list | See example | CloudWatch metrics to enable for monitoring |
IAM role configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
meter_service_role_arn | string | Yes | ARN of Meter’s service role (provided by Meter) |
external_id | string | Yes | Random secret string (64+ characters recommended) |
Advanced configuration
On-demand Kinesis stream
For unpredictable event volumes, use on-demand mode:Enhanced monitoring with CloudWatch alarms
Add CloudWatch alarms to monitor integration health:Server-side encryption
Enable encryption at rest for compliance:VPC endpoints for private connectivity
Route Kinesis traffic through your VPC:Integration with Kinesis Firehose
Forward events to S3 for long-term storage:Best practices
Security
- Store external ID securely: Never commit the external ID to version control. Use Terraform variables with
sensitive = trueand store the value in AWS Secrets Manager or a secure secrets management tool. - Enable encryption: Use KMS encryption for streams containing sensitive security data.
- Least privilege: Only grant
PutRecordandPutRecordspermissions, not full Kinesis access. - Enable CloudTrail: Log all API calls to your Kinesis stream and IAM role for audit purposes.
Cost optimization
- Right-size shards: Start with 1 shard and monitor
IncomingBytesandWriteProvisionedThroughputExceededmetrics. Add shards only when needed. - Optimize retention: The default 24-hour retention is sufficient if you’re consuming events in real-time. Longer retention increases costs.
- Use on-demand carefully: On-demand mode is convenient but can be more expensive for consistent, high-volume streams.
Operational
- Tag resources: Add consistent tags for cost tracking and resource management.
- Monitor metrics: Enable shard-level metrics and set up CloudWatch alarms for proactive monitoring.
- Test before production: Deploy to a test environment first and send test events to validate the configuration.
- Document your setup: Keep a record of your Terraform module version, external ID rotation schedule, and any customizations.
Related resources
- SIEM integration technical overview
- Configuring SIEM integration in Dashboard
- Terraform AWS Provider documentation
- AWS Kinesis Data Streams pricing