GithubHelp home page GithubHelp logo

bensoer / cdk-photo-archive Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 278 KB

CDK based AWS Infrastructure for Photo Archiving

JavaScript 3.26% TypeScript 63.57% Python 33.18%
archiving aws cdk photography s3

cdk-photo-archive's Introduction

๐Ÿ‘‹ Hi, Iโ€™m @bensoer . A DevOps Engineer, Photographer, Outdoor enthusiast, and part-time philosopher. I love building things that help make these things in my world easier and more fun!

๐Ÿ‘€ Currently I'm exploring AWS Technologies, specifically the AWS CDK, TypeScript, Custom Resources and a bunch in between. I love automating things

๐ŸŒฑ Iโ€™m currently learning AWS Certifications, a bit of Terraform, TypeScript and the AWS CDK

๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on meaningful projects to make our real-world lives easier, as well improve functionality of existing toolings and frameworks that make our development processes smoother

cdk-photo-archive's People

Contributors

bensoer avatar dependabot[bot] avatar

Watchers

 avatar  avatar

cdk-photo-archive's Issues

Add CfnParameters and passing parameters to NestedStacks

Background
Currently all settings and configuration is done in CDK code. This means its done at synthesis, producing no parameter values for the generated CloudFormation code.

Problem
In order to integrate with the AWS Marketplace or increase further integrations in more ways. Settings at synthesis is not enough

Resolution
Implement CfnParameters at the root cdk-photo-archive stack. To work with the existing parameters set at synthesis time, make the default values for all CfnParameters to that of the configured values.

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnParameter.html
https://bobbyhadz.com/blog/aws-cdk-parameters-example

Implementing this may also require different handling of conditional logic which now needs to be pushed to at runtime rather then syntehsis time: https://loige.co/create-resources-conditionally-with-cdk/

Configure also NestedStack parameters to pass around the needed parameters from there too: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.NestedStack.html#parameters

Tiering Storage Configuration Improvements

Background
Currently storage uses 3 tiers, Standard, Infrequent Access and Glacier. This is all set using the switchToWhateverTierAfterDays parameters.

Tiering is also assumed to be from most expensive to cheapest: Standard > Infrequent Access > Glacier . This functionality is assumed when viewing the settings

Problem
When switchToWhateverTierAfterDays is set to 0. The behavior is that the entry is not added to the lifecycle. This works if you want to skip InfrequentAccess and go straight to Glacier after X number of days. But if both settings are 0. Then everything will stay in Standard Tier. This is confusing and does not reflect intuitively to the expected functionality

Code Sample of the current functionality

if(switchToInfrequentAccessTierAfterDays !== undefined 
    && switchToInfrequentAccessTierAfterDays > 0){

    transitions.push(
        {
            storageClass: s3.StorageClass.INFREQUENT_ACCESS,
            transitionAfter: Duration.days(switchToInfrequentAccessTierAfterDays)
        }
    )
}else if(switchToInfrequentAccessTierAfterDays === undefined){
    transitions.push(
        {
            storageClass: s3.StorageClass.INFREQUENT_ACCESS,
            transitionAfter: defaultInfrequentAccessTransitionDuration
        }
    )
}

Resolution
Having 0 days should mean that it is then immediatly sent to the next storage tier. If all parameters have 0 days, then everything should be going straight to Glacier storage.

IF switchToInfrequentAccessTierAfterDays is 0. Then any upload should immediatly go into InfrequentAccess
IF switchToGlacierAccessTierAfterDays is 0. Then any upload should immediatly go into Glacier

IF switchToInfrequentAccessTierAfterDays is 0 AND switchToGlacierAccessTierAfterDays is 0. Then any upload should immediatly go info Glacier

Setup Lambda Versions

Background
cdk-photo-archive uses a number of lambdas for processing things. When updating these lambdas though, can cause wierd or unwanted states on the end user

Problem
Sometimes lambdas are in wierd states where they can't be fully deleted or the user needs to fully uninstall the cdk-photo-archive just to upgrade. This is not ideal

Solution
Implement blue/green deploys and use AWS Lambda Versions from the CDK and Cloudformation to deploy updates to lambdas within the cdk-photo-archive. Most importantly is the feature lambdas should be having this treatement on updates. Second place is the other processing and queueing lambdas

Create an API Endpoint for Accessing DynamoDB Records

Background
DynamoDB records can be enabled with a setting within the cdk-phot-archive. But they now can't be accessed in any meaningful way other then the AWS UI

Problem
DynamoDB records can be enabled with a setting within the cdk-phot-archive. But they now can't be accessed in any meaningful way other then the AWS UI

Solution
Create an API Gateway with it to access the information. Add also a setting to true/false enable/disable this featue

Create a Reactjs App to view dynamoDB table information

Background
A prerequisiste to this is the completion of #7

Problem
Now access this API information in a user friendly way. Not all users will be technical.

Solution
Create a Reactjs app that queries the API for the dynamoDB statistical information.

Some additional features that would be good in this UI:

  • Authentication handled with AWS Cognito ?
  • Access also the S3 data so that information can be cross referenced as to what has metric information and what does not. Essentially this UI functions like an S3 browser, just focused on photo buckets and artifacts

Switch Processing Lambdas over to Step Functions

Background
Current implementation has a number of lambdas calling eachother and passing data between eachother in a static format.

Problem
This can be massively simplified in code and CDK by using Step Functions

Solution
Use step functions for image processing from event all the way to feature handling

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.