arazzo: 1.0.1 info: title: Amazon RDS Add an Aurora Replica Instance summary: Confirm a cluster is available, add a reader instance, and poll until it joins. description: >- Scales read capacity on an Aurora DB cluster by adding a new reader instance into the existing cluster and waiting for it to come online. The workflow confirms the target cluster is available, creates a DB instance attached to the cluster, and polls DescribeDBInstances until the new reader reaches the available status, looping while it is still creating. Every step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: amazonRdsApi url: ../openapi/amazon-rds-openapi.yml type: openapi workflows: - workflowId: add-aurora-replica-instance summary: Add a reader instance to an Aurora cluster and wait for it to become available. description: >- Confirms the cluster is available, creates an instance that joins the cluster as a reader, then polls DescribeDBInstances until the new instance is available. inputs: type: object required: - dbClusterIdentifier - dbInstanceIdentifier - dbInstanceClass - engine properties: dbClusterIdentifier: type: string description: The identifier of the existing Aurora DB cluster to add a reader to. dbInstanceIdentifier: type: string description: The unique identifier for the new reader DB instance. dbInstanceClass: type: string description: The compute and memory capacity class for the reader (e.g. db.r5.large). engine: type: string description: The Aurora engine matching the cluster (aurora-mysql, aurora-postgresql). steps: - stepId: confirmCluster description: >- Describe the Aurora DB cluster to confirm it is available before adding a reader instance. operationId: describeDBClusters parameters: - name: DBClusterIdentifier in: query value: $inputs.dbClusterIdentifier successCriteria: - condition: $statusCode == 200 - context: $response.body condition: $.dBClusters[0].status == 'available' type: jsonpath outputs: clusterStatus: $response.body#/dBClusters/0/status - stepId: createReader description: >- Create a new DB instance that joins the existing Aurora cluster as a reader, using the cluster engine and supplied instance class. operationId: createDBInstance parameters: - name: DBInstanceIdentifier in: query value: $inputs.dbInstanceIdentifier - name: DBInstanceClass in: query value: $inputs.dbInstanceClass - name: Engine in: query value: $inputs.engine successCriteria: - condition: $statusCode == 200 outputs: readerId: $response.body#/dBInstance/dBInstanceIdentifier initialStatus: $response.body#/dBInstance/dBInstanceStatus - stepId: pollReader description: >- Describe the new reader instance and inspect its status. While it is still creating the workflow loops back to poll again; once it is available the flow ends. operationId: describeDBInstances parameters: - name: DBInstanceIdentifier in: query value: $inputs.dbInstanceIdentifier successCriteria: - condition: $statusCode == 200 outputs: status: $response.body#/dBInstances/0/dBInstanceStatus endpointAddress: $response.body#/dBInstances/0/endpoint/address onSuccess: - name: stillCreating type: goto stepId: pollReader criteria: - context: $response.body condition: $.dBInstances[0].dBInstanceStatus != 'available' type: jsonpath - name: available type: end criteria: - context: $response.body condition: $.dBInstances[0].dBInstanceStatus == 'available' type: jsonpath outputs: readerId: $steps.createReader.outputs.readerId status: $steps.pollReader.outputs.status endpointAddress: $steps.pollReader.outputs.endpointAddress