Skip to content

Instantly share code, notes, and snippets.

"Outputs": {
"ApiEndpoint": {
"Description": "Link to API endpoint for sending image requests to.",
"Value": {
"Fn::Sub": "https://${ImageHandlerDistribution.DomainName}"
}
},
"DemoUrl": {
"Description": "Link to the demo user interface for the solution.",
"Value": {
resource "aws_cloudformation_stack" "my_test_stack" {
name = "MYTESTSTACK"
capabilities = ["CAPABILITY_NAMED_IAM"]
template_body = <<STACK
// ADD CLOUD FORMATION TEMPLATE HERE, USING HEREDOC SYNTAX
STACK
}
Description: >-
(SO0023) - Serverless Image Handler with aws-solutions-constructs: This
template deploys and configures a serverless architecture that is optimized
for dynamic image manipulation and delivery at low latency and cost. Leverages
SharpJS for image processing. Template version v5.0.0
AWSTemplateFormatVersion: 2010-09-09
Metadata:
'AWS::CloudFormation::Interface':
ParameterGroups:
- Label:
aws cloudformation create-stack --stack-name MYTESTSTACK --template-body FILE --capabilities CAPABILITY_NAMED_IAM
// or
aws cloudformation create-stack --stack-name MYTESTSTACK --template-url AWS_S3_URL --capabilities CAPABILITY_NAMED_IAM
@joaogolias
joaogolias / aws_solutions_serverless_image_handler.json
Last active October 16, 2020 04:13
CloudFormation file of AWS Solutions Servlerss Image Hanlder
{
"Description": "(SO0023) - Serverless Image Handler with aws-solutions-constructs: This template deploys and configures a serverless architecture that is optimized for dynamic image manipulation and delivery at low latency and cost. Leverages SharpJS for image processing. Template version v5.0.0",
"AWSTemplateFormatVersion": "2010-09-09",
"Metadata": {
"AWS::CloudFormation::Interface": {
"ParameterGroups": [
{
"Label": {
"default": "CORS Options"
},
@joaogolias
joaogolias / serverless.yml
Last active July 8, 2020 13:39
Um arquivo de serverless com as configurações de uma Lambda, com Typescript, Webpack e deploy no API Gateway
plugins:
- serverless-offline
- serverless-webpack
- serverless-dotenv-plugin
# Nome do projeto
# Será usado para construir o nome da Lambda e do API Gateway
service: testing-deploy
# Existem vários serviços que utilizam o Serverless Framework
@joaogolias
joaogolias / webpack.config.js
Created July 7, 2020 16:13
Exemplo de arquivo de configuração do webpack para typescript
const path = require("path");
const slsw = require("serverless-webpack");
const nodeExternals = require("webpack-node-externals");
module.exports = {
entry: slsw.lib.entries,
module: {
rules: [
{
test: /\.ts$/,
const dateInTimestap = 1541089363
const date = new Date(dateInTimestap*1000)
console.log(date)
console.log(date.toString())
console.log(date.toLocaleTimeString())
{
"compilerOptions": {
"target": "es6",
"declaration": true,
"module": "commonjs",
"sourceMap": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": true,
const name = 'Joao'
const age = 21
const message = `
Hi, my name is ${name}.
I am ${age} years old.
My elder brother is ${age + 5}
`