Open drakejin opened 2 years ago
You can leverage this to bridge the gap.
https://github.com/99designs/aws-vault/blob/master/USAGE.md#using-credential_process
Sorry, I can't understand. How can I adopt this credential_process when using Run/Debug configuration? I want to use breakpoints and see some values.
By using a credential profile backed by a credential_process
, the toolkit can automatically request new credentials from the credential process when the temporary credentials are about to expire. aws-vault exec
sets environment variables on the given process, which is fine for short-lived commands but is undesirable for use-cases such as IDEs, since there is no good way to swap out the environment variables of a running process.
@abrooksv Hm.. Still I don't get it. credential_process
how can I use for 'the bridge'?
I no meant to how to use AWS toolkit. I already set up to get aws credentials on AWS toolkit. using credential_process
.
Hm... In my case, My company has a 4 aws accounts by purpose and stage, So, I want choose for credentials for running GO application. Therefore, I need to select aws credentials without turn off my IDEA process.
Okay, I think I understand what you are asking.
You want to be able to leverage the experimental feature for run configs that you showed in your screenshot for Java, but for Go-based run configs?
Sorry for late comment. For Go-based run configs.
That experimental feature is really useful using java. I want to use the feature when using golang too
Okay, we are limited by the API exposed by JetBrains for each run config. Last I checked it was not possible to mutate the Go-based run configs
Okay, I'll take this issue to JetBrains repository, Would you link me the code for injecting aws credentials at Run/Debug configuration?
I need to understand how AWS Toolkit inject aws credentials.
In Java, we use this extension point: https://github.com/JetBrains/intellij-community/blob/master/java/execution/impl/src/com/intellij/execution/RunConfigurationExtension.java
In Python, we use this one: https://github.com/JetBrains/intellij-community/blob/master/python/src/com/jetbrains/python/run/PythonRunConfigurationExtension.java
Hmmm.. There may actually be a Go one now: com.goide.execution.extension.GoRunConfigurationExtension
This should actually be pretty straight-forward to implement. We have a language agnostic wrapper (see AwsConnectionRunConfigurationExtension
) that does 99% of the functionality that we we just use in the Python/Java Run Configurations. Take a look at the JavaAwsConnectionExtension
for an example usage.
I'd be happy to review a PR for the functionality - did you want to have a go at implementing this?
Similar to the Java / Python ones we'd want to gate this behind a ToolkitExperiment
see software.aws.toolkits.jetbrains.core.execution.JavaAwsConnectionExperiment
for an example.
And we'd need integration tests similar to the Java/Python ones.
My pleasure, I'd love to. Is it okay making a PR after 3 weeks later?
I'm in end of deadline about company project. after that I'll start to make a PR
My pleasure, I'd love to. Is it okay making a PR after 3 weeks later?
I'm in end of deadline about company project. after that I'll start to make a PR
Yes, that sounds fine. We appreciate the effort.
Sounds awesome! Thanks.
It's my first time contributing on intelliJ plugins. I don't know how work it is.
I ask something.
com.goide.execution.GoRunConfigurationBlahBlah
is only implemented on GoLand except IntelliJ?com.goide.*
It was not imported yet. How can I use this?
com.goide.*
is about GoLand.com.goide.*
, is it possible to control about Go Run Configuration?GoRunConfigurationBlahBlah
is in module com.intellj.execution.*
Goland is the Go plugin + IntelliJ platform. The Go API is be accessible from our jetbrains-ultimate
subproject. See software.aws.toolkits.jetbrains.services.lambda.go
packages for existing Go code.
You can run :jetbrains-ultimate:runIde
to get IntelliJ Ultimate with Go plugin already configured for testing.
Everything you need should already be present from JetBrains.
The extension point for plugin.xml usage is com.goide.runConfigurationExtension
, the abstract class is com.goide.execution.extension.GoRunConfigurationExtension
And the implementation you create should be wired in the ext-go.xml
- this means it will only be loaded if the required go-plugin dependency is present (e.g. you're running IntelliJ Ultimate with the Go plugin, or you're running GoLand)
It's very similar to how the Python/Java ones are implemented in:
ext-java.xml
ext-python.xml
Any update for getting the toolkit working in Goland/Go?
Oh.. my.. I'm Sorry @jchannon
I've totally forgot this. I didn't start yet. If you want to make yourself I'll give you turn....
Is your feature request related to a problem? Please describe.
I make a golang application with aws-vault. There is a solution about making application on intelliJ with aws-vault. just exec like this command. It's the only way to run intelliJ with aws authentication.
But, It has a problem. I cannot notice when expired aws-vault authentication. At that time, I have to turn off all about process IDEA and exec that command again
aws-vault exec blahprofile -- idea {project-directory}
. So I use the configuration about choose aws profile credentials at Run/Debug configuration menu.Thanks your service all the time. have a nice day.