coderazzi / aws_codeartifact_maven

Support to update AWS CodeArtifact credentials on maven IDEA projects.
MIT License
6 stars 6 forks source link

Request: Ability to specify AWS profile the command is run with #6

Closed jagiles-gg closed 2 years ago

jagiles-gg commented 2 years ago

Based on observation, it appears that the tool runs using either the default profile, or whatever profile is set in the AWS_PROFILE environment variable.

It would be great if the dialog provided the ability to (optionally) specify a name of the AWS profile to execute the command with. As someone who has access to many AWS accounts and has quite a few in my credentials file, being able to specify which set of credentials the command is executed with would be greatly appreciated.

coderazzi commented 2 years ago

Hi, Jason, thanks for the feedback, you are right, I use the default profile and I hadn't foreseen the need to include it in the request execution. I will implement it as soon as possible.

On Thu, Jan 6, 2022 at 7:30 PM Jason Giles @.***> wrote:

Based on observation, it appears that the tool runs using either the default profile, or whatever profile is set in the AWS_PROFILE environment variable.

It would be great if the dialog provided the ability to (optionally) specify a name of the AWS profile to execute the command with. As someone who has access to many AWS accounts and has quite a few in my credentials file, being able to specify which set of credentials the command is executed with would be greatly appreciated.

— Reply to this email directly, view it on GitHub https://github.com/coderazzi/aws_codeartifact_maven/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH54IODSOCK66QFWVZ46N3UUXNVRANCNFSM5LM6DZEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

jagiles-gg commented 2 years ago

Thank you, sir! Much appreciated.

coderazzi commented 2 years ago

Hi, Jason, I have updated the plugin and deployed it on the beta channel: https://plugins.jetbrains.com/plugin/16777-aws-codeartifact--maven/update/153353

Could you check if it works as you expected?

On Fri, Jan 7, 2022 at 10:46 PM Jason Giles @.***> wrote:

Thank you, sir! Much appreciated.

— Reply to this email directly, view it on GitHub https://github.com/coderazzi/aws_codeartifact_maven/issues/6#issuecomment-1007762516, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH54IIGQDGMI4TA6PDPHULUU5NLFANCNFSM5LM6DZEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

jagiles-gg commented 2 years ago

It does work, but the plugin does assume the existence of a ~/.aws/config file. If that file does not exist, then an error dialog pops up and the profile drop down is empty.

You might also fall back to the ~/.aws/credentials file and read profiles from there? I know when using aws configure it puts things in the right place, but the documentation on the CLI does not require that certain properties lie in ~/.aws/config and does allow for all properties to lie in ~/.aws/credentials.

I recognize that this is a non-standard setup so feel free to ignore this particular bit of feedback.

coderazzi commented 2 years ago

Hi,

yep, that is right. Didn't you have a ~/.aws/config file and got yourself the error? Reading the documentation, I understood that both files were required, so it would make little sense to try reading the credentials file IF the config file was missing. I can indeed use the credentials file if the config one is missing, just not sure if that would help (the config includes the associated region, so it would be still required).

On Thu, Jan 13, 2022 at 3:51 PM Jason Giles @.***> wrote:

It does work, but the plugin does assume the existence of a ~/.aws/config file. If that file does not exist, then an error dialog pops up and the profile drop down is empty.

You might also fall back to the ~/.aws/credentials file and read profiles from there? I know when using aws configure it puts things in the right place, but the documentation on the CLI does not require that certain properties lie in ~/.aws/config and does allow for all properties to lie in ~/.aws/credentials.

I recognize that this is a non-standard setup so feel free to ignore this particular bit of feedback.

— Reply to this email directly, view it on GitHub https://github.com/coderazzi/aws_codeartifact_maven/issues/6#issuecomment-1012207124, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH54IPHXBOVIF2JQJUB66TUV3RENANCNFSM5LM6DZEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

jagiles-gg commented 2 years ago

Yeah...you can probably feel free to ignore. My configuration was setup manually and not through the CLI. So for me, response format, region, etc is all setup in the credentials file.

I am willing to admit to being in a non-standard setup. If I move those settings to the config file where they are supposed to live I don't see the error.

coderazzi commented 2 years ago

Mmmmm... for completeness, I guess I should cover both files :-(

On Thu, Jan 13, 2022 at 10:46 PM Jason Giles @.***> wrote:

Yeah...you can probably feel free to ignore. My configuration was setup manually and not through the CLI. So for me, response format, region, etc is all setup in the credentials file.

I am willing to admit to being in a non-standard setup. If I move those settings to the config file where they are supposed to live I don't see the error.

— Reply to this email directly, view it on GitHub https://github.com/coderazzi/aws_codeartifact_maven/issues/6#issuecomment-1012541077, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH54INYQMF4ZR5UAJPL3M3UV5B4BANCNFSM5LM6DZEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

coderazzi commented 2 years ago

Hi, Jason, I uploaded a new beta: https://plugins.jetbrains.com/plugin/16777-aws-codeartifact--maven/versions/beta/154281 It is now -or it should be- conformant to the AWS specification: https://docs.aws.amazon.com/sdkref/latest/guide/file-location.html Please give it a try,

On Fri, Jan 14, 2022 at 1:32 PM coderazzi @.***> wrote:

Mmmmm... for completeness, I guess I should cover both files :-(

On Thu, Jan 13, 2022 at 10:46 PM Jason Giles @.***> wrote:

Yeah...you can probably feel free to ignore. My configuration was setup manually and not through the CLI. So for me, response format, region, etc is all setup in the credentials file.

I am willing to admit to being in a non-standard setup. If I move those settings to the config file where they are supposed to live I don't see the error.

— Reply to this email directly, view it on GitHub https://github.com/coderazzi/aws_codeartifact_maven/issues/6#issuecomment-1012541077, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH54INYQMF4ZR5UAJPL3M3UV5B4BANCNFSM5LM6DZEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>