View vue.config.js
module.exports = { | |
devServer: { | |
disableHostCheck: true, | |
public: 'https://[your cloud9 host id].vfs.cloud9.[region].amazonaws.com' | |
} | |
} |
View node8hello.js
const http = require('http'); | |
const hostname = '0.0.0.0'; | |
const port = process.env.PORT || 3000; | |
const server = http.createServer((req, res) => { | |
res.statusCode = 200; | |
res.setHeader('Content-Type', 'text/plain'); | |
res.end('Hello World\n'); | |
}); |
View infrastructure.yaml
AWSTemplateFormatVersion: "2010-09-09" | |
Description: AWS S3 Hosting bucket and CloudFront Distrobution | |
Resources: | |
## Origin Access ID for CloudFront | |
HostAccessIdentity: | |
Type: "AWS::CloudFront::CloudFrontOriginAccessIdentity" | |
Properties: | |
CloudFrontOriginAccessIdentityConfig: | |
Comment: MyHostBucketId |
View handler.js
const AWS = require('aws-sdk'); | |
const rds = new AWS.RDS(); | |
const sns = new AWS.SNS(); | |
const prefix = `snapper-${process.env.TIME_TO_LIVE}-${process.env.TIME_TO_LIVE_METRIC}-${process.env.CLUSTER_ID}` | |
const createClusterSnapshot = () => { | |
let params = { | |
DBClusterIdentifier: process.env.CLUSTER_ID, | |
DBClusterSnapshotIdentifier: `${prefix}-${Date.now()}`, | |
Tags: [{ Key: 'type', Value: 'snapper' }] |
View cognito.yaml
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Cognito Stack | |
Parameters: | |
AuthName: | |
Type: String | |
Description: Unique Auth Name for Cognito Resources | |
Resources: | |
# Creates a role that allows Cognito to send SNS messages | |
SNSRole: |
View Usage
<input type="checkbox" checked.bind="color | checkedValue:'Green':'Blue'" /> |
View Base File
AWSTemplateFormatVersion: '2010-09-09' | |
Description: 'Deployment Stack' | |
Parameters: | |
GitHubToken: | |
NoEcho: true | |
Type: String | |
Description: Secret. It might look something like 9b189a1654643522561f7b3ebd44a1531a4287af OAuthToken with access to Repo. Go to https://github.com/settings/tokens" | |
GitHubOwner: | |
Type: String | |
Description: GitHub UserName |
View aureila-dynamic-validation-rules.js
//This is a rough attempt at dynamically building validation rules based on a JSON document. | |
let rules = []; | |
Forms[this.viewing].map(field => { | |
if(field.required && !field.viewIf){ | |
rules.push(ValidationRules.ensure(field.propName).required().rules[0]) | |
} | |
if (field.required && field.viewIf) { | |
rules.push(ValidationRules.ensure(field.propName).required() |
View Activate
activate(){ | |
return this.auth.getSession(); | |
} |
View Auth Class
import {inject} from 'aurelia-framework'; | |
import {Session} from './session'; | |
@inject(Session) | |
export class Auth { | |
// App specific | |
userPoolId = 'us-east-1_fgCWraBkF'; | |
appClientId = '57lq262n28o7ddt8i36jcjj7qd'; |