Skip to content

Configuration Options

Ben Soer edited this page Feb 19, 2022 · 4 revisions

Summary

cdk-photo-archive has a number of settings that can be configured within it for deployments. Much of these options allow you to tweak the project to easily integrate with any existing AWS infrastructure you may be using already for your photo archiving.

Located in conf/configuration.ts is a method getConfiguration() which returns an IConfiguration object containing all of the configuration settings available for the cdk-photo-archive. Some options are required and others are optional. Optional parameters have default values if they are not supplied. Below is a breakdown of all the configuration options available

Setting Value Type Required Default Value
features Array<Features> YES N/A
deploymentRegion Region YES N/A
useExistingBuckets Array<string> NO undefined
bucketNamePrefix string NO pt
appendRegionToBucketName boolean NO true
switchToInfrequentAccessTierAfterDays number NO 90
switchToGlacierAccessTierAfterDays number NO 120
photoArchiveStackName string NO photo-archive-stack
photoArchiveSettingsStackName string NO photo-archive-settings-stack
photoArchiveBucketsStackName string NO photo-archive-bucket-stack
appendDeploymentRegionToStackNames boolean NO true
enableDynamoMetricsTable boolean NO false
enableLoggingOfArchiveBuckets boolean NO true
enableInventoryOfArchiveBuckets boolean NO true
applyTransitionsToMainBuckets boolean NO true

Breakdown

The following describes each of the configuration settings in detail of what they each do and examples of their usage

features

Type: Array<Features>
Description: Sets which feature lambdas are enabled. Setting is set by using the FeaturesEnum and putting values within the list.

Each Feature lambda provides a specific functionality which is run and analysed against every new file added to the archive buckets. By including the matching enum value within the features array, the feature will be run on every new file. Each feature lambda is as follows:

Name Features Enum Value Description
Hash Tag Lambda Features.HASH_TAG Tags each file with an MD5, SHA1, SHA256 and SHA512 hash of the file
Photo Meta Tag Lambda Features.PHOTO_META_TAG Tags each photo with Camera & Lense information, Photo Information (ISO, Aperture, Shutter Speed, etc) and the Image Date based on EXIF data within the photo. Only valid for JPEG, JPG, PNG and DNG files.
Photo Rekog Tag Lambda Features.PHOTO_REKOG_TAG Uses AWS Rekognition to add up to 10 labels describing the contents of the photo. Only valid for JPEG, JPG and PNG files.


Example:

features: [
    Features.HASH_TAG,
    Features.PHOTO_META_TAG,
    Features.PHOTO_REKOG_TAG
]

deploymentRegion

Type: Region enum
Description: Set which region to deploy the cdk-photo-archive to. Must be one of the values provided within the Region enum
Example:

deploymentRegion: Region.USEAST1

useExistingBuckets

Type: Array<string>
Description: Secify the ARNs of the buckets to import with the deployment of the cdk-photo-archive. If this is left empty or undefined, the stack will create its own buckets for archiving with
Example:

useExistingBuckets: [
    "arn:aws:s3:::examplebucket"
]

bucketNamePrefix

Type: string
Description: Specify a custom prefix for the photo archive bucket and logging bucket names. Leave undefined for default value. Default value is "pt"

appendRegionToBucketName

Type: boolean
Description: Whether or not to append the region name to the bucket name. Leave undefined for default value. Default value is true

switchToInfrequentAccessTierAfterDays

Type: number
Description: Specify how many days before swithcing bucket contents from Standard Tier to Infrequent Access Tier. Set to 0 to skip this teir. This parameter is only valid when useExistingBuckets parameter is undefined. Leave undefined for default value. Default value is 90 days

switchToGlacierAccessTierAfterDays

Type: number
Description: Specify how many days before swithcing bucket contents to Glacier Access Tier. This parameter is only valid when useExistingBuckets is undefined. Leave undefined for default value. Default value is 120 days

photoArchiveStackName

Type: string
Description: Specify the name of the photo archive stack name in CloudFormation. Leave blank to use default. Default name is "photo-archive-stack"

photoArchiveSettingsStackName

Type: string
Description: Specify the name of the photo archive settings stack name in CloudFormation. Leave blank to use default. Default name is "photo-archive-settings-stack"

photoArchiveBucketsStackName

Type: string
Description: Specify the name of the photo archive bucket stack name in CloudFormation. Leave blank to use default. Default name is "photo-archive-bucket-stack"

appendDeploymentRegionToStackNames

Type: boolean
Description: Specify whether stack names should have their deployment region appended to them. Leave blank to use default. Default value is true.

IF a custom stack name is provided and this option is TRUE, then the region will be appended to the custom name
IF the default stack name is used and this value is TRUE, then the region will be appended to the default name

enableDynamoMetricsTable

Type: boolean
Description: Enable/Disable the dynamo metrics table. This is a table that stores verboes detailed information about each photo processed by each fo the feature lambdas. Additional information in addition to what is tagged to the archived files, will be stored and can be queried from here. Leave undefined for default value. Default value is FALSE

enableLoggingOfArchiveBuckets

Type: boolean
Description: Enable/Disable S3 Bucket Logging on the Archive Buckets. This includes both created and imported buckets. IF true, will create a logging bucket which will have all actions done on the archive buckets logged to it. Leave undefined for default value. Default value is TRUE

enableInventoryOfArchiveBuckets

Type: boolean
Description: Enabled/Disable S3 Bucket Inventories on the Archive Buckets. this includes both created and imported buckets. IF true, will create a logging bucket which will have weekly inventories of all archive buckets stored in it. Leave undefined for default value. Default value is TRUE

applyTransitionsToMainBuckets

Type: boolean
Description: Enable transition settings to the S3 Archive Buckets. Set this value to false if you would like to apply your own transitions to your buckets. This may be useful if you are importing existing buckets and do not want their transition settings to be overriden or modified by the cdk-photo-archive. Leave undefined for defaul value. Default value is TRUE

IF set the false, switchToInfrequentAccessTierAfterDays and switchToGlacierAccessTierAfterDays will have no point. They can still be set, but ther value will not be applied to any buckets as transitions will not be applied

Post Deployment Configuration Options

cdk-photo-archive also deploys a number of settings to SSM Parameter Settings on AWS. These can be found under /pa section. Changes to these settings can be made to effect the system in real-time if need be, without having to re-deploy from the CDK. WARNING If possible, it is better to redeploy changes from the CDK. The settings available within SSM Parameter Store are as follows:

Path Description
/pa/features Contains a StringList of all available features that were deployed with cdk-photo-archive
/pa/features/<featurename>/enabled Setting value of TRUE or FALSE as to whether the given feature is enabled. When deploying this value is automatically set to TRUE. By changing it to FALSE, the given feature is disabled from future executions.