This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: "2010-09-09" | |
Description: CloudFormation template used for showcasing AWS AppConfig feature flags | |
Parameters: | |
AppName: | |
Type: String | |
Description: "Name of application associated with AppConfig instance." | |
AllowedPattern: ".+" | |
CostCenter: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { buildResponse } = require("./helpers/response-builders"); | |
const { loadFrozenModel } = require("./helpers/model-loader"); | |
const MODEL_PATH = "./weights/hate-speech-classifier.json"; | |
let model = null; | |
module.exports = { | |
async execute(event, context) { | |
try { | |
// if request is CORS-related, quickly respond | |
if (event.httpMethod.toLowerCase() === "options") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async () => { | |
try { | |
let [classifier, data] = await Promise.all([loadFrozenModel(), loadData()]); | |
let results = data.map((i, idx) => { | |
let actual = getLabel(i.class_id); | |
let predicted = classifier.classify(i.tweet); | |
console.clear(); | |
console.log(`Inferring Item ${idx + 1} out of ${data.length}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LifecycleConfiguration: | |
Rules: | |
- Id: SetToStandardIAAfterAYear | |
Status: Enabled | |
Transitions: | |
- TransitionInDays: "365" | |
StorageClass: STANDARD_IA | |
- Id: SetToGlacierAfterThreeYears | |
Status: Enabled | |
Transitions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bad Debts in Singapore | |
# IRAS keeps record of bad debts for a span of years for investigation purposes | |
# Source: https://www.companyregistrationinsingapore.com.sg/long-keep-business-records/ | |
# 2555 Days = 7 Years | |
LifecycleConfiguration: | |
Rules: | |
- Id: DeleteArtifactAfterConstraintDays | |
Status: "Enabled" | |
ExpirationInDays: 2555 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Provide your variable values here | |
AWS_CF_STACK_NAME="testing-ninja-buckets-a"; | |
ENVIRONMENT_NAME="dev"; | |
AWS_CLI_PROFILE="ninja-boy"; | |
aws cloudformation create-stack \ | |
--stack-name "${AWS_CF_STACK_NAME}" \ | |
--template-body file://tables.cfn.yaml \ | |
--profile "${AWS_CLI_PROFILE}" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: "2010-09-09" | |
Description: > | |
CloudFormation template used for provisioning SAM artifact storage for environments | |
that require rapid expiration of build artifacts. | |
Parameters: | |
AppName: | |
Type: String | |
Description: "Name of application." | |
AllowedPattern: ".+" | |
Default: "ninja-buckets" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { getWeapons } = require("./modules/weapons-query"); | |
const { buildResponse } = require(process.env.AWS | |
? "/opt/nodejs/response-builder" | |
: "../base-layer/nodejs/response-builder"); | |
const { sendAlert } = require(process.env.AWS | |
? "/opt/nodejs/slack-alarm" | |
: "../base-layer/nodejs/slack-alarm"); | |
module.exports = { | |
async execute(event, context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require("axios"); | |
const moment = require("moment"); | |
const slackConfig = require("./slack.config.json"); | |
let buildMarkdown = (err) => { | |
let output = ""; | |
output += `Something went wrong on our application! :boom:\n`; | |
output += `*Lambda Function Name:* ${process.env.AWS_LAMBDA_FUNCTION_NAME}\n`; |
NewerOlder