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
{ | |
"version": "2017-02-28", | |
"payload": ${noteTypes} | |
} |
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
/* eslint-disable no-undef */ | |
const { getNoteTypes } = require("./src/note-types/get-note-types"); | |
const { getErrorTypes } = require("./src/error-types/get-error-types"); | |
const { getErrorMessages } = require("./src/error-messages/get-error-messages"); | |
const serverlessConfiguration = { | |
service: "serverless-appsync-i18n", | |
frameworkVersion: "2", | |
plugins: ["serverless-appsync-plugin"], | |
provider: { |
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
#if($ctx.args.noteId == 0) | |
$utils.error($util.str.toReplace("${invalidValueErrorMessage}", "{0}", "$ctx.args.noteId"), "${invalidValueErrorType}") | |
#else | |
{ | |
"version" : "2017-02-28", | |
"operation" : "GetItem", | |
"key" : { | |
"noteId" : { "S" : "${context.arguments.noteId}" }, | |
}, | |
"consistentRead" : true |
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
function getErrorTypes(locale = "uk") { | |
const errorTypes = { | |
uk: { | |
noDataErrorType: "NoData", | |
accessDeniedErrorType: "AccessDenied", | |
invalidValueErrorType: "InvalidValue", | |
}, | |
fr: { | |
noDataErrorType: "PasDeDonnées", | |
accessDeniedErrorType: "AccèsRefusé", |
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
function getErrorMessages(locale = "uk") { | |
const errorMessages = { | |
uk: { | |
noDataErrorMessage: "No data", | |
accessDeniedErrorMessage: "Access denied", | |
invalidValueErrorMessage: "The value {0} is invalid", | |
}, | |
fr: { | |
noDataErrorMessage: "Pas de données", | |
accessDeniedErrorMessage: "Accès refusé", |
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
service: serverless-lambda-destinations | |
provider: | |
name: aws | |
runtime: nodejs12.x | |
lambdaHashingVersion: 20201221 | |
memorySize: 128 | |
stage: ${opt:stage, 'develop'} | |
region: eu-west-1 | |
apiGateway: | |
shouldStartNameWithService: true |
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
/* eslint-disable no-undef */ | |
const axios = require("axios"); | |
const { | |
STAGE: stage, | |
APPLICATION: application, | |
ENVIRONMENT: environment, | |
CONFIGURATION: configuration, | |
} = process.env; |
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
service: serverless-feature-flag | |
provider: | |
name: aws | |
runtime: nodejs12.x | |
lambdaHashingVersion: 20201221 | |
memorySize: 128 | |
stage: ${opt:stage, 'develop'} | |
region: eu-west-1 | |
apiGateway: | |
shouldStartNameWithService: true |
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
import type { AWS } from "@serverless/typescript"; | |
import hello from "@functions/hello"; | |
const serverlessConfiguration: AWS = { | |
service: "test", | |
frameworkVersion: "2", | |
custom: { | |
webpack: { | |
webpackConfig: "./webpack.config.js", |
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
import { config } from "@shared/config"; | |
import { Stages } from "@models/Stages"; | |
import hello from "@functions/hello"; | |
export const configureAlarms = () => { | |
// only add alarm if prod or staging | |
if (config.stage === Stages.prod || config.stage === Stages.staging) { | |
return { | |
HelloFunctionErrorAlarm: { | |
Type: "AWS::CloudWatch::Alarm", |