awscfncli icon indicating copy to clipboard operation
awscfncli copied to clipboard

Add Export Option

Open andyfase opened this issue 6 years ago • 6 comments

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

  • Perform any Automatic Packaging, upload resources to S3 and alter templates etc
  • Produce complete set of CloudFormation JSON parameter files
  • Produce ZIP file container templates and JSON parameter files

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!

andyfase avatar Feb 22 '19 18:02 andyfase

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.

Kotaimen avatar Feb 23 '19 02:02 Kotaimen

@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

GlieseRay avatar Feb 23 '19 16:02 GlieseRay

@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?

andyfase avatar Feb 23 '19 18:02 andyfase

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.

Kotaimen avatar Feb 24 '19 02:02 Kotaimen

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

andyfase avatar Feb 24 '19 03:02 andyfase

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

Kotaimen avatar Feb 26 '19 00:02 Kotaimen