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
gefragt vor 2 Jahren344 Aufrufe
1 Antwort
1
Akzeptierte Antwort

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
EXPERTE
beantwortet vor 2 Jahren
  • Thank you, Indranil - worked perfectly.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen