Giter Club home page Giter Club logo

terraform-aws-faasd's Introduction

faasd for Amazon Web Services

This repo contains a Terraform Module for how to deploy a faasd instance on the AWS using Terraform.

faasd, a lightweight & portable faas engine, is OpenFaaS reimagined, but without the cost and complexity of Kubernetes. It runs on a single host with very modest requirements, making it fast and easy to manage. Under the hood it uses containerd and Container Networking Interface (CNI) along with the same core OpenFaaS components from the main project.

What's a Terraform Module?

A Terraform Module refers to a self-contained packages of Terraform configurations that are managed as a group. This repo is a Terraform Module and contains many "submodules" which can be composed together to create useful infrastructure patterns.

How do you use this module?

This repository defines a Terraform module, which you can use in your code by adding a module configuration and setting its source parameter to URL of this repository:

module "faasd" {
  source = "github.com/jsiebens/terraform-aws-faasd"

  name      = "faasd"
  vpc_id    = var.vpc_id
  subnet_id = var.subnet_id
  key_name  = var.key_name
}

Requirements

Name Version
terraform >= 1.0.0
aws >= 3.30.0
random >= 3.1.0

Providers

Name Version
aws >= 3.30.0
random >= 3.1.0

Resources

Name Type
aws_eip.faasd resource
aws_eip_association.faasd resource
aws_iam_instance_profile.faasd resource
aws_iam_policy_attachment.faasd resource
aws_iam_role.faasd resource
aws_instance.faasd resource
aws_security_group.faasd resource
random_password.faasd resource
aws_ami.ubuntu data source

Inputs

Name Description Type Default Required
basic_auth_password The basic auth password, if left empty, a random password is generated. string null no
basic_auth_user The basic auth user name. string "admin" no
domain A public domain for the faasd instance. This will the use of Caddy and a Let's Encrypt certificate string "" no
email Email used to order a certificate from Let's Encrypt string "" no
instance_type The instance type to use for the instance. string "t2.micro" no
key_name Key name of the Key Pair to use for the instance. string null no
name The name of the faasd instance. string n/a yes
subnet_id VPC Subnet ID to launch in. string n/a yes
tags A map of tags to assign to the resource. map(string) {} no
vpc_id VPC ID. string n/a yes

Outputs

Name Description
basic_auth_password The basic auth password.
basic_auth_user The basic auth user name.
gateway_url The url of the faasd gateway
ipv4_address The public IP address of the faasd instance

See Also

terraform-aws-faasd's People

Contributors

jsiebens avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

terraform-aws-faasd's Issues

Cannot connect to OpenFaaS on URL

First of all thanks for making this terraform configuration. I was able to create a faasd instace on EC2 in 5 mins.

I am new to OpenFaaS and Faasd. The issue I am facing is that using the basic-auth-password and the gateway url output after running terraform, faas-cli is unable to connect with the instance. Am I missing some step here. Any help is much appreciated.

Commands

export OPENFAAS_URL=<gateway url as given after terraform apply>
faas-cli login -u admin --password <basic-auth-password that is set in faasd instance>

error

Calling the OpenFaaS server to validate the credentials...
WARNING! You are not using an encrypted connection to the gateway, consider using HTTPS.
Cannot connect to OpenFaaS on URL: http://$IP:8080. Get "http://$IP:8080/system/functions": dial tcp $IP:8080: connect: connection refused

Additional information

In the EC2 instance, it seems like there is no faasd instance running.

Logs from shell session into the server

$ sudo systemctl status faasd
Unit faasd.service could not be found.

Expected behaviour

faas-cli login succeeds.

Any help is much appreciated.

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.