Cloud IAM Setup
When flexFS servers run on cloud instances, they can authenticate to object storage using the cloud provider’s native identity system instead of static credentials. This is the recommended approach for production deployments because it eliminates the need to manage and rotate access keys.
The identities that need storage access are those of the metadata server and any proxy servers. For a block store created without --password, the metadata server passes mount clients the blockUser and blockPass from its own credentials file or, when that file has no blockPass, credentials from its host’s identity, so mount hosts do not need a role of their own. On AWS, GCP, and OCI the metadata server obtains those credentials through the same credential chain it uses for its own access; on Azure it uses only its host’s system-assigned (or a single user-assigned) managed identity (see the Azure section).
Amazon Web Services (S3)
Section titled “Amazon Web Services (S3)”On AWS, flexFS can use EC2 instance roles to access S3 without static credentials.
1. Create an IAM policy
Section titled “1. Create an IAM policy”Create a policy that grants the required S3 permissions:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject", "s3:PutObject", "s3:DeleteObject", "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::<bucket>", "arn:aws:s3:::<bucket>/*" ] } ]}Replace <bucket> with your bucket name.
S3 Express One Zone (directory buckets)
Section titled “S3 Express One Zone (directory buckets)”For an S3 Express One Zone bucket, use the following policy instead. S3 Express One Zone uses session-based authentication, so a single s3express:CreateSession permission on the directory bucket authorizes the S3 data operations — the standard s3:* actions shown above are not required.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3express:CreateSession", "Resource": "arn:aws:s3express:<region>:<account-id>:bucket/<bucket>" } ]}Replace <region>, <account-id> (your AWS account ID), and <bucket> to match your bucket. Directory bucket names always end in --x-s3 (for example, my-flexfs-bucket--use1-az4--x-s3).
Save the policy document (standard or S3 Express) to policy.json, then create the policy:
aws iam create-policy \ --policy-name flexfs-s3-policy \ --policy-document file://policy.json2. Create an IAM role
Section titled “2. Create an IAM role”aws iam create-role \ --role-name flexfs-role \ --assume-role-policy-document '{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": {"Service": "ec2.amazonaws.com"}, "Action": "sts:AssumeRole" }] }'3. Attach the policy to the role
Section titled “3. Attach the policy to the role”aws iam attach-role-policy \ --role-name flexfs-role \ --policy-arn arn:aws:iam::<account-id>:policy/flexfs-s3-policy4. Create an instance profile and attach the role
Section titled “4. Create an instance profile and attach the role”aws iam create-instance-profile \ --instance-profile-name flexfs-profile
aws iam add-role-to-instance-profile \ --instance-profile-name flexfs-profile \ --role-name flexfs-role5. Attach the profile to your instances
Section titled “5. Attach the profile to your instances”For new instances, specify the profile at launch:
aws ec2 run-instances \ --instance-type c6gn.16xlarge \ --iam-instance-profile Name=flexfs-profile \ ...For existing instances:
aws ec2 associate-iam-instance-profile \ --instance-id i-0123456789abcdef0 \ --iam-instance-profile Name=flexfs-profile6. Configure flexFS with the instance role
Section titled “6. Configure flexFS with the instance role”With the role attached, the instance provides credentials automatically — omit both --username and --password when creating the block store:
configure.flexfs create block-store \ --providerCode aws \ --regionCode <region> \ --apiCode s3 \ --bucket <bucket> \ --prefix <prefix>Credential chain
Section titled “Credential chain”When no password is set (see the tip above), flexFS tries in order:
- EC2 instance metadata (IMDS v2) for instance role credentials
- Default AWS credential chain (environment variables,
~/.aws/credentials, IRSA and EKS Pod Identity, ECS task roles, etc.)
Google Cloud Platform (GCS)
Section titled “Google Cloud Platform (GCS)”On GCP, flexFS can use attached service accounts on Compute Engine VMs or Workload Identity on GKE.
1. Create a service account
Section titled “1. Create a service account”gcloud iam service-accounts create flexfs-sa \ --display-name "flexFS Storage Access"2. Grant storage permissions
Section titled “2. Grant storage permissions”gcloud storage buckets add-iam-policy-binding gs://<bucket> \ --member serviceAccount:flexfs-sa@<project-id>.iam.gserviceaccount.com \ --role roles/storage.objectAdmin3. Attach the service account to your VM
Section titled “3. Attach the service account to your VM”For new instances:
gcloud compute instances create <vm-name> \ --service-account flexfs-sa@<project-id>.iam.gserviceaccount.com \ --scopes storage-full \ ...For existing instances (requires a stop/start):
gcloud compute instances stop <vm-name>gcloud compute instances set-service-account <vm-name> \ --service-account flexfs-sa@<project-id>.iam.gserviceaccount.com \ --scopes storage-fullgcloud compute instances start <vm-name>4. Configure flexFS with the attached service account
Section titled “4. Configure flexFS with the attached service account”With the service account attached, the instance provides credentials automatically — omit both --username and --password when creating the block store:
configure.flexfs create block-store \ --providerCode gcp \ --regionCode <region> \ --apiCode gcs \ --bucket <bucket> \ --prefix <prefix>Credential chain
Section titled “Credential chain”When no password is set (see the tip above), flexFS uses GCP Application Default Credentials (ADC):
GOOGLE_APPLICATION_CREDENTIALSenvironment variablegcloud auth application-default logincredentials- Attached service account or GKE Workload Identity (via metadata server)
Microsoft Azure (Blob Storage)
Section titled “Microsoft Azure (Blob Storage)”On Azure, flexFS can use managed identities to access Blob Storage without access keys.
1. Enable managed identity on your VM
Section titled “1. Enable managed identity on your VM”For system-assigned identity:
az vm identity assign --name <vm-name> --resource-group <resource-group>Note the principalId from the output.
2. Grant storage permissions
Section titled “2. Grant storage permissions”az role assignment create \ --assignee <principal-id> \ --role "Storage Blob Data Contributor" \ --scope /subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Storage/storageAccounts/<storage-account>3. Configure flexFS with only the storage account name
Section titled “3. Configure flexFS with only the storage account name”When creating a block store, provide --username (the storage account name) but omit --password:
configure.flexfs create block-store \ --providerCode azure \ --regionCode <region> \ --apiCode azure \ --bucket <container> \ --prefix <prefix> \ --username <storage-account>On each proxy server, set blockUser to the storage account name and omit --blockPass. Run it as the user that runs the proxy server (with sudo for the systemd service, which runs as root):
proxy.flexfs init creds --blockUser <storage-account>Credential chain
Section titled “Credential chain”When no password is set, the credentials the metadata server passes to mount clients come only from the system-assigned (or a single user-assigned) managed identity of the metadata server’s host. AZURE_CLIENT_ID is not used for this, so a host with several user-assigned identities and no system-assigned one cannot supply mount credentials. A service principal in environment variables, Workload Identity, or az login on the metadata host does not give mount clients access, so the metadata server must run on an Azure host with a managed identity that has the role assignment above.
For their own storage access, the metadata and proxy servers use DefaultAzureCredential, which tries in the order documented by the Azure SDK:
- Environment variables (
AZURE_CLIENT_ID,AZURE_TENANT_ID,AZURE_CLIENT_SECRET) - Workload identity (for AKS)
- Managed identity (system-assigned or user-assigned)
- Azure CLI credentials (
az login), then Azure Developer CLI and Azure PowerShell
Oracle Cloud Infrastructure (OCI)
Section titled “Oracle Cloud Infrastructure (OCI)”On OCI, flexFS can use instance principals to access Object Storage without API keys.
1. Create a dynamic group
Section titled “1. Create a dynamic group”Create a dynamic group named flexfs-instances (the name referenced by the policy in Step 2) with a matching rule for your compute instances:
Any {instance.compartment.id = '<compartment-ocid>'}Or match specific instances:
Any {instance.id = '<instance-ocid>'}2. Create an IAM policy
Section titled “2. Create an IAM policy”Allow dynamic-group flexfs-instances to manage objects in compartment <compartment-name>Allow dynamic-group flexfs-instances to read buckets in compartment <compartment-name>3. Configure flexFS without credentials
Section titled “3. Configure flexFS without credentials”When creating a block store, omit both --username and --password (--namespace is still required for the oci API):
configure.flexfs create block-store \ --providerCode oci \ --regionCode <region> \ --apiCode oci \ --namespace <namespace> \ --bucket <bucket> \ --prefix <prefix>Credential chain
Section titled “Credential chain”When no password is set (see the tip above), flexFS tries in order:
- Instance principal (from instance metadata via dynamic group)
- Default OCI config (
~/.oci/config)