Closed jsboak closed 2 years ago
This may require #118 to complete successfully.
@qualman want to take a look again and make sure all looks good?
Looking now!
Uh oh, another error :( Looks like it does not like ALL_REGIONS
:
[2022-04-05T10:02:06,989] ERROR resources.ExceptionCatchingResourceModelSource - [ResourceModelSource: 3.source (aws-ec2), project: test]
java.lang.IllegalArgumentException: Endpoint does not contain a valid host name: https://ALL_REGIONS
at com.amazonaws.AmazonWebServiceClient.computeSignerByURI(AmazonWebServiceClient.java:426) ~[aws-java-sdk-core-1.11.743.jar:?]
at com.amazonaws.AmazonWebServiceClient.setEndpoint(AmazonWebServiceClient.java:318) ~[aws-java-sdk-core-1.11.743.jar:?]
at com.dtolabs.rundeck.plugin.resources.ec2.InstanceToNodeMapper.performQuery(InstanceToNodeMapper.java:126) ~[?:?]
at com.dtolabs.rundeck.plugin.resources.ec2.EC2ResourceModelSource.getNodes(EC2ResourceModelSource.java:258) ~[?:?]
at com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource.getNodes(ExceptionCatchingResourceModelSource.java:58) [rundeck-core-4.0.0-SNAPSHOT.jar:?]
Okay, mea culpa, I think I misread an error or something. I think it does in fact need to be getEndpoint().equals("ALL_REGIONS")
, and that's the error here. I am going to test that real quick
Okay, @jsboak, I pushed a change that fixes that, and I tested locally and all is well. I am going to wait for tests and then we're ready to go
This PR enables a single node-source to integrate (pull in EC2's) from multiple regions by specifying multiple Endpoints using a comma-separated list of EC2 "endpoints" or by specifying
ALL_REGIONS
.This is backwards compatible because the
Endpoint
field can still utilize a single entry.To properly test, make sure the plugin retrieves nodes when the
Endpoint
field contains:https://ec2.us-west-1.amazonaws.com
)https://ec2.us-west-1.amazonaws.com, https://ec2.us-east-1.amazonaws.com,https://ec2.us-west-2.amazonaws.com
ALL_REGIONS
-> This will search for (and pull in) instances from all regions that the Credentials (or IAM Role) have access to.Endpoint
field are misspelled.Multiple Endpoints:
_ALLREGIONS
Failure Message