Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/aws: support custom endpoints for AWS EC2 ELB and IAM #4263

Closed
wants to merge 3 commits into from
Closed

provider/aws: support custom endpoints for AWS EC2 ELB and IAM #4263

wants to merge 3 commits into from

Conversation

turkenh
Copy link
Contributor

@turkenh turkenh commented Dec 11, 2015

Allows to specify AWS Endpoints for EC2, IAM and ELB directly from .tf file like:

provider "aws" {
    access_key = "xxx"
    secret_key = "xxx"
    ec2_endpoint = "<ec2_endpoint_url>"
    elb_endpoint = "<elb_endpoint_url>"
    iam_endpoint = "<iam_endpoint_url>"
    insecure = "true"
    region = "us-east-1"
}

It also allows to disable HTTPS certificate check which is necessary for corporate solutions.

Solves #416 and #3974

@ecunal
Copy link

ecunal commented Dec 14, 2015

👍

1 similar comment
@tugbabodrumlu
Copy link

👍

@kaskavalci
Copy link

👍

@onuryilmaz
Copy link

👍

@SchwarzM
Copy link

wow this would be nice

@radeksimko
Copy link
Member

Although I probably personally won't need this, I'm in favour of such feature, except I'd change the DSL.

Keeping all of these options in the 1st level doesn't look very scalable. Imagine how many endpoints this list may grow up to. I'd rather see something like this:

provider "aws" {
    access_key = "xxx"
    secret_key = "xxx"
    endpoints {
        ec2 = "<ec2_endpoint_url>"
        elb = "<elb_endpoint_url>"
        iam = "<iam_endpoint_url>"
    }
    insecure = "true"
    region = "us-east-1"
}

client.iamconn = iam.New(sess)

awsIamConfig := *awsConfig
awsIamConfig.Endpoint = aws.String(c.IamEndpoint)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really optional? If it was, I guess a condition would be necessary here and below for each endpoint?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do not set an endpoint, then, "c.IamEndpoint" is just an empty string here. And default value of config.Endpoint is also an empty string. So this is why I thought that there is no need for a condition here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you're right.
That's quite elegant solution then.

@turkenh
Copy link
Contributor Author

turkenh commented Dec 17, 2015

@radeksimko Regarding your above comment about the change in DSL, I can change my pull request like that. But currently there are two endpoint options already implemented, namely dynamodb_endpoint and kinesis_endpoint at the first level. So, I should also try to move them under "endpoints" block then, right?

@radeksimko
Copy link
Member

currently there are two endpoint options already implemented, namely dynamodb_endpoint and kinesis_endpoint at the first level

Good point!

@catsby was merging #3255 and #2825 - what do you think about the DSL currently used VS proposed?

@afritzler
Copy link

+1

Any idea when this pull request will make it into the official release?

@catsby
Copy link
Contributor

catsby commented Jan 22, 2016

Hey Friends –

Terribly sorry about the silence here. I agree with @radeksimko in that the top level will not be sustainable, and a block format like he suggested is preferable.

We'd need to enable backwards compatibility with the current top level ones, however, so we'd have to support both.

If you could refactor to have at least the components you're suppling to use the block format, I can worry about the backwards compatibility. Or, if you're feeling super generous, feel free to tackle it 😄

Thanks so much! I apologize again for the delay here. Let us know what you think

@catsby catsby added the waiting-response An issue/pull request is waiting for a response from the community label Jan 22, 2016
@turkenh
Copy link
Contributor Author

turkenh commented Feb 8, 2016

@catsby and @radeksimko, I moved the endpoints added with this PR under "Endpoints" block.
Did not touch previously added ones not to break something :)

catsby added a commit that referenced this pull request Feb 12, 2016
provider/aws: support custom endpoints for AWS EC2 ELB and IAM [GH-4263]
@catsby
Copy link
Contributor

catsby commented Feb 12, 2016

Hey Friends – I just merged #5114 which is this PR but rebased on master, so I'm closing this. Thanks for all the work!

@ghost
Copy link

ghost commented Apr 28, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement provider/aws waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants