This is an example README for Gopher Holes Unlimited - a fake business but real API that tracks two things:
- Gophers
- Holes
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Instant Messaging | Momento</title> | |
<style> | |
body { | |
font-family: Inter, sans-serif; |
// This script will scan all files in a given directory for locally referenced images. It will take the images, rename them with a standard convention, then upload them to s3 with a 'public-read' ACL. The script will then update the reference to the local image with the link to the version in the cloud. | |
// If there are any issues during operation, the script will output either a 'skipped-posts.json' file that lists the posts that were not processed or a 'failed-image-uploads.json' file that lists images that failed to upload into S3. | |
// Arguments for operation | |
// | |
// [0] blogPostDirectory - relative path from the root where all blog posts live | |
// [1] imageDirectory - relative path from the root where all images live | |
// [2] bucketName - name of the S3 bucket to upload the local images to | |
// [3] awsProfileName - name of the aws profile on your machine that has access to the S3 bucket |
const { marshall } = require('@aws-sdk/util-dynamodb'); | |
const { DynamoDBClient, UpdateItemCommand } = require('@aws-sdk/client-dynamodb'); | |
const ddb = new DynamoDBClient(); | |
exports.handler = async (event) => { | |
try { | |
// Example input | |
// [ | |
// { "op": "add", "path": "/comment", "value": "This is a nasty gopher" }, |
openapi: 3.0.0 | |
info: | |
title: AWS Service Integration API | |
version: 1.0.0 | |
paths: | |
/translations: | |
post: | |
requestBody: | |
required: true |
[ | |
"Amazon MQ", | |
"AppStream 2.0", | |
"AppSync", | |
"AppSync Data Plane", | |
"Athena", | |
"Auto Scaling", | |
"AWS Certificate Manager (ACM)", | |
"Batch", | |
"Cloud Directory", |
const fs = require('fs'); | |
const YAML = require('json-to-pretty-yaml'); | |
const definition = JSON.parse(fs.readFileSync('definition.asl.json')); | |
const substitutions = []; | |
parameterizeStates(definition.States, substitutions); | |
console.log(substitutions) |
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Globals: | |
Function: | |
Runtime: nodejs14.x | |
Architectures: | |
- arm64 | |
Tracing: Active | |
Timeout: 3 | |
Handler: index.handler |
Parameters: | |
VpcCidrBlock: | |
Type: String | |
Default: "12.0.0.0/16" | |
PublicSubnetCidrBlock: | |
Type: String | |
Default: "12.0.0.0/24" | |
PrivateSubnetCidrBlock: | |
Type: String | |
Default: "12.0.1.0/24" |
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: [AWS::Serverless-2016-10-31, AddSSMParametersMacro] | |
Description: SAM template for consuming a CloudFormation Macro | |
Resources: | |
ExampleWithEnvVarFunction: | |
Type: AWS::Serverless::Function | |
Properties: | |
CodeUri: example-with-env-var | |
Handler: function.handler |