diff --git a/.changelog/31931.txt b/.changelog/31931.txt new file mode 100644 index 00000000000..ec716eaa117 --- /dev/null +++ b/.changelog/31931.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_lambda_event_source_mapping: The `queues` argument has changed from a set to a list with a maximum of one element. +``` diff --git a/internal/service/lambda/event_source_mapping.go b/internal/service/lambda/event_source_mapping.go index 1f03ebc6154..5f4b869fdac 100644 --- a/internal/service/lambda/event_source_mapping.go +++ b/internal/service/lambda/event_source_mapping.go @@ -232,9 +232,10 @@ func ResourceEventSourceMapping() *schema.Resource { Computed: true, }, "queues": { - Type: schema.TypeSet, + Type: schema.TypeList, Optional: true, ForceNew: true, + MaxItems: 1, Elem: &schema.Schema{ Type: schema.TypeString, ValidateFunc: validation.StringLenBetween(1, 1000), @@ -426,8 +427,8 @@ func resourceEventSourceMappingCreate(ctx context.Context, d *schema.ResourceDat input.ParallelizationFactor = aws.Int64(int64(v.(int))) } - if v, ok := d.GetOk("queues"); ok && v.(*schema.Set).Len() > 0 { - input.Queues = flex.ExpandStringSet(v.(*schema.Set)) + if v, ok := d.GetOk("queues"); ok && len(v.([]interface{})) > 0 { + input.Queues = flex.ExpandStringList(v.([]interface{})) } if v, ok := d.GetOk("scaling_config"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { diff --git a/website/docs/r/lambda_event_source_mapping.html.markdown b/website/docs/r/lambda_event_source_mapping.html.markdown index c013c6e17ae..e1c6dc44cc2 100644 --- a/website/docs/r/lambda_event_source_mapping.html.markdown +++ b/website/docs/r/lambda_event_source_mapping.html.markdown @@ -161,7 +161,7 @@ resource "aws_lambda_event_source_mapping" "example" { * `maximum_record_age_in_seconds`: - (Optional) The maximum age of a record that Lambda sends to a function for processing. Only available for stream sources (DynamoDB and Kinesis). Must be either -1 (forever, and the default value) or between 60 and 604800 (inclusive). * `maximum_retry_attempts`: - (Optional) The maximum number of times to retry when the function returns an error. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of -1 (forever), maximum of 10000. * `parallelization_factor`: - (Optional) The number of batches to process from each shard concurrently. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of 1, maximum of 10. -* `queues` - (Optional) The name of the Amazon MQ broker destination queue to consume. Only available for MQ sources. A single queue name must be specified. +* `queues` - (Optional) The name of the Amazon MQ broker destination queue to consume. Only available for MQ sources. The list must contain exactly one queue name. * `scaling_config` - (Optional) Scaling configuration of the event source. Only available for SQS queues. Detailed below. * `self_managed_event_source`: - (Optional) For Self Managed Kafka sources, the location of the self managed cluster. If set, configuration must also include `source_access_configuration`. Detailed below. * `self_managed_kafka_event_source_config` - (Optional) Additional configuration block for Self Managed Kafka sources. Incompatible with "event_source_arn" and "amazon_managed_kafka_event_source_config". Detailed below.