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
질문됨 2년 전344회 조회
1개 답변
1
수락된 답변

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
전문가
답변함 2년 전
  • Thank you, Indranil - worked perfectly.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