Skip to content
Cloud8 Logo
  • PRODUCT
  • PRICING
  • SUPPORT
  • CONTACT US
  • LOGIN
  • PRODUCT
  • PRICING
  • SUPPORT
  • CONTACT US
  • LOGIN

Best Practices

  • How to integrate Slack into Best Practices
  • How to monitor memory and swap with SSM
  • AWS Bucket S3 Topic Notification
  • Best Practices: Password and Credential Monitoring
  • Best Practices: Custom Rule Notifications via AWS S3
  • Best Practices: Microsoft Teams Support

Charging

  • AWS account suspension: tips and what to do

Concepts

  • Security groups
  • Access key
  • Cloud server image or template
  • Snapshot
  • Additional disks
  • Cost model: pay per use
  • Cloud Control Panel – AWS, Azure, GCP, Huawei and Oracle
  • Cloud Computing
  • Comparison: Automation via Cloud8 vs “homemade” automation
  • FINOPS: Data Integration and Enhancement Flow (Infographic)
  • Difference between RI Applied vs RI in Cloud8 Panel

Credentials

  • Using Cloud8 with a custom AWS security credential
  • How to use IAM Role to integrate your security with Cloud8
  • Security credentials for public clouds
  • Connecting OCI Providers to Cloud8 – Full Tutorial
  • Credential for Huawei Cloud
  • Best Practices: Enabling user monitoring in Azure

First Steps

  • Connecting GCP Providers to Cloud8 – Full tutorial
  • How to manage more than one AWS account
  • Hot to enable cloud cost estimates monitoring
  • Creating a new Amazon AWS account
  • Connecting Azure Enterprise Agreement providers to Cloud8 – Full tutorial
  • Creating a New Account on Amazon Cloud (AWS)
  • Connecting OCI Providers to Cloud8 – Full Tutorial
  • Cloud8 Users and Profiles
  • Onboarding: getting started on Cloud8
  • Connecting AWS Providers to Cloud8 – Full Tutorial

MSP / Reseller

  • White label at no additional cost
  • MSP: Configuring costs
  • MSP: Configuring markup

Services

  • Using Cloud8 Insights
  • Audit logs
  • Managers on Cloud8 – Resource management on AWS, Azure and GCP
  • Cloud usage statistics
  • Alerts
  • Cloud cost control, alerts and reports
  • Cloud aggregator control panel
  • Using Automations in Cloud8
  • Automated backup of cloud servers
  • Multiple Users – Multiuser Panel
  • ECS / Fargate support on Workflow
  • Enabling Azure AD SSO in the Cloud8 Dashboard
  • Detailed Costs Report
  • Workflow: How to reset tasks periodically
  • Kubernetes Cost Support
  • How to install Metricbeat component on AKS
  • How to enable support for ECS / EKS shared costs
  • Add TAGs with CSV file
  • GCP Storage Integration
  • RDS reports with grouping by ID
  • Exporting data to AWS S3 (Bucket)
  • How to install Metricbeat component on GKE clusters
  • How to install Metricbeat component on EKS
  • How to install the Metricbeat component in OKE
  • FinOps: Cost Anomaly Reports and Charts
  • Enabling MFA in the Cloud8 Dashboard
  • FinOps: Reverse API
  • FinOps: Tag Sharing and Prorating
  • FinOps: Tag Sanitization, Compliance and MultiCloud
  • FinOps: Tagged / Untagged
  • FinOps: Reports, Alerts and Budgets
  • FinOps: Tags and Usage
  • FinOps: Tags / Labels / Resource Groups
  • Exporting data to Azure Storage Account
  • S3 Lambda Notification Processor (deploy via CLI)

Troubleshooting

  • I subscribed Amazon and I still can’t access Cloud8
  • How is the cloud cost estimate calculated?
  • I created a security group through the AWS console and it still doesn’t appear in Cloud8
  • I exported the cloud server usage report. What do the fields mean?
  • Using Cloud8 with a custom AWS security credential
  • Cloud8 and Amazon don’t monitor my cloud server’s memory?

Tutorials

  • How to access a Windows server in the Amazon AWS cloud
  • How to access a Linux server
  • How to create a cloud server
  • How to integrate Slack into Best Practices
  • How to configure scheduling for script execution in AWS
  • How to configure scheduling by Tags / Labels
  • Configure vault copy at AWS (cross account) with KMS
  • How to configure the Scheduler for script execution on OCI
  • Workflow: How to reset tasks periodically
  • How to install Metricbeat component on AKS
  • How to install Metricbeat component on GKE clusters
  • How to install Metricbeat component on EKS
  • How to install the Metricbeat component in OKE
  • FinOps: Cost Anomaly Reports and Charts
  • Group data in Pivot Table
  • FinOps: Tag Sanitization, Compliance and MultiCloud
  • S3 Lambda Notification Processor (deploy via CLI)
  • Best Practices: Microsoft Teams Support
