Coder Social home page Coder Social logo

jackobid / content-management-system-cms-workflow-using-aws-step-functions Goto Github PK

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

Update or import content data from CSV files stored in an S3 bucket into a content management system (CMS)

License: MIT License

content-management-system-cms-workflow-using-aws-step-functions's Introduction

Content-Management-System-CMS-Workflow-Using-AWS-Step-Functions

Update or import content data from CSV files stored in an S3 bucket into a content management system (CMS)

Objective: Update or import content data from CSV files stored in an S3 bucket into a content management system (CMS).

Prerequisites

  1. AWS Account: Please ensure you have an AWS account with the necessary permissions.
  2. AWS CLI: Installed and configured.
  3. Git: Installed.
  4. Terraform: Installed.
  5. Amazon S3 Bucket: Store the CSV files.
  6. DynamoDB Table: To store CMS metadata or other relevant information.

Workflow Steps

  1. Setup Infrastructure

    • Clone Repository:
      git clone https://github.com/aws-samples/step-functions-workflows-collection
      cd step-functions-workflows-collection/distributed-map-csv-iterator-tf
    • Initialize Terraform:
      terraform init
    • Apply Terraform Configuration:
      terraform apply
      • Confirm with yes.
  2. Upload CSV File to S3

    • Upload your CSV file to the designated S3 bucket.
  3. Modify State Machine

    • Update the state machine definition to process each content item and store metadata in DynamoDB.
    • Example State Machine Definition:
      {
        "Comment": "A description of my state machine",
        "StartAt": "ProcessCSV",
        "States": {
          "ProcessCSV": {
            "Type": "Map",
            "ItemProcessor": {
              "ProcessorConfig": {
                "Mode": "DISTRIBUTED",
                "ExecutionType": "CHILD"
              },
              "StartAt": "UpdateCMS",
              "States": {
                "UpdateCMS": {
                  "Type": "Task",
                  "Resource": "arn:aws:states:::dynamodb:putItem",
                  "Parameters": {
                    "TableName": "YOUR-DYNAMODB-TABLE",
                    "Item": {
                      "ContentID": {
                        "S.$": "States.ArrayGetItem($.Item, 0)"
                      },
                      "VideoTitle": {
                        "S.$": "States.ArrayGetItem($.Item, 1)"
                      },
                      "VideoPublishTime": {
                        "S.$": "States.ArrayGetItem($.Item, 2)"
                      },
                      "Views": {
                        "N.$": "States.ArrayGetItem($.Item, 3)"
                      }
                    }
                  },
                  "End": true
                }
              }
            },
            "End": true
          }
        }
      }
  4. Trigger State Machine

    • Start Execution:
      • Use the following input:
        {
          "BucketName": "YOUR-BUCKET-NAME",
          "FileKey": "PREFIX/metrics.csv"
        }
  5. Verify Data in DynamoDB

    • Go to the DynamoDB console and explore the table to verify the content metadata has been updated.
  6. Cleanup Resources

    • Destroy Resources:
      terraform destroy
      • Confirm with yes.

These detailed workflows provide a structured approach to implementing the Batch Data Import and Content Management Systems using AWS Step Functions and associated AWS services. Adjust the parameters and resource names according to your specific environment and requirements.

content-management-system-cms-workflow-using-aws-step-functions's People

Contributors

jackobid 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.