Git Product home page Git Product logo

yopa's Introduction

_/\/\____/\/\____/\/\/\/\____/\/\/\/\/\________/\/\_____
_/\/\____/\/\__/\/\____/\/\__/\/\____/\/\____/\/\/\/\___
___/\/\/\/\____/\/\____/\/\__/\/\/\/\/\____/\/\____/\/\_
_____/\/\______/\/\____/\/\__/\/\__________/\/\/\/\/\/\_
_____/\/\________/\/\/\/\____/\/\__________/\/\____/\/\_
________________________________________________________

YOPA is Your Own Personal AWS

It allows developers to code without being connected to the net.

Build Status
Clojars Project

Also available as a Docker image.

Features

HTTP/S SNS subscriptions

  • The SNS service does not retry HTTP/S failed deliveries.

  • HTTP/S subscriptions are immediately active, whether or not they have been confirmed, this to ease testing applications without having to constantly re-subscribe them.

  • It's possible to manually instruct YOPA to verify an HTTP/S subscription via a custom SNS command:

    curl -v -dAction=VerifySubscription -dSubscriptionArn=<ARN> http://localhost:47196
    

    assuming YOPA SNS is reachable at http://localhost:47196 (replace with whatever hostname and port is relevant for you).

Build and run

Bring the rubygems in with:

mvn -f fake-s3-pom.xml clean initialize

Run the integration tests:

lein test

Run with the example config:

lein trampoline run --config yopa-config-example.yml

Docker container release process

Run the following:

lein clean
mvn -f fake-s3-pom.xml clean initialize
lein uberimage -t unbounce/yopa:latest
sudo docker push unbounce/yopa:latest

Usage

Run lein run to get help.

The following examples assume all the default configuration parameters are used.

AWS CLI

aws --endpoint-url http://localhost:47196 sns list-topics

Ruby

AWS.config(:access_key_id => 'x',
           :secret_access_key => 'x',
           :region => 'yopa-local',
           :use_ssl => false,
           :sqs_endpoint => 'localhost',
           :sqs_port => 47195,
           :sns_endpoint => 'localhost',
           :sns_port => 47196)

JVM

You can either set the endpoints explicitly, like with:

AmazonSNS snsClient = new AmazonSNSClient(awsCredentials);
snsClient.setEndpoint("http://localhost:47196");

Or you can configure the SDK to load the regions override configuration generated by Yopa and get the yopa-local region:

System.setProperty(SDKGlobalConfiguration.REGIONS_FILE_OVERRIDE_SYSTEM_PROPERTY, "/tmp/aws-regions-override.xml");
Region region = RegionUtils.getRegion("yopa-local");

and then either set the region on the client, while forcing the client to use HTTP:

AmazonSNS snsClient = new AmazonSNSClient(awsCredentials, new ClientConfiguration().withProtocol(Protocol.HTTP));
snsClient.setRegion(region);

or derive the endpoint from the region:

AmazonSNS snsClient = new AmazonSNSClient(awsCredentials);
snsClient.setEndpoint("http://" + region.getServiceEndpoint("sns"));

To use the EC2 Metadata service, set the SDK overriding property to point to Yopa's SNS port, using the /ec2-metadata path:

System.setProperty(SDKGlobalConfiguration.EC2_METADATA_SERVICE_OVERRIDE_SYSTEM_PROPERTY, "http://0.0.0.0:47196/ec2-metadata");

Accessing S3

Using Yopa's S3 service requires setting the S3 client to use the forced path style. Check out this detailed clients guide to see how to do it for your platform.

Note that Yopa can be configured to create buckets with non-DNS compliant names, which is enough for automatically triggering the use of the forced path style in the Java AWS SDK. In that case it is enough to use setEndpoint() to configure the S3 client.

yopa's People

Contributors

ddossot avatar jpb avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.