- Drop both these files in the same folder.
- Deploy using AWS SAM
sam deploy --guided
{ | |
"apiId": "xxxxxxxxxxxxxxxxxxxxxxxxxx", | |
"name": "sync_step_function", | |
"description": "step function test", | |
"type": "HTTP", | |
"serviceRoleArn": "arn:aws:iam::xxxxxxx:role/appsync-step-function", | |
"httpConfig": { | |
"endpoint": "https://sync-states.us-east-2.amazonaws.com", | |
"authorizationConfig": { | |
"authorizationType": "AWS_IAM", |
import {inject} from 'aurelia-framework'; | |
import {Session} from './session'; | |
@inject(Session) | |
export class Auth { | |
// App specific | |
userPoolId = 'us-east-1_fgCWraBkF'; | |
appClientId = '57lq262n28o7ddt8i36jcjj7qd'; |
import boto3 | |
import json | |
import requests | |
from requests_aws4auth import AWS4Auth | |
def lambda_handler(event, context): | |
signature = get_signature() | |
return fetch(signature) | |
def get_signature(): |
openapi: "3.0.1" | |
info: | |
title: "vtl-example" | |
version: "1.0" | |
servers: | |
- url: "https://r5aji4fod4.execute-api.us-west-2.amazonaws.com/{basePath}" | |
variables: | |
basePath: | |
default: "/Prod" | |
paths: |
#! /usr/bin/env python | |
# Use at your own risk and reward. | |
# requires boto3 to be installed | |
# example `./get-vars.py MyStack > vars.json` | |
import sys, json | |
import boto3 | |
if len(sys.argv) == 1: |
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: |
curl -L https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip -o aws-sam-cli-linux-x86_64.zip | |
unzip aws-sam-cli-linux-x86_64.zip -d sam-installation | |
sudo ./sam-installation/install | |
where sam | |
sam --version |
## Manage your Lambda layer in SAM | |
## This creates a layer and the permissions for the layer. This particular permission opens it to the world. | |
## I then use 'sam package' and 'sam deploy' to create/update the layer | |
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: Lambda Layer | |
Resources: | |
MyLayer: |