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.
Before starting this tutorial:
VMware recommends that you read About the AWS Services package. The topic provides context about the goals of the package, and some of the considerations and compromises that were made as part of its development.
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
To find out about available AWS services:
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
.
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.
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.
After creating the claim, you can bind it to one or more of your application workloads.
ImportantIf 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.
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.
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.