Guide · Amazon HealthLake · IAM & Security

Amazon HealthLake IAM for MCP Servers — Permissions, Data Store Scoping, HIPAA Audit with CloudTrail

HealthLake IAM has two distinct surfaces that must be configured correctly and independently: the MCP server role that calls the management SDK and signs FHIR REST requests, and the HealthLake data access role that the HealthLake service itself assumes when reading from or writing to S3 during import and export jobs. Conflating these two roles — or trying to use a single role for both — is the most common HealthLake IAM mistake. This guide covers the full management action reference, the resource ARN format for scoping permissions to specific data stores, read-only and write policy examples you can deploy directly, the iam:PassRole requirement for import and export operations, the confused deputy protection pattern for the data access role trust policy, and the CloudTrail configuration needed to meet HIPAA audit logging requirements for FHIR data access events.

TL;DR

Two IAM surfaces: (1) MCP server role with healthlake:* management actions plus SigV4 signing authority for FHIR REST API calls; (2) HealthLake data access role assumed by the HealthLake service itself, with healthlake.amazonaws.com as the trust principal, used only for import/export S3 operations. iam:PassRole on the data access role ARN is required when calling StartFHIRImportJob or StartFHIRExportJob — missing it returns AccessDeniedException regardless of your other HealthLake permissions. Scope management permissions to specific data store ARNs with arn:aws:healthlake:{region}:{accountId}:datastore/{datastoreId}. Add an explicit Deny for healthlake:DeleteFHIRDatastore to all production roles. Enable CloudTrail data events for HealthLake to log FHIR REST API access for HIPAA compliance.

Two IAM surfaces: MCP server role vs data access role

Understanding the architectural split between these two roles prevents the most common HealthLake IAM misconfigurations. They serve entirely different purposes and are used by entirely different identities at runtime.

Surface 1: the MCP server role. This is the AWS IAM role your MCP server process assumes — typically via an EC2 instance profile, an ECS task role, a Lambda execution role, or an assumed role in your application. This role is used for two things: calling the HealthLake management SDK (creating data stores, starting import/export jobs, checking job status) and signing FHIR REST API HTTP requests with SigV4 (GET, POST, PUT, DELETE requests to the HealthLake FHIR endpoint). The same role can do both, or you can use separate roles for management vs FHIR REST access — but if you split them, each role needs its respective permission set.

Surface 2: the HealthLake data access role. This role is assumed by the HealthLake service itself, not by your application. When you call StartFHIRImportJob, you pass the data access role ARN and the HealthLake service internally calls sts:AssumeRole on it. The HealthLake service then uses that role's credentials to read NDJSON files from your S3 input prefix and write error reports to your S3 output prefix. Your application never directly uses this role's credentials — it only references the ARN. This is why the trust policy must list healthlake.amazonaws.com as the principal, not your account root or your application role.

The separation is by design. It limits blast radius: even if your MCP server role is compromised, the attacker cannot directly use it to read S3 data — they would need to trigger a HealthLake job and collect the output from S3, which is audited. It also allows fine-grained S3 access scoping for the data access role without polluting your application role's permission set with S3 bucket policies.

Management action reference

The following table covers every HealthLake management action your MCP server may need. The Resource column shows whether the action supports resource-level permissions (specific data store ARN) or requires a wildcard. List and tag-related actions that are not tied to a specific resource require "Resource": "*" in the IAM policy statement.

Action Purpose Notes
healthlake:CreateFHIRDatastore Create a new FHIR data store One-time setup; guard in prod
healthlake:DescribeFHIRDatastore Get endpoint, status, encryption config Required before FHIR API calls
healthlake:ListFHIRDatastores List all data stores in account Requires Resource: *
healthlake:DeleteFHIRDatastore Delete a data store permanently Irreversible — Deny in prod
healthlake:StartFHIRImportJob Start bulk NDJSON import from S3 Requires iam:PassRole
healthlake:DescribeFHIRImportJob Poll import job status Used in job polling loops
healthlake:ListFHIRImportJobs List import jobs with optional status filter Audit / resuming stalled jobs
healthlake:StartFHIRExportJob Start bulk export snapshot to S3 Requires iam:PassRole
healthlake:DescribeFHIRExportJob Poll export job status Polling loop
healthlake:ListFHIRExportJobs List export jobs Audit
healthlake:TagResource Add tags to a data store Cost allocation, ABAC
healthlake:UntagResource Remove tags from a data store
healthlake:ListTagsForResource List tags on a data store

