Skip to main content
MigrateClouds logoMigrateClouds
DocsUser GuidesConnect S3 Iam Role
Back to Dashboard

Connect Your S3 Bucket Using IAM Role

The most secure and recommended method - Step-by-step guide

Why IAM Role?

🔐

More Secure

Temporary credentials that expire after 1 hour

🔄

Easy to Revoke

Simply delete the role to remove access

📊

Better Auditing

All actions logged in your CloudTrail

✨

Best Practice

Recommended by AWS for third-party access

🔑 Our Service Account ID

When creating your IAM role, you'll need to trust this account:

867973539502

💡 This is MigrateClouds' service account. Your role will trust this account to access your S3 bucket.

Step 1: Create IAM Role

1.1 Open IAM Service

  1. Log into your AWS Console
  2. In the search bar at the top, type IAM and click on the service

1.2 Navigate to Roles

  1. In the left sidebar, click Roles
  2. Click the Create role button (orange button on the right)

1.3 Select Trusted Entity

  1. Trusted entity type: Select AWS account
  2. An AWS account: Select Another AWS account
  3. Account ID: Enter 867973539502
  4. Options:
    • ✅ Check "Require external ID (Best practice when a third party will assume this role)"
    • External ID: Enter a unique identifier like migrateclouds-YOUR-EMAIL-HERE
    • âš ī¸ Save this External ID - you'll need it later!
  5. Click Next

💡 Tip:The External ID prevents the "confused deputy problem" - it ensures only you can use this role.

Step 2: Attach S3 Permissions

2.1 Create Custom Policy

  1. On the "Add permissions" page, click Create policy (opens in new tab)
  2. Click the JSON tab
  3. Delete everything in the editor
  4. Copy and paste this policy:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ListBucket",
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket",
        "s3:GetBucketLocation",
        "s3:GetBucketVersioning",
        "s3:ListBucketVersions"
      ],
      "Resource": "arn:aws:s3:::YOUR-BUCKET-NAME"
    },
    {
      "Sid": "ObjectOperations",
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:GetObjectVersion",
        "s3:GetObjectAttributes",
        "s3:PutObject",
        "s3:DeleteObject",
        "s3:DeleteObjectVersion",
        "s3:AbortMultipartUpload",
        "s3:ListMultipartUploadParts"
      ],
      "Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
    },
    {
      "Sid": "ObjectMetadataAndTags",
      "Effect": "Allow",
      "Action": [
        "s3:GetObjectTagging",
        "s3:PutObjectTagging",
        "s3:DeleteObjectTagging",
        "s3:GetObjectRetention",
        "s3:RestoreObject"
      ],
      "Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
    },
    {
      "Sid": "CloudWatchMetrics",
      "Effect": "Allow",
      "Action": [
        "cloudwatch:GetMetricStatistics"
      ],
      "Resource": "*"
    }
  ]
}

âš ī¸ Replace YOUR-BUCKET-NAME with your actual bucket name in all 3 Resource ARNs above (1 bucket-level permission without /*, and 2 object-level permissions with /*)

â„šī¸ CloudWatch Permission: The cloudwatch:GetMetricStatisticspermission allows MigrateClouds to read your bucket's storage metrics for FREE quota calculation. This is optional but highly recommended.

✨ Advanced S3 Features: The policy includes permissions for:

  • â€ĸ Versioning: View and restore previous versions of files
  • â€ĸ Metadata: View and edit file metadata and content headers
  • â€ĸ Tags: Manage object tags for organization
  • â€ĸ Storage Classes: Change storage tiers and restore from Glacier

Note:This policy has been optimized to avoid IAM validation errors. Optional bucket configuration permissions (like GetEncryptionConfiguration) have been removed as they're not needed for core functionality.

  1. Click Next

2.2 Name Your Policy

  1. Policy name: MigrateCloudsS3Access
  2. Description (optional): Allows MigrateClouds to access my S3 bucket
  3. Click Create policy

2.3 Attach Policy to Role

  1. Go back to the role creation tab (previous tab)
  2. Click the 🔄 refresh icon next to "Create policy" button
  3. In the search box, type: MigrateCloudsS3Access
  4. ✅ Check the box next to your policy
  5. Click Next

Step 3: Name and Create Role

3.1 Configure Role Details

  1. Role name: MigrateCloudsRole (or any name you prefer)
  2. Description (optional): Role for MigrateClouds to access my S3 bucket
  3. Review your settings
  4. Click Create role

3.2 Copy Role ARN

  1. After creation, click on your role name: MigrateCloudsRole
  2. At the top, you'll see ARN: arn:aws:iam::123456789012:role/MigrateCloudsRole
  3. Copy this ARN - you'll need it in the next section!

Step 4: Configure S3 CORS

CORS (Cross-Origin Resource Sharing) is required for browser-based uploads to work.

4.1 Navigate to Your Bucket

  1. Go to S3 Console
  2. Click on your bucket name

4.2 Edit CORS

  1. Click the Permissions tab
  2. Scroll down to Cross-origin resource sharing (CORS)
  3. Click Edit
  4. Delete any existing CORS configuration
  5. Paste this configuration:
[
  {
    "AllowedHeaders": ["*"],
    "AllowedMethods": ["GET", "PUT", "POST", "DELETE", "HEAD"],
    "AllowedOrigins": [
      "https://migrateclouds.com",
      "https://www.migrateclouds.com"
    ],
    "ExposeHeaders": [
      "ETag",
      "Content-Length",
      "Content-Type"
    ],
    "MaxAgeSeconds": 3000
  }
]

âš ī¸ Critical: The ExposeHeaders MUST include "ETag" - without it, file uploads will fail!

  1. Click Save changes

Step 5: Connect in MigrateClouds

5.1 Open Connection Dialog

  1. Go to MigrateClouds Dashboard
  2. Navigate to Connected Services
  3. Click Amazon S3
  4. Click Connect Amazon S3 button

5.2 Fill in Connection Details

Common Fields:

  • Display Email: Enter your email
  • Region: Your bucket's region (e.g., us-east-1)
  • Bucket Name: Your bucket name
  • Key Prefix: Optional folder path

IAM Role Fields:

  • Click on the IAM Role (Recommended) option
  • Role ARN: Paste the ARN from Step 3.2
  • External ID: Enter the same ID from Step 1.3

5.3 Validate and Save

  1. Click Validate Connection button
  2. You should see: "S3 connection validated" ✅
  3. Click Save & Connect button
  4. Your S3 bucket is now connected!

Success! Your S3 Bucket is Connected

You can now browse, upload, download, and manage your S3 files directly from MigrateClouds!

Go to Dashboard

Need help? Contact us at support@t.migrateclouds.com

Last updated: October 15, 2025