View Categories
  • Home
  • Docs
  • Services

S3 Lambda Notification Processor (deploy via CLI)

2 min read

In the AWS serverless solutions universe, one of the most used combinations is the integration between Amazon S3 and AWS Lambda for processing event notifications. In this tutorial, you will learn how to configure a Cloud Formation template and create an infrastructure to process JSON notifications stored in an S3 bucket. The system consists of a Lambda function that is triggered when files are created in the S3 bucket, processes the JSON content and sends it to a configured web service endpoint.

AWS Resources Created

  • Lambda Function: Process JSON Notifications
  • IAM Role: Permissions Required for Lambda Function
  • Lambda Permission: Allows S3 to invoke the Lambda function

Prerequisites

  • AWS CLI installed and configured
  • Name of the S3 Bucket where notifications are being sent
  • Permissions required to create resources via CloudFormation

Implementing the solution #

Obtaining the template #

Download the template file from the following URL:
https://notification-processor-cloudformation-template.s3.us-east-1.amazonaws.com/stack.yaml

Template Customization #

Before deploying, you need to adjust your stack.yaml file so that the processing is compatible with the format of your JSON payload. The simplest way to modify the payload is through the preparePayload(notificationData) function . In this function, you can parse the received object and structure it according to your needs before sending it to the endpoint.

Example: #

// Javascript
function preparePayload(notificationData) {
  // Exemplo: Adicionar campo adicional
  return {
    …
    notificationData,
    environment: "production",
    processedAt: new Date().toISOString()
  };
}

By default, the full JSON fetched from the bucket is sent as a payload to the specified endpoint. The default code does not perform authentication, but you can adapt it to include this
process if necessary.

Deploy do CloudFormation #

Reference: https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudformation/deploy.html

aws cloudformation deploy\
--stack - name notification - processor\
  --template - file stack.yaml\
  --parameter - overrides\
S3BucketName = \
  WebServiceEndpoint = \
  --capabilities CAPABILITY_IAM

S3 Event Notification Configuration #

After deploying CloudFormation, you need to configure the S3 Bucket to trigger the Lambda function:

Reference :
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/put-bucket-notification-con
figuration.html

Get the Lambda Function ARN #

LAMBDA_ARN = $(aws cloudformation describe - stacks\
  --stack - name notification - processor\
  --query 'Stacks[0].Outputs[?OutputKey==LambdaFunctionARN].OutputValue'\
  --output text)

Configure S3 bucket notification #

aws s3api put - bucket - notification - configuration\
  --bucket\
  --notification - configuration '{
"LambdaFunctionConfigurations": [{
  "LambdaFunctionArn": "'$LAMBDA_ARN'",
  "Events": ["s3:ObjectCreated:*"],
  "Filter": {
    "Key": {
      "FilterRules": [{
        "Name": "suffix",
        "Value": ".json"
      }]
    }
  }
}]
}'

You may want to check these Docs too: #

  • Using Cloud8 Insights
  • Exporting data to Azure Storage Account
  • FinOps: Tags / Labels / Resource Groups
  • FinOps: Tags and Usage
  • FinOps: Reports, Alerts and Budgets
Amazon, Automations, AWS, AWS Cli, bucket, CloudFormation, Lambda, notification, S3 Bucket
Did this Doc help you?

Share This Article:

  • Facebook
  • X
  • LinkedIn
  • Pinterest
Table of Contents
  • Implementing the solution
    • Obtaining the template
    • Template Customization
      • Example:
    • Deploy do CloudFormation
    • S3 Event Notification Configuration
      • Get the Lambda Function ARN
      • Configure S3 bucket notification
Cloud8 Logo
  • Terms of Use
  • About Us
  • FAQ / Support
  • Blog
  • Contact Us
  • Cookies (EU)
  • Terms of Use
  • About Us
  • FAQ / Support
  • Blog
  • Contact Us
  • Cookies (EU)
Globe-americas Facebook Twitter Linkedin Youtube

Disclaimer: AWS, images, and associated services are property of Amazon Web Services Inc. and its affiliates. Azure, images, and associated services are property of Microsoft Corporation. GCP, images, and associated services are property of Google Inc. Huawei, images, and associated services are property of Huawei Technologies Co Ltd. Oracle, images, and associated services are property of Oracle Corporation. Cloud8 Brasil em Português.

Manoel Netto Designer
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}