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
class Function extends LambdaHandler[S3Event, Unit] with NoopLambdaConfiguration |
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 com.amazonaws.serverless.proxy.model.{AwsProxyRequest, AwsProxyResponse} | |
import com.amazonaws.services.lambda.runtime.Context | |
import io.onema.userverless.configuration.lambda.NoopLambdaConfiguration | |
import io.onema.userverless.function.ApiGatewayHandler | |
import io.onema.userverless.function.ApiGatewayHandler.Cors | |
import org.apache.http.HttpStatus | |
class ApiGatewayFunction | |
extends ApiGatewayHandler |
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 com.amazonaws.services.lambda.runtime.Context | |
import io.onema.userverless.configuration.lambda.NoopLambdaConfiguration | |
import io.onema.userverless.function.SnsHandler | |
case class Foo(bar: String) | |
class Function extends SnsHandler[Foo] with NoopLambdaConfiguration { | |
//--- Methods --- | |
def execute(event: Foo, context: Context): Unit = { |
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 com.amazonaws.services.lambda.runtime.Context | |
import com.amazonaws.services.lambda.runtime.events.S3Event | |
import com.amazonaws.services.s3.{AmazonS3, AmazonS3ClientBuilder} | |
import com.amazonaws.services.s3.event.S3EventNotification.S3EventNotificationRecord | |
import io.onema.userverless.configuration.lambda.EnvLambdaConfiguration | |
import io.onema.userverless.function.LambdaHandler | |
import scala.collection.JavaConverters._ | |
class CopyFunction extends LambdaHandler[S3Event, Unit] with EnvLambdaConfiguration { |
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
# Code pipeline for scala applications | |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: > | |
Template to create codebuild service for components and libraries | |
# | |
#-------------------------------------------------------------------------- | |
# PARAMETERS | |
#-------------------------------------------------------------------------- |
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
/** | |
* See https://github.com/LambdaSharp/March2018-DynamoDB | |
*/ | |
package onema | |
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBAsyncClientBuilder | |
import com.amazonaws.services.lambda.runtime.Context | |
import collection.JavaConverters._ | |
import com.amazonaws.services.lambda.runtime.events.S3Event |
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 java.io.{BufferedWriter, FileWriter} | |
import com.github.tototoshi.csv.CSVWriter | |
// ... | |
def writeCaseClasses(seqOfCaseClasses: Seq[AnyRef], filename: String): Unit = { | |
import Implicits._ | |
val mapOfKeyValues = seqOfCaseClasses.map(x => x.toMap) | |
val values = mapOfKeyValues.map(_.values.toSeq) |
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: > | |
Tempalte to create a managed policy to lock down users to create instance of a specific type | |
Parameters: | |
InstanceTypes: | |
Description: > | |
Comma separated list of instance types that will be allowed by the policy | |
e.g. "t1.*, t2.*, m3.*" |
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
sudo /bin/bash -c "echo 'Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports' >> /etc/sudoers" | |
sudo /bin/bash -c "echo 'Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart' >> /etc/sudoers" | |
sudo /bin/bash -c "echo 'Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /usr/bin/sed -E -e /*/ d -ibak /etc/exports' >> /etc/sudoers" | |
sudo /bin/bash -c "echo '%admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_EXPORTS_REMOVE' >> /etc/sudoers" |
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 signal | |
class GracefulInterruptHandler(object): | |
def __init__(self, sig=signal.SIGINT): | |
self.sig = sig | |
def __enter__(self): | |
self.interrupted = False |
NewerOlder