This repository provides the supporting infrastructure and configuration guidelines to integrate with Amazon Q Business FSx connector, as detailed in the associated AWS Blog post. It includes automated deployment scripts and step-by-step instructions to help you successfully set up and configure the necessary AWS services.
- Prerequisites
- Cloning the Repository
- CloudFormation Stack Deployment
- Accessing the Windows EC2 Instance
- Running the PowerShell Script
- Validation Steps
- Identity Center Configuration
- Cleanup Procedures
- Troubleshooting
Before beginning this implementation, ensure you have the following in place:
- Active AWS account with administrative permissions
- AWS CLI installed and configured with credentials
- Valid EC2 key pair in your target region
- Git installed on your local machine
First, you'll need to clone the repository containing all necessary scripts and templates. Open your terminal and run:
# Clone the repository
git clone https://github.com/your-repo-url/amazonq-connector-for-fsx-windows.git
# Navigate to the cloned directory
cd amazonq-connector-for-fsx-windows
This step creates the core infrastructure including VPC, EC2 instance, and FSx file system. You can choose either the console or CLI method.
-
Access CloudFormation
- Open the AWS CloudFormation Console
- Click "Create stack" → "With new resources (standard)"
-
Upload Template
- Upload the template file:
fsx-windows-environment-setup.yaml
- Upload the template file:
-
Configure Stack
Stack Name: <your-unique-stack-name> Parameters: - VPCName: amazonq-connector-for-win-fsx-blog - CIDRBlock: 10.0.0.0/16 - AZCount: 2 - InstanceType: m5.large - KeyPair: <your-keypair-name>
# Create the CloudFormation stack
aws cloudformation create-stack \
--stack-name your-stack-name \
--template-body file://fsx-windows-environment-setup.yaml \
--parameters \
ParameterKey=VPCName,ParameterValue=amazonq-connector-for-win-fsx-blog \
ParameterKey=CIDRBlock,ParameterValue=10.0.0.0/16 \
ParameterKey=AZCount,ParameterValue=2 \
ParameterKey=InstanceType,ParameterValue=m5.large \
ParameterKey=KeyPair,ParameterValue=your-key-pair-name \
--capabilities CAPABILITY_IAM
# Monitor stack creation status
aws cloudformation describe-stacks \
--stack-name your-stack-name \
--query Stacks[0].StackStatus
Wait for the stack creation to complete (approximately 20-30 minutes). You'll see the status change to "CREATE_COMPLETE" when finished.
Once the CloudFormation stack is successfully created, you can access the Windows instance:
-
Locate the Instance
- Navigate to the EC2 Console
- In the instances list, find the instance named "FSx/W Windows Instance"
- Verify that the instance status is "running"
-
Connect via Fleet Manager
- Select the instance
- Click "Connect" button
- Choose "RDP client" and then Connection type as "Connect using fleet manager"
- Clikc on "Fleet Manager Remote Desktop"
- Use these credentials:
Username: [email protected] Password: [Retrieve from AWS Secrets Manager] Secret Name: QBusiness-fsx-creds
After successfully connecting to the Windows instance, you'll configure the environment:
-
Open PowerShell
- Right-click the Windows Start button
- Select "Windows PowerShell (Admin)"
-
Clone Repository
# Clone the repository git clone https://github.com/your-repo-url/amazonq-connector-for-fsx-windows.git # Navigate to the directory cd amazonq-connector-for-fsx-windows
-
Execute Configuration Script
# Run the configuration script .\configure_ad_users_groups_and_fsx.ps1
-
Script Actions The script will automatically:
- Set up logging
- Retrieve AWS Secrets Manager credentials
- Create Active Directory groups and users
- Mount Amazon FSx for Windows File Server
- Configure file permissions
- Perform cleanup operations
Monitor the script output for any errors. The process typically takes 3-5 minutes to complete.
After the script completes, verify the setup:
-
Mount File System
# Replace with your FSx DNS name net use X: \\<dns-name>.example.com\share
-
Verify Files
- Open File Explorer
- Navigate to X: drive
- Confirm presence of:
generative-ai-on-aws-how-to-choose.pdf
aws-security-incident-response-guide.pdf
-
Check Permissions
# View file permissions Get-Acl "X:\generative-ai-on-aws-how-to-choose.pdf" | Format-List Get-Acl "X:\aws-security-incident-response-guide.pdf" | Format-List
Now that the infrastructure is ready, let's configure IAM Identity Center:
Note: Perform #1 only if you it is not enabled in your AWS Account
- Service Activation
- Navigate to IAM Identity Center in AWS Console
- Click "Enable"
- Select "Enable in only this AWS Account"
- Click "Continue"
- Wait for activation to complete (approximately 2-3 minutes)
-
Access MFA Configuration
- Go to "Settings" → "Authentication"
- Click "Configure" under MFA section
-
Update Settings
Prompt users for MFA: Never Click: Save changes
Note: This MFA setting is for demonstration purposes. In production environments, always enable MFA.
- Change Identity Source
- Navigate to "Settings" → "Identity source"
- Click "Actions" → "Change identity source"
- Select "Active Directory"
- Choose
example.com
from the Existing Directories dropdown - Review and confirm changes
Wait for the identity source change to complete (approximately 5 minutes).
-
Add Groups
Navigate to: Settings → Groups Click: Add users and groups Select: Groups Add: - ml-engineers - security-engineers Note: If you see a banner with "Resume Sync" option, click on it to resume the Sync
-
Sync Status
- It takes 3-5 minutes for the sync
- Verify group members are properly synchronized
When you're ready to remove all resources, follow these steps in order:
- Delete IAM Identity Center
- Navigate to IAM Identity Center console
- Go to "Settings" → "Management"
- Click "Delete"
- Check all confirmation boxes
- Enter Instance ID when prompted
- Wait for complete deletion (approximately 5-10 minutes)
-
Delete CloudFormation Stack
# Delete stack using AWS CLI aws cloudformation delete-stack \ --stack-name your-stack-name # Monitor deletion status aws cloudformation describe-stacks \ --stack-name your-stack-name \ --query Stacks[0].StackStatus
-
Clean Up Secrets
# Delete all associated secrets aws secretsmanager delete-secret \ --secret-id QBusiness-fsx-creds \ --force-delete-without-recovery aws secretsmanager delete-secret \ --secret-id jdoe \ --force-delete-without-recovery aws secretsmanager delete-secret \ --secret-id jsmith \ --force-delete-without-recovery
-
Remove Amazon Q Business Application
- Navigate to Amazon Q console
- Select "Applications"
- Choose your Q Business Application
- Click "Delete" and confirm
After cleanup, verify all resources are properly removed:
-
Verify Stack Deletion
# Check stack status aws cloudformation list-stacks \ --query 'StackSummaries[?StackName==`your-stack-name`].StackStatus'
-
Verify Network Resources
# List remaining ENIs in VPC aws ec2 describe-network-interfaces \ --filters Name=vpc-id,Values=<your-vpc-id> # Delete any remaining ENIs if necessary aws ec2 delete-network-interface \ --network-interface-id <eni-id>
-
Final Verification Checklist
- CloudFormation stack deleted
- VPC removed
- EC2 instances terminated
- FSx file system deleted
- Secrets removed from Secrets Manager
- IAM Identity Center disabled
- Amazon Q Business Application removed
Q: Why am I seeing only "Sorry, I could not find relevant information to complete your request." as response from Amazon Q?
A: There can be multiple reasons:
- Ensure the user has permissions on the file in the FSx file system
- Check in the Amazon Cloudwatch to check if the file is considered under crawling and indexed successfully
- Verify if the question has the relevance in the indexed documents
Q: Why am I seeing "KendraCustomerSession is not authorized to perform: fsx:DescribeFileSystems on resource:" during the data sync?
A: The role is missing the FSx permissions. Add the FSx permissions and run again.
Q: Why am I seeing "Kendra is unable to assume index IAM role, please ensure that service principal kendra.amazonaws.com is added to IAM role trust policy" during the data sync?
A: Add the below JSON in the IAM Role, Trusted relationships section:
{
"Sid": "AllowKendraToAssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "kendra.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
Q: Why am I seeing "Message":"Connector sync failed due to following exception","Exception":"Dangling meta character '*' near index"?
A: In the Sync scope section of Data source, remove * in front of the file types. The correct way to add file types is:
.txt,.pdf,.png
-
Documentation
-
Support Channels
- [AWS re:Post] (https://repost.aws/)