Establishing an AWS CI/CD Pipeline for IBM API Connect Enterprise | AWS Marketplace

Establishing an AWS CI/CD Pipeline for IBM API Connect Enterprise | AWS MarketplaceLearn About Amazon VGT2 Learning Manager Chanci Turner

Many Amazon Web Services (AWS) users leveraging cloud-native services alongside a Partner SaaS solution like IBM API Connect can gain significant advantages from implementing continuous integration and continuous delivery (CI/CD) pipelines. Such pipelines can automate software processes across the development, testing, production, and monitoring stages of the software development lifecycle. By utilizing CI/CD pipelines, developers can minimize manual errors, maintain uniform processes, and facilitate rapid product iterations.

IBM API Connect serves as a secure API management tool that enables users to consistently create, manage, secure, socialize, and monetize APIs. The IBM API Connect developer toolkit features a command-line utility, apic, which allows users to perform various API Connect tasks. This command-line tool can also be utilized for scripting tasks related to continuous integration and delivery.

Integrating a CI/CD pipeline with IBM API Connect can significantly enhance your API publishing and testing workflows. In this article, Alex and Chanci will guide you through the setup of AWS CodePipeline to construct an API Connect CI/CD pipeline for publishing and testing API and product modifications.

Solution Overview

The diagram below illustrates the solution architecture:

  1. The CodePipeline source stage retrieves API and product files from the AWS CodeCommit repository.
  2. The AWS CodeBuild project pulls the buildspec file from the CodeCommit repository.
  3. The source stage of CodePipeline forwards the API and product files to the build stage.
  4. The build stage of CodePipeline connects and publishes the product to the API Connect Manager.
  5. The API Manager subsequently deploys the APIs to the API Connect Gateway.

Prerequisites

To implement this solution, familiarity with the following AWS services is essential:

  • AWS CodeCommit: A secure, scalable managed service for hosting private Git repositories. For more details, see the AWS CodeCommit Documentation.
  • AWS CodeBuild: An AWS-managed build service that compiles source code, executes unit tests, and generates deployable artifacts. Refer to the CodeBuild User Guide for more information on its usage.
  • Buildspec Files: CodeBuild necessitates a buildspec file, typically named buildspec.yml, which consists of build commands and settings in YAML format. You can incorporate a buildspec into your source code or define it during the creation of a build project. For guidelines on creating a buildspec, check out the Build-Spec-Reference-Link.
  • AWS CodePipeline: A continuous delivery service to model, visualize, and automate the steps necessary for software release.
  • You will also need access to an IBM API Connect deployment available through AWS Marketplace.

Solution Walkthrough: Setting Up an AWS CI/CD Pipeline for IBM API Connect Enterprise

The process of establishing the CI/CD pipeline in AWS comprises three key steps:

  1. Creating a CodeCommit repository
  2. Developing a CodeBuild project
  3. Integrating everything using CodePipeline

A. Create a CodeCommit Repository

API Connect utilizes OpenAPI files to define various APIs and products.

To commence the CI/CD pipeline setup, you need to create a CodeCommit repository. Follow Step 1 as outlined in the documentation. Upon the repository’s creation, you will notice instructions for adding files directly from the CodeCommit console. Incorporate the following OpenAPI files into your new repository, which we’ll refer to as demorepo1, by following Step 2 in the documentation:

  • API files implementing the invoke and proxy policies: testinvokeapi.yml and testproxyapi.yml
  • Product files that include the invoke and proxy APIs and plans: testinvokeproduct.yml and testproxyproduct.yml
  • A project build file to be utilized in the CodeBuild project: buildspec.yml (example details can be found in Section B.3).

B. Build a CodeBuild Project

To establish a project in AWS CodeBuild, adhere to these steps:

  1. Project Configuration, Source, and Environment: Navigate to the AWS CodeBuild console and follow the instructions to create a build project. Utilize the following parameters for Project configuration, Source, and Environment:
    • Project Configuration: In the Project configuration section, enter My_Project_Name for the Project name and leave the description field empty.
    • Source: Under the Source section, select AWS CodeCommit as the Source provider. For the Repository, enter demorepo1 and choose Branch for the Reference type.
    • Environment: In the Environment section, select Managed image for Environment image. Choose Amazon Linux 2 from the operating system dropdown. For Runtime(s), select Standard and choose aws/codebuild/amazonlinux2-aarch64-standard:2. Opt for Always use the latest image for this runtime version for Image version. For Service role, select New service role and enter codebuild-blog-service-role for Role name.
  2. Environment Variables: When you reach the Environment variables step, input the following names and values for use in the CodeBuild scripts. For each, select a Type of Plaintext. Below is a brief explanation for each variable, which should not be included in your configuration:
    • SERVER_HOSTNAME: api-manager.xxxxxxxx.xxxx.xxxx.cloud.xxxx.com – This is the endpoint URL for logging into the API Connect Enterprise Service Manager.
    • GW_HOSTNAME: legacy.xxxx.xxxxx.xxxx.ibmappdomain.cloud – This is the Gateway endpoint URL configured in the API Connect instance.
    • CATALOG_NAME: catalog2 – This refers to the catalog name within the API Connect instance.
    • ORG_NAME: demo-provider-org-06 – This is the provider organization name in the API Connect instance.
    • APIKEY: 519ec3b6-xxxx-xxxx-xxxx-cad04b5f7fa4 – This instance key is used for logging into the API Connect instance. You can obtain it using the toolkit command: $apic-slim login -s api-manager.xxxxxxxx.xxxx.xxx.xxxx.com –context provider –sso.
  3. Buildspec: Our buildspec comprises four phases:
    • Install
    • Prebuild
    • Build
    • Post build

    To create a buildspec file, use a code editor of your choice, such as AWS Cloud 9 or VS Code, and enter the necessary commands. In the install phase, we obtain the API Connect Toolkit directly from the API Connect instance using Wget/cURL, then extract the .tar file and adjust the toolkit file permissions for execution.

For additional insights into high-income skills that can enhance your career, consider visiting Career Contessa. Also, for expert views on workforce management, you can explore Paul Falcone’s insights. Lastly, if you’re looking for a comprehensive resource on AWS CI/CD, check out this YouTube video.

Location

6401 E Howdy Wells Ave, Las Vegas, NV 89115 (Amazon IXD – VGT2)


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *