manage_cloudwaf
Manage Fastly CloudWAF instances to protect web applications by listing, creating, updating, or deleting deployments with configuration options for domains, regions, and security settings.
Instructions
Manage CloudWAF instances
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| corpName | No | Corporation name (uses context default if not provided) | |
| action | Yes | Action to perform | |
| deploymentId | No | Deployment ID (for get/update/delete) | |
| name | No | Instance name | |
| description | No | Instance description | |
| region | No | AWS region | |
| tlsMinVersion | No | Minimum TLS version | |
| siteName | No | Site name for configuration | |
| domains | No | Domains to protect | |
| origin | No | Origin server URL |
Implementation Reference
- server.js:1146-1187 (handler)Primary execution handler for the 'manage_cloudwaf' tool. Dispatches to appropriate CloudWAF client methods based on the 'action' parameter (list, create, get, update, delete).case 'manage_cloudwaf': const { corpName: corpForCloudWAF } = resolveContext(typedArgs); if (typedArgs.action === 'list') { result = await client.listCloudWAFInstances(corpForCloudWAF); } else if (typedArgs.action === 'create') { const instanceData = { name: typedArgs.name, description: typedArgs.description, region: typedArgs.region, tlsMinVersion: typedArgs.tlsMinVersion, workspaceConfigs: [{ siteName: typedArgs.siteName, instanceLocation: "direct", listenerProtocols: ["https"], routes: [{ domains: typedArgs.domains, origin: typedArgs.origin, passHostHeader: false, connectionPooling: true, trustProxyHeaders: false, }], }], }; result = await client.createCloudWAFInstance(corpForCloudWAF, instanceData); } else if (typedArgs.action === 'get') { result = await client.getCloudWAFInstance(corpForCloudWAF, typedArgs.deploymentId); } else if (typedArgs.action === 'update') { const instanceData = { name: typedArgs.name, description: typedArgs.description, region: typedArgs.region, tlsMinVersion: typedArgs.tlsMinVersion, }; result = await client.updateCloudWAFInstance(corpForCloudWAF, typedArgs.deploymentId, instanceData); } else if (typedArgs.action === 'delete') { result = await client.deleteCloudWAFInstance(corpForCloudWAF, typedArgs.deploymentId); } break;
- server.js:777-796 (registration)Registration of the 'manage_cloudwaf' tool in the tools list, including name, description, and input schema. This is returned by the ListToolsRequestSchema handler.{ name: 'manage_cloudwaf', description: 'Manage CloudWAF instances', inputSchema: { type: 'object', properties: { corpName: { type: 'string', description: 'Corporation name (uses context default if not provided)' }, action: { type: 'string', enum: ['list', 'create', 'get', 'update', 'delete'], description: 'Action to perform' }, deploymentId: { type: 'string', description: 'Deployment ID (for get/update/delete)' }, name: { type: 'string', description: 'Instance name' }, description: { type: 'string', description: 'Instance description' }, region: { type: 'string', description: 'AWS region' }, tlsMinVersion: { type: 'string', enum: ['1.0', '1.2'], description: 'Minimum TLS version' }, siteName: { type: 'string', description: 'Site name for configuration' }, domains: { type: 'array', items: { type: 'string' }, description: 'Domains to protect' }, origin: { type: 'string', description: 'Origin server URL' }, }, required: ['action'], }, },
- server.js:780-794 (schema)Input schema definition for the 'manage_cloudwaf' tool, specifying parameters and validation rules.inputSchema: { type: 'object', properties: { corpName: { type: 'string', description: 'Corporation name (uses context default if not provided)' }, action: { type: 'string', enum: ['list', 'create', 'get', 'update', 'delete'], description: 'Action to perform' }, deploymentId: { type: 'string', description: 'Deployment ID (for get/update/delete)' }, name: { type: 'string', description: 'Instance name' }, description: { type: 'string', description: 'Instance description' }, region: { type: 'string', description: 'AWS region' }, tlsMinVersion: { type: 'string', enum: ['1.0', '1.2'], description: 'Minimum TLS version' }, siteName: { type: 'string', description: 'Site name for configuration' }, domains: { type: 'array', items: { type: 'string' }, description: 'Domains to protect' }, origin: { type: 'string', description: 'Origin server URL' }, }, required: ['action'],
- server.js:305-325 (helper)Supporting methods in the FastlyNGWAFClient class that implement the core API interactions for managing CloudWAF instances (list, create, get, update, delete).// CloudWAF Management async listCloudWAFInstances(corpName) { const response = await this.api.get(`/corps/${corpName}/cloudwafInstances`); return response.data; } async createCloudWAFInstance(corpName, instanceData) { const response = await this.api.post(`/corps/${corpName}/cloudwafInstances`, instanceData); return response.data; } async getCloudWAFInstance(corpName, deploymentId) { const response = await this.api.get(`/corps/${corpName}/cloudwafInstances/${deploymentId}`); return response.data; } async updateCloudWAFInstance(corpName, deploymentId, instanceData) { const response = await this.api.put(`/corps/${corpName}/cloudwafInstances/${deploymentId}`, instanceData); return response.data; } async deleteCloudWAFInstance(corpName, deploymentId) { await this.api.delete(`/corps/${corpName}/cloudwafInstances/${deploymentId}`); return { success: true }; }