Manual modification - where to find documentation on possible properties
Amplify CLI Version
N/A
Question
Hello, I'd like to modify an api cli-inputs.json file manually, but can't find any documentation on the property values. Where can I find documentation? e.g. what are all the possible properties that go into "permissions"?
Also, you you probably want to edit this comment, since this path does not exist anymore?
Current vs Expected Behavior
Current Behavior
// From consolidate-apigw-policies.ts - Type definitions exist but no public documentation
type APIGatewayPermissionSetting = 'open' | 'private' | 'protected';
type APIGateway = {
resourceName: string;
params?: {
paths?: Record<
string,
{
name?: string;
lambdaFunction?: string;
permissions?: {
settings?: APIGatewayPermissionSetting;
auth?: CrudOperation[];
guest?: CrudOperation[];
};
}
>;
};
};
Users must reverse-engineer cli-inputs.json structure from:
- Source code inspection
- Trial and error
- Community forums
Expected Behavior
# Expected Documentation Structure
## API Gateway CLI Inputs Reference
### permissions
- **Type**: Object
- **Description**: Configures access permissions for API paths
- **Properties**:
- `settings`: 'open' | 'private' | 'protected'
- `auth`: Array of CRUD operations for authenticated users
- `guest`: Array of CRUD operations for unauthenticated users
### Example
```json
{
"permissions": {
"settings": "private",
"auth": ["create", "read", "update", "delete"],
"guest": ["read"]
}
}
Hi @yakovsushenok,
Thank you for bringing this documentation gap to our attention! You're absolutely right that there's currently no comprehensive documentation for manually modifying cli-inputs.json files.
Based on the TypeScript definitions in consolidate-apigw-policies.ts, the permissions property supports:
{
"permissions": {
"settings": "open" | "private" | "protected",
"auth": ["create", "read", "update", "delete"],
"guest": ["create", "read", "update", "delete"]
}
}
You're also correct about the outdated comment - that schema file path doesn't exist. This issue is related to #10043 which requests JSON schemas for better developer experience.
We should:
- Create proper documentation for cli-inputs.json schema
- Fix the outdated comment you identified
- Consider implementing JSON schemas as requested in #10043
Would you be interested in contributing a PR to help document these configuration options? The community would greatly benefit from your insights on manual configuration workflows!