Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This guide explains how to set up an API Manager cluster in an Amazon Web Services (AWS) instance.

...

Figure: Sample deployment architecture of the API Manager components

<image>

Figure: AWS VPC architecture with product deployment diagram

...

To create a VPC Internet gateway, go to your AWS instance and click Services -> VPC -> Internet  Internet Gateways. Then, click Create Internet Gateway  and give a name for your new gateway. Here's an example:

Creating subnets

A subnet  is  a range of IP addresses in your VPC. You can launch AWS resources into a subnet that you select. Use a public subnet for resources that must be connected to the Internet, and a private subnet for the ones that don't. 

According to the deployment pattern shared earlier, you need the following seven subnets across the three availability zones. You can use a subnet naming convention of your choice.

...

Creating route tables

A route table contains a set of rules, called routes , that are used to determine where network traffic is directed.

In this guide, we create two route tables- one to configure the Internet gateway to face the public network (i.e., the Internet), and another for the internal routes.

Creating the public route table

Follow the steps below to create the public route table:

  1. Go to your AWS instance and click  Services -> VPC -> Route Tables. Then, click Create Route Tables and give the details of the public route table. Here's an example:
  2. Select the public route table you just created, click the Routes tab, and add a route for the previously created Internet gateway as follows:  
  3. Go to the Subnet Associations  tab and configure the subnet associations to the route table. In this example, we associate the DMZ and DB subnets to the route table, since those subnets directly face the Internet.

Let's create the private route table next.

Creating the internal route table

Follow the steps below to create the private internal route table. 

  1. Go to your AWS instance and click  Services -> VPC -> Route Tables.  Then, click  Create Route Tables   and give the details of the internal route table. Here's an example:
  2. Configure the routes and subnets. Here's an example:
    Subnet association configuration:
  3. After configuring the route tables, go to each subnet summary  and verify that the details are correct.

    SubnetSummary
    apim-subnet-b
    apim-subnet-c
    apim-dmz-b
    apim-dmz-d
    apim-dmz-c
    apim-db-subnet-c
    apim-db-subnet-b

...

  1. Go to your AWS instance and click Services -> EC2 -> Security Group. Then, click Create security Group.
  2. Create six security groups separately as follows and set their Inbound and OutBound rules.

    Tip

    Tip: You can use a different naming convention for the groups or create a security group without rules and add them later. 

    Security Group Summary
    apimapim-bastion-sg Image Added
    apimapim-nat-sg Image Added
    apimapim-puppetmaster-sg Image Added
    apimapim-dmz-sg 

    Image AddedImage Added

    apimapim-cluster-sg 
    apimapim-db-sg 
  3. After creating the security groups, go to Services -> EC2 -> Security Groups and verify that the details are correct. 

...

To create a new key pair, go to your AWS instance and click  Services -> EC2 -> Key pair -> Create Key Pair. Then, download the created key pair to your host machine.

Creating instances

Let's see how to create six instances as follows: 

Table of Contents
maxLevel4
minLevel4

...

Creating a bastion instance

A bastion is a special-purpose server instance that is designed to be the primary access point from the Internet. It acts as a proxy to your other EC2 instances. In this guide, we use it as a base instance in our VPC and configure it to connect to other instances in our VPC via SSH.

Follow the steps below to create a bastion instance:

...

Creating a puppet master instance

puppet is a configuration management system that allows you to define the state of your IT infrastructure, then automatically enforces the correct state.

Follow the steps below to create a puppet master instance. 

...

  1. In your AWS instance, click S ervices -> RDS -> Subnet Groups -> Create DB Subnet Group.

  2. In the Create DB Subnet Group page that opens, fill in the details according to your environment  and click  Create .
    In this guide, we select the VPC that is created here and add the two subnets that are hosted in two availability  zones separately.

    Next, let's create the RDS instance. 

  3. In your AWS instance, click Services -> RDS -> Instance -> Launch DB Instance .

  4. Select MySQL as the database engine.

  5. In the second step, choose the options to use Multi-AZ deployment.

  6. In step 3, the  Specify DB Details page, enter the database settings.
    In this guide, the DB instance identifier is apim-db and master username is wso2.

  7. In the Configure Advanced Settings page, set the network, database options, and backup plans.
    Image Modified

  8. Go to your AWS instance and click  Services -> RDS -> Instances. Then,  select the database that you created earlier (in this example, it is  apim-db) and note the details of the RDS instance that you just created.  The Endpoint specifies the server URL for connecting to the database.

...

  1. Connect to the bastion instance using SSH.

    Code Block
    root# ssh -i <security certificate file path> ubuntu@<give the public IP>
  2. Connect to the MySQL server using the MySQL client.
  3. Create the databases described in https://docs.wso2.com/display/AM190/Setting+up+MySQL  using the MySQL server. Note that you can change the names of these databases as you like.

...