Error when passing s3=None to ExportDefinition

0

There seems to be a problem with passing None as a value for the s3 parameter for the ExportDefinition when calling create_message_stream. The following code will produce the error below. But, if I remove the parameter: s3=None altogether, the code runs fine.

client.create_message_stream(MessageStreamDefinition(
name="WednesDayStream", # Required.
max_size=268435456, # Default is 256 MB.
stream_segment_size=16777216, # Default is 16 MB.
time_to_live_millis=None, # By default, no TTL is enabled.
strategy_on_full=StrategyOnFull.OverwriteOldestData, # Required.
persistence=Persistence.File, # Default is File.
flush_on_write=False, # Default is false.
export_definition=ExportDefinition( # Optional. Choose where/how the stream is exported to the AWS Cloud.
kinesis=None,
iot_analytics=None,
iot_sitewise=None,
s3=None
)
))

2021-02-05T15:09:17.112Z [INFO] (aws.greengrass.TokenExchangeService-lifecycle) com.example.stream.create: shell-runner-start. {scriptName=services.com.example.stream.create.lifecycle.Run.script, serviceName=com.example.stream.create, currentState=STARTING, command=["ln -f -s -t . /greengrass/v2/packages/artifacts/com.example.stream.create/1.0...."]}
2021-02-05T15:09:17.436Z [INFO] (Copier) com.example.stream.create: Run script exited. {exitCode=137, serviceName=com.example.stream.create, currentState=FINISHED}
2021-02-05T15:09:57.236Z [INFO] (pool-2-thread-26) com.example.stream.create: shell-runner-start. {scriptName=services.com.example.stream.create.lifecycle.Run.script, serviceName=com.example.stream.create, currentState=STARTING, command=["ln -f -s -t . /greengrass/v2/packages/artifacts/com.example.stream.create/1.0...."]}
2021-02-05T15:09:57.678Z [WARN] (Copier) com.example.stream.create: stderr. Traceback (most recent call last):. {scriptName=services.com.example.stream.create.lifecycle.Run.script, serviceName=com.example.stream.create, currentState=RUNNING}
2021-02-05T15:09:57.683Z [WARN] (Copier) com.example.stream.create: stderr. File "create-stream.py", line 27, in <module>. {scriptName=services.com.example.stream.create.lifecycle.Run.script, serviceName=com.example.stream.create, currentState=RUNNING}
2021-02-05T15:09:57.684Z [WARN] (Copier) com.example.stream.create: stderr. s3=None. {scriptName=services.com.example.stream.create.lifecycle.Run.script, serviceName=com.example.stream.create, currentState=RUNNING}
2021-02-05T15:09:57.684Z [WARN] (Copier) com.example.stream.create: stderr. TypeError: init() got an unexpected keyword argument 's3'. {scriptName=services.com.example.stream.create.lifecycle.Run.script, serviceName=com.example.stream.create, currentState=RUNNING}
2021-02-05T15:09:57.705Z [INFO] (Copier) com.example.stream.create: Run script exited. {exitCode=1, serviceName=com.example.stream.create, currentState=RUNNING}
20

DarrenB
asked 3 years ago274 views
3 Answers
0
Accepted Answer

Hi,
As the error says, there is no keyword argument called "s3". See the documentation for the arguments which you can use: https://aws.github.io/aws-greengrass-core-sdk-python/_apidoc/greengrasssdk.stream_manager.data.html#greengrasssdk.stream_manager.data.ExportDefinition

Cheers,
Michael Dombrowski

AWS
EXPERT
answered 3 years ago
profile picture
EXPERT
reviewed 23 days ago
0

Thanks. I had copied and pasted from the docs here: https://docs.aws.amazon.com/greengrass/v2/developerguide/work-with-streams.html
It looks like a type then.

DarrenB
answered 3 years ago
0

Thank you very much for pointing that out, I'll make sure our documentation gets updated shortly.

Cheers,
Michael Dombrowski

AWS
EXPERT
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