Set UserData for RunInstances step function

0

I'm trying to migrate from ModifyInstanceAttribute+StartInstances to RunInstances and I'm stumped for a reason why they use different formats for UserData. Figuring out creating blobAttributeValue was hard enough, but it worked as it does base64 encoding for you. The question is how do I base64-encode UserData for RunInstances in my state machine? What's more, even if I put base64-encoded data in UserData (callback task token), it never shows up in the instance's user data - in Web UI it is shown as "No user data found". Apparently just because the task token decodes into a random binary stream, and it causes problems down the line - I guess AWS tries to parse it to figure out if it's some script to execute and bails out completely.

My main goal is to pass the task token to the EC2 instance I create (along with some other params which I can put in tags separately - it works). But the task token won't fit into a tag, so UserData seems to be the only option. I am at a loss - is it even technically possible to use RunInstances with a callback?

  • Tbh I find the callback mechanism severely restricted at this point - there's no way to use it for anything else other than Lambda where you can put the task token into the event context. There should be a general way to send the task token to SNS/SQS/EventBridge

Vitaly
질문됨 2년 전77회 조회
답변 없음

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

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

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

관련 콘텐츠