You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/2.storage-drivers/s3.md
+44-30Lines changed: 44 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,12 +24,10 @@ services:
24
24
25
25
STORAGE_DRIVER: s3
26
26
STORAGE_S3_BUCKET: gh-actions-cache
27
-
STORAGE_S3_ACCESS_KEY: access_key
28
-
STORAGE_S3_SECRET_KEY: secret_key
29
27
30
-
STORAGE_S3_ENDPOINT: minio
31
-
STORAGE_S3_PORT: '9000'
32
-
STORAGE_S3_USE_SSL: 'false'
28
+
AWS_ACCESS_KEY_ID: access_key
29
+
AWS_SECRET_ACCESS_KEY: secret_key
30
+
AWS_ENDPOINT_URL: http://minio:9000
33
31
volumes:
34
32
- cache-data:/app/.data
35
33
@@ -47,6 +45,8 @@ volumes:
47
45
48
46
### `docker-compose` AWS S3 example
49
47
48
+
This example assumes that credentials are being provided by the environment, e.g. via an [instance profile](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html) or [EKS IRSA](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html).
49
+
50
50
```yaml [docker-compose.yml]
51
51
version: '3.9'
52
52
@@ -60,12 +60,7 @@ services:
60
60
61
61
STORAGE_DRIVER: s3
62
62
STORAGE_S3_BUCKET: gh-actions-cache
63
-
STORAGE_S3_ACCESS_KEY: access_key
64
-
STORAGE_S3_SECRET_KEY: secret_key
65
63
66
-
STORAGE_S3_ENDPOINT: s3.amazonaws.com
67
-
STORAGE_S3_PORT: '443'
68
-
STORAGE_S3_USE_SSL: 'true'
69
64
volumes:
70
65
- cache-data:/app/.data
71
66
@@ -75,46 +70,65 @@ volumes:
75
70
76
71
### Environment Variables
77
72
78
-
Don't forget to set the `STORAGE_DRIVER` environment variable to `s3` to use the S3 storage driver.
73
+
The only required S3-related environment variables are `STORAGE_DRIVER: s3` and `STORAGE_S3_BUCKET`. The rest of the environment variables are optional and depend on your S3-compatible storage provider.
74
+
75
+
The AWS SDK will automatically use any AWS credentials available in the environment, e.g. `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_REGION`. Outside of AWS, these environment variables can still be used to authenticate with S3-compatible storage, as seen in the Minio example above.
76
+
77
+
Common environment variables are listed below. For a full list of configuration options, see the [AWS SDK documentation](https://docs.aws.amazon.com/sdkref/latest/guide/settings-reference.html#EVarSettings).
79
78
80
79
#### `STORAGE_S3_BUCKET`
81
80
82
81
Example: `gh-actions-cache`
83
82
84
-
The name of the S3 bucket used for storage.
83
+
The name of the S3 bucket used for storage. This environment variable is always required.
85
84
86
-
#### `STORAGE_S3_ACCESS_KEY`
85
+
#### `AWS_REGION`
87
86
88
-
Example: `access_key`
87
+
Example: `us-east-1`
89
88
90
-
The access key for S3 storage.
89
+
The AWS SDK relies on this variable being set. In the cache server, it defaults to `us-east-1` if not provided. This has no effect if you are using a non-AWS S3-compatible storage provider, such as MinIO.
91
90
92
-
#### `STORAGE_S3_SECRET_KEY`
91
+
#### `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
93
92
94
-
Example: `secret_key`
93
+
Example:
94
+
`AWS_ACCESS_KEY_ID: access_key`
95
+
`AWS_SECRET_ACCESS_KEY: secret_key`
95
96
96
-
The secret key for S3 storage.
97
+
This is the access key/secret key used to authenticate with S3-compatible storage. If required to authenticate with your provider, these should be provided by the provider. Alternatively, you can use the `AWS_PROFILE` environment variable to specify a profile from your AWS credentials file.
97
98
98
-
#### `STORAGE_S3_ENDPOINT`
99
+
#### `AWS_PROFILE`
99
100
100
-
Example: `s3.amazonaws.com`, `minio`
101
+
Example: `my-profile`
101
102
102
-
The endpoint hostname for S3 storage.
103
+
If you wish to run the cache server locally and utilize a profile from your AWS credentials file or local AWS CLI configuration, you can set the `AWS_PROFILE` environment variable to the name of the profile. Note that this will also require mounting the AWS credentials file into the container in order for the SDK to be able to find it.
# Mount the AWS CLI credentials and config into the container
124
+
- ~/.aws:/root/.aws:ro
113
125
114
-
The port S3 storage is running on.
126
+
volumes:
127
+
cache-data:
128
+
```
115
129
116
-
#### `STORAGE_S3_USE_SSL`
130
+
#### `AWS_ENDPOINT_URL`
117
131
118
-
Example: `false`
132
+
Example: `http://minio:9000`
119
133
120
-
Whether to use SSL for S3 storage connections.
134
+
This is the endpoint URL for the S3-compatible storage. This is only required if you are using a non-AWS S3-compatible storage provider, such as MinIO.
0 commit comments