-
Notifications
You must be signed in to change notification settings - Fork 0
/
.env.example
89 lines (71 loc) · 2.43 KB
/
.env.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# make this file .env
NEXT_PUBLIC_REGION=your-region
NEXT_PUBLIC_AWS_BUCKET=your-bucket-name
NEXT_PUBLIC_AWS_ACCESS_KEY_ID=your-access-key-id
NEXT_PUBLIC_AWS_SECRET_ACCESS_KEY=your-secret-access-key
# - create bucket
# - create iam role
# - get keys from iam role from (users) > (createdIam) -> (security_credentials)
# - get s3 bucket name and region
# - done
# S3 Bucket Policy
# {
# "Version": "2012-10-17",
# "Statement": [
# {
# "Sid": "PublicReadGetObject",
# "Effect": "Allow",
# "Principal": "*",
# "Action": "s3:GetObject",
# "Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*"
# }
# ]
# }
# Cross-origin resource sharing (CORS)
# [
# {
# "AllowedHeaders": [
# "*"
# ],
# "AllowedMethods": [
# "GET",
# "PUT",
# "POST",
# "DELETE",
# "HEAD"
# ],
# "AllowedOrigins": [
# "http://localhost:3000",
# "https://example.app",
# "http://example.com",
# "http://example.app"
# ],
# "ExposeHeaders": [],
# "MaxAgeSeconds": 3000
# }
# ]
# Creating an S3 Bucket:
# Go to AWS S3 Management Console. https://ca-central-1.console.aws.amazon.com/s3/home?region=ca-central-1
# Click on "Create bucket".
# Enter a unique bucket name and select the region from the URL (e.g., ca-central-1).
# Click "Create".
# Setting Up Environment Variables:
# Add your bucket name to your Environment variables.
# Set the region (e.g., ca-central-1) as an environment variable. check your region from url.
# 2. Creating an IAM Role: (here you wull create keys)
# Go to AWS IAM Management Console. https://us-east-1.console.aws.amazon.com/iam/home
# Navigate to "Access Management" -> "Users" -> "Create User".
# After creating the user, go to the user you created.
# Under "Security credentials", click on "Create access key" to generate an API key and secret key.
# Add these keys to your AWS environment variables.
# now you are ready to create image urls
## Additonal information
# Additionaly in policy section you cann create policies like you want to to create requests update or delete
# If you dont want to create the provide full access not
# recommended for the live environment
# recommended_policy_section very important
# Read (1 of 62)
# - GetObject
# Write (2 of 63)
# - DeleteObject
# - PutObject