Skip to content
Ben Soer edited this page Feb 19, 2022 · 6 revisions

Welcome to the cdk-photo-archive wiki!

Features Details

Tiered Storage

cdk-photo-archive's bucket is configured with tiered storage to reduce costs for your archived files. It is done in a scheduled manner though so that more recently uploaded files can still be accessed with minimal detriment. The tiering is configured in a way to slowly reduce storage cost, but at the expense of more expensive and difficult retrieval. This allows photographers to still retrieve files if shortly after uploading find they still need the photos.

cdk-photo-archive takes advantage of 3 AWS S3 Storage tiers: Standard, Infrequent Access (Standard-IA), and Glacier (Flexible Retrieval). You can find more details of this from AWS here: https://aws.amazon.com/s3/storage-classes/

By default, cdk-photo-archive will transition archived files from Standard tier to Infrequent Access tier after 90 days. Then, after 120 days will transition archived files to Glacier (Flexible Retrieval). cdk-photo-archive currently does not have implemented support for Glacier Deep Archive. These transition days can be changed within the conf/configuration.ts file. switchToInfrequentAccessAfterDays and switchToGlacierAccessAfterDays settings configures these transition day values. Applying these changes will require a deployment of the cdk.

An example of these settings may look like this:

switchToInfrequentAccessAfterDays: 90,
switchToGlacierAccessAfterDays: 120

Bring Your Own Bucket (BYOB)

cdk-photo-archive supports Bring-Your-Own-Bucket. This way you can configure and control your existing archive buckets as you wish, but still take advantage of the cdk-photo-archive's feature lambdas. Configuration of this is done by setting the useExistingBuckets parameter in the conf/configuration.ts file. By default this value is undefined. Once it is defined, the cdk-photo-archive will no longer manage or create any buckets for the archive. Any features related to archive storage including tiering and naming will be ineffective.

useExistingBuckets setting takes an array of strings. Where the strings are the full ARN values of the existing buckets you want cdk-photo-archive to use. An example of this configuration may look as follows:

useExistingBuckets: [
    "arn:aws:s3:::pt-photo-archive",
    "arn:aws:s3:::my-other-archive"
]

Note: If at a later time, you want to revert this, remove the setting from conf/configuration.ts, set the value to undefined or leave it as an empty array

Note: If you have already deploy the cdk-photo-archive and it has created the buckets for you. You will need to first fully destroy the stack with cdk destroy --all before configuring BYOB and redeploying.

Tip: cdk-photo-archive will create the archive bucket for you if you do not supply one. In the event you need to entirely delete the cdk-photo-archive stack. The archive bucket will not be deleted. When restoring the stack though, the CDK will error that the bucket it wishes to create already exists. You can work around this issue by then copying the ARN of the bucket created previously from the CDK and treating it like BYOB.

Architecture

cdk-photo-archive-architecture-diagram

Clone this wiki locally