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!

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南