By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Multi-measure records not yet possible??

0

I am trying to populate a new database/ new table using the newly announced multimeasure records. But I get error messages when doing so using MULTI mmeasure types, and don't know why. The error I am getting reads:

"Error: Parameter validation failed
Unknown parameter in Records[0]: "MeasureValues", must be one of: Dimensions, MeasureName, MeasureValue, MeasureValueType, Time, TimeUnit, Version"

so based on this error I am not allowed to pass "MeasureValues", only "MeasureValue"? This seems wrong for MULTI measures, has that not yet been implemented?

I am using client.write_records with boto3 according to this documentation: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/timestream-write.html#TimestreamWrite.Client.write_records

MeasureValues is allowed for MULTI type objects.

Using python, I am passing on:

CommonAttributes = {
"Dimensions": dimensions,
"MeasureName": "data",
"MeasureValueType": "MULTI",
"TimeUnit": "SECONDS"
}

Records = [ {
"Time": "1628703068",
"MeasureValues": [
{
"Name": "1",
"Value": "5.57",
"Type": "DOUBLE"
},
{
"Name": "2",
"Value": "9.93",
"Type": "DOUBLE"
} ]
}
]

So I am using MULTI as MeasureValueType, but am getting a parameter validation error. What am I missing?

Edited by: JH1234 on Dec 3, 2021 12:08 AM

asked 3 years ago1K views
5 Answers
0

Hello,

Can you check if you have upgraded boto3 - https://boto3.amazonaws.com/v1/documentation/api/latest/index.html
?

Thanks!

AWS
answered 3 years ago
0

I am using this within a Lambda Function, in the US-WEST-1 region, with python 3.9 as runtime setting. As below. Does this mean that AWS has not updated boto3 within Lambda Functions code? This seems nothing that I can control on my end, no?

import boto3
import botocore
from botocore.exceptions import ClientError

client = boto3.client('timestream-write', region_name='us-east-1')  
try:  
    response = client.write_records(DatabaseName=database,  
                                        TableName=table,  
                                        Records=records,  
                                        CommonAttributes=common_attributes)  

Edited by: JH1234 on Dec 3, 2021 8:12 AM

answered 3 years ago
0

I checked, and indeed AWS Lambda is using an older version of boto3 in both us-west-1 and us-east1: 1.18.55

When can I expect this to be updated? These are features that have been annonced and I am surprised this isn't implemented within the AWS infrastructure itself yet!

answered 3 years ago
0

Looked like you have reported this issue in Lambda forums https://forums.aws.amazon.com/message.jspa?messageID=1001959#1001959

One suggestion to unblock your use case could be to create a Lambda layer that has recent version of boto3 - Reference: https://github.com/keithrozario/Klayers

Thanks!

AWS
answered 3 years ago
0

this worked, thank you very much! It's at least a temporary fix until Lambda catches up with its own boto3 library.
I'm glad also that my code was correct. thanks for the help.

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions