Working with AWS Services

In this tutorial you learn how application operators and application developers can use AWS Services on Tanzu Application Platform. You will learn how to discover, claim, and bind services to application workloads.

Prerequisites

Before starting this tutorial:

About this tutorial

Target user roles: Application Operator, Application Developer
Complexity: Basic
Estimated time: 15 minutes
Topics covered: AWS, RDS, PostgreSQL, MySQL, Classes, Claims
Learning outcomes: An understanding of how to work with RDS PostgreSQL and MySQL instances on Tanzu Application Platform using the AWS Services package

Step 1: Discover the list of available AWS services

To find out about available AWS services:

  1. To discover the list of available services, run:

    tanzu service class list
    

    The expected output has two services: postgresql-managed-aws and mysql-managed-aws.

  2. To learn more about the service, including which claim parameters are provided, run:

    tanzu service class get CLASS-NAME
    

    Where CLASS-NAME is one of the services listed in the previous step.

Step 2: Claim an instance of an AWS RDS service

To claim an instance of an AWS RDS service:

tanzu service class-claim create CLAIM-NAME --class CLASS-NAME

Where:

  • CLAIM-NAME is the name you choose for your claim, for example, rds-1.
  • CLASS-NAME is one of the services listed earlier.

It takes about 5 to 10 minutes for the service instance to be provisioned. You can watch the claim and wait for it to transition into a READY: True state to know when it is ready to use.

Step 3: Bind the service to a workload

After creating the claim, you can bind it to one or more of your application workloads.

Important

If you want to bind to more than one application workload, all application workloads must be in the same namespace. This is a known limitation. For more information, see Cannot claim and bind to the same service instance from across multiple namespaces.

  1. Find the reference for the claim by running:

    tanzu service class-claim get CLAIM-NAME
    

    Where CLAIM-NAME is the name of the claim you want to bind your workload to, for example, rds-1.

    The reference is in the output under the heading Claim Reference.

  2. Bind the claim to a workload of your choice by passing a reference to the claim to the --service-ref flag of the tanzu apps workload create command. For example:

    tanzu apps workload create my-workload --image my-registry/my-app-image --service-ref db=services.apps.tanzu.vmware.com/v1alpha1:ClassClaim:rds-1
    

    You must pass the claim reference with a corresponding name that follows the format --service-ref db=services.apps.tanzu.vmware.com/v1alpha1:ClassClaim:rds-1. The db= prefix to this example reference is an arbitrary name for the reference.

check-circle-line exclamation-circle-line close-line
Scroll to top icon