Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

How to connect OpenShift Pipelines using AWS CodeCommit

November 13, 2023
Nirjhar Jajodia Savita Ashture
Related topics:
Automation and managementKubernetes
Related products:
Red Hat OpenShift

    In today's fast-paced software development landscape, pipelines have become essential for organizations to streamline their development processes. Tekton, an open source framework for building pipelines, offers a flexible and scalable solution. This article will explore how to create an efficient and automated workflow by integrating Tekton (Red Hat OpenShift Pipelines) with AWS CodeCommit, a fully managed source control service by Amazon Web Services (AWS).

    Integrating Trigger with AWS CodeCommit brings together the benefits of a flexible pipeline framework and a managed source control service. This integration enables organizations to create an efficient and automated workflow, encompassing code changes, building, testing, and deploying applications. To enable the AWS CodeCommit webhook to trigger a Tekton pipeline in Red Hat OpenShift, you must configure several resources, including Tekton TriggerTemplate, EventListener, and TriggerBinding objects.

    Refer to the OpenShift Pipelines documentation for more information. This article describes the steps to connect AWS CodeCommit with the OpenShift Pipelines and use it as source code management (SCM) for CI\CD.

    Prerequisites

    1. OpenShift cluster and AWS account to use AWS CodeCommit and SNS service.
    2. To setup, follow OpenShift Pipelines (OSP) for OpenShift and Tekton Pipelines and Tekton Triggers for Kubernetes.
    3. Make sure all workloads are up and running.

    Steps to connect AWS CodeCommit

    1. Enable debug logs for Triggers eventlistener to obtain the subscription URL, which we will explain in a later section of this article. Debug logging will help us to see the event listener detailed logging information.

    2. Create samples for TriggerTemplate, TriggerBinding, and EventListener and expose event listener service, which will help to configure in AWS CodeCommit trigger.

    You can review samples on GitHub.

    oc create -f https://gist.githubusercontent.com/savitaashture/097c366753ea58017e8a24be83892ad4/raw/a441f65afe73113dd554122c8e86818af030b7da/gistfile1.txt

    3. Sign in to your AWS account and navigate to your chosen region.

    4. Look for the CodeCommit AWS service in the search bar to locate and access the repository hosting and version control solution swiftly.

    5. Navigate to the left side of the panel and choose Source -> Repositories -> Create Repository to initiate the repository creation process (Figure 1).

    A screenshot of the create repository page in AWS CodeCommit.
    Figure 1: Create a repository in AWS CodeCommit.

    Adding triggers

    After successfully creating the repository, proceed with the following steps to add triggers:

    1. Create a Simple Notification Service (SNS) as shown in Figure 2.

    2. Search for SNS service.

    A screenshot of creating an SNS topic in AWS code commit.
    Figure 2: Creating an SNS topic.

    3. Click on Create topic (Figure 3).

    A screenshot of creating an SNS topic.
    Figure 3: Creating an SNS topic.

    4. Click on Create Subscription (Figure 4).

    A screenshot of the first part of creating a subscription in AWS code commit.
    Figure 4: First part of creating a subscription.

    5. Ensure that you enable raw message delivery by checking the appropriate box (Figure 5).

    A screenshot of the second part of creating a subscription in AWS code commit.
    Figure 5: The second part of creating a subscription.

    6. Once you have successfully created a subscription, click on Request confirmation (Figure 6).

    A screenshot of the highlighted request confirmation subscription button.
    Figure 6: Requesting confirmation subscription.

    7. Then go to the event listener pod:

    oc logs -f <pod-name>

    8. Search for SubscribeURL and copy value.

    Example:

    "SubscribeURL\" : \"https://sns.us-east-2.amazonaws.com/?Action=ConfirmSubscription&TopicArn=arn:aws:sns:us-east-2:361754793035:demo-acc-tekton&Token=2336412f37fb687f5d51e6e2425c464de257e9a5924e2fd4cf343ac0f1dcdb40cc7dad021f86dcf2af98fbabf59b6314b975e5d5bfc673924522ab99cb9b45b824a2795d81328e045db0148571c0ba451648f60157690c2c377eb41f58a7d663c15a36654beda27c295f9f90cc8a0f46096aea96a40f9c4ca0b1ec1092e32116\"

    9. Click on Confirm subscription (Figure 7).

    A screenshot of the confirm subscription button in AWS code commit.
    Figure 7: Click the Confirm Subscription button.

    10. Make sure the status is confirmed (Figure 8).

    A screenshot of confirmed status notification in AWS Code Commit.
    Figure 8: Status confirmed.

    11. Now go back to CodeCommit page.

    12. Go to Source -> Repositories and select demo-acc-tekton (Figure 9).

    A screenshot of create repository after all the changes in AWS Code Commit.
    Figure 9: Create a repository after all the changes.

    13. Go to Settings -> Triggers, then click on Create trigger (Figure 10).

    A screenshot of creating trigger in AWS Code Commit.
    Figure 10: Creating a trigger in AWS Code Commit.

    14. While creating the trigger, give the trigger name. Set the events to: All repository events Service to use AWS SNS. Choose the previously configured SNS topic (Figure 11).

    A screenshot of the trigger details page in AWS.
    Figure 11: Trigger details page.

    15. Once the Create trigger is successful, go back to the AWS CodeCommit repository and send a push request. You should see a new Taskrun created.

    kubectl get taskruns | grep aws-codecommit-push-listener-run-

    Important note

    Users can get the request body data coming from AWS Code Commit from the EventListener pod as we have enabled debug log initially. So all request body will be displayed as payload.

    Sample payload for push request:

    {"level":"debug","ts":"2023-07-29T18:49:13.904Z","logger":"eventlistener","caller":"sink/sink.go:177", "msg":"handling event with path /, payload: {\"Records\":[{\"awsRegion\":\"us-e
    ast-2\",\"codecommit\":{\"references\":[{\"commit\":\"b660b4bbf35e6d18478063a01dbcaa0f94edef6e\",\"ref\":\"refs/heads/main\"}]},\"customData\":null,\"eventId\":\"9d769236-ad9b-48ea-
    84e0-bd1b93378560\",\"eventName\":\"ReferenceChanges\",\"eventPartNumber\":1,\"eventSource\":\"aws:codecommit\",\"eventSourceARN\":\"arn:aws:codecommit:us-east-2:361754793035: demo-a
    cc-tekton\",\"eventTime\":\"2023-07-29T18:49:13.816+0000\",\"eventTotalParts\":1,\"eventTriggerConfigId\":\"34d16103-b8a5-48cd-b16a-cbd287a724c8\",\"eventTriggerName\":\"demo-acc-te
    kton\",\"eventVersion\":\"1.0\",\"userIdentityARN\":\"arn:aws:iam: :361754793035:user/njajodia@redhat.com-v7nxk-admin\"}]} and header: map [Accept-Encoding: [gzip,deflate] Content-Leng

    Summary

    In this article, we explored integrating Tekton (OpenShift Pipelines) with AWS CodeCommit. Integrating Tekton with AWS CodeCommit brings together the benefits of a flexible pipeline framework and a managed source control service. This integration enables organizations to create an efficient and automated workflow, encompassing code changes, building, testing, and deploying applications. We demonstrated how to enable the AWS CodeCommit to trigger a Tekton pipeline in OpenShift and configured several resources, including TriggerTemplate, EventListener, and TriggerBinding objects along with SNS topic in AWS.

    Related Posts

    • 5 principles for deploying your API from a CI/CD pipeline

    • Build a Go application using OpenShift Pipelines

    • Red Hat Open Innovation Labs: Automating CI/CD Deployment Pipelines

    • How to create an EC2 instance in AWS using Ansible workflow

    Recent Posts

    • Tekton joins the CNCF as an incubating project

    • Federated identity across the hybrid cloud using zero trust workload identity manager

    • Confidential virtual machine storage attack scenarios

    • Introducing virtualization platform autopilot

    • Integrate zero trust workload identity manager with Red Hat OpenShift GitOps

    What’s up next?

    The automated builds and deployments (CI/CD) of container-based applications can reduce mistakes, improve productivity, and promote more thorough testing. Try this sandbox activity to learn about OpenShift Pipelines for automated builds and deployment.

    Start learning
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.