@@ -183,6 +183,7 @@ data "scaleway_rdb_instance" "mybackend" {
183
183
You can use scaleway object-storage bucket as an S3 compatible backend to store your terraform .tfstate file just like you would do with AWS s3
184
184
185
185
### by using hardcoded credetials (NOT RECOMMENDED)
186
+
186
187
```
187
188
terraform {
188
189
backend "s3" {
@@ -201,11 +202,14 @@ terraform {
201
202
```
202
203
203
204
### by using credentials environment variables
205
+
204
206
```
205
207
$ export SCW_ACCESS_KEY="XXXXXXXXXXX"
206
208
$ export SCW_SECRET_KEY="YYYYYYYYYYY"
207
209
```
210
+
208
211
and this simple backend code
212
+
209
213
```
210
214
terraform {
211
215
backend "s3" {
@@ -217,16 +221,18 @@ terraform {
217
221
}
218
222
```
219
223
220
- ### and with the shared congfiguration file ?
221
- scaleway scw-cli provide you with a credential file
224
+ ### and with the shared congfiguration file ?
225
+ scaleway scw-cli provide you with a credential file
222
226
> ~ /$HOME/.config/scw/config.yaml
223
227
224
228
to generate your credential file you can run scw init at first run or login for every new key pairs generated
229
+
225
230
```
226
231
scw login
227
232
```
228
233
229
234
it will generate scw shared configuration file folowinng this format
235
+
230
236
```
231
237
profiles:
232
238
myProfile1:
@@ -251,6 +257,7 @@ so in order to read scw ccredentials, do not try to use `profile = myProfile1` i
251
257
aws_access_key_id = XXXXXXXXXXX
252
258
aws_secret_access_key = YYYYYYYYYYY
253
259
```
260
+
254
261
then in your tf backend bloc use this profile as if it waf a aws backend ` profile = "scaleway_rofile" `
255
262
256
263
```
@@ -268,4 +275,5 @@ terraform {
268
275
}
269
276
}
270
277
```
278
+
271
279
now run terraform init and the s3 backend should be able to use scaleway object storage instead of aws s3.
0 commit comments