How to pass blobAttributeValue to Step Function

0

I have a state machine which needs to set EC2 instance's UserData. For that I'm using EC2 ModifyInstanceAttribute box and can't figure out how to set UserData (which has to be of type blobAttributeValue according to AWS docs). Example:

{
  "InstanceId.$": "$.Instance",
  "UserData": "Peppa Pig"
}

Doesn't matter if I set it to "Peppa Pig" or its base64 representation, it fails with Cannot construct instance of software.amazon.awssdk.services.ec2.model.BlobAttributeValue$BuilderImpl (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('Peppa Pig') when I try to save the state machine

Vitaly
질문됨 2년 전463회 조회
1개 답변
1
수락된 답변

Hey Vitaly,

Can you please try this?

{
  "InstanceId.$": "$.Instance",
  "UserData": {"Value": "Peppa Pig"}
}
AWS
답변함 2년 전
  • Thank you! This is weird. I did try that before in Workflow Studio and it gave me an error ("Parameters: Invalid JSON"). Then I force-saved it, and it added some odd entry "Input Form \UserData..." to the state machine's JSON which made it unusable. Then I just fixed it in the JSON editor, and now I cannot reproduce it anymore - even Workflow Studio doesn't throw that error no matter what. Did you just fix something on your side? Well, the problem is solved, very much appreciated!

  • As far as I know, nothing has been changed on the AWS side nor have the documents been updated to reflect any changes (https://docs.aws.amazon.com/step-functions/latest/dg/document-history.html). If that solved your problem, can you please mark the answer as accepted so other folks can benefit from the fix? Thanks!

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

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

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

관련 콘텐츠