Kotaimen / awscfncli

Friendly AWS CloudFormation CLI
MIT License
59 stars 12 forks source link

Add Export Option #71

Open andyfase opened 5 years ago

andyfase commented 5 years ago

Hey There,

Come across this awesome CFN tooling just before I was able to start writing my own and I see a great amount of synergy. Having kicked the tires a little bit there are a couple of features I was thinking of that awscfncli does not support yet - hence looking to see if you would be open to some collaboration / PR's

First item would be the ability to package the output of all stacks into a single file for distribution externally to users that may not want or have to use cfn-cli. While the tooling is great, I (and I believe others) have a need to have the tool be "optional" hence have the ability to define configuration in cfn-cli but export it to native CloudFormation format which then could be re-used within deployment pipelines or run using native AWS CLI.

The idea being a command option

cfn-cli export - Packages and Exports a complete Stack stage for external distribution

Usage:

cfn-cli export dev

Functionality wise this would

If you are happy with this idea I would be happy to start working on the code changes to perform this and produce a PR.

Thanks!

Kotaimen commented 5 years ago

I think you are describing a command which is able to convert the "cfn-cli" stack parameter to the format which is compatible with awscli or CodePipeline CloudFormation stage, right?

How will this function work for mutilable stacks? We have the cross-stack reference functionality which a stack's input is depends on another's output.

GlieseRay commented 5 years ago

@andyfase That's a good point. @Kotaimen Maybe we can raise error when user who is using cross-statck reference wants to export config. We need to add proper tests to make this project open source ready for 3.0 release

andyfase commented 5 years ago

@Kotaimen correct this is exactly what i am describing.

Yeah the implementation of cross-stack references in cfn-cli wont work for exporting config. I agree at that point error'ing out would be the be the best option there.

Given there are multiple ways of achieving the same stack inter-dependency goal i.e Fn::ImportValue with Stack outputs and the use of ParameterStore (my favorite option) I personally would argue that supporting exporting config is worth pursuing with the caveat it wont work with the native cfn-cli cross-stack references. This can be managed through documentation and nice error messaging IMO.

So would you guys be happy for me to start working on this feature?

Kotaimen commented 5 years ago

Hi @andyfase, we will try to release this feature in 2.2 release.

@GlieseRay i have reduced scope of the release and our goal is release bug fix and several new commands in 2.2. note: drift command is already slipped into 2.1.4.

andyfase commented 5 years ago

Ok let me know if I can help? there are a couple of people I know who would be willing to contribute coding time to helping out as well. Theres also a couple of other minor improvements I may raise separate issues for too.

Thanks for being accommodating! hoping I can help out and get a few other minor things done with you guys

Kotaimen commented 5 years ago

hi @andyfase, that would be very nice! just create PR and we will merge them, thanks!