Install BDOT Collector in AWS ECS Fargate
Deploy BDOT Collector on AWS ECS Fargate for scalable, serverless collector deployment with automatic scaling and monitoring.
Prerequisites
Quick Deployment with CloudFormation
CloudFormation Template
AWSTemplateFormatVersion: '2010-09-09'
Description: 'BDOT Collector on AWS ECS Fargate with VPC and Auto Scaling'
Parameters:
CollectorSecretKey:
Type: String
Description: BDOT Collector secret key from Bindplane Server
NoEcho: true
OpampEndpoint:
Type: String
Description: OpAMP endpoint URL
Default: 'wss://app.bindplane.com/v1/opamp'
AllowedPattern: '^(ws|wss)://.*'
CollectorImage:
Type: String
Description: BDOT Collector Docker image
Default: 'ghcr.io/observiq/bindplane-agent:1.84.0'
Environment:
Type: String
Description: Environment name (used for resource naming)
Default: prod
AllowedValues: [dev, staging, prod]
DesiredCount:
Type: Number
Description: Desired number of Bindplane collector instances
Default: 1
MinValue: 1
MaxValue: 10
Resources:
# VPC and Networking
VPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
EnableDnsHostnames: true
EnableDnsSupport: true
Tags:
- Key: Name
Value: !Sub '${Environment}-bindplane-collector-vpc'
# Internet Gateway
InternetGateway:
Type: AWS::EC2::InternetGateway
Properties:
Tags:
- Key: Name
Value: !Sub '${Environment}-bindplane-collector-igw'
InternetGatewayAttachment:
Type: AWS::EC2::VPCGatewayAttachment
Properties:
InternetGatewayId: !Ref InternetGateway
VpcId: !Ref VPC
# Public Subnets
PublicSubnet1:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC
AvailabilityZone: !Select [0, !GetAZs '']
CidrBlock: 10.0.1.0/24
MapPublicIpOnLaunch: true
Tags:
- Key: Name
Value: !Sub '${Environment}-bindplane-collector-public-1a'
PublicSubnet2:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC
AvailabilityZone: !Select [1, !GetAZs '']
CidrBlock: 10.0.2.0/24
MapPublicIpOnLaunch: true
Tags:
- Key: Name
Value: !Sub '${Environment}-bindplane-collector-public-1b'
# Route Tables
PublicRouteTable:
Type: AWS::EC2::RouteTable
Properties:
VpcId: !Ref VPC
Tags:
- Key: Name
Value: !Sub '${Environment}-bindplane-collector-public-rt'
DefaultPublicRoute:
Type: AWS::EC2::Route
DependsOn: InternetGatewayAttachment
Properties:
RouteTableId: !Ref PublicRouteTable
DestinationCidrBlock: 0.0.0.0/0
GatewayId: !Ref InternetGateway
PublicSubnet1RouteTableAssociation:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId: !Ref PublicRouteTable
SubnetId: !Ref PublicSubnet1
PublicSubnet2RouteTableAssociation:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId: !Ref PublicRouteTable
SubnetId: !Ref PublicSubnet2
# Security Groups
CollectorSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Security group for BDOT Collector
VpcId: !Ref VPC
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 4317
ToPort: 4317
CidrIp: 0.0.0.0/0
Description: OTLP gRPC
- IpProtocol: tcp
FromPort: 4318
ToPort: 4318
CidrIp: 0.0.0.0/0
Description: OTLP HTTP
- IpProtocol: tcp
FromPort: 13133
ToPort: 13133
CidrIp: 0.0.0.0/0
Description: Health check
- IpProtocol: tcp
FromPort: 55679
ToPort: 55679
CidrIp: 0.0.0.0/0
Description: ZPages debugging
Tags:
- Key: Name
Value: !Sub '${Environment}-bindplane-collector-sg'
# IAM Roles
TaskExecutionRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: ecs-tasks.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy
Tags:
- Key: Name
Value: !Sub '${Environment}-bindplane-collector-execution-role'
TaskRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: ecs-tasks.amazonaws.com
Action: sts:AssumeRole
Tags:
- Key: Name
Value: !Sub '${Environment}-bindplane-collector-task-role'
# CloudWatch Log Group
LogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub '/ecs/${Environment}-bindplane-collector'
RetentionInDays: 30
# ECS Cluster
ECSCluster:
Type: AWS::ECS::Cluster
Properties:
ClusterName: !Sub '${Environment}-bindplane-collector-cluster'
CapacityProviders:
- FARGATE
DefaultCapacityProviderStrategy:
- CapacityProvider: FARGATE
Weight: 1
# ECS Task Definition
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
Family: !Sub '${Environment}-bindplane-collector'
NetworkMode: awsvpc
RequiresCompatibilities:
- FARGATE
Cpu: 512
Memory: 1024
ExecutionRoleArn: !Ref TaskExecutionRole
TaskRoleArn: !Ref TaskRole
ContainerDefinitions:
- Name: bdot-collector
Image: !Ref CollectorImage
PortMappings:
- ContainerPort: 4317
Protocol: tcp
- ContainerPort: 4318
Protocol: tcp
- ContainerPort: 13133
Protocol: tcp
- ContainerPort: 55679
Protocol: tcp
Environment:
- Name: OPAMP_ENDPOINT
Value: !Ref OpampEndpoint
- Name: OPAMP_SECRET_KEY
Value: !Ref CollectorSecretKey
- Name: OPAMP_LABELS
Value: !Sub 'environment=${Environment},platform=aws-ecs-fargate'
- Name: MANAGER_YAML_PATH
Value: /etc/otel/storage/manager.yaml
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-group: !Ref LogGroup
awslogs-region: !Ref AWS::Region
awslogs-stream-prefix: ecs
# ECS Service
ECSService:
Type: AWS::ECS::Service
Properties:
ServiceName: !Sub '${Environment}-bindplane-collector-service'
Cluster: !Ref ECSCluster
TaskDefinition: !Ref TaskDefinition
DesiredCount: !Ref DesiredCount
LaunchType: FARGATE
NetworkConfiguration:
AwsvpcConfiguration:
Subnets:
- !Ref PublicSubnet1
- !Ref PublicSubnet2
SecurityGroups:
- !Ref CollectorSecurityGroup
AssignPublicIp: ENABLED
Outputs:
VPCId:
Description: VPC ID
Value: !Ref VPC
Export:
Name: !Sub '${Environment}-bindplane-collector-vpc-id'
ECSClusterName:
Description: ECS Cluster Name
Value: !Ref ECSCluster
Export:
Name: !Sub '${Environment}-bindplane-collector-cluster-name'
ServiceName:
Description: ECS Service Name
Value: !Ref ECSService
Export:
Name: !Sub '${Environment}-bindplane-collector-service-name'
TaskDefinitionArn:
Description: ECS Task Definition ARN
Value: !Ref TaskDefinition
Export:
Name: !Sub '${Environment}-bindplane-collector-task-definition-arn'Deploy with CloudFormation
Architecture Overview
Container Architecture
Manual Deployment Steps
Step 1: Set Up AWS Infrastructure
Step 2: Create ECS Resources
Step 3: Create Task Definition
Step 4: Create ECS Service
Configuration and Management
Connecting to Bindplane Server
Scaling Collectors
Monitoring and Logging
TLS Configuration
Troubleshooting
Common Issues
Best Practices
Cleanup
Next Steps
Last updated
Was this helpful?