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.For more information about fields, see Real-time log configuration 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.cloudfront.realtime_log_configs (
EndPoints,
Fields,
Name,
SamplingRate,
region
)
SELECT
'{{ end_points }}',
'{{ fields }}',
'{{ name }}',
'{{ sampling_rate }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.cloudfront.realtime_log_configs
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
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