deprovision
This guide shows you how to completely remove a Datafye Trading Environment from AWS.
Prerequisites
Before you begin, ensure:
You have previously provisioned an AWS Trading Environment
AWS credentials are configured (see AWS Setup)
Warning: Deprovisioning is irreversible. All deployment resources will be permanently deleted from AWS, including EC2 instances, EBS volumes, VPC networking, data, configurations, and trading history. All data will be lost.
CRITICAL: Deprovisioning only removes the Datafye infrastructure. It does not close positions or cancel orders with your broker. Ensure you have closed all positions and canceled all open orders before deprovisioning.
Deprovision Command
Use the following command to deprovision your AWS Trading Environment:
datafye trading aws deprovision --name <deployment-name> --profile <aws-profile>Parameters
Required Parameters
--name <name>
Name of the deployment to deprovision
--profile <profile>
AWS CLI profile to use
Optional Parameters
--force
Skip confirmation prompt
false
Example
Deprovision a Trading Environment named my-paper-trading:
Confirmation
The CLI will prompt you to confirm the deprovision operation:
Type yes to proceed with deprovisioning.
Skip confirmation:
Deprovision Process
When you deprovision the deployment, the CLI will:
Verify credentials - Check AWS authentication
Locate deployment - Find the deployment by name
Disconnect from broker - Close broker connections
Stop services - Gracefully stop all Datafye services
Terminate EC2 instances - Delete all virtual machines
Delete EBS volumes - Remove all data storage volumes
Delete networking - Remove VPC, subnets, security groups, route tables
Delete Route53 records - Remove DNS entries (if created)
Clean up metadata - Remove deployment tracking information
Display status - Confirm successful deprovisioning
AWS deprovisioning typically takes 5-10 minutes. Do not interrupt the process.
After Deprovisioning
Once deprovisioning completes:
All AWS resources for the deployment are permanently deleted
All data, configurations, and trading history are gone
You stop incurring all charges related to this deployment
The deployment name becomes available for reuse
Broker account remains unchanged:
Any positions you had remain open with your broker
Your broker account balance is unaffected
Trading history remains in your broker account
You can log into your broker's platform to manage positions
To create a new deployment: Run datafye trading aws provision with your descriptor files.
Your AWS Trading Environment has been completely removed!
When to Deprovision
Deprovision your deployment when:
No longer needed - You're done with the deployment permanently
Starting fresh - You want to recreate the deployment from scratch
Cost control - You want to eliminate all charges for this deployment
Project completion - Development, testing, or trading phase is complete
Troubleshooting - Resolving persistent infrastructure issues
Changing regions - Moving to a different AWS region
Changing brokers - Switching to a different broker provider
Troubleshooting
AWS Credential Errors
If you see authentication errors:
Verify your AWS profile:
aws sts get-caller-identity --profile datafyeEnsure credentials have necessary permissions
Check you're using the correct profile name
Deployment Not Found
If you see an error that the deployment doesn't exist:
Verify the deployment name:
datafye trading aws list --profile datafyeEnsure you're using the correct AWS profile
The deployment may already be deprovisioned
Partial Deprovision
If deprovisioning fails partway through:
Review the error message for the specific resource that failed
Retry the deprovision command - it should resume and clean up remaining resources
If issues persist, you can manually clean up resources:
Check EC2 console for instances tagged with the deployment name
Check VPC console for VPCs tagged with the deployment name
Contact Datafye support for assistance
Resource Deletion Failures
If AWS resources fail to delete:
Check for dependencies (e.g., volumes attached to running instances)
Verify no AWS service limits are preventing deletion
Retry the deprovision command
If needed, manually delete resources via AWS console:
EC2 instances
EBS volumes
VPC and networking components
Permission Denied During Deprovision
If you encounter permission errors:
Verify your IAM user has
ec2:*androute53:*permissionsCheck that resources aren't protected by AWS Organizations SCPs
Ensure you have permission to delete resources in the region
Open Positions Remain
After deprovisioning, if you still have open positions:
Log into your broker's platform directly (paper or live)
Close positions manually through the broker interface
Cancel any pending orders
The Datafye deployment is independent of your broker positions
Related Commands
Provision an AWS Trading Environment - Create a new deployment
Start an AWS Trading Environment - Start a stopped deployment
Stop an AWS Trading Environment - Stop a running deployment
Last updated: 2025-10-22
Last updated

