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!

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