Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions cdn/dovetail-cdn/real-time-logs-kinesis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,29 @@ Resources:
- { Key: prx:ops:environment, Value: !Ref EnvironmentType }
- { Key: prx:dev:family, Value: Dovetail }
- { Key: prx:dev:application, Value: Counts }
CloudfrontRealTimeLogsStreamPolicy:
Type: AWS::Kinesis::ResourcePolicy
Properties:
ResourceArn: !GetAtt CloudfrontRealTimeLogsStream.Arn
ResourcePolicy:
Statement:
- Action:
- kinesis:DescribeStream
- kinesis:DescribeStreamSummary
- kinesis:GetRecords
- kinesis:GetShardIterator
- kinesis:ListShards
Condition:
StringEquals:
aws:ResourceOrgID: ${aws:PrincipalOrgID}
aws:ResourceTag/prx:ops:environment: ${aws:PrincipalTag/prx:ops:environment}
Effect: Allow
Resource: !GetAtt CloudfrontRealTimeLogsStream.Arn
Principal:
AWS:
- "561178107736"
- !Ref AWS::AccountId
Version: "2012-10-17"

Outputs:
RealTimeLogsStreamArn:
Expand Down
3 changes: 2 additions & 1 deletion spire/templates/apps-100A.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ Resources:
ArrangementsDynamodbRegion: !Sub /prx/${EnvironmentTypeAbbreviation}/dovetail-cdn-arranger/ARRANGEMENTS_DDB_REGION
ArrangementsDynamodbTableName: !Sub /prx/${EnvironmentTypeAbbreviation}/dovetail-cdn-arranger/ARRANGEMENTS_DDB_TABLE
ArrangementsDynamodbAccessRoleArn: !Sub /prx/${EnvironmentTypeAbbreviation}/dovetail-cdn-arranger/ARRANGEMENTS_DDB_ACCESS_ROLE
DovetailCdnLogsKinesisStreamArn: !Ref DovetailCdnLogsKinesisStreamArn
DovetailCdnLogsKinesisStreamArn: !Sub /prx/${EnvironmentTypeAbbreviation}/Spire/Dovetail-Counts/cdn-logs-kinesis-stream-arn-${AWS::Region}
OldDovetailCdnLogsKinesisStreamArn: !Ref DovetailCdnLogsKinesisStreamArn
DovetailCountedKinesisStreamArn: !Ref DovetailCountedKinesisStreamArn
DovetailRedisClientSecurityGroupId: !Ref DovetailRedisClientSecurityGroupId
DovetailRedisReplicationGroupEndpointAddress: !Ref DovetailRedisReplicationGroupEndpointAddress
Expand Down
11 changes: 10 additions & 1 deletion spire/templates/apps/dovetail-counts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ Parameters:
ArrangementsDynamodbRegion: { Type: AWS::SSM::Parameter::Value<String> }
ArrangementsDynamodbTableName: { Type: AWS::SSM::Parameter::Value<String> }
ArrangementsDynamodbAccessRoleArn: { Type: AWS::SSM::Parameter::Value<String> }
DovetailCdnLogsKinesisStreamArn: { Type: String }
DovetailCdnLogsKinesisStreamArn: { Type: AWS::SSM::Parameter::Value<String> }
OldDovetailCdnLogsKinesisStreamArn: { Type: String }
DovetailCountedKinesisStreamArn: { Type: String }
DovetailRedisReplicationGroupEndpointAddress: { Type: String }
DovetailRedisReplicationGroupEndpointPort: { Type: String }
Expand Down Expand Up @@ -88,6 +89,14 @@ Resources:
BisectBatchOnFunctionError: true
Enabled: true
StartingPosition: LATEST
Stream: !Ref OldDovetailCdnLogsKinesisStreamArn
Type: Kinesis
CountsBytesKinesisStreamTrigger:
Properties:
BatchSize: 100
BisectBatchOnFunctionError: true
Enabled: !If [IsProduction, false, true]
StartingPosition: LATEST
Stream: !Ref DovetailCdnLogsKinesisStreamArn
Type: Kinesis
Handler: index.handler
Expand Down