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!

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则