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
feita há 2 anos344 visualizações
1 Resposta
1
Resposta aceita

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
ESPECIALISTA
respondido há 2 anos
  • Thank you, Indranil - worked perfectly.

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas