rundeck-plugins / rundeck-ec2-nodes-plugin

Get resource node data from Amazon EC2
86 stars 45 forks source link

Endpoint config being ignored #50

Closed csgyuricza closed 8 years ago

csgyuricza commented 8 years ago

I have Rundeck 2.6.4-1 and installed the ec2 plugin v 1.5.2. I added this to the project configuration:

resources.source.1.endpoint=us-west-2
resources.source.1.type=aws-ec2

But in the nodes section, it continues to list all my nodes from the us-east-1 region, basically ignoring the us-west-2 specification in the config. Already restarted the rundeck process but that didn't help.

I see no errors in the logs.

Any ideas what could be wrong?

csgyuricza commented 8 years ago

By the way, I also tried resources.source.1.config.endpoint=us-west-2 but in that case it generates exceptions in the logs:

2016-06-06 23:30:07,311 [qtp193837291-33] ERROR com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource - [ResourceModelSource: 1.aws-ec2 (AWS EC2 Resources), project: PowerReviews] 
com.amazonaws.AmazonClientException: Unable to execute HTTP request: us-west-2
    at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:452)
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:292)
...
csgyuricza commented 8 years ago

I figured it out... the endpoint config requires the actual URL of the AWS endpoint not the region as per the ec2-nodes-plugin documenation. I'll do a PR to fix this, but basically the documentation says:

endpoint - the AWS region endpoint to use, or blank for the us-east-1

when it should say something like

endpoint - the FQDN of the AWS endpoint for the desired region (see http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region)

csgyuricza commented 8 years ago

An even nicer solution would be to change the endpoint config to region so we can specify the region rather than the FQDN endpoint.