realtime_log_configs
Creates, updates, deletes or gets a realtime_log_config resource or lists realtime_log_configs in a region
Overview
| Name | realtime_log_configs |
| Type | Resource |
| Description | A real-time log configuration. |
| Id | awscc.cloudfront.realtime_log_configs |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | |
end_points | array | Contains information about the Amazon Kinesis data stream where you are sending real-time log data for this real-time log configuration. |
fields | array | A list of fields that are included in each real-time log record. In an API response, the fields are provided in the same order in which they are sent to the Amazon Kinesis data stream.<br />For more information about fields, see [Real-time log configuration fields](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html#understand-real-time-log-config-fields) in the *Amazon CloudFront Developer Guide*. |
name | string | The unique name of this real-time log configuration. |
sampling_rate | number | The sampling rate for this real-time log configuration. The sampling rate determines the percentage of viewer requests that are represented in the real-time log data. The sampling rate is an integer between 1 and 100, inclusive. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | |
region | string | AWS region. |
For more information, see AWS::CloudFront::RealtimeLogConfig.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | realtime_log_configs | INSERT | Name, EndPoints, Fields, SamplingRate, region |
delete_resource | realtime_log_configs | DELETE | Identifier, region |
update_resource | realtime_log_configs | UPDATE | Identifier, PatchDocument, region |
list_resources | realtime_log_configs_list_only | SELECT | region |
get_resource | realtime_log_configs | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual realtime_log_config.
SELECT
region,
arn,
end_points,
fields,
name,
sampling_rate
FROM awscc.cloudfront.realtime_log_configs
WHERE
region = 'us-east-1' AND
Identifier = '{{ arn }}';
Lists all realtime_log_configs in a region.
SELECT
region,
arn
FROM awscc.cloudfront.realtime_log_configs_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new realtime_log_config resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.cloudfront.realtime_log_configs (
EndPoints,
Fields,
Name,
SamplingRate,
region
)
SELECT
'{{ end_points }}',
'{{ fields }}',
'{{ name }}',
'{{ sampling_rate }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.cloudfront.realtime_log_configs (
EndPoints,
Fields,
Name,
SamplingRate,
region
)
SELECT
'{{ end_points }}',
'{{ fields }}',
'{{ name }}',
'{{ sampling_rate }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: realtime_log_config
props:
- name: end_points
value:
- kinesis_stream_config:
role_arn: '{{ role_arn }}'
stream_arn: '{{ stream_arn }}'
stream_type: '{{ stream_type }}'
- name: fields
value:
- '{{ fields[0] }}'
- name: name
value: '{{ name }}'
- name: sampling_rate
value: null
UPDATE example
Use the following StackQL query and manifest file to update a realtime_log_config resource, using stack-deploy.
/*+ update */
UPDATE awscc.cloudfront.realtime_log_configs
SET PatchDocument = string('{{ {
"EndPoints": end_points,
"Fields": fields,
"SamplingRate": sampling_rate
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.cloudfront.realtime_log_configs
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';
Permissions
To operate on the realtime_log_configs resource, the following permissions are required:
- Create
- Delete
- List
- Read
- Update
cloudfront:CreateRealtimeLogConfig,
iam:PassRole
cloudfront:DeleteRealtimeLogConfig,
cloudfront:GetRealtimeLogConfig
cloudfront:ListRealtimeLogConfigs
cloudfront:GetRealtimeLogConfig
cloudfront:UpdateRealtimeLogConfig,
cloudfront:GetRealtimeLogConfig,
iam:PassRole