Coder Social home page Coder Social logo

aws-api-sqs's Introduction

API Gateway and AWS SQS integration using terraform

The terraform configuration creates and integrates an AWS API Gateway with a AWS Simple Queue Service.

Resources created:

  1. AWS API Gateway
  2. AWS SQS
  3. AWS IAM Roles : AWS CloudWatch and SQS access
  4. AWS IAM policy

Installing Terraform

If you have Homebrew installed you can install terraform by typing

    $ brew install terraform

Otherwise, please download the latest version of terraform binary here.

Prerequisites

  1. An AWS bucket must exist with the same name as in the main.tf file:

    backend "s3" {
       bucket         = "apigw-sqs-salesforce"
       key            = "non-prod/dev.tfstate"
       region         = "us-east-1"
       dynamodb_table = "s3-state-lock"
       encrypt        = true
    }
    

    The bucket can be called anything, the config must be updated to match the bucket name. The AWS account used to run the script must have permissions to add/update on the s3 bucket.

  2. A DynamoDb table must exist with the same name as the dynamodb_table attribite in the config file

Running the terraform configuration

Once the terraform binary is installed, run the below commands;

  1. To check if the terraform is installed properly.
    $ terraform -version

The terraform code is configured to use the s3 bucket as remote backend for storing and managing the terraform state file. A DynamoDB table takes cares of the state locking mechanism, i.e., it prevents another user from triggering an infra build at the same time.

Note : The AWS CLI should be installed and configured with sufficient user level permissions for enabling the terraform to create aws resources.

Note : A separate AWS account must be used run terraform with production/non-production properties.

  1. Initialize terraform configuration.
$ terraform init
  1. Create a terraform plan.
$ terraform plan -var-file="dev.tfvars"
  1. Deploy the terraform configuration.
$ terraform apply --auto-approve -var-file="dev.tfvars"

aws-api-sqs's People

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.