In addition to these management SDK actions, FHIR REST API calls are controlled by a separate set of IAM actions enforced by the HealthLake FHIR endpoint. These actions are checked against the SigV4 signing role for each FHIR HTTP request: healthlake:GetCapabilities, healthlake:ReadFHIR, healthlake:ReadFHIRWithPost, healthlake:CreateFHIRResource, healthlake:UpdateFHIRResource, and healthlake:DeleteFHIRResource. These are distinct from the management SDK actions — a role with only healthlake:DescribeFHIRDatastore cannot make FHIR REST API calls, and vice versa.

Resource ARN format and scoping

HealthLake data store ARNs follow this format:

arn:aws:healthlake:{region}:{accountId}:datastore/{datastoreId}

For example: arn:aws:healthlake:us-east-1:123456789012:datastore/abc123def456ghij7890

The datastoreId is the alphanumeric ID returned by CreateFHIRDatastoreCommand and visible in the AWS console. It is not the data store name you chose at creation time — it is a system-generated ID that you need to store and reference in your MCP server configuration.

Scoping rules for resource ARNs in IAM policy statements:

Actions that operate on a specific data store (DescribeFHIRDatastore, DeleteFHIRDatastore, StartFHIRImportJob, DescribeFHIRImportJob, StartFHIRExportJob, DescribeFHIRExportJob, TagResource, UntagResource, ListTagsForResource) support resource-level permissions and should be scoped to either a specific data store ARN or a wildcard within your account: arn:aws:healthlake:us-east-1:123456789012:datastore/*.

Actions that list across the account (ListFHIRDatastores, ListFHIRImportJobs, ListFHIRExportJobs) are not resource-level and require "Resource": "*" in their policy statement. You cannot restrict ListFHIRDatastores to a specific data store ARN — it will return an error. For the list operations on import and export jobs, the data store ID is passed as a request parameter, not as a resource ARN, so resource-level scoping does not apply.

Read-only MCP server policy

Use this policy for MCP server roles that need to read FHIR data and check job status but must not start new imports, trigger exports, or delete anything. This is the right starting point for most production read-path MCP servers:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "HealthLakeReadManagement",
      "Effect": "Allow",
      "Action": [
        "healthlake:DescribeFHIRDatastore",
        "healthlake:DescribeFHIRImportJob",
        "healthlake:DescribeFHIRExportJob",
        "healthlake:ListTagsForResource"
      ],
      "Resource": "arn:aws:healthlake:us-east-1:123456789012:datastore/abc123"
    },
    {
      "Sid": "HealthLakeListAll",
      "Effect": "Allow",
      "Action": [
        "healthlake:ListFHIRDatastores",
        "healthlake:ListFHIRImportJobs",
        "healthlake:ListFHIRExportJobs"
      ],
      "Resource": "*"
    }
  ]
}

Notice that this policy intentionally omits healthlake:CreateFHIRDatastore, healthlake:DeleteFHIRDatastore, all Start* job actions, and all FHIR write actions. For FHIR REST read access via the endpoint, the same role needs the FHIR REST IAM actions: healthlake:ReadFHIR, healthlake:ReadFHIRWithPost, and healthlake:GetCapabilities.

Scope the data store ARN in the first statement to the specific data store ID your MCP server uses. If your server legitimately needs access to multiple data stores — for example, a multi-tenant architecture where each customer has a separate data store — use arn:aws:healthlake:us-east-1:123456789012:datastore/* and implement tenant isolation through resource tags and an ABAC condition instead.

Write policy with import/export and iam:PassRole

For MCP server roles that need to perform bulk imports and exports, add the job-start actions and the iam:PassRole permission for the data access role. The iam:PassedToService condition restricts PassRole so your MCP server can only pass the data access role to HealthLake, not to other AWS services that accept role passes:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "HealthLakeFullManagement",
      "Effect": "Allow",
      "Action": [
        "healthlake:DescribeFHIRDatastore",
        "healthlake:StartFHIRImportJob",
        "healthlake:DescribeFHIRImportJob",
        "healthlake:ListFHIRImportJobs",
        "healthlake:StartFHIRExportJob",
        "healthlake:DescribeFHIRExportJob",
        "healthlake:ListFHIRExportJobs",
        "healthlake:TagResource",
        "healthlake:ListTagsForResource"
      ],
      "Resource": "arn:aws:healthlake:us-east-1:123456789012:datastore/abc123"
    },
    {
      "Sid": "HealthLakeListOperations",
      "Effect": "Allow",
      "Action": [
        "healthlake:ListFHIRDatastores"
      ],
      "Resource": "*"
    },
    {
      "Sid": "PassDataAccessRole",
      "Effect": "Allow",
      "Action": "iam:PassRole",
      "Resource": "arn:aws:iam::123456789012:role/healthlake-data-access",
      "Condition": {
        "StringEquals": {
          "iam:PassedToService": "healthlake.amazonaws.com"
        }
      }
    }
  ]
}

The iam:PassedToService condition in the PassRole statement is a security best practice that prevents privilege escalation. Without it, a user or role with iam:PassRole on a role ARN could pass that role to any AWS service that accepts role delegation — not just HealthLake. With the condition, the PassRole permission is narrowly scoped to only be usable when calling HealthLake.

Note that healthlake:DeleteFHIRDatastore and the FHIR write REST actions are intentionally absent from this write policy as well. Add them only if explicitly required, and apply the Deny policy described in the next section to prevent accidental data loss in production.

Deny policy for destructive operations

The most consequential HealthLake operation is DeleteFHIRDatastore. It permanently deletes the entire data store and every FHIR resource it contains. There is no soft delete, no recycle bin, no recovery path — once invoked, all data is gone. For production data stores containing PHI, this action must be blocked for all operational roles through an explicit IAM Deny:

{
  "Sid": "DenyDestructiveOperations",
  "Effect": "Deny",
  "Action": [
    "healthlake:DeleteFHIRDatastore",
    "healthlake:DeleteFHIRResource"
  ],
  "Resource": "*"
}

Add this Deny statement to every production IAM role that has HealthLake permissions. Because IAM Deny always overrides Allow, this statement is effective even if another policy in the role (or in an attached AWS managed policy) grants the Delete actions. The only exception should be a break-glass emergency admin role that is not used in normal operations, requires MFA to assume, and has CloudTrail alarming on its use.

healthlake:DeleteFHIRResource is the FHIR REST API action corresponding to a DELETE HTTP request to the FHIR endpoint. Including it in the Deny prevents individual FHIR resources from being deleted by the MCP server role, which is usually the right posture for clinical data — FHIR R4 uses status flags (e.g., Condition.clinicalStatus: entered-in-error) rather than physical deletion as the standard workflow for correcting records.

Data access role trust policy with confused deputy protection

The data access role used for import and export operations needs a trust policy that grants healthlake.amazonaws.com the ability to assume it. Without additional conditions, any AWS account's HealthLake service could potentially assume this role — a confused deputy vulnerability where a third party tricks the HealthLake service into acting on your data using a role you intended only for your own account's jobs. The aws:SourceAccount condition prevents this:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "healthlake.amazonaws.com"
      },
      "Action": "sts:AssumeRole",
      "Condition": {
        "StringEquals": {
          "aws:SourceAccount": "123456789012"
        }
      }
    }
  ]
}

The aws:SourceAccount condition restricts role assumption so that only your account's HealthLake service can assume this role, not HealthLake acting on behalf of another account. Replace 123456789012 with your actual AWS account ID.

Some teams add a further constraint using aws:SourceArn to restrict to a specific data store ARN:

{
  "StringEquals": {
    "aws:SourceAccount": "123456789012",
    "aws:SourceArn": "arn:aws:healthlake:us-east-1:123456789012:datastore/abc123"
  }
}

This is the most restrictive option — only the HealthLake service acting on behalf of that specific data store can assume the role. Use this in high-security environments where you want hard isolation between data stores that share S3 infrastructure.

HIPAA compliance considerations

Amazon HealthLake is HIPAA eligible, which means AWS will sign a Business Associate Agreement (BAA) covering HealthLake as a covered service. The BAA is a prerequisite for storing Protected Health Information (PHI) in HealthLake — do not load PHI before signing the BAA with AWS through the AWS Artifact console.

HIPAA compliance for the technical layer requires audit logging of all access to PHI. HealthLake produces two categories of CloudTrail log entries:

Management events (logged by default in CloudTrail): CreateFHIRDatastore, DeleteFHIRDatastore, StartFHIRImportJob, StartFHIRExportJob, and all other SDK management operations. These are automatically captured if you have a CloudTrail trail configured for your account — no additional setup needed.

Data events (require explicit CloudTrail configuration): FHIR REST API calls via the HealthLake endpoint, specifically ReadFHIR and WriteFHIR operations. These log which IAM principal accessed which FHIR resource type and ID. For HIPAA, data event logging for FHIR access is typically required to satisfy the Audit Controls standard (§164.312(b)).

To enable HealthLake data events in CloudTrail, configure a data event selector in your trail for the HealthLake data event source. In CloudFormation or CDK:

// Using AWS CDK to add HealthLake data events to an existing trail:
// trail.addEventSelector(DataResourceType.HEALTH_LAKE_DATASTORE, [datastoreArn]);

// In CloudFormation, add to the Trail resource's EventSelectors:
// DataResources:
//   - Type: AWS::HealthLake::FHIRDatastore
//     Values:
//       - arn:aws:healthlake:us-east-1:123456789012:datastore/abc123

CloudTrail log entries for HealthLake include the following fields that are essential for HIPAA audit investigations: eventSource: healthlake.amazonaws.com, eventName (e.g., ReadFHIR, WriteFHIR), userIdentity (the IAM principal — including whether it was a role assumption and the assumed role ARN), requestParameters (resource type and resource ID for FHIR calls), responseElements, sourceIPAddress, and userAgent.

The requestParameters field for FHIR data events includes the resource type and ID, which allows you to answer the question "who accessed Patient resource abc123 and when?" during a breach investigation or compliance audit.

CloudTrail alarming for HIPAA

Beyond capturing logs, HIPAA's Audit Controls requirement is typically interpreted to require timely detection of suspicious access patterns. Set up CloudWatch Metric Filters and Alarms on your CloudTrail log group for the following HealthLake events:

// CloudWatch Metric Filter for DeleteFHIRDatastore events
// Filter pattern: { $.eventSource = "healthlake.amazonaws.com" && $.eventName = "DeleteFHIRDatastore" }

// CloudWatch Metric Filter for DeleteFHIRResource events
// Filter pattern: { $.eventSource = "healthlake.amazonaws.com" && $.eventName = "DeleteFHIRResource" }

// Set alarms with threshold = 1 and evaluation period = 1 minute
// SNS topic to on-call security team

Send CloudTrail logs to a CloudWatch Logs log group if not already doing so — this is the prerequisite for Metric Filters. The log group name is typically /aws/cloudtrail/management-events and /aws/cloudtrail/data-events if separated by event type.

For S3 buckets containing FHIR export data, enable S3 server access logging and configure S3 Object-level CloudTrail data events for GetObject and PutObject on the FHIR export prefix. FHIR export files contain PHI and must have the same access audit trail as the HealthLake data store itself.

KMS key policy for CMK-encrypted data stores

When you create a HealthLake data store with a customer-managed KMS key, the HealthLake service needs to use that key for encrypting data at rest. The KMS key policy must explicitly grant HealthLake the necessary actions. Without this policy addition, the data store creation will succeed but write operations may fail with KMS access errors:

{
  "Effect": "Allow",
  "Principal": {
    "Service": "healthlake.amazonaws.com"
  },
  "Action": [
    "kms:DescribeKey",
    "kms:GenerateDataKey",
    "kms:GenerateDataKeyWithoutPlaintext",
    "kms:Decrypt",
    "kms:ReEncryptFrom",
    "kms:ReEncryptTo"
  ],
  "Resource": "*",
  "Condition": {
    "StringEquals": {
      "kms:ViaService": "healthlake.us-east-1.amazonaws.com",
      "aws:SourceAccount": "123456789012"
    }
  }
}

The kms:ViaService condition restricts these KMS permissions to calls that originate from the HealthLake service endpoint in the specified region. This prevents the key from being used for non-HealthLake encryption operations via the healthlake.amazonaws.com principal. The aws:SourceAccount condition again provides confused deputy protection.

Remember that data store encryption configuration is immutable after creation. Set the sseConfiguration.kmsEncryptionConfig in CreateFHIRDatastoreCommand before loading any data. If you need to change from AWS-owned keys to a CMK after the fact, the only path is create a new data store with the desired encryption, export from the old store, and import into the new one.

Multi-environment isolation with ABAC

For teams running dev, staging, and prod HealthLake data stores in the same AWS account, Attribute-Based Access Control (ABAC) using resource tags prevents a misconfiguration from letting a dev MCP server role call the prod data store. Tag each data store with an Environment tag and tag the IAM roles with the same attribute:

{
  "Effect": "Deny",
  "Action": "healthlake:*",
  "Resource": "*",
  "Condition": {
    "StringNotEquals": {
      "aws:ResourceTag/Environment": "${aws:PrincipalTag/Environment}"
    }
  }
}

Add this Deny statement as a Service Control Policy (SCP) in AWS Organizations, or as an inline policy on the IAM roles. With this in place, a role tagged Environment: dev that calls any healthlake:* action on a resource tagged Environment: prod will receive a Deny regardless of what Allow policies are in place. The ${aws:PrincipalTag/Environment} syntax is an IAM policy variable that resolves at evaluation time to the tag value on the calling principal.

For this to work, two prerequisites must be in place: data stores must be tagged at creation time (the tags parameter in CreateFHIRDatastoreCommand), and IAM roles must be tagged with the matching Environment tag. Use IAM tag policies in AWS Organizations to enforce that all roles in the account are tagged with Environment.

Common gotchas

iam:PassRole without iam:PassedToService condition. Older documentation and many Stack Overflow examples show PassRole granted without the iam:PassedToService condition. While this works, it allows the same PassRole grant to be used to pass the data access role to any AWS service that accepts role delegation — not just HealthLake. Always include the condition "iam:PassedToService": "healthlake.amazonaws.com" to scope the permission precisely.

DeleteFHIRDatastore has no recovery path. Unlike RDS with snapshot retention or S3 versioning, a deleted HealthLake data store and all its FHIR resources are permanently gone. This action must not appear in operational MCP server roles. Apply the explicit Deny in production and test your Deny policy is effective before loading PHI.

FHIR REST IAM actions are separate from management SDK actions. A role that can call DescribeFHIRDatastore cannot automatically make FHIR REST API calls — the FHIR REST IAM actions (ReadFHIR, WriteFHIR, etc.) must be explicitly granted. If your MCP server uses one code path for the management SDK and a different HTTP client for FHIR REST calls signed with SigV4, verify that the signing role has the FHIR REST actions.

Cross-account access requires role assumption. HealthLake does not support resource-based policies on data stores the way S3 supports bucket policies. You cannot grant another account direct access to your data store via a resource policy. Cross-account access requires the calling account to assume a role in the data store account. This is different from S3 and can surprise teams expecting to share HealthLake data stores across accounts the way they share S3 buckets.

CloudTrail data events have per-event pricing. Enabling HealthLake FHIR REST data events in CloudTrail incurs a cost per event. For high-throughput production environments with millions of FHIR reads per day, estimate the CloudTrail cost before enabling full data event logging. As an alternative for cost-sensitive environments, consider logging only write events (WriteFHIR) to CloudTrail and implementing application-layer audit logging for reads within your MCP server.

SigV4 signing role must have FHIR REST actions scoped correctly. When the FHIR REST endpoint evaluates IAM permissions for a request, it checks the resource-level permission against the specific data store ARN — not a wildcard. If your SigV4 signing role has healthlake:ReadFHIR scoped to a different data store ARN than the one you are calling, the request fails with 403. Verify that the resource ARN in the FHIR REST action policy matches the data store endpoint you are calling.