From f2d4554c86ff2564cf6d31a11c9759454a3020e0 Mon Sep 17 00:00:00 2001
From: awstools Creates a log group with the specified name. You can create up to 20,000 log groups per account. Creates a log group with the specified name. You can create up to 1,000,000 log groups per Region per account. You must use the following guidelines when naming a log group:
*
CloudWatch Logs disables a metric filter if it generates 1,000 different name/value pairs for - * your specified dimensions within a certain amount of time. This helps to prevent accidental - * high charges.
+ *CloudWatch Logs might disable a metric filter if it generates 1,000 different name/value pairs for + * your specified dimensions within one hour.
* + *When log events reach their retention setting they are marked for deletion. After
+ * they are marked for deletion, they do not add to your archival storage costs anymore, even if
+ * they are not actually deleted until later. These log events marked for deletion are also not
+ * included when you use an API to retrieve the storedBytes
value to see how many bytes a log group is storing.
Used as an idempotency token, to avoid returning an exception if the service receives the same request twice because of a network + * error.
+ */ + clientToken?: string; } /** diff --git a/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts index 33fb3060ae49..334e8afa35f7 100644 --- a/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts @@ -17,6 +17,7 @@ import { ResponseMetadata as __ResponseMetadata, SerdeContext as __SerdeContext, } from "@smithy/types"; +import { v4 as generateIdempotencyToken } from "uuid"; import { AssociateKmsKeyCommandInput, AssociateKmsKeyCommandOutput } from "../commands/AssociateKmsKeyCommand"; import { CancelExportTaskCommandInput, CancelExportTaskCommandOutput } from "../commands/CancelExportTaskCommand"; @@ -725,7 +726,7 @@ export const se_PutQueryDefinitionCommand = async ( ): Promise<__HttpRequest> => { const headers: __HeaderBag = sharedHeaders("PutQueryDefinition"); let body: any; - body = JSON.stringify(_json(input)); + body = JSON.stringify(se_PutQueryDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -3844,7 +3845,18 @@ const se_PutMetricFilterRequest = (input: PutMetricFilterRequest, context: __Ser }); }; -// se_PutQueryDefinitionRequest omitted. +/** + * serializeAws_json1_1PutQueryDefinitionRequest + */ +const se_PutQueryDefinitionRequest = (input: PutQueryDefinitionRequest, context: __SerdeContext): any => { + return take(input, { + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + logGroupNames: _json, + name: [], + queryDefinitionId: [], + queryString: [], + }); +}; // se_PutResourcePolicyRequest omitted. diff --git a/codegen/sdk-codegen/aws-models/cloudwatch-logs.json b/codegen/sdk-codegen/aws-models/cloudwatch-logs.json index daf0995439ee..6d65adc38094 100644 --- a/codegen/sdk-codegen/aws-models/cloudwatch-logs.json +++ b/codegen/sdk-codegen/aws-models/cloudwatch-logs.json @@ -219,6 +219,16 @@ "smithy.api#input": {} } }, + "com.amazonaws.cloudwatchlogs#ClientToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 128 + }, + "smithy.api#pattern": "^\\S{36,128}$" + } + }, "com.amazonaws.cloudwatchlogs#CreateExportTask": { "type": "operation", "input": { @@ -345,7 +355,7 @@ } ], "traits": { - "smithy.api#documentation": "Creates a log group with the specified name. You can create up to 20,000 log groups per account.
\nYou must use the following guidelines when naming a log group:
\nLog group names must be unique within a Region for an Amazon Web Services\n account.
\nLog group names can be between 1 and 512 characters long.
\nLog group names consist of the following characters: a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), \n '/' (forward slash), '.' (period), and '#' (number sign)
\nWhen you create a log group, by default the log events in the log group do not expire.\n To set a retention policy so that events expire and are deleted after a specified time, use\n PutRetentionPolicy.
\nIf you associate an KMS key with the log group, ingested data is\n encrypted using the KMS key. This association is stored as long as the data\n encrypted with the KMS key is still within CloudWatch Logs. This enables\n CloudWatch Logs to decrypt this data whenever it is requested.
\nIf you attempt to associate a KMS key with the log group but the KMS key does not exist or the KMS key is disabled, you receive an\n InvalidParameterException
error.
CloudWatch Logs supports only symmetric KMS keys. Do not associate an\n asymmetric KMS key with your log group. For more information, see Using\n Symmetric and Asymmetric Keys.
\nCreates a log group with the specified name. You can create up to 1,000,000 log groups per Region per account.
\nYou must use the following guidelines when naming a log group:
\nLog group names must be unique within a Region for an Amazon Web Services\n account.
\nLog group names can be between 1 and 512 characters long.
\nLog group names consist of the following characters: a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), \n '/' (forward slash), '.' (period), and '#' (number sign)
\nWhen you create a log group, by default the log events in the log group do not expire.\n To set a retention policy so that events expire and are deleted after a specified time, use\n PutRetentionPolicy.
\nIf you associate an KMS key with the log group, ingested data is\n encrypted using the KMS key. This association is stored as long as the data\n encrypted with the KMS key is still within CloudWatch Logs. This enables\n CloudWatch Logs to decrypt this data whenever it is requested.
\nIf you attempt to associate a KMS key with the log group but the KMS key does not exist or the KMS key is disabled, you receive an\n InvalidParameterException
error.
CloudWatch Logs supports only symmetric KMS keys. Do not associate an\n asymmetric KMS key with your log group. For more information, see Using\n Symmetric and Asymmetric Keys.
\nCreates or updates a metric filter and associates it with the specified log group. With\n metric filters, you can configure rules to extract metric data from log events ingested\n through PutLogEvents.
\nThe maximum number of metric filters that can be associated with a log group is\n 100.
\nWhen you create a metric filter, you can also optionally assign a unit and dimensions\n to the metric that is created.
\nMetrics extracted from log events are charged as custom metrics.\n To prevent unexpected high charges, do not specify high-cardinality fields such as \n IPAddress
or requestID
as dimensions. Each different value \n found for \n a dimension is treated as a separate metric and accrues charges as a separate custom metric.\n
CloudWatch Logs disables a metric filter if it generates 1,000 different name/value pairs for\n your specified dimensions within a certain amount of time. This helps to prevent accidental\n high charges.
\nYou can also set up a billing alarm to alert you if your charges are higher than \n expected. For more information, \n see \n Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services Charges.\n
\nCreates or updates a metric filter and associates it with the specified log group. With\n metric filters, you can configure rules to extract metric data from log events ingested\n through PutLogEvents.
\nThe maximum number of metric filters that can be associated with a log group is\n 100.
\nWhen you create a metric filter, you can also optionally assign a unit and dimensions\n to the metric that is created.
\nMetrics extracted from log events are charged as custom metrics.\n To prevent unexpected high charges, do not specify high-cardinality fields such as \n IPAddress
or requestID
as dimensions. Each different value \n found for \n a dimension is treated as a separate metric and accrues charges as a separate custom metric.\n
CloudWatch Logs might disable a metric filter if it generates 1,000 different name/value pairs for\n your specified dimensions within one hour.
\nYou can also set up a billing alarm to alert you if your charges are higher than \n expected. For more information, \n see \n Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services Charges.\n
\nThe query string to use for this definition. \n For more information, see CloudWatch Logs Insights Query Syntax.
", "smithy.api#required": {} } + }, + "clientToken": { + "target": "com.amazonaws.cloudwatchlogs#ClientToken", + "traits": { + "smithy.api#documentation": "Used as an idempotency token, to avoid returning an exception if the service receives the same request twice because of a network\n error.
", + "smithy.api#idempotencyToken": {} + } } }, "traits": { @@ -5202,7 +5219,7 @@ } ], "traits": { - "smithy.api#documentation": "Sets the retention of the specified log group. With a retention policy, you can\n configure the number of days for which to retain log events in the specified log\n group.
\nCloudWatch Logs doesn’t immediately delete log events when they reach their retention\n setting. It typically takes up to 72 hours after that before log events are deleted, but in\n rare situations might take longer.
\nTo illustrate, imagine that you change a log group to have a longer retention setting\n when it contains log events that are past the expiration date, but haven’t been deleted.\n Those log events will take up to 72 hours to be deleted after the new retention date is\n reached. To make sure that log data is deleted permanently, keep a log group at its lower\n retention setting until 72 hours after the previous retention period ends. Alternatively,\n wait to change the retention setting until you confirm that the earlier log events are\n deleted.
\nSets the retention of the specified log group. With a retention policy, you can\n configure the number of days for which to retain log events in the specified log\n group.
\nCloudWatch Logs doesn’t immediately delete log events when they reach their retention\n setting. It typically takes up to 72 hours after that before log events are deleted, but in\n rare situations might take longer.
\nTo illustrate, imagine that you change a log group to have a longer retention setting\n when it contains log events that are past the expiration date, but haven’t been deleted.\n Those log events will take up to 72 hours to be deleted after the new retention date is\n reached. To make sure that log data is deleted permanently, keep a log group at its lower\n retention setting until 72 hours after the previous retention period ends. Alternatively,\n wait to change the retention setting until you confirm that the earlier log events are\n deleted.
\nWhen log events reach their retention setting they are marked for deletion. After\n they are marked for deletion, they do not add to your archival storage costs anymore, even if \n they are not actually deleted until later. These log events marked for deletion are also not \n included when you use an API to retrieve the storedBytes
value to see how many bytes a log group is storing.