aws / aws/aws-cli

AWS CLI does not accept valid file URIs

Open
#7,473 6 comments 0 reactions 0 assignees View on GitHub
bug p3
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

### Describe the bug

Consider the following command line executed with PowerShell 7 on a Windows system:

```
aws ecs register-task-definition --container-definitions "file:///e:/tmp/file" --family "foo" --network-mode awsvpc
Error parsing parameter '--container-definitions': Unable to load paramfile file:///e:/tmp/file: [Errno 22] Invalid argument: '/e:/tmp/file'
```

It is currently not possible to automate AWS CLI on Windows with correct URI generators because of this.

### Expected Behavior

I expect that AWS CLI accepts valid file URIs.

### Current Behavior

AWS CLI does not accept valid file URIs in Windows systems running PowerShell 7.

### Reproduction Steps

On a Windows system with PowerShell 7:

0. create a file at e:/tmp/file.json
1. run the command line: aws ecs register-task-definition --container-definitions "file:///c:/tmp/file.json" --family "foo" --network-mode awsvpc

### Possible Solution

Fix file URI parsing on Windows systems.

It is *not true* that the following is an appropriate file URI on Windows systems: file://\e:\tmp\file.json

### Additional Information/Context

https://www.rfc-editor.org/rfc/rfc8089

### CLI version used

aws-cli/2.9.0 Python/3.9.11 Windows/10 exe/AMD64 prompt/off

### Environment details (OS name and version, etc.)

windows, powershell

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.