@@ -183,6 +183,7 @@ data "scaleway_rdb_instance" "mybackend" {
183183You 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
184184
185185### by using hardcoded credetials (NOT RECOMMENDED)
186+
186187```
187188terraform {
188189 backend "s3" {
@@ -201,11 +202,14 @@ terraform {
201202```
202203
203204### by using credentials environment variables
205+
204206```
205207$ export SCW_ACCESS_KEY="XXXXXXXXXXX"
206208$ export SCW_SECRET_KEY="YYYYYYYYYYY"
207209```
210+
208211and this simple backend code
212+
209213```
210214terraform {
211215 backend "s3" {
@@ -217,16 +221,18 @@ terraform {
217221}
218222```
219223
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
222226> ~ /$HOME/.config/scw/config.yaml
223227
224228to generate your credential file you can run scw init at first run or login for every new key pairs generated
229+
225230```
226231scw login
227232```
228233
229234it will generate scw shared configuration file folowinng this format
235+
230236```
231237profiles:
232238 myProfile1:
@@ -251,6 +257,7 @@ so in order to read scw ccredentials, do not try to use `profile = myProfile1` i
251257aws_access_key_id = XXXXXXXXXXX
252258aws_secret_access_key = YYYYYYYYYYY
253259```
260+
254261then in your tf backend bloc use this profile as if it waf a aws backend ` profile = "scaleway_rofile" `
255262
256263```
@@ -268,4 +275,5 @@ terraform {
268275 }
269276}
270277```
278+
271279now run terraform init and the s3 backend should be able to use scaleway object storage instead of aws s3.
0 commit comments