diff --git a/changelog.d/22934_sqs_poll_secs_range_validation.fix.md b/changelog.d/22934_sqs_poll_secs_range_validation.fix.md new file mode 100644 index 0000000000000..0100d60841267 --- /dev/null +++ b/changelog.d/22934_sqs_poll_secs_range_validation.fix.md @@ -0,0 +1,3 @@ +Constrained the `aws_s3` source's `sqs.poll_secs` and the `aws_sqs` source's `poll_secs` configuration fields to the AWS-imposed maximum of 20 seconds. These fields map to SQS `ReceiveMessage`'s `WaitTimeSeconds` parameter; previously, values above 20 caused AWS to reject the call, manifesting as silent ingestion failure with no error or hint in the documentation. The field documentation now states the limit explicitly, and `vector validate` rejects out-of-range configurations. + +authors: st-omarkhalid diff --git a/src/sources/aws_s3/sqs.rs b/src/sources/aws_s3/sqs.rs index 9ad5b47be61cc..13ac5984b9d64 100644 --- a/src/sources/aws_s3/sqs.rs +++ b/src/sources/aws_s3/sqs.rs @@ -106,11 +106,18 @@ pub(super) struct Config { /// /// Generally, this should not be changed unless instructed to do so, as if messages are available, /// they are always consumed, regardless of the value of `poll_secs`. + /// + /// Maps to the SQS `ReceiveMessage` `WaitTimeSeconds` parameter, which is + /// [capped at 20 seconds by AWS][aws_docs]. Values above 20 are rejected by AWS and result in + /// silent ingestion failure, so this field is constrained to the same range. + /// + /// [aws_docs]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html // NOTE: We restrict this to u32 for safe conversion to i32 later. // NOTE: This value isn't used as a `Duration` downstream, so we don't bother using `serde_with` #[serde(default = "default_poll_secs")] #[derivative(Default(value = "default_poll_secs()"))] #[configurable(metadata(docs::type_unit = "seconds"))] + #[configurable(validation(range(max = 20)))] pub(super) poll_secs: u32, /// The visibility timeout to use for messages, in seconds. diff --git a/src/sources/aws_sqs/config.rs b/src/sources/aws_sqs/config.rs index c2f630bf28a8d..33600522e6760 100644 --- a/src/sources/aws_sqs/config.rs +++ b/src/sources/aws_sqs/config.rs @@ -41,12 +41,19 @@ pub struct AwsSqsConfig { /// /// Generally, this should not be changed unless instructed to do so, as if messages are available, /// they are always consumed, regardless of the value of `poll_secs`. + /// + /// Maps to the SQS `ReceiveMessage` `WaitTimeSeconds` parameter, which is + /// [capped at 20 seconds by AWS][aws_docs]. Values above 20 are rejected by AWS and result in + /// silent ingestion failure, so this field is constrained to the same range. + /// + /// [aws_docs]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html // NOTE: We restrict this to u32 for safe conversion to i32 later. // NOTE: This value isn't used as a `Duration` downstream, so we don't bother using `serde_with` #[serde(default = "default_poll_secs")] #[derivative(Default(value = "default_poll_secs()"))] #[configurable(metadata(docs::type_unit = "seconds"))] #[configurable(metadata(docs::human_name = "Poll Wait Time"))] + #[configurable(validation(range(max = 20)))] pub poll_secs: u32, /// The visibility timeout to use for messages, in seconds. diff --git a/website/cue/reference/components/sources/generated/aws_s3.cue b/website/cue/reference/components/sources/generated/aws_s3.cue index 95730d6c68ca6..e495f2af7545b 100644 --- a/website/cue/reference/components/sources/generated/aws_s3.cue +++ b/website/cue/reference/components/sources/generated/aws_s3.cue @@ -871,6 +871,12 @@ generated: components: sources: aws_s3: configuration: { Generally, this should not be changed unless instructed to do so, as if messages are available, they are always consumed, regardless of the value of `poll_secs`. + + Maps to the SQS `ReceiveMessage` `WaitTimeSeconds` parameter, which is + [capped at 20 seconds by AWS][aws_docs]. Values above 20 are rejected by AWS and result in + silent ingestion failure, so this field is constrained to the same range. + + [aws_docs]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html """ required: false type: uint: { diff --git a/website/cue/reference/components/sources/generated/aws_sqs.cue b/website/cue/reference/components/sources/generated/aws_sqs.cue index b52cfcea28a31..60b0c5f42c32a 100644 --- a/website/cue/reference/components/sources/generated/aws_sqs.cue +++ b/website/cue/reference/components/sources/generated/aws_sqs.cue @@ -682,6 +682,12 @@ generated: components: sources: aws_sqs: configuration: { Generally, this should not be changed unless instructed to do so, as if messages are available, they are always consumed, regardless of the value of `poll_secs`. + + Maps to the SQS `ReceiveMessage` `WaitTimeSeconds` parameter, which is + [capped at 20 seconds by AWS][aws_docs]. Values above 20 are rejected by AWS and result in + silent ingestion failure, so this field is constrained to the same range. + + [aws_docs]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html """ required: false type: uint: {