Amazon cloudformation 如何将实时日志附加到CloudInformation中的分发
我已经创建了一个实时日志配置。 但是,我找不到如何将其连接到CloudFront发行版的。 创建实时日志记录的CloudFront模板是:Amazon cloudformation 如何将实时日志附加到CloudInformation中的分发,amazon-cloudformation,amazon-cloudfront,Amazon Cloudformation,Amazon Cloudfront,我已经创建了一个实时日志配置。 但是,我找不到如何将其连接到CloudFront发行版的。 创建实时日志记录的CloudFront模板是: KinesisDataStream: Type: AWS::Kinesis::Stream Properties: Name: my-stream RetentionPeriodHours: 24 ShardCount: 1 RealTimeLogggingRole: Type: AWS::IAM::Role Properties: Tags
KinesisDataStream:
Type: AWS::Kinesis::Stream
Properties:
Name: my-stream
RetentionPeriodHours: 24
ShardCount: 1
RealTimeLogggingRole:
Type: AWS::IAM::Role
Properties:
Tags:
- Key: Name
Value: my-role
Path: "/"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action: sts:AssumeRole
Principal:
Service: cloudfront.amazonaws.com
Policies:
- PolicyName: po-real-time-logging-policy
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- kinesis:DescribeStreamSummary
- kinesis:DescribeStream
- kinesis:PutRecord
- kinesis:PutRecords
Resource:
- !GetAtt KinesisDataStream.Arn
RealTimeLoggging:
Type: AWS::CloudFront::RealtimeLogConfig
Properties:
Name: my-logging
SamplingRate: 100
Fields:
- timestamp
- c-ip
- cs-host
- cs-uri-stem
- cs-headers
EndPoints:
- StreamType: Kinesis
KinesisStreamConfig:
RoleArn: !GetAtt RealTimeLogggingRole.Arn
StreamArn: !GetAtt KinesisDataStream.Arn
CloudFrontDistribution:
Type: AWS::CloudFront::Distribution
...
我可以将其连接到GUI上:
但是我找不到如何使用CloudFormation执行此操作?您必须更新并设置:
您提供的模板有什么问题?有错误吗?我提供的模板没有将实时日志附加到分发版。我需要使用AWS控制台手动连接它。它进行得如何?你成功设置日志记录了吗?是的,成功了!谢谢
RealtimeLogConfigArn: !Ref RealTimeLoggging