aws-lambda-image
aws-lambda-image copied to clipboard
Sample CloudFormation
I added a CloudFormation directory with a README and 3 templates needed to spin up a CF stack with the image-resizer working. The three templates are applied sequentially to the same stack, to handle some CF dependency issues. End state is a pair of buckets, one with code and logs, one with images, both raw and resized
@amacks Thank you for your PR. This seems useful for CF users, but those templates cannot change easily themselves. So in order to add this feature, I want to consider about following things:
- Configuration is loose coupling from our project stack. so it would be better to external project
- If we bundle those, we gonna have to create generator like
npm run cloudfrontand generate your templates automatically byconfig.jsonandnpm-config.
Do you have any idea for above things?
If have a time, plz review this @kdybicz
From logical and technical point of view this approach seems to be more than valid. But I totally agree with both points @ysugimoto presented. If we would want to merge this feature I think it would be nice to try to hide the CF magic behind some generator, to don't discourage less experienced users.
Agreed, it's not easy to make CF a turnkey solution. I thought of this more as a "here's a way known to work, modify as needed" rather that a complete stack for all needs.
I don't have any experience with CF Template generation/regeneration, so I'm not sure I'd be able to create any sort of template generator. There would have to be a lot of config variables on that
One code change to the main app that would make this easier would be if the bucket name for the app could be specified as a lambda environment variable. Then the bucket names could be entirely controlled from the CF stack.
@amacks you can actually do this all in one template there is a rather helpful amazon FAQ on the subject here https://aws.amazon.com/premiumsupport/knowledge-center/unable-validate-circular-dependency-cloudformation/
@amacks this can totally be done end to end with a single template today. CustomResources would help. I'm debating on forking this and modifying this build system to at least better support multi-environment deployments (different config files), and parameter passing, like which aws credential profile you want to be used. I have development/production deployments in different regions and it's much too dangerous to use as is. The CF turnkey is ideal, it's just a lot of work, but at least you got basics out of the way.