Skip to content

Instantly share code, notes, and snippets.

Nxtra / commands.js
Created Oct 24, 2020
Create a Cypress command to signIn with AWS Amplify before executing your tests! Repository:
View commands.js
const Auth = require("aws-amplify").Auth;
import "cypress-localstorage-commands";
const username = Cypress.env("username");
const password = Cypress.env("password");
const userPoolId = Cypress.env("userPoolId");
const clientId = Cypress.env("clientId");
const awsconfig = {
Nxtra / commands.js
Created Nov 6, 2020
Cypress custom Amplify command.
View commands.js
Cypress.Commands.add("signIn", () => {
cy.then(() => Auth.signIn(username, password)).then((cognitoUser) => {
const idToken = cognitoUser.signInUserSession.idToken.jwtToken;
const accessToken = cognitoUser.signInUserSession.accessToken.jwtToken;
const makeKey = (name) => `CognitoIdentityServiceProvider.${cognitoUser.pool.clientId}.${cognitoUser.username}.${name}`;
cy.setLocalStorage(makeKey("accessToken"), accessToken);
cy.setLocalStorage(makeKey("idToken"), idToken);
Nxtra / example.test.js
Created Nov 6, 2020
Call custom signIn command before cypress test suite
View example.test.js
describe("Example test", () => {
before(() => {
after(() => {
Nxtra / template.yaml
Last active Nov 8, 2020
Setup a billing alarm for your AWS account with cloudformation
View template.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: Billing Alerts for your AWS Account
Type: String
Description: The email address to receive alerts per email
Nxtra / schema.graphql
Last active Nov 25, 2020
Amplify schema with relations and custom mutation
View schema.graphql
type Blog @model {
id: ID!
name: String!
posts: [Post] @connection(keyName: "byBlog", fields: ["id"])
type Post @model @key(name: "byBlog", fields: ["blogID"]) {
id: ID!
title: String!
blogID: ID!
Nxtra / template.json
Last active Nov 26, 2020
Amplify lambda access dynamodb api resources policy
View template.json
"AccessDynamoDBApiResourcesPolicy": {
"DependsOn": ["LambdaExecutionRole"],
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyName": "amplify-lambda-execution-policy",
"Roles": [
"Ref": "LambdaExecutionRole"
Nxtra / index.js
Last active Dec 6, 2020
A lambda function to resolve the editPostAndComments mutation.
View index.js
const AWS = require("aws-sdk");
const docClient = new AWS.DynamoDB.DocumentClient();
const POSTTABLE = process.env.POSTTABLE;
const resolvers = {
Mutation: {
deletePostAndComments: (event) => {
Nxtra / openapi-generator-maven-plugin-configuration.xml
Last active Jan 16, 2021
An example of how to configure the openapi-generator plugin for your maven projects
View openapi-generator-maven-plugin-configuration.xml
Nxtra /
Created Jan 28, 2021
athena blog

Serverless data pipelines: ETL workflow with Step Functions and Athena

This blog is Part 3 of a multi-part series around analysing Flanders’ traffic whilst leveraging the power of cloud components!
For part 1 see:
For part 2 see:

What is our goal?

This blog aims to explore the use of the AWS Glue service in conjunction with the AWS Athena service to repartition raw streaming data events.
We previously landed these events on an Amazon S3 bucket partitioned according to the processing time on Kinesis.