Terraform: Generic EC2 provider

Created on 19 Nov 2015  ·  11Comments  ·  Source: hashicorp/terraform

Hi.

We have a private cloud solution deployed on our own hardware (https://qstack.com/) which provides an EC2 compatable RESTful API (not fully compatable with AWS but the main functions such as instance creation etc are implemented).

I know that there is the AWS provider but with other tools (such as chef-provisioning) the problem with those seems to be that there is no support for specifying a custom endpoint URL. From what I've read about the AWS provider for Terraform, this seems to be the case as well.

So my question is, is there any "generic EC2" provider (based on fog for example)? Or is there any way to specify a custom endpoint URL in the AWS provider?

provideaws question

Most helpful comment

@catsby I just realized, that the region validation is hardcoded in the aws provider config.go file. Just wondering: wouldn't it make sense to skip the validation if I am using a custom EC2/EBS endpoint?

https://github.com/hashicorp/terraform/blob/master/builtin/providers/aws/config.go#L299-L310

All 11 comments

Go's _net/http_ library supports HTTP_PROXY and HTTPS_PROXY environment variables. I've used this to troubleshoot provider API requests before. You could potentially use this to redirect the requests?

$ HTTP_PROXY=localhost:8888 terraform apply

weeeeell... using a proxy to redirect the requests is way too much of a hack for us. I think what I need is a dedicated EC2 provider that's independent of AWS (apart from it using the EC2 API of course). I guess no such thing exists and it probably isn't planned either.

Looking into a similary usecase here. What I found in the aws-sdk-go (used by terraform) is the following:
https://github.com/aws/aws-sdk-go/blob/master/aws/config.go#L32
So the endpoint can be changed in the aws-sdk.

I guess we could expose the base endpoint as part of the aws provider - this could potentially allow us to support Eucalyptus as well as custom APIs (assuming the claims of EC2 compatibility are actually met). @catsby, any opinions here?

+1
We have partially AWS-compatible in our corporate environment with our own region definitions. We need to set an endpoint for our cloud solution as well as including new region endpoints. As initial ideas:

  • Moving endpoint and region syntaxes (or paths) into configuration files.
  • Making builtin AWS Provider extendible so that plugins for AWS-Compatible cloud solutions can be developed easily.

+1
Agree on this, having an easy way to set custom endpoint would be perfect.

+1

Btw. in this context:
It would also be greate if you could use custom regions in the aws provider. Not sure if that will be an issue atm.

Hey friends – I've merged #4263 which allows you to set a custom endpoint for ELB, EC2 and such, so I'm going to close this. Let us know if you need anything else.

@catsby I just realized, that the region validation is hardcoded in the aws provider config.go file. Just wondering: wouldn't it make sense to skip the validation if I am using a custom EC2/EBS endpoint?

https://github.com/hashicorp/terraform/blob/master/builtin/providers/aws/config.go#L299-L310

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings