This guide addresses managing service-linked roles and Customer Profiles domains in Amazon Connect, focusing on resolving persistent service-linked role issues after instance deletion. Written for AWS administrators and DevOps engineers, it provides CLI and console-based solutions, along with best practices for maintaining clean AWS environments and preventing resource management issues.
Introduction
Amazon Connect administrators often need to manage service-linked roles when working with Customer Profiles. This guide provides best practices and step-by-step instructions for managing these roles, particularly focusing on proper cleanup after instance deletion.
Table of Contents
- Understanding the Architecture
- Identifying Service-Linked Roles
- Solution Methods
- Step-by-Step Removal Process
- Preventive Measures
- Troubleshooting
- Best Practices
1. Understanding the Architecture
Customer Profiles Domain Structure
- Customer Profiles domains operate independently of Connect instances
- Each domain has its own service-linked role
- Domains can be associated with multiple instances
Service-Linked Role Purpose
Role Name Format: AWSServiceRoleForProfile
Primary Purpose: Enables Customer Profiles to interact with other AWS services
Permissions: Pre-defined by AWS for specific service interactions
Here's the next section:
2. Identifying Service-Linked Roles
Using AWS Management Console
- Open AWS Management Console
- Navigate to IAM Console
- Select "Roles" from the left navigation
- Search for "AWSServiceRoleForProfile"
Using AWS CLI
# List service-linked roles for Customer Profiles
aws iam list-roles --path-prefix "/aws-service-role/profile.amazonaws.com/"
3. Solution Methods
Method 1: AWS CLI Approach
Advantages:
- Automated execution
- Efficient for multiple domains
- Suitable for scripted operations
Method 2: Console Approach
Advantages:
- Visual interface
- Real-time feedback
- Recommended for single operations
4. Step-by-Step Removal Process
Using AWS CLI
- Configure AWS CLI
aws configure
- List Domains
aws customer-profiles list-domains --region <region>
- Delete Domain
aws customer-profiles delete-domain \
--domain-name <domain-name> \
--region <region>
- Verify Removal
aws customer-profiles list-domains --region <region>
Using AWS Console
- Access Customer Profiles
- Open Amazon Connect console
- Navigate to your instance
- Select "Customer Profiles"

- Domain Management
- Select existing domain
- Review associated instances
- Verify domain settings

- Domain Deletion Process
- Select "Delete domain"
- Review impact warning:
- Agent access to customer information
- Contact flow functionality
- Case management capabilities
- Campaign management features
- Confirm deletion
- Wait for completion

Here are the next sections:
5. Preventive Measures
Pre-Deletion Checklist
- Document domain configurations
- Review instance associations
- Assess business impact
- Create backup if needed
Documentation Template
Environment Details:
Instance Region: <region>
Domain Information:
- Name: <domain-name>
- Associated Instances: <number-of-instances>
Service-Linked Roles:
- Role ARN: <role-arn>
6. Troubleshooting
Common Issues and Solutions
- Domain Deletion Failures
Issue: Domain deletion not completing
Solution:
- Verify no active instances are using the domain
- Check for pending operations
- Allow 15 minutes between attempts
- Role Persistence
Issue: Service-linked role remains after deletion
Solution:
- Confirm domain deletion completion
- Verify no other domains use the role
- Check AWS CloudTrail for related activities
- Access Issues
Issue: Insufficient permissions
Solution:
- Verify IAM permissions include:
- customer-profiles:DeleteDomain
- customer-profiles:ListDomains
- Check AWS Organizations policies
7. Best Practices
Resource Management
- Implement standardized naming conventions
- Maintain resource inventory
- Schedule regular audits
- Document dependencies
Security Guidelines
- Follow principle of least privilege
- Implement resource tagging
- Enable AWS CloudTrail logging
- Regular security reviews
Operational Excellence
- Create runbooks for common tasks
- Implement monitoring:
- CloudWatch metrics
- Resource usage alerts
- Deletion events
- Maintain change documentation
Here are the final sections:
Conclusion
Effective management of Customer Profiles service-linked roles in Amazon Connect requires understanding of AWS service relationships and careful attention to cleanup procedures. Following this guide's structured approach helps maintain a clean AWS environment and prevents common operational issues. Regular audits and proper documentation ensure long-term success in managing these resources.
Additional Resources
AWS Official Documentation
AWS CLI References
Best Practice Guidelines
Before modifying Customer Profiles domains:
- Review current configurations
- Assess impact on:
- Active contact flows
- Agent workflows
- Integration points
- Create documentation for:
- Configuration changes
- Dependency mappings
- Recovery procedures
Important Notes
- Always test procedures in a non-production environment
- Maintain detailed change logs
- Follow AWS security best practices
- Keep documentation current
- Monitor AWS service updates