terraform-provider-docker icon indicating copy to clipboard operation
terraform-provider-docker copied to clipboard

Proposal: Container file upload and docker host behind bastion

Open mf-sky opened this issue 4 years ago • 9 comments

Hi team.

I have the following feature proposal:

Resource Docker Container

  • Currently i can only upload a single file per upload directive. So when i upload multiple files it renders the tf file unreadable. Allow upload of directory would be a major upgrade.

Provider

  • The host directive allows an ssh connection to the host. My host is behind a bastion and i can reach it if i have a config file for ssh and reference that connection on the host directive. The dependecy of this config should be removed and passed to the provider if it had a forward/connection option like, for example, the provisioner file has.

Thanks for your time!

mf-sky avatar Dec 03 '20 13:12 mf-sky

Hi Manuel,

sure thing. Thanks for the proposal.

Allow upload of directory would be a major upgrade.

Sounds reasonable

My host is behind a bastion and i can reach it if i have a config file for ssh and reference that connection on the host directive.

Do you mean that the machine the docker host is on, is reachable only via a bastion host? If so I already played around with something like this in the past: https://github.com/hashicorp/terraform-provider-docker/tree/feat/bastion-host-new-dclient

mavogel avatar Dec 23 '20 09:12 mavogel

Hi Manuel :)

My host is behind a bastion and i can reach it if i have a config file for ssh and reference that connection on the host directive.

Do you mean that the machine the docker host is on, is reachable only via a bastion host? If so I already played around with something like this in the past: https://github.com/hashicorp/terraform-provider-docker/tree/feat/bastion-host-new-dclient

Exactly this! But it's not available officially, is it?

Thanks for the feedback!

mf-sky avatar Dec 28 '20 10:12 mf-sky

Not yet. There is no plan how to use a terraform provider's endpoint with a jump host in between. But we can implement it here to make a POC. Let me finish #102 and the current milestone, then we can revisit this.

mavogel avatar Dec 28 '20 16:12 mavogel

Awesome! Thanks @mavogel

mf-sky avatar Dec 28 '20 16:12 mf-sky

You should also consider how this plays in with resource provisioners. Uploading multiple files can also be done with a dynamic "upload" and a list of files created elsewhere.

innovate-invent avatar Dec 28 '20 18:12 innovate-invent

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. If you don't want this issue to be closed, please set the label pinned.

github-actions[bot] avatar Mar 29 '21 10:03 github-actions[bot]

It seems that i cant ghet this one to pinned. Regarding innovate-invent comment, i don't want to maintain a list of files to upload. I simply want to put X files in there and let the provider copy them transparently

mf-sky avatar Mar 29 '21 14:03 mf-sky

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. If you don't want this issue to be closed, please set the label pinned.

github-actions[bot] avatar May 29 '21 10:05 github-actions[bot]

It seems that i cant ghet this one to pinned. Regarding innovate-invent comment, i don't want to maintain a list of files to upload. I simply want to put X files in there and let the provider copy them transparently

I didn't necessarily mean that you would manually maintain a list, I meant that the list could be generated elsewhere. See https://www.terraform.io/docs/language/functions/fileset.html

innovate-invent avatar May 29 '21 21:05 innovate-invent