Hi, Please use
template.getOptions() .as(AWSEC2TemplateOptions.class) .securityGroups(..) template.getOptions().as(AWSEC2TemplateOptions.class) .keyPair(..) where template is Template template = templateBuilder.build(); Hope this helps! On Wed, Jul 10, 2013 at 2:09 AM, Mauricio Alarcon <mauricio...@gmail.com>wrote: > Hello everybody, > > I'm very new to jclouds, I'm using 1.6.0 I've found couple of rocks on my > path trying to use it with ec2 while overriding the security-groups and > keypairs. > > What I'm trying to accomplish is use my already created security-group and > keyPair but I haven't been successful. Found this old thread > https://groups.google.com/d/msg/jclouds/ZXwxW5qCNYg/z92wLp8sWlQJ that > seems to solve it for version 1.5. but no luck with 1.6 > > here's what I've got on my simple test > https://gist.github.com/mauricioalarcon/40bac95f5aa9cd145bfa > > As it's there it creates a node and executes my script, But If I uncomment > line 15 > "templateBuilder.options(inboundPorts(22, 80, 2022, 6060));" > it starts complaining that it can't authenticate?? > > "- <<authenticated>> woke to: net.schmizz.sshj.userauth.UserAuthException: > publickey auth failed" > > 1. How is possible that just setting the inbound ports trigger this? > 2. What I'm doing wrong? > 3. How can I override with my security-group and keyPair? > > I tried the following > > "overrideLoginCredentials(loginCredentials).keyPair("tom-key").runAsRoot( > true).nameTask("install-infrastructure.sh"));" > > But it complains about authentication again. > > Thanks in advance > > Cheers > > ~M > -- Thanks & regards, Nirmal Senior Software Engineer- Platform Technologies Team, WSO2 Inc. Mobile: +94715779733 Blog: http://nirmalfdo.blogspot.com/