1
0
mirror of https://github.com/mxpv/podsync.git synced 2024-05-11 05:55:04 +00:00

Initial CloudWatch integration

This commit is contained in:
Maksym Pavlenko
2018-12-11 22:49:39 -08:00
parent 371f4c6a27
commit 06e2796237
3 changed files with 31 additions and 1 deletions

View File

@ -142,6 +142,18 @@ Resources:
Resource:
- "*"
# CloudWatch
LogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Ref "AWS::StackName"
RetentionInDays: 30
BackendLogStream:
Type: AWS::Logs::LogStream
Properties:
LogGroupName: !Ref LogGroup
LogStreamName: "Backend"
# Access from DigitalOcean VM
DOUser:
Type: AWS::IAM::User
@ -150,7 +162,7 @@ Resources:
- PledgesTable
Properties:
Policies:
- PolicyName: "DynamoAccess"
- PolicyName: "DynamoDB"
PolicyDocument:
Version: "2012-10-17"
Statement:
@ -168,6 +180,16 @@ Resources:
- "dynamodb:ListTables"
Resource:
- "*"
- PolicyName: "CloudWatch"
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- "logs:CreateLogStream"
- "logs:PutLogEvents"
Resource:
- "*"
DOUserKey:
Type: AWS::IAM::AccessKey
DependsOn: DOUser

View File

@ -24,6 +24,8 @@ import (
)
func main() {
log.SetFormatter(&log.JSONFormatter{})
stop := make(chan os.Signal)
signal.Notify(stop, syscall.SIGINT, syscall.SIGTERM)

View File

@ -26,6 +26,12 @@ services:
- DYNAMO_PLEDGES_TABLE_NAME=Prod_Pledges
volumes:
- {PATH_TO_GOOGLE_CREDENTIALS_FILE_FOR_USE_OUTSIDE_GOOGLE_CLOUD}:/google-credentials.json
logging:
driver: "awslogs"
options:
awslogs-region: "us-east-1"
awslogs-group: "Prod"
awslogs-stream: "Backend"
ytdl:
image: mxpv/ytdl
container_name: ytdl