Skip to content

Instantly share code, notes, and snippets.

View sjmach's full-sized avatar
💭
I may be slow to respond.

Sundeep Joseph Machado sjmach

💭
I may be slow to respond.
View GitHub Profile
#!/bin/bash
set -u
up() {
INSTANCE_TYPE=${INSTANCE_TYPE:-n1-standard-1}
curl -sLS https://get.k3sup.dev | sh
sudo install k3sup /usr/local/bin/
(
set -x
// load the AWS SDK
const AWS = require('aws-sdk')
// load CloudFront key pair from environment variables
// Important: when storing your CloudFront private key as an environment variable string,
// you'll need to replace all line breaks with \n, like this:
// CF_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nMIIE...1Ar\nwLW...2eL\nFOu...k2E\n-----END RSA PRIVATE KEY-----"
const cloudfrontAccessKeyId = process.env.CF_ACCESS_KEY_ID
const cloudFrontPrivateKey = process.env.CF_PRIVATE_KEY
const signer = new AWS.CloudFront.Signer(cloudfrontAccessKeyId, cloudFrontPrivateKey)