step function PutBucketWebsite dose not allow String-argument ERROR

0

Hi Getting an error in the step function when trying to use the Put Bucket Website function. when placing a string "IndexDocument": "index.html" it does not allow me to save the function changes and states the error: software.amazon.awssdk.services.s3.model.IndexDocument$BuilderImpl (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('index.html')]" I tried to place an argument - it allowed me to save - but the execution failed with a similar error: { "error": "States.Runtime", "cause": "An error occurred while executing the state 'Put Bucket Website' (entered at the event id #42). The Parameters '{"WebsiteConfiguration":{"IndexDocument":"index.html"},"Bucket":"thetest1"}' could not be used to start the Task: [Cannot construct instance of software.amazon.awssdk.services.s3.model.IndexDocument$BuilderImpl (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('index.html')]" }

bd
asked 2 years ago340 views
1 Answer
1
Accepted Answer

Looking at the API Documentation, your configuration seems to be missing a Suffix element - https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html

If you look at the Javascript example - https://docs.aws.amazon.com/code-library/latest/ug/s3_example_s3_PutBucketWebsite_section.html, your JSON should be something like

{ "Bucket": "thetest1", "WebsiteConfiguration": { "ErrorDocument": { "Key": "SomeErrorDocument.html" }, "IndexDocument": { "Suffix": "index.html" } } }

profile pictureAWS
EXPERT
answered 2 years ago
  • Thank you, Indranil - worked perfectly.

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