Code Monkey home page Code Monkey logo

apigateway-asg-update's Introduction

apigateway-asg-update

API to update AutoScaling group (values for min, max, and desired count as values for the mentioned autoscaling group.)

Step1:- First we are creating an s3 bucket and an object (Lambda function code ) in it. For that, we have an s3 directory for Terraform code first we will deploy that.

.. /S3 $terraform apply

Step 3:- Now we are creating policies and roles for the communication between AWS resources also creating Lambda function and API Gateway. Terraform script for the same is inside Terraform directory.

../Terraform $terraform apply

Step 4:- This will give an invoke_url (Post API URL)

complete_invoke_url = "https://5tbkkuk676.execute-api.us-east-1.amazonaws.com/dev/resource"

Step 5:- In this, we will pass our parameters (ASG-Name,CesiredCapacity,MinimumCapacity,MaximumCapacity)

https://5tbkkuk676.execute-api.us-east-1.amazonaws.com/dev/resource?

Curl Request

curl --location --request POST 'https://izoaehgcz1.execute-api.us-east-1.amazonaws.com/dev/resource?ASG-Name=testScaling&DesiredCapacity=0&MinimumCapacity=0&MaximumCapacity=0'

Output Sample

{
    "ASG-Name": "testScaling",
    "CesiredCapacity": 0,
    "MinimumCapacity": 0,
    "MaximumCapacity": 0,
    "Status": "The auto scaling group --> testScalingis successfully updated "
}

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.