Git Product home page Git Product logo

aws-delete-default-vpc's Introduction

AWS VPC Delete

AWS Serverless template to delete default VPCs in newly created AWS accounts as part of the account creation.

This solution works asynchronously. So, you will get an HTTP 200 immediately after you've sent the request. This response is not an indicator that all default VPCs were being deleted. Deleting default VPCs in all available regions takes roughly 60 seconds.

On purpose, this script does not delete instances, VPC peerings, VPC endpoints, or other resources used by a default VPC not to interrupt projects which are actively using a default VPC. If this solution is executed right after the account creation, it is enough to delete the default VPC.

Base architecture

AWS VPC Delete base architecture

Used AWS Services

  • AWS Lambda
  • AWS API Gateway
  • AWS Cloudwatch

Implementation guide

Please follow all the steps below to deploy the solution.

Requirements

  • Serverless (tested with version 2.19.0)

Deployment Requirements

  1. Deploy the CloudFormation template "vpc_delete_orga_iam_role.yaml" in the AWS Organization main account
  2. Deploy the CloudFormation template "vpc_delete_project_iam_role.yaml" in the newly created AWS project account

Deployment

  1. Clone this repository
  2. Edit the parameters in the serverless.yml
  • organization_account_id: The AWS account it of the AWS Organization main account
  1. run sls deploy to deploy the solution

โ— The serverless output while action 3 will mention:

WARNING: Function function has timeout of 180 seconds, however, it's attached to API Gateway so it's automatically limited to 30 seconds.

The function is called asynchronously; therefore, you can ignore this message.

The endpoint URL and the key can be found in the output of the serverless deployment. The account id for the account where the default VPC needs to be deleted must be provided via URL parameter account_id.

Undeploy

  1. run sls remove to remove the solution

aws-delete-default-vpc's People

Contributors

n-schilling avatar

Watchers

 avatar

Forkers

bencloudify

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.