Git Product home page Git Product logo

terraform-aws-openfaas-fargate's Introduction

Overview

Openfaas for fargate overview

Installing

  1. Install terraform

Mac: brew install terraform

Linux:

wget https://releases.hashicorp.com/terraform/0.11.7/terraform_0.11.7_linux_amd64.zip
unzip terraform_0.11.7_linux_amd64.zip
sudo mv terraform /usr/local/bin
terraform --version
  1. Create terraform.tfvars

You will need to create a new file in the root of this repo called terraform.tfvars which configures variables used to install faas-ecs

Name Description
aws_region The aws region to create the openfaas ecs cluster in
debug 1 to create an ec2 bastion in the external subnet and a test instance in the internal subnet
developer_ip your ip address, used to whitelist incoming ssh to bastion

Example file

cat > ./terraform.tfvars <<EOF
aws_region   = "eu-west-1"
debug        = "0"
developer_ip = "217.46.68.185"
EOF
  1. Create a public key for ssh

Ssh access is only required if debug = "1", however the ssh key is still required for the install to work even if debug disabled. To create the key run:

make keys

  1. Run terraform

make

Known issue

If you get the following error:

Error: Error applying plan:

2 error(s) occurred:

* module.ecs_provider.aws_ecs_service.main: 1 error(s) occurred:

* aws_ecs_service.main: InvalidParameterException: Unable to assume the service linked role. Please verify that the ECS service linked role exists.
	status code: 400, request id: d967b493-82f9-11e8-9d63-f5180ba0fbef "ecs-provider"
* module.nats.aws_ecs_service.main: 1 error(s) occurred:

* aws_ecs_service.main: InvalidParameterException: Unable to assume the service linked role. Please verify that the ECS service linked role exists.
	status code: 400, request id: dab962b7-82f9-11e8-8cc5-29d47e720a04 "nats"

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

Please just re-run make, this is an eventual consistency problem see #4

Uninstalling

  1. Run make uninstall
  2. Patiently wait about 5-10 minutes

Known issue


1 error(s) occurred:

* aws_service_discovery_private_dns_namespace.openfaas (destroy): 1 error(s) occurred:

To resolve this problem manually delete all the service registrations

aws servicediscovery list-services | jq '.Services[].Id' -r | xargs -L 1 aws servicediscovery delete-service --id

terraform-aws-openfaas-fargate's People

Contributors

ewilde avatar

Stargazers

Gerard Dragoi avatar

Watchers

James Cloos avatar Gerard Dragoi 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.