Discover and Publish Resources hosted in AWS

This article describes features that are only available in the Banyan Enterprise edition.

Overview

Banyan automatically discovers the AWS resources that need to be accessed by your end users. You can then publish these discovered resources as Banyan services.

Prerequisites

Before proceeding through the steps below, ensure you have installed and configured the Python clients needed to interact with the Banyan and AWS APIs.

See the pybanyan docs for detailed instructions for AWS.

Run the test-aws subcommand to ensure you’re correctly authenticated and authorized.

$> banyan cloud-resource test-aws {aws-region}
--> AWS configuration test passed. Found 12 resources.

Steps

At a high level, you will:

Step 1. Tag your resources in AWS

In the AWS console, add tags to the resources you need to discovered by Banyan. For this guide, we use the tag banyan:discovery to label resources that should be discovered by Banyan, but you can use any tag for this purpose.

In the AWS console, navigate the the Tags section to view the resources you have tagged.

Step 2. Sync resources into Banyan

Now that your resources are tagged for discovery, use the pybanyan sync-aws subcommand to get the resource metadata from AWS and submit them via the Banyan API.

$> banyan cloud-resource sync-aws all {aws-region} --tag_name banyan:discovery

--> Getting list of AWS EC2 resources:

--> Getting list of AWS RDS resources:

--> Getting list of AWS ELB resources:

type    id                name              public_dns_name    public_ip    private_dns_name    private_ip     ports    provider         account  region       tags
------  ----------------  ----------------  -----------------  -----------  ------------------  -------------  -------  ----------  ------------  ---------  ------
ec2     i-0e69ab23ff6415  cr-wiki-js1-org                                   ip-172-31-1-88.e    172.31.1.88    []       aws         722538922137  us-east-1       3
ec2     i-0f9da0253421e1  td-kube-node-1-1                                  ip-172-31-85-220    172.31.85.220  []       aws         722538922137  us-east-1      12
ec2     i-0f193dc63d893b  td-kube-node-1-1                                  ip-172-31-86-50.    172.31.86.50   []       aws         722538922137  us-east-1      12
ec2     i-055f56845a5b5d  td-server1-1f-pv


--> Filtering for new AWS resources:

type    id                name              public_dns_name    public_ip    private_dns_name    private_ip     ports    provider         account  region       tags
------  ----------------  ----------------  -----------------  -----------  ------------------  -------------  -------  ----------  ------------  ---------  ------
ec2     i-0e69ab23ff6415  cr-wiki-js1-org                                   ip-172-31-1-88.e    172.31.1.88    []       aws         722538922137  us-east-1       3
ec2     i-0f9da0253421e1  td-kube-node-1-1                                  ip-172-31-85-220    172.31.85.220  []       aws         722538922137  us-east-1      12
ec2     i-0f193dc63d893b  td-kube-node-1-1                                  ip-172-31-86-50.    172.31.86.50   []       aws         722538922137  us-east-1      12
ec2     i-055f56845a5b5d  td-server1-1f-pv

--> Sync with AWS successful.

You can specify the resource_type to be all or a specific supported resource_type - VM, LB, etc. Check pybanyan help for additional filtering options.

Step 3. Select discovered resources to publish

Once your cloud resources are synchronized, you will be able to view them in the Manage Services > Discovered Resources > Inventory section in the Banyan Command Center.

Select an individual resource to see more details, such as Private IP Address, Ports and Tags.

Step 4. Publish services

Click on the Publish icon to publish a Banyan service from of this discovered resource.

Select the type of service you wish to create, populate the required fields - such as service domain, access tier, etc - and attach a policy.


Congrats! You have discovered your AWS resources and published them for your end-users. You can repeat this process as often as you need.



Last modified: Dec 01, 2021