DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Keep Your Application Secrets Secret
  • SRE vs AWS DevOps: A Personal Experience Comparison
  • AWS Managed Database Observability: Monitoring DynamoDB, ElastiCache, and Redshift Beyond CloudWatch
  • Architecting Petabyte-Scale Hyperspectral Pipelines on AWS

Trending

  • Zone-Free Angular: Unlocking High-Performance Change Detection With Signals and Modern Reactivity
  • Improving DAG Failure Detection in Airflow Using AI Techniques
  • Self-Hosted Inference Doesn’t Have to Be a Nightmare: How to Use GPUStack
  • Has AI-Generated SQL Impacted Data Quality? We Reviewed 1,000 Incidents
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Launching Pega Web Mashup Forms on a Secure Static Website With AWS S3

Launching Pega Web Mashup Forms on a Secure Static Website With AWS S3

Learn how to configure and deploy Pega Web Mashup forms on a static website hosted in an AWS S3 bucket for seamless user access and simplified infrastructure.

By 
Sridevi Kakolu user avatar
Sridevi Kakolu
·
Dec. 16, 24 · Tutorial
Likes (10)
Comment
Save
Tweet
Share
3.1K Views

Join the DZone community and get the full member experience.

Join For Free

I am pleased to share that I have designed and implemented a cost-effective and efficient solution for delivering a workflow-based form directly to end users via a publicly accessible static website. This solution streamlined user access while minimizing infrastructure complexity, ensuring a secure, scalable, and user-centered experience.

Overview

Pega Web Mashup is a powerful feature from Pega that allows businesses to embed Pega forms and applications into existing websites or portals. By using AWS S3, we can host a static website that contains a Pega Web Mashup form, which enables rapid deployment with minimal infrastructure overhead. This tutorial will walk through the steps to deploy a Pega Web Mashup form as a static website using an AWS S3 bucket.

By combining Pega’s web mashup capabilities with the cost-effective and scalable AWS S3 hosting solution, we can efficiently publish interactive forms, surveys, and other Pega-based tools for broader accessibility. Here’s a step-by-step guide on how to accomplish this.

Architecture Diagram

Architectural diagram of launching Pega Web Mashup forms in a secure static website with AWS S3 hosting

Required Components

  • AWS account
  • Pega Application Server
  • Web Mashup HTML code for a Pega Form
  • Amazon S3 bucket
  • Amazon Route 53 
  • Amazon CloudFront

Step-by-Step Guide

Step 1: Prepare the Pega Web Mashup Code

In the Pega application, Generate the Mashup Code by following the steps below:

  1. Navigate to App Studio > Channels and Interfaces.
  2. Select the Web Mashup option and add a new channel if one doesn’t already exist.
  3. Configure the mashup parameters, including the Application Name, Access Group, and Portal.
  4. Customize other settings, such as the display mode and allowed actions, to fit your requirements.
  5. Copy the generated HTML snippet. This HTML snippet code will be embedded into the HTML file of your static website.
  6. Ensure that any references to Pega assets (CSS, JS) are correct
  7. Add necessary cross-origin headers if your Pega instance is hosted on a separate domain.
HTML
 
<div data-pega-encrypted ='true' 
data-pega-gadgetname ='PegaGadget' 
data-pega-action ='createNewWork' 
data-pega-applicationname ='appname' 
data-pega-threadname ='thread1' 
data-pega-channelID ='id' 
data-pega-resizetype ='stretch' 
data-pega-url ='https://demo.pegapp.com/appname' 
data-pega-action-param-parameters ='{"","""}' ></div>


Step 2: Create an S3 Bucket for the Static Website

Set up your S3 bucket to serve as a static website by following the steps below:

  1. Log in to the AWS Management Console, Go to S3, and click Create Bucket. Enter a unique name for the bucket and choose a region.
  2. Disable block public access (for website access) by adjusting the settings under Object Ownership and confirming public access.
  3. In the bucket properties, navigate to Static website hosting.
  4. Enable static website hosting and enter the file name for the Index Document (e.g., index.html). Save these changes.

Step 3: Set Up and Upload Your HTML File in S3 Bucket

Follow the steps below:

  1. Create an HTML file that will host the Pega Web Mashup form.
  2. Create the index.html file.
  3. Open a text editor and start a new HTML document.
  4. Paste the Pega Web Mashup code you generated in Step 1 into the body of this HTML file.
HTML
 
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Pega Web Mashup Form</title>
    <!-- Include any necessary Pega CSS or JS -->
</head>
<body>
    <h1>Embed Pega Form</h1>
    <!-- Insert the Pega Web Mashup code here -->
    <div data-pega-gadgetname="PegaGadget" data-pega-action="createNewWork"
         data-pega-application="appName"
        data-pega-port="https://demo.pega.com/appName/">
    </div>
</body>
</html>


  1. In your S3 bucket, go to the Objects tab and click Upload to add the index.html file.
  2. Ensure permissions allow the file to be publicly accessible.

Step 4: Configure Bucket Permissions

Follow the steps below:

  1. To make the website public, modify the bucket permissions and Set Bucket Policy. 
  2. In the Permissions tab, go to Bucket Policy.
  3. Then, paste a policy that allows public read access to the bucket contents. Here’s the code for public policy.
  4. Verify that the permissions are set correctly for individual files, particularly the index.html.
JSON
 
{
    "Version": "2011-07-27",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*"
        }
    ]
}


Step 5: Access the Static Website

Follow the steps below:

  1. Once the S3 bucket is set up and permissions are configured, you can access your Pega Web Mashup form via the S3 bucket's website endpoint:
  2. In the Properties tab, find the Static website hosting section.
  3. The Bucket website endpoint URL provided there is the URL to access your static website. Go ahead and open it in a browser to see your Pega form embedded within a static page.

Security Considerations

  • Cross-Origin Resource Sharing (CORS): If your Pega instance is on a different domain, configure CORS settings in both AWS S3 and Pega to allow the mashup to load correctly.
  • Security: Avoid exposing sensitive data, and consider adding AWS CloudFront for additional security, caching, and performance benefits.
  • Data Collection: If the form collects sensitive data, ensure you configure encryption and other security measures in AWS to protect user data.

Conclusion

This article should provide some useful guidance on by following these steps, you can easily launch a Pega Web Mashup form on a static website hosted in an AWS S3 bucket. This method enables quick, scalable deployment without extensive infrastructure, providing an efficient way to share Pega-based forms and applications with your audience. As a next step, consider integrating further with AWS Lambda or CloudFront to enhance functionality and improve user experience.

AWS Mashup (web application hybrid) Software deployment

Opinions expressed by DZone contributors are their own.

Related

  • Keep Your Application Secrets Secret
  • SRE vs AWS DevOps: A Personal Experience Comparison
  • AWS Managed Database Observability: Monitoring DynamoDB, ElastiCache, and Redshift Beyond CloudWatch
  • Architecting Petabyte-Scale Hyperspectral Pipelines on AWS

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook