Skip to content

Instantly share code, notes, and snippets.

@faermanj
Last active February 25, 2021 19:34
Show Gist options
  • Save faermanj/bf35079ad64cbbb5bfa85f1878ad023c to your computer and use it in GitHub Desktop.
Save faermanj/bf35079ad64cbbb5bfa85f1878ad023c to your computer and use it in GitHub Desktop.
Julio on Twitch.TV/AWS

This is the first gist with notes my broadcasts on [Twitch.TV/AWS](twitch.tv/aws].

This broadcast is all about being:

  • Interactive and driven by you: use Twitch Chat or @jmfaerman on twitter to send your questions and comments.
  • Beginners friendly, but not basic: we'll dive deep, but all questions will be answered.
  • English, Javascript and Open Source first: Being accessible to most developers, in the abscence of further requirements.
  • Data applications development and integration: collection, analysis, learning, visualization and all around data on AWS.

Next episode:

Application Delivery

Join us for application delivery and heat up our app with serverless data collection!

See you next Thursday, March 23 4pm GMT (5pm Madrid, 4pm London, 11am NYC, 8am SFO)

In the first broadcast we:

Created an open-source project:

https://github.com/jfaerman/breakless

Presented the AWS Console, AWS CLI and AWS Javascript SDKs

Stored static content on Amazon S3

Website deployed to s3://prod.breakless.bike

Regional delivery with S3 static website hosting

Website served directly from S3 bucket for a while, but moved to CloudFront. We showed the two ways to make objects publicly accessible:

  • Setting the Object ACL ('make public' on console or '--acl public-read' on CLI)
  • Setting the Bucket Policy, here is ours:
{
  "Version":"2012-10-17",
  "Statement":[
    {
      "Sid":"AddPerm",
      "Effect":"Allow",
      "Principal": "*",
      "Action":["s3:GetObject"],
      "Resource":["arn:aws:s3:::prod.breakless.bike/*"]
    }
  ]
}

Global delivery with Amazon CloudFront

Using CloudFront delivery is more:

  • Performant (CDN edge closer to users)
  • Cost efficient (Cached responses will not hit ELBs, instances & functions)
  • Secure (Attacks must pass AWS Shield and possibly WAF before reaching your application)

Up and running at: http://d11f2lti3pafhi.cloudfront.net/

Caching and content expiration

See: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html

Static website engines (Jekyll, React, GWT and more)

Deployed a Jekyll and a React sample application from quickstart, but same would be for any Single Page Application framework or static blog generator. Just sync to S3:

$ aws s3 sync \
  build/ \
  s3://prod.breakless.bike \
  --delete \
  --cache-control "max-age=15"
  --region=us-east-1

Thanks for joining!

@youngfeldt
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment