In this step, you will create a Data Repository Association (DRA) between the S3 bucket and FSx Lustre Filesystem.
source ~/environment/env_vars
aws fsx create-data-repository-association \
--file-system-id ${FSX_ID} \
--file-system-path "/hsmtest" \
--data-repository-path s3://${BUCKET_NAME_DATA} \
--s3 AutoImportPolicy='{Events=[NEW,CHANGED,DELETED]},AutoExportPolicy={Events=[NEW,CHANGED,DELETED]}' \
--batch-import-meta-data-on-create \
--region ${AWS_REGION}
aws fsx describe-data-repository-associations --filters "Name=file-system-id,Values=${FSX_ID}" --query "Associations[0].Lifecycle" --output text
The status should be CREATING. Once created the status should be AVAILABLE. You can also check the Data repository association details and status in the FSx console by clicking on your File System ID.
Step 3 is expected to take a few minutes. You are going to check this again and you can proceed with the next section. While creating you should be able to see the status as shown above.