Cloud Storage & CDN
Amazon S3 Configuration
Step-by-step AWS guide: setting up an IAM user, crafting least-privilege security policies, creating an S3 bucket, and configuring CORS.
1. Create an AWS IAM Policy (Least-Privilege)
Never use root credentials or full Administrator privileges. Create a dedicated IAM policy containing only the exact permissions Clockwork Offloader requires to store, read, and delete media files.
- Open the AWS IAM Console.
- Click Policies → Create policy.
- Switch to the JSON tab and paste the following policy (replace
your-media-bucket-namewith your actual bucket name):
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ClockworkBucketAccess",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": "arn:aws:s3:::your-media-bucket-name"
},
{
"Sid": "ClockworkObjectAccess",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject",
"s3:PutObjectAcl"
],
"Resource": "arn:aws:s3:::your-media-bucket-name/*"
}
]
} 2. Create the Dedicated IAM User
- In the IAM Console, navigate to Users → Create user.
- Enter a name such as
clockwork-offloader-user. Do not enable AWS Management Console access. - Under Set permissions, choose Attach policies directly and select the policy created in Step 1.
- After creating the user, click on the user name → Security credentials → Create access key.
- Choose Application running outside AWS. Save your Access Key ID and Secret Access Key securely.
3. Create Your S3 Bucket
- Navigate to the AWS S3 Console and click Create bucket.
- Enter a globally unique bucket name (e.g.,
media.yourcompany.orgorcompany-wp-media). - Select the AWS Region geographically closest to your audience (e.g.
us-east-1,us-east-2,eu-west-1). - Object Ownership: Select ACLs enabled (Bucket owner preferred) if you plan on serving files directly from S3 without CloudFront. If using CloudFront with Origin Access Control (OAC), ACLs disabled is recommended.
4. Configure CORS (Cross-Origin Resource Sharing)
If your media library contains SVGs, custom web fonts, or images loaded dynamically via JavaScript canvas, you must configure CORS on the bucket:
- In your bucket settings, click the Permissions tab.
- Scroll down to Cross-origin resource sharing (CORS) and click Edit.
- Paste the following JSON:
[
{
"AllowedHeaders": ["*"],
"AllowedMethods": ["GET", "HEAD"],
"AllowedOrigins": ["https://yourdomain.com", "https://*.yourdomain.com"],
"ExposeHeaders": ["ETag"],
"MaxAgeSeconds": 86400
}
] Next Step: With your S3 bucket active, set up Amazon CloudFront CDN → for global edge caching and free SSL delivery.