This is a static site generator plugin for the AWS Git-backed static website stack. This plugin performs the identity function. That is, it copies its input to its output without any transformation.
This plugin takes the form of an AWS Lambda function that is deployed in a ZIP file in an S3 bucket. When the static website stack is created with CloudFormation, the site generator AWS Lambda function parameters are pointed to the ZIP file in the S3 bucket, causing the AWS Lambda function to be created and run in the new stack.
When the stack is running and the CodeCommit Git repository contents are updated, CodePipeline automatically invokes this AWS Lambda function, providing it a ZIP file of the CodeCommit Git branch contents. This function turns that site source into the static web site contents, and passes back a ZIP file. The stack then syncs that content to the S3 bucket that serves the static website.
This identity function plugin is the least interesting of the static site generator plugins as it performs no modifications to the source content, but simply copies it straight through to the site content.
This identity function plugin is still useful in a couple ways:
-
If your Git repository content is exactly what you want to show on your static website, then use this identity plugin to effect no change.
-
If you want to create a new static website generator plugin for this static website stack, you might consider starting with this source code and enhancing it to peform the transformation you desire. Then specify that new AWS Lambda function as the generator plugin when creating a new stack.
When passing parameters to the AWS Git-backed static website CloudFormation template, specify:
-
GeneratorLambdaFunctionS3Bucket - The S3 bucket containing this AWS Lambda function ZIP file. E.g., "run.alestic.com"
-
GeneratorLambdaFunctionS3Key - The S3 key containing this AWS Lambda function ZIP file. E.g., "lambda/aws-lambda-site-generator-identity.zip"
-
GeneratorLambdaFunctionRuntime - "python2.7"
-
GeneratorLambdaFunctionHandler - "index.handler"
-
GeneratorLambdaFunctionUserParameters - "unused"