theonestack / cfhighlander

Cloudformation DSL and component library
MIT License
25 stars 23 forks source link

Support for building a Container Images and pushing to ECR for use with Lambda or ECS #171

Open aaronwalker opened 3 years ago

aaronwalker commented 3 years ago

This feature is kinda similar to LambdaFunctions in that it allows custom code to be package and deployed with the generated cloudformation but with support for building and publishing container images.

Use Case: Creating more application specific components and services. For example a component for deploying a running ProxySQL Rather than relying on public container images have the component include all the dependencies (Dockerfile, config etc)

Add a new operation to the highlander dsl to build and publish a container image

Something like

ContainerImage image_name: proxysql, dockerfile: 'Dockerfile', ecr_repo: '1234567890.dkr.ecr.eu-central-1.amazonaws.com'

During the compile stage highlander would run a docker build and docker push to ecr and would create the ecr repo if it didn't exist with options for setting the permissions for the ecr_repo

aaronwalker commented 3 years ago

@Guslington @Samseppiol @toshke thoughts?

toshke commented 3 years ago

I like the feature and it will move the tool into more hybrid category where it's not necessary used only for infrastructure code, but also for deployment of other related artifacts - which already do with S3 publish function to extent.

Looking at CDK this feature seems to be supported as well as in Pulumi

Kinda goes against "single tool for single job" unix philosophy, but that's probably just my ocd speaking more than anything.

Also, in definition you would probably want args: and context: keyword parameters.