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

Plugin support plans #8064

Closed
1 of 2 tasks
ptdel opened this issue Jul 25, 2023 · 3 comments
Closed
1 of 2 tasks

Plugin support plans #8064

ptdel opened this issue Jul 25, 2023 · 3 comments
Assignees
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. duplicate This issue is a duplicate. feature-request A feature should be added or improved.

Comments

@ptdel
Copy link

ptdel commented Jul 25, 2023

Describe the feature

I was looking at v1/v2 and saw that support for plugins was removed #4650 and #4670 because of constraints with the packaged python environment. I was wondering if any consideration had been given towards adding plugin support back in?

Use Case

~/.aws/cli/alias works for 99% of things, but there are a few scenarios where having the ability to add functionality from a python module plugin is nice.

if I have something like:

set-profile =
  !f() {
    export AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id --profile "$1")
    export AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key --profile "$1")
    # ...
  }; f

Those environment variables won't be available, I think because Python's subprocess.call runs in a SUBSHELL.

aws-cli/awscli/alias.py

Lines 252 to 253 in 3b93822

class ExternalAliasCommand(BaseAliasCommand):
def __init__(self, alias_name, alias_value, invoker=subprocess.call):

There are other ways to accomplish that alias but you get the limitation. It's also nice to have access to the session object as well for calling out to 3rd-party integrations that expect some kind of credentials to be present.

Proposed Solution

If the reason that plugins were disabled is because v2 ships with an isolated environment the only thing I could think would be either allow somebody to just build the tool as if they were developing but with the ability to build in plugins. Either that or provide some sort of shim over the top of venv if that is how the environment is being isolated.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CLI version used

aws-cli/2.13.3 Python/3.11.4 Linux/6.4.5-arch1-1 exe/x86_64.arch prompt/off

Environment details (OS name and version, etc.)

6.4.5-arch1-1 GNU/Linux

@ptdel ptdel added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jul 25, 2023
@tim-finnigan tim-finnigan self-assigned this Jul 26, 2023
@tim-finnigan
Copy link
Contributor

Hi @ptdel thanks for reaching out. Mentioned in #4650 (comment) is this PR: #4854, which added a cli_legacy_plugin_path setting that you can use. Here is the documentation on that: https://awscli.amazonaws.com/v2/documentation/api/latest/topic/config-vars.html

But please note the warning on that page:

Plugin support in the AWS CLI v2 is completely provisional and intended to help users migrate from AWS CLI v1 until a stable plugin interface is released. There are no guarantees that a particular plugin or even the CLI plugin interface will be supported in future versions of the AWS CLI v2. If you are relying on plugins, be sure to lock to a particular version of the CLI and test functionality of your plugin when you do upgrade.

There are plans to support a more comprehensive plugin interface for v2 but we don't have a specific timeline for that. This also overlaps with an older issue, #2350, so I think we should continue to track the request there. You can add a 👍 to that issue and comment there if you want to show support for this feature request.

@tim-finnigan tim-finnigan added duplicate This issue is a duplicate. closing-soon This issue will automatically close in 4 days unless further comments are made. and removed needs-triage This issue or PR still needs to be triaged. labels Jul 26, 2023
@ptdel
Copy link
Author

ptdel commented Jul 27, 2023

thanks for pointing out the legacy path config @tim-finnigan I'd managed to overlook it. That solves my problem!

@ptdel ptdel closed this as completed Jul 27, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. duplicate This issue is a duplicate. feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

2 participants