terraform-cdk icon indicating copy to clipboard operation
terraform-cdk copied to clipboard

feat(cli): support --template urls with file:// protocol

Open icholy opened this issue 1 year ago • 4 comments

Related issue

Fixes #3656

Description

Update the --template flag to support file:// URIs for using local template files.

Example

cdktf init --template file://../my-template.zip

Checklist

  • [x] I have updated the PR title to match CDKTF's style guide
  • [x] I have run the linter on my code locally
  • [x] I have performed a self-review of my code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation if applicable
  • [x] My changes generate no new warnings
  • [ ] I have added tests that prove my fix is effective or that my feature works if applicable
  • [x] New and existing unit tests pass locally with my changes

icholy avatar Jun 20 '24 16:06 icholy

CLA assistant check
All committers have signed the CLA.

hashicorp-cla-app[bot] avatar Jun 20 '24 16:06 hashicorp-cla-app[bot]

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

hashicorp-cla-app[bot] avatar Jun 20 '24 16:06 hashicorp-cla-app[bot]

Hi there! 👋 We haven't heard from you in 60 days and would like to know if you're still working on this or need help. If we don't hear from you before then, I'll auto-close this PR in 30 days.

github-actions[bot] avatar Aug 20 '24 02:08 github-actions[bot]

Still waiting for comment.

icholy avatar Aug 20 '24 14:08 icholy

After some real-life experience with this, what I actually want to do is point it at a template directory. Having the template as a zip committed to the repo is pretty clunky. Also, the way I'm using the file:// scheme is not correct. file:// URIs do not support relative paths.

In light of this, I would like to change the design to work like this:

  • If the template string is an exact match to a built-in template, use that.
  • If the template string starts with http(s):// download the zip.
  • Otherwise treat it like a local directory.

icholy avatar Oct 20 '24 14:10 icholy

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Nov 21 '24 01:11 github-actions[bot]