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
asked 2 years ago456 views
1 Answer
1
Accepted Answer

Hey Vitaly,

Can you please try this?

{
  "InstanceId.$": "$.Instance",
  "UserData": {"Value": "Peppa Pig"}
}
AWS
answered 2 years ago
  • 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!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions