Skip to content

Cloud IAM Setup

When flexFS servers and mount clients 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.

On AWS, flexFS can use EC2 instance roles to access S3 without static credentials.

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:::my-flexfs-bucket",
"arn:aws:s3:::my-flexfs-bucket/*"
]
}
]
}

Replace my-flexfs-bucket with your bucket name.

Terminal window
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"
}]
}'
Terminal window
aws iam attach-role-policy \
--role-name flexfs-role \
--policy-arn arn:aws:iam::$ACCOUNT_ID:policy/flexfs-s3-policy

4. Create an instance profile and attach the role

Section titled “4. Create an instance profile and attach the role”
Terminal window
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-role

For new instances, specify the profile at launch:

Terminal window
aws ec2 run-instances \
--instance-type c6gn.16xlarge \
--iam-instance-profile Name=flexfs-profile \
...

For existing instances:

Terminal window
aws ec2 associate-iam-instance-profile \
--instance-id i-0123456789abcdef0 \
--iam-instance-profile Name=flexfs-profile

When blockPass is empty, flexFS tries in order:

  1. EC2 instance metadata (IMDS v2) for instance role credentials
  2. Default AWS credential chain (environment variables, ~/.aws/credentials, etc.)