Pre-Cleanup Checklist
Before deleting resources, you may want to:Export Cedar policies
If you created policies during the demo that you want to reference later:
- Go to AWS Console > Verified Permissions > Your Policy Store
- Click Policies
- For each policy you want to save:
- Click the policy name
- Copy the Cedar policy text
- Save to a local file
Document Policy Store configuration
Note your Policy Store settings if you want to recreate a similar setup:
- Policy Store ID
- Schema definition (JSON)
- Validation mode settings
Delete AWS Infrastructure
The demo creates resources in two places: SAM stack (Lambda, API Gateway) and Verified Permissions. Delete them in this order:Step 1: Delete the SAM Stack
The SAM stack includes:- Lambda functions (check-access, get-users, agent)
- API Gateway
- IAM roles and policies
- CloudWatch log groups
Step 2: Delete the Policy Store
Navigate to Verified Permissions
- Open the AWS Console
- Search for “Verified Permissions”
- Select Verified Permissions service
Locate your Policy Store
Find the Policy Store you created (e.g.,
FinancialDocsStore).Click on the Policy Store name to view details.Delete all policies first
Before deleting the Policy Store, remove all policies:
- Click Policies in the left sidebar
- Select all policies (checkboxes)
- Click Delete
- Confirm the deletion
You must delete policies before the Policy Store itself can be removed.
Delete the Policy Store
- Return to the Policy Store details page
- Click Delete policy store (usually in the Actions dropdown or top-right)
- Type the Policy Store name to confirm
- Click Delete
Verify Complete Cleanup
Double-check that all resources are removed:CloudFormation Stacks
CloudFormation Stacks
avp-demo in the output with status DELETE_COMPLETE.Lambda Functions
Lambda Functions
[] or not include:avp-check-accessavp-get-usersavp-agent
API Gateway APIs
API Gateway APIs
[].Verified Permissions Policy Stores
Verified Permissions Policy Stores
CloudWatch Logs Retention
CloudWatch log groups are automatically deleted with the SAM stack, but logs may be retained based on your AWS account settings.
Anthropic API Key
The Anthropic API Key you provided during deployment:- Was stored as an encrypted environment variable in Lambda
- Is automatically deleted when the Lambda function is deleted
- Does not need manual cleanup
- Visit console.anthropic.com
- Go to API Keys
- Find the key you used for the demo
- Click Revoke or Delete
Local Files Cleanup
The demo files on your local machine are not automatically deleted. To remove them:Cost Verification
After cleanup, verify no ongoing costs:Check AWS Cost Explorer
- AWS Console > Cost Explorer
- Set date range to include demo period
- Group by Service
- Look for:
- Lambda: Should drop to $0 after cleanup
- API Gateway: Should drop to $0
- Verified Permissions: Should drop to $0
- CloudWatch Logs: May have small storage cost if logs retained
Troubleshooting Cleanup Issues
SAM delete fails with 'stack does not exist'
SAM delete fails with 'stack does not exist'
The stack may have been deleted already, or you’re in the wrong region.Verify region:Check all regions:
Policy Store deletion fails
Policy Store deletion fails
Error: “Cannot delete policy store with existing policies”You must delete all policies first:
- Go to Policy Store > Policies
- Delete each policy individually
- Wait for deletion to complete
- Then delete the Policy Store
CloudFormation stack stuck in DELETE_IN_PROGRESS
CloudFormation stack stuck in DELETE_IN_PROGRESS
Some resources may have dependencies preventing deletion.View events:Look for resources with status
DELETE_FAILED and error messages.Common causes:- CloudWatch log groups with retention policies
- IAM roles still attached to resources
- API Gateway deployments not fully removed
- AWS Console > CloudFormation
- Select the stack
- Actions > Delete Stack
- Check “Retain resources” for stuck resources
- Manually delete retained resources afterward
Orphaned IAM roles
Orphaned IAM roles
If SAM delete leaves behind IAM roles:List roles:Delete manually (only if SAM delete completed):You may need to detach policies first:
Re-deploying After Cleanup
If you want to run the demo again:- Policy Store: Create a new one (Step 1 in setup)
- Schema: Re-apply the schema JSON (Step 2)
- SAM: Run
sam build && sam deploy --guidedwith the new Policy Store ID - Frontend: Update API URLs in HTML files
- Policies: You’ll start with an empty Policy Store (Zero Trust demo)
Next Steps
Architecture Overview
Learn how the demo components work together
Cedar Policies
Explore more Cedar policy patterns and examples