Git Product home page Git Product logo

Comments (9)

corvint avatar corvint commented on September 20, 2024 5

From #101, the proposal:

provider "docker" {
  host = "ssh://user@remote-host:22"
  private_key = file(var.my_key_path)
}

I believe it is possible to use terraform builtins for the connection as the null_resource provider allows for a connection.private_key field. There may be other providers that use this pattern, but this is the only example I have offhand.

from terraform-provider-docker.

mavogel avatar mavogel commented on September 20, 2024 1

Let's see if we make that with #119

from terraform-provider-docker.

mavogel avatar mavogel commented on September 20, 2024 1

feel free to file a PR :) unfortunately we're busy with the refactorings and release this feature as well then

from terraform-provider-docker.

rgb000 avatar rgb000 commented on September 20, 2024

Hello.
Same issue here. Please add possibility to add private key, passphrase.

from terraform-provider-docker.

BenNewsome avatar BenNewsome commented on September 20, 2024

Looks like something about this line needs updating.

// If there is no cert information, then check for ssh://

The updated function to enable this appears to have been made here:
https://github.com/docker/cli/blob/d26bdfd4ea235a4e94c5fc907215b197280f80c0/cli/connhelper/connhelper.go#L33

from terraform-provider-docker.

aleon1220 avatar aleon1220 commented on September 20, 2024

too much effort to try making it work. The Docker provider needs more work. Refer to #80

In my case i was trying to make it work from terraform cloud. It was a pain. Refer to https://discuss.hashicorp.com/t/docker-provider-in-terraform-cloud-error-failed-to-query-available-provider-packages/21148

I will use a combination of

  1. user_data.tpl in my terraform cloud workspace that installs latest docker-compose version up to now 2021-02-22
COMPOSE_VERSION="1.28.4"
sudo curl -L "https://github.com/docker/compose/releases/download/$COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
  1. a docker-compose file embedded in a terraform string variable. See https://gist.github.com/jamesmishra/18ee5d7d053db9958d0e4ccbb37f8e1d

  2. finally pray that all of this works and I can restore a PostgreSQL dump from 9.3.3 to RDS PostgreSQL 9.6

from terraform-provider-docker.

github-actions avatar github-actions commented on September 20, 2024

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.

from terraform-provider-docker.

aleon1220 avatar aleon1220 commented on September 20, 2024

how could we work together to implement this?

from terraform-provider-docker.

AndreiPashkin avatar AndreiPashkin commented on September 20, 2024

@corvint

I believe it is possible to use terraform builtins for the connection as the null_resource provider allows for a connection.private_key field. There may be other providers that use this pattern, but this is the only example I have offhand.

As far as my knowledge of Terraform goes the connection directive is only for provisioners, not for resources:
https://www.terraform.io/docs/language/resources/provisioners/connection.html

Another reference:
https://github.com/hashicorp/terraform-plugin-sdk/blob/112e2164c381d80e8ada3170dac9a8a5db01079a/terraform/state.go#L1592

Look at the comment: "ConnInfo is used for the providers to export information which is used to connect to the resource for provisioning".

So it's not a pattern for providers, it's a built-in directive for provisioners.

from terraform-provider-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.