Giter Club home page Giter Club logo

0086-daylily-tf's Introduction

Project Daylily: A Setp Function Demo - Transfer Data Records (Lambda, DynamoDB, Amazon SQS)

This is a simple demo of an AWS Step function using Lambda, DynamoDB, SQS Queue to show looping within a workflow.

Description

This is a demo of a step function to loop through a list of items. In the first state a Lambda function inserts some quotes (with is passed as an input) to the DynamoDB table and returns a list of patrtition keys. The state machine then loops through the list and in each iteration fetches the quote from the DynamoDB table and pushes it to a SQS Queue.

The entire stack is created using HashiCorp Terraform. Only for higher environment (test/prod) the SNS Topic will be encrypted using Customer Managed KMS Key.

Project Daylily - Design Diagram

Project Daylily - Services Used

Project Daylily - Workflow

Installing

  • Clone the repository.
  • Create a S3 bucket to store the terraform state file.
  • Create the folder - 0069-daylily/
  • Create a KMS Key for higher environment (test/prod) in the region where you want to deply the stack.
  • Create the terraform.tfvars file with the appropriate variable values, a sample of it provided below:
        ## ---------------------------------------------------------------------------------------------------------------------
        ## Variable Values - Project Daylily
        ## Modification History:
        ##   - 1.0.0    Jun 3,2023   -- Initial Version
        ## ---------------------------------------------------------------------------------------------------------------------
    
        ######################################## Project Name ##############################################
        project_name = "daylily"
        ######################################## Environment Name ##########################################
        environment_name = "devl"
        ######################################## KMS Key ###################################################
        kms_key_alias = "alias/SB-KMS"
        kms_key_arn = {
        "us-east-1" = "arn:aws:kms:us-east-1:807724355529:key/e4c733c5-9fbe-4a90-bda1-6f0362bc9xxx"
        "us-east-2" = "arn:aws:kms:us-east-2:807724355529:key/dfc9fe4a-7021-4eb8-a8e9-520a2f91fyyy"
        "us-west-2" = "arn:aws:kms:us-west-2:807724355529:key/2e99fc66-0257-4f12-841e-38dcddb71zzz"
        }
        ######################################## SNS Topic #################################################
        sns_topic_base_name    = "sns-topic"
        sns_topic_display_name = "Daylily SNS Topic used in the step function using SNS and Wait state."
        ######################################## SNS Topic Subscription ####################################
        sns_subscription_email = ["[email protected]", "[email protected]"]
        ######################################## Step Function IAM Role ####################################
        sf_iam_role_name   = "step-function-role"
        sf_iam_policy_name = "step-function-policy"
    
  • Modify the 01-provider.tf and change the S3 bucket to store the state region where you want to deploy the stack
  • Run the following terraform commands from the projec directory:
    • terraform init
    • terraform validate
    • terraform plan
    • terraform apply -auto-approve
  • To delete the stack run the following command:
    • terraform destroy -auto-approve

Executing program

  • Go to the Step Function Console and use the sample input and start the execution
  • Step-by-step bullets

Help

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

Authors

Contributors names and contact info

Subhamay Bhattacharyya - [email protected]

Reference

https://docs.aws.amazon.com/step-functions/latest/dg/sample-project-transfer-data-sqs.html

Version History

  • 0.1
    • Initial Release

License

None

Acknowledgments

AWS

0086-daylily-tf'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.