-
Notifications
You must be signed in to change notification settings - Fork 1
Demo
Important
The blocks on this page require you to approve permissions for the Speedrun Prod Github App. These permissions enable Speedrun to authorize access to AWS roles based on your GitHub username, teams and organizations.
As a side hustle, you landed a rover on the moon to collect moon rocks. The rover emits telemetry logs and metrics to CloudWatch and you want to see why it keeps throwing faults at the 55th minute of every hour and how many rocks you are missing out on.
- Click the
${\textsf{\color{lime}Green}}$ Open AWS Console button to go to the AWS Console all set up. - Click Run query in the console to execute it.
If you'd like, change the region in the Speedrun toolbar at the top of this page to do the same thing in another account and region.
#CWLInsights
filter fault>0
| stats count(*), sum(rocks) by details, bin(1m)
Note
Click the Code tab on any block to see the underlying raw Markdown. Click the icon to copy the underlying Markdown to the clipboard.
Now you want to see the timestamps when you collected more than a certain number of rocks. Notice how it dynamically builds the query based on your input.
- Click Open AWS Console then Ok after you've selected your number of rocks.
- Finally click Run query in the console to execute it.
#CWLInsights
filter fault<1 and rocks > ~~~Rocks Collected {type:'select',options:['10','20','50']}~~~ |
display @timestamp, rocks |
sort by rocks desc
Nina from accounts payable had an extra moment and wants to see the new sticker designs before the Bobs see them. You oblige with this link to go to the sticker bucket for the region. I'll leave off the exact buttons you need to click, see if you understand the interface enough to do it.
#S3Bucket
But Nina has to transfer a call before you show her, so you improve the tool to go straight to the file.
#S3Object
~~~key=Sticker {type:'select', options: {'No Backspace Crew':'nobackspacecrew.svg','Speedrun':'speedrun.svg'}}~~~
Now you want someone to say "Hello" to you, but you're working from home, so you get a Lambda to greet you instead. Paste what it copies to the clipboard somewhere to see the result after you've run it.
#!lambda {functionName:"HelloWorldService"}
{
"name": "~~~Name {default:'Samuel L. Jackson'}~~~"
}
Ok, you are feeling greeted, but you're hungry. You go to your rec room to use the Lambda powered warm nuts dispenser. Somehow it knows your GitHub login! Paste what it copies to the clipboard somewhere to see the result after you've run it.
#!lambda {functionUrl:"${lambdaFunctionUrl}"}
{
"warmed": ~~~Warm the nuts? {type: 'checkbox', default:true}~~~
}
Now it's dinner time. You heard from your coworker George that there is a place called "Hot Soup" down the street that serves delicious soups but the owner Yev can be a bit feisty. They've moved to using an online ordering system powered by Step Functions. You decide to order a soup. Click the Run button below to put in your soup order. See if Yev decides to give you a soup.
#!stepfunction {functionName:'HotSoup', inputTitle:'Order a soup', required:true}
{
"message" : ~~~Soup order {type:'textarea', transform:'JSON.stringify(value)', label:"Enter your soup order. Ask nicely and don't push it."}~~~
}
Your boss wants to know how many occurrences of a word are in the Nickelback song Photograph. Luckily you have a database with the word frequency mirrored across two AWS accounts in separate regions for availability. You throw this together to get him off your (Nickel)back. He 😍's it and you get a raise.
#DDBItem {tableName:'nickleback-lyrics'}
~~~partitionKey=Lyric {transform:'value.toLowerCase().trim()', default:'photograph'}~~~
Note
To run this next command; first install and run srinit to authenticate your command line and install the AWS CLI (if you don't already have it). Feel free to skip to Deep link to a site if you'd rather do these steps later.
And because your Mom's Dec PDP-1 doesn't have a browser, and she already has everything in the JC Penny catalog, you make her a Nickelback lyric command line tool for Christmas:
#copy.withCreds {forceNewCreds:true}
aws dynamodb get-item --table-name nickleback-lyrics \
--key $'{"word":{"S":"~~~partitionKey=Lyric {transform:'bashEscape(value.toLowerCase().trim())', default:'photograph'}~~~"}}' \
--query Item.occurences \
--output text
You want to tell everyone about when you demoed to the CEO of GitHub, but 10% of the time rick-roll them.
#link
https://youtu.be/${Math.random() < (1.0/10)?'dQw4w9WgXcQ':'fu_MC0rujXw'}
But then you're like, why don't I just embed the video instead:
#!YouTube
fu_MC0rujXw
Generation X has this weird fascination with how many milliseconds have elapsed since 1970. You can never remember the command to calculate it, so you make this to keep them fascinated.
#copy
//Epoch time is
${Date.now()}
You want to file a complaint about the documentation quality. Note You must be signed into GitHub for it to populate your username in the signature.
#download {'filename':'complaint.txt', 'words':['difficult','unclear','obtuse','unpolished','hard']}
${dayjs().format('MM-DD-YYYY')}
Dear ~~~Name {default:'Adam'}~~~,
Your docs did me dirty. There were so many steps! They were so ${randWord(words)}!
I've submitted a pull request to improve them and make them easier.
Cheers,
${user}
The Getting Started page goes into more details about the markdown syntax and how it all works.
Below if you look for #srConfig
you'll see how little config is powering all of this. The trust policy on the Demo role is set to allow any GitHub user that is using the Speedrun app.
#srConfig
{
role: 'Demo',
services: {
DecacornService: {
bucket:"speedrun-demo-stickers-${region}",
logGroups:"/aws/lambda/MoonRocksService",
regions: {
"us-west-2" : {
account: '205348963185',
lambdaFunctionUrl: 'a2bocmnz4calxsxunj4ht7uibm0qcbsm'
},
"us-east-2" : {
account: '330023003565',
lambdaFunctionUrl: 'g37mubrn2y3mlbqacsow64wz4m0rfjky'
}
}
}
},
"function:randWord": {
"args" : ["words"],
"body" : "return words[Math.floor(Math.random()*words.length)]"
},
srShowConfig: true
}
Super Secret Squirrel Clearance Required
Sorry, you won't have access to this elevated privilege role, it is for perpil
only. But you can click these red buttons anyway and get denied.
#federateService {role:'Administrator'}
#copy.withCreds {role:'Administrator'}