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

Using with AWS #4

Open
vaibhavrdbhat opened this issue Jun 13, 2018 · 2 comments
Open

Using with AWS #4

vaibhavrdbhat opened this issue Jun 13, 2018 · 2 comments

Comments

@vaibhavrdbhat
Copy link

Hey guys,

The README basically discusses how to use this with Azure. I was wondering how I can use it to deploy on AWS. Would the only changes be in the application.properties file? And if so, what data is required in that for AWS? Thanks!

  • Vaibhav Bhat
@prassiv
Copy link

prassiv commented Aug 12, 2019

@vaibhavrdbhat - I am on similar boat.were you able to use this for AWS?

@SellamiRami
Copy link

Dear all,
I have the same problem, I want to provision ressources in AWS using the Client library. However, I get the error below even if the referenced repository and the terrafom script exists inside it.

Here is my code source :

`@Post
public String provision() {

	TerraformToolkitImpl terraformToolkit = new TerraformToolkitImpl();

	String uid = "", pathTOSCA = "", pathTerraformScript = "", pathTerraformVariable = "", path = "";
	try {
		// Get the UID send in the query
		uid = this.getRequestAttributes().get("uid").toString();
		// Create the path to the Tosca Model identified by the UID
		path = basePath + uid + "/";

		TerraformClient client = new TerraformClient();
		// client.setOutputListener(System.out::println);
		// client.setErrorListener(System.err::println);

		client.setWorkingDirectory(Paths.get(path));
		System.out.println(client.plan().get());
		client.plan().get();
		client.apply().get();
	} catch (Exception e) {
		e.printStackTrace();
	}
	return "Error when provisioning with Terraform";
	
}`

java.lang.RuntimeException: java.io.IOException: Cannot run program "terraform" (in directory "./src/main/resources/837e08d3-9ce2-4cff-9c5f-48757490d495"): error=2, No such file or directory at com.microsoft.terraform.ProcessLauncher.launch(ProcessLauncher.java:71) at com.microsoft.terraform.TerraformClient.run(TerraformClient.java:106) at com.microsoft.terraform.TerraformClient.plan(TerraformClient.java:86) at net.apispark.webapi.resource.server.TerraformProvisionnerResource.provision(TerraformProvisionnerResource.java:83) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.restlet.resource.ServerResource.doHandle(ServerResource.java:524) at org.restlet.resource.ServerResource.post(ServerResource.java:1376) at org.restlet.resource.ServerResource.doHandle(ServerResource.java:621) at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:679) at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:357) at org.restlet.resource.ServerResource.handle(ServerResource.java:1044) at org.restlet.resource.Finder.handle(Finder.java:236) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.routing.Router.doHandle(Router.java:422) at org.restlet.routing.Router.handle(Router.java:639) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:140) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202) at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:75) at org.restlet.Application.handle(Application.java:385) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.routing.Router.doHandle(Router.java:422) at org.restlet.routing.Router.handle(Router.java:639) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.routing.Router.doHandle(Router.java:422) at org.restlet.routing.Router.handle(Router.java:639) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:140) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202) at org.restlet.Component.handle(Component.java:408) at org.restlet.Server.handle(Server.java:507) at org.restlet.engine.connector.ServerHelper.handle(ServerHelper.java:63) at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:143) at org.restlet.ext.jetty.JettyServerHelper$WrappedServer.handle(JettyServerHelper.java:273) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:313) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:626) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:546) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.IOException: Cannot run program "terraform" (in directory "./src/main/resources/837e08d3-9ce2-4cff-9c5f-48757490d495"): error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at com.microsoft.terraform.ProcessLauncher.launch(ProcessLauncher.java:69) ... 59 more Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.<init>(UNIXProcess.java:247) at java.lang.ProcessImpl.start(ProcessImpl.java:134) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 60 more

Thank you in advance for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants