diff --git a/README.md b/README.md index c3386aed16a65d76378920b3cdf2924a4e526565..b2466252491b5aaec640ea8ca1a40c38d3951ac2 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Template are available to the link below. In this example, you will find how to create a file to a defined path with cloud-init. Content inside `%` are meant to be replaced with sed command to be able to use environment variables or user-data. -**example:** +**Example:** ```yaml write_files: - content: | @@ -94,7 +94,7 @@ sed -i "s/%atrium_count_index%/$(scw-userdata atrium_count_index)/g" /root/atriu The example show how to curl a configuration file from repository to a defined path with cloud-init. -**example :** +**Example :** ```yaml runcmd: # @@ -111,11 +111,10 @@ runcmd: ## Use Gitlab variables in instances -### Example - From my instances, I should be able to access the variables as user-data using the command `scw-userdata <my-variable>` after declaring them in Terraform. **Some documentation : https://blog.scaleway.com/introducing-scaleway-cloud-init-support/** +**Example : Declare in Terraform** ```HCL user_data = { atrium_count_index = count.index @@ -126,6 +125,11 @@ user_data = { } ``` +** Example : Retrieve in instance +```bash +scw-userdata atrium_count_index +``` + ## Setup Terraform Locally First, you must setup 2 local files for your variables : @@ -164,7 +168,7 @@ Now, you can create a file for your variables information called **variables-loc SCW_PROJECT_ID = "" SCW_ACCESS_KEY = "" SCW_SECRET_KEY = "" -INSTANCES_COUNT = "2" +INSTANCES_COUNT = "" ENVIRONMENT = "" ```