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
+52-17Lines changed: 52 additions & 17 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
@@ -70,30 +70,65 @@ volumes:
70
70
71
71
### Environment Variables
72
72
73
-
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.
74
76
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`.
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).
76
78
77
79
#### `STORAGE_S3_BUCKET`
78
80
79
81
Example: `gh-actions-cache`
80
82
81
-
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.
84
+
85
+
#### `AWS_REGION`
86
+
87
+
Example: `us-east-1`
88
+
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.
90
+
91
+
#### `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
92
+
93
+
Example:
94
+
`AWS_ACCESS_KEY_ID: access_key`
95
+
`AWS_SECRET_ACCESS_KEY: secret_key`
82
96
83
-
#### `STORAGE_S3_ENDPOINT`
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.
84
98
85
-
Example: `s3.amazonaws.com`, `minio`
99
+
#### `AWS_PROFILE`
86
100
87
-
The endpoint hostname for S3 storage.
101
+
Example: `my-profile`
88
102
89
-
#### `STORAGE_S3_PORT`
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
125
+
126
+
volumes:
127
+
cache-data:
128
+
```
94
129
95
-
#### `STORAGE_S3_USE_SSL`
130
+
#### `AWS_ENDPOINT_URL`
96
131
97
-
Example: `false`
132
+
Example: `http://minio:9000`
98
133
99
-
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