GithubHelp home page GithubHelp logo

isabella232 / temporal-aws-sdk-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from temporalio/temporal-aws-sdk-go

0.0 0.0 0.0 9.47 MB

Temporal activities and workflow stubs that wrap AWS Go SDK

License: MIT License

Go 99.98% Makefile 0.02%

temporal-aws-sdk-go's Introduction

Temporal AWS SDK

โš ๏ธ This code is an experiment: Absolutely no guarantee of backwards compatibility

This repository is a prototype of generated Temporal activities and workflow stubs for all AWS APIs exposed by AWS Go SDK.

Generated activities and stubs are in Go at this point. Java SDK has to call them by string name until Java activity interface generation is added.

This repository relies on the temporal-aws-sdk-generator.

Generated Code

activities package contains generated code for activities that call AWS APIs through AWS Go SDK.

clients package contains generated code that workflows can use to call these activities in a strongly typed manner.

Regenerating Code

Update a template in templates directory and run:

make bins

to regenerate and compile the generated code.

Templates

Templates that are used for code generation are located in templates directory. They use Go text/template package. Each template is invoked with AWSSDKDefinition structure as a parameter. A template file must call SetFileName function at the beginning to specify the output file name. It is allowed to call SetFileName multiple times to generate multiple files from the same template.

Running Temporal AWS SDK Activities

To run Temporal AWS SDK activities:

Create ~/.aws/credentials file with aws access key id and secret or set corresponding environment variables. The basic credentials file format:

[default]
aws_access_key_id = <ID>
aws_secret_access_key = <SECRET>

See AWS Go SDK documentation for details. Set AWS_REGION environment variable. Another option is to set AWS_SDK_LOAD_CONFIG variable to true and set Region config value.

AWS_REGION=us-west-2 bin/aws-sdk-worker

Samples

S3 List Bucket

samples/s3list directory contains very simple example of a workflow that lists S3 buckets under an account. The sample assumes that AWS SDK activities are already running.

bin/samples/s3list

EC2 Instance

samples/ec2demo directory contains an example of a workflow that launches an EC2 instance and keeps restarting it when terminated. The sample assumes that AWS SDK activities are already running.

To start workflow worker:

bin/samples/ec2demo-worker

To initiate workflow

bin/samples/ec2demo-starter

temporal-aws-sdk-go's People

Contributors

mfateev avatar sagikazarmark 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.