Giter Site home page Giter Site logo

mock-direct-connect's Introduction

Direct Connect Mock

At the current moment is not possible to test features of Direct Connect without access to one. This is a mock of the Direct Connect API service. It is useful to test API (or Boto3, Terraform or Ansible) that uses the Direct Connect API or any other code that uses the Direct Connect API. The following API calls are implemented:

  • CreateBGPPeer
  • CreateConnection
  • CreateDXGateway
  • CreateDirectConnectGatewayAssociation
  • CreatePrivateVirtualInterface
  • CreatePublicVirtualInterface
  • CreateTransitVirtualInterface
  • DeleteBGPPeer
  • DeleteConnections
  • DeleteDXGateway
  • DeleteDirectConnectGatewayAssociation
  • DeleteVirtualInterface
  • DescribeConnections
  • DescribeDXGateways
  • DescribeDirectConnectGatewayAssociations
  • DescribeVirtualInterfaces
  • DescribeTags
  • TagResource
  • UpdateConnection
  • UpdateDXGateway

How to install

Download the binary from the release page and put it in your path.

How to use it

  1. For testing purposes download the repo and move to the mock-direct-connect directory.
  2. For testing with Terraform:
# Start the mock
./mock-direct-connect
# Run Terraform in another terminal
# Move to the terraform directory
cd examples/terraform-aws-direct-connect
# Run Terraform
terraform init
terraform apply
  1. For testing with Python:
# Start the mock
./mock-direct-connect
# Run Python in another terminal
# Move to the python directory
cd examples/python
python3 main.py

Relevant links

This is the link to the AWS Direct Connect API Reference.

This is the link to the AWS Direct Connect Go SDKv2.

This like is very useful AWS Direct API.

  • The header X-Amz-Target is used to determine action to perform. The header has value like this: OvertureService.CreateConnection this correspond CreateConnection action. In other words this is a substitute the the Action in the query string.
  • The header Content-Type is used to determine the format of the request body. The header has value like this: application/x-amz-json-1.1.

BGP Peer

The localhost (host where the mock is running) will run BGP with ASN 65001, the IP address would be the primary IP address of the main interface, the mock will auto-discovery this IP. You should see the log similar to this:

INFO: 2023/06/25 11:22:11 logger.go:51: create BGP service is true
INFO: 2023/06/25 11:22:11 logger.go:51: creating BGP service
INFO: 2023/06/25 11:22:11 logger.go:51: primary IP address is 192.168.1.100

mock-direct-connect's People

Contributors

rogerscuall avatar

Watchers

 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.