Giter VIP home page Giter VIP logo

subhamay-cloudworks / 0018-sunflower-cft Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 19 KB

Accessing a S3 bucket in one AWS Acount (Account-A) from a Lambda function in another AWS Account(Account-B), The stack is created using CloudFormation

Python 100.00%
aws-cloudformation aws-cloudwatch-logs aws-cross-account-s3-integration aws-kms aws-lambda-python aws-sns-subscriptions aws-sns-topic

0018-sunflower-cft's Introduction

Project Sunflower: Accessing a S3 bucket in one AWS Account (Account-A) from a Lambda function in another AWS Account(Account-B).

Description

This sample project demonstrate how to access an objects in a S3 bucket in one Account from another. A S3 Bucket is created in Account-A. A SNS Topic is setup for event notification once a file is uploaded to the bucket. A Lambda function is created in Account-B and created a subscription to the SNS Topic. Once a file is uploaded to the bucket, S3 event notification send an event to SNS Topic and the Lambda function is triggered. The Lambda, in Account-B reads the file from the S3 bucket using bucket policy and uses Python Pandas to render it as a dataframe and sends an an email using AWS SES.The entire stack is created AWS CloudFormation.

Project Sunflower - Design Diagram

Project Sunflower - Services Used

Dependencies

  • You need to have two AWS Accounts to implement this.
  • Create three Customer Managed KMS Keys in the regions where you want to create the stack. First two in Account-A and the third one in Account-B
  • Modify the KMS Key Policy to let the AWS Account (root) encrypt / decrypt using any resource using the created KMS Key. In the destination account KMS Key policy, grant permission to source account to use the key for S3 bucket.

Installing

Executing program

  • Upload the sample sample csv to the S3 bucket in Account-A
  • Within a few seconds (depending on the size) the csv file will be read using Python Pandas and an email will be sent to the reciepient address

Help

Post message in my blog (https://blog.subhamay.com)

Authors

Contributors names and contact info

Subhamay Bhattacharyya - [email protected]

Version History

  • 0.1
    • Initial Release

License

This project is licensed under Subhamay Bhattacharyya. All Rights Reserved.

Acknowledgments

Inspiration, code snippets, etc.

0018-sunflower-cft's People

Contributors

subhamay-cloudworks avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.