Private Bitbucket Repo as Module Source

3,677 views
Skip to first unread message

Kyle Anderson

unread,
Jan 17, 2017, 1:26:23 PM1/17/17
to Terraform
I'm having a hard time using a private Bitbucket Repo as a Module Source.  I've tried a variety of different syntax's to no avail.  For example:

module "vpc" {
  source = "g...@bitbucket.org:org-name/terraform-modules.git//vpc"
}

All of these fail with different errors that aren't specific enough to help me address the problem.  I'm able to use git via ssh from my local machine without issue.

Has anyone here set up a private Bitbucket Repo as a Module Source and can share the specific syntax that they used?

Thank You!

Lowe Schmidt

unread,
Jan 17, 2017, 2:32:04 PM1/17/17
to terrafo...@googlegroups.com
You can use the git https variant for source. 
Something like 

module "mymodule" {
}

That what I use for our internal GH Enterprise installation at least.

--
Lowe Schmidt | +46 723 867 157

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/f7e5ecb3-a3ab-4698-9274-0cd275207b64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Kyle Anderson

unread,
Jan 17, 2017, 4:46:32 PM1/17/17
to Terraform
Excellent!  That did the trick.

Thanks Lowe.


On Tuesday, January 17, 2017 at 11:32:04 AM UTC-8, Lowe Schmidt wrote:
You can use the git https variant for source. 
Something like 

module "mymodule" {
}

That what I use for our internal GH Enterprise installation at least.

--
Lowe Schmidt | +46 723 867 157

On 17 January 2017 at 19:26, Kyle Anderson <kander...@gmail.com> wrote:
I'm having a hard time using a private Bitbucket Repo as a Module Source.  I've tried a variety of different syntax's to no avail.  For example:

module "vpc" {
  source = "g...@bitbucket.org:org-name/terraform-modules.git//vpc"
}

All of these fail with different errors that aren't specific enough to help me address the problem.  I'm able to use git via ssh from my local machine without issue.

Has anyone here set up a private Bitbucket Repo as a Module Source and can share the specific syntax that they used?

Thank You!

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.

mohamed amine ferhi

unread,
Mar 30, 2017, 7:24:42 AM3/30/17
to Terraform
What if it is a private repo ?
Is there a way to use a sort of token or OAuth via https ?

Thanks in advance.


Le mardi 17 janvier 2017 20:32:04 UTC+1, Lowe Schmidt a écrit :
You can use the git https variant for source. 
Something like 

module "mymodule" {
}

That what I use for our internal GH Enterprise installation at least.

--
Lowe Schmidt | +46 723 867 157

On 17 January 2017 at 19:26, Kyle Anderson <kander...@gmail.com> wrote:
I'm having a hard time using a private Bitbucket Repo as a Module Source.  I've tried a variety of different syntax's to no avail.  For example:

module "vpc" {
  source = "g...@bitbucket.org:org-name/terraform-modules.git//vpc"
}

All of these fail with different errors that aren't specific enough to help me address the problem.  I'm able to use git via ssh from my local machine without issue.

Has anyone here set up a private Bitbucket Repo as a Module Source and can share the specific syntax that they used?

Thank You!

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.

Lowe Schmidt

unread,
Mar 30, 2017, 8:43:41 AM3/30/17
to terrafo...@googlegroups.com

On 30 March 2017 at 13:24, mohamed amine ferhi <ferhi.m...@gmail.com> wrote:
What if it is a private repo ?

If you can clone the repo from the terminal, you should be able to use it as a source in terraform. 

isaac.c....@gmail.com

unread,
May 1, 2018, 10:36:15 AM5/1/18
to Terraform
Just to add in as there was a question about private Bitbucket use and I ran into this issue you can configure via:

# Configure the Bitbucket Provider
provider "bitbucket" {
 
username = "GobBluthe"
 
password = "idoillusions" # you can also use app passwords
}

resource "bitbucket_repository" "illusions" {
 
owner      = "theleagueofmagicians"
 
name       = "illusions"
 
scm        = "hg"
 
is_private = true
}

https://www.terraform.io/docs/providers/bitbucket/index.html

You will of course want put your creds into variables and/or create App Specific passwords for use. 
Reply all
Reply to author
Forward
0 new messages