Git Product home page Git Product logo

serverless-fargate-tasks's Introduction

Serverless Fargate Tasks

This Serverless plugin will setup a Fargate cluster and setup services and tasks. With this plugin it's fairly easy to setup a (long running) task which would hook up to kinesis streams or SQS endpoints.

The (minimal) config is as follows:

custom:
  fargate:
    vpc:
      subnets:
        - subnet-1234
        - subnet-5678

    tasks:
      my-task:
        image: 123456789369.dkr.ecr.eu-west-1.amazonaws.com/my-image

Of course, you can customize to your hearts desire, here are all the available options:

custom:
  fargate:
    # you can put global environment variables here, these will be added
    # to all tasks. Optional of course.
    environment:
      foo: bar

    # you can set the execution role that will be used, this will default to the default
    # role for your account
    role: arn:aws:iam::123456789369:role/ecsTaskExecutionRole

    vpc:
      public-ip: DISABLED  # optional, defaults to disabled
      subnets:
        - subnet-1234
        - subnet-5678
      security-groups:  # optional, defaults to vpc default
        - sg-123456678

    tasks:
      my-task:
        name: ${self:service}-${self:provider.stage}-my-task # default name is be the object key (here 'my-task')
        image: 123456789369.dkr.ecr.eu-west-1.amazonaws.com/my-image
        environment:  # optional
          platypus: true
          # local variables will always override global ones
          foo: wut
          # you can also use cloudformation references with eg serverless-pseudo-parameters
          myArn: #{MyResource.Arn}
        cpu: 512  # optional, defaults to 25% -> 256, see cloudformation docs for valid values
        memory: 1GB  # optional, defaults to 0.5GB

Advanced usage

You can override the generated CF resource properties per task with the override properties:

custom:
  fargate:
    tasks:
      my-task:
        image: 123456789369.dkr.ecr.eu-west-1.amazonaws.com/my-image

        # these are all optional
        override:
          task:
            Foo: BAR
          container:
            Foo: Bar
          service:
            Foo: BAR
          vpc:
            Foo: BAR
          role: ARN

serverless-fargate-tasks's People

Contributors

christophebougere avatar svdgraaf avatar tfoster avatar wizardishungry avatar

Watchers

 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.