Configure AWS S3 to Store Pipeline Logs
Learn how to use AWS S3 to store pipeline logs securely in Harness.
By default, Harness supports an embedded database for storing CI pipeline logs, suitable for evaluation or small-scale deployments. However, as deployments scale or demand grows, it’s critical to switch to a more scalable and reliable storage solution. Harness supports AWS S3 for storing CI pipeline logs, providing a secure, robust, and cost-effective way to manage large volumes of log data.
To use AWS S3, you must configure it as an external storage solution, which involves setting up an S3 bucket and connecting it to Harness by specifying the required details like the bucket name, region, and access credentials. This ensures your pipeline logs are stored securely and are easily accessible for analysis.
Create an S3 Bucket
Navigate to the S3 API page in the AWS Console.
Create a General Purpose Bucket with your desired name and ensure public access is disabled.

aws-s3-logs-1 
aws-s3-logs-2 After the bucket is created, go to the Access Points tab for that bucket.

aws-s3-logs-2 Add a new access point and connect it to your VPC.
Set up Access Key, Secret Key & Policy to access Bucket
To create an AWS Access Key ID and Secret Access Key with limited permissions for a specific S3 bucket, follow these steps:
Create a New IAM User:
Sign in to the AWS Management Console and go to the IAM console.
Select Users > Add user.
Enter a user name and click Next: Set Permissions.
Attach Policy Directly or Add to Group:
For direct policy attachment, choose Attach existing policies directly > Create policy.
Use the JSON editor to specify permissions for viewing and uploading to your bucket. Replace
YOUR_BUCKET_NAMEwith your actual bucket name in the policy:
Alternatively, you can add the user to a group that already has the required permissions.
Review and Create User:
After attaching the policy, proceed through Next: Tags, Next: Review, and click Create user.
Access Key and Secret:
Once the user is created, you'll see the Access Key ID and Secret Access Key. Be sure to save them securely.
Create Gateway Endpoint to Connect with S3 from a Private Subnet
Go to the Endpoints section in the VPC page (e.g., VPC Console).
Click Create New Endpoint and provide the following details:
Name:
<some-name>Type: AWS Services
Service:
com.amazonaws.<region>.s3(Select the Gateway type, and filter with "s3")VPC: VPC ID of your EKS cluster
Route Tables: Select the route tables associated with the private subnets of your VPC/EKS cluster
Allow Full Access: Enable this option.

aws-s3-logs-4
Validate Connectivity from EKS to S3
Exec into Minio Pod in your Harness Namespace Use the following command to access the Minio pod:
Set Alias for S3 Set up the S3 alias with the following command:
Create a Dummy File Create a test file with the following command:
Copy the File to S3 Upload the dummy file to your S3 bucket:
Verify the File Exists in Your Bucket Ensure the file was successfully uploaded by checking your S3 bucket.
Copy Data from Minio to AWS S3
To transfer data from Minio to S3, execute the following commands inside the Minio pod:
Configure Harness to use S3 as Log Storage
Harness allows you to store logs in AWS S3 via the AWS S3 client. Harness supports connecting to AWS S3 using either static credentials (Access Key and Secret Key) or IAM Roles for Service Accounts (IRSA). You can choose the authentication method that best fits your security and operational requirements.
Option 1: Configure Harness - Using Static Credentials
To configure Harness to use AWS S3 for log storage using static credentials you need the S3 Access Key, S3 Secret Key, Endpoint, Region, and Bucket Name.
Create Kubernetes Secret to Store AccessKey and SecretKey
Create a Kubernetes secret in your cluster so the application can refer to it.
Use the following YAML format to store the
S3_ACCESS_KEYandS3_SECRET_ACCESS_KEY:Configure Harness Overrides to Use AWS S3
Use the following YAML format to configure the log service to use AWS S3 using the above secrets:
Option 2: Configure Harness - Using IAM Role for Service Accounts (IRSA)
To configure Harness to use AWS S3 for log storage using IAM Role for Service Accounts (IRSA) you need Bucket Name, Bucket Policy and Region.
Create a Service Account with The Bucket Policy
Use the following command to create a Service Account configured with the required S3 bucket policy. This command automatically creates a new IAM Role with the specified bucket policy and attaches a trust policy that allows the Service Account to assume the role using IRSA.
Configure Harness Overrides to Use Custom Service Account
Use the following YAML format to configure the log service to use the above newly created service account.
Upgrade your harness instance with above overrides
Make sure to verify that the logs for existing pipelines appear correctly in the Harness UI, and that logs for new pipeline runs are stored properly.
Once confirmed, you can disable Minio by setting:
Your setup for storing logs in AWS S3 is now complete.
Last updated
Was this helpful?