Make container logs available

Store and retrieve container logs using Cloudwatch Logs
This commit is contained in:
Johannes Würbach
2018-04-20 23:52:59 +02:00
committed by Robbie Zhang
parent 0a1acbc78e
commit 803b0218c8
6 changed files with 79 additions and 4 deletions

View File

@@ -5,15 +5,18 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
"github.com/aws/aws-sdk-go/service/cloudwatchlogs/cloudwatchlogsiface"
"github.com/aws/aws-sdk-go/service/ecs"
"github.com/aws/aws-sdk-go/service/ecs/ecsiface"
)
// Client communicates with the regional AWS Fargate service.
type Client struct {
region string
svc *ecs.ECS
api ecsiface.ECSAPI
region string
svc *ecs.ECS
api ecsiface.ECSAPI
logsapi cloudwatchlogsiface.CloudWatchLogsAPI
}
var client *Client
@@ -42,6 +45,9 @@ func newClient(region string) (*Client, error) {
client.svc = ecs.New(session)
client.api = client.svc
// Create the CloudWatch service client.
client.logsapi = cloudwatchlogs.New(session)
log.Println("Created Fargate service client.")
return &client, nil