Skip to content

Plugin support plans #8064

@pzybe

Description

@pzybe

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

Metadata

Metadata

Assignees

Labels

closing-soonThis issue will automatically close in 4 days unless further comments are made.duplicateThis issue is a duplicate.feature-requestA feature should be added or improved.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions