- Newest
- Most votes
- Most comments
When referencing a JSON file in AWS CLI on Windows, you need to use the file:// prefix before the file path. Here are the correct ways to specify a JSON file path:
- Using forward slashes:
--cli-input-json file://C:/path/to/file.json
- Using escaped backslashes:
--cli-input-json file://C:\\path\\to\\file.json
- If your path contains spaces, enclose the entire path in quotes:
--cli-input-json "file://C:/path/to/my file.json"
The most common issues when specifying file paths in Windows are:
- Missing the
file://prefix - Using unescaped backslashes
- Having spaces between
file://and the beginning of the path
For simplicity, you can also navigate to the directory containing your JSON file using the cd command, and then use a relative path:
--cli-input-json file://file.json
Remember that the path should follow Windows conventions (backslashes), but you need to either escape them or use forward slashes when specifying them in the AWS CLI.
Sources
In AWS CLI, how do I reference a path to a JSON file that is stored on my PC's local drive? | AWS re:Post
Update AMI image pipelines from the AWS CLI - EC2 Image Builder
Walkthrough: Use the AWS CLI with Run Command - AWS Systems Manager
Create a container image pipeline from the AWS CLI - EC2 Image Builder
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
