Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Added Cloud Configuration Hierarchy #8031

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions src/cloud/live/sens-data-over.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You must have [environment-level, Admin role privileges][admin] to complete conf

## Consistent configuration

The database contains default configurations for your Magento store. When you update configurations in the {{site.data.var.ece}} environments using the Magento Admin panel, your configuration changes apply to the `app/etc/config.php` file. You can then use this file to manage and synchronize the Magento application configuration for your local environment and across each Cloud environment.
The database contains default configurations for your Magento store. When you update configurations in the {{site.data.var.ece}} environments using the Magento Admin panel or the Magento CLI `bin/magento config:set` command, your configuration changes apply to the `app/etc/config.php` file. You can then use this file to manage and synchronize the Magento application configuration for your local environment and across each Cloud environment.

Use the `{{site.data.var.ct}}` command in the remote environment to generate a `config.php` file:

Expand Down Expand Up @@ -43,7 +43,9 @@ Because {{site.data.var.ece}} supports only the Magento production and maintenan

### Sensitive data

Sensitive values are _not_ stored in the `app/etc/config.php` file. Any sensitive configurations export to the `app/etc/config.php` file during the `config:dump` process. We recommend using environment variables to store sensitive values. For an example, see [Add Magento authentication keys][auth].
Sensitive values are _not_ stored in the `app/etc/config.php` file. Any sensitive configurations export to the `app/etc/env.php` file when you use the `bin/magento app:config:dump` Magento CLI command. For Cloud projects, we recommend using {{ site.data.var.ece }} environment variables to store sensitive values. For an example, see [Add Magento authentication keys][auth].

You can also set sensitive values using the Magento CLI command: `bin/magento config:sensitive:set`, see [Sensitive or system-specific settings] in the _Configuration Guide_.

### SCD performance

Expand All @@ -60,6 +62,17 @@ All system configurations are set during build and deploy according to the follo
1. If an environment variable does not exist, use the configuration from a `MAGENTO_CLOUD_RELATIONSHIPS` name-value pair in the [`.magento.app.yaml` file][app-yaml]. Ignore the default configuration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why MAGENTO_CLOUD_RELATIONSHIPS is mentioned here? This variable contains only connection data to services not system configurations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

1. If an environment variable does not exist and `MAGENTO_CLOUD_RELATIONSHIPS` does not contain a name-value pair, remove all customized configuration and use the values from the default configuration.

If the same setting is configured in multiple places, Magento relies on the following configuration hierarchy to determine which value to apply to the environment :

|Priority|Configuration<br/>Method|Description|
|---|---|---|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This table seems to have an unnatural order. My spidey-sense wants to see priority listed in some sequential order. Is there a method you used that I overlooked or can this be reordered?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The strange order seems to be something that happened in my VS code instance. I'm not sure what happened. Should be in sequential order.

|1 | Project Web UI<br>environment variables | Values added from the _Variables_ tab of environment configuration in the Project Web UI. We recommend specifying values here for sensitive or environment-specific configurations. Settings specified here cannot be edited from the Magento Admin. See [Environment configuration variables][].|
|2 | `.magento.app.yaml` | Values added in the `variables` section of the `.magento.app.yaml` file. We recommend specifying values here to ensure consistent configuration across all environments. **Do not specify sensitive values in the `.magento.app.yaml` file.** See [Application settings][app-yaml].|
|3 | `app/etc/env.php` | Environment-specific configuration values stored here are added by using the Magento `app:config:dump` command. Set the system-specific and sensitive values using environment variables or the Magento CLI. See [Sensitive data](#sensitive-data). The `env.php` file is **not** included in source control.|
|4 | `app/etc/config.php` | Values stored here are added by using the Magento `app:config:dump` command. Shared configuration values are added to `config.php`. Set shared configuration from the Magento Admin or using the Magento CLI. See [Consistent configuration](#consistent-configuration). The `config.php` file is included in source control.|
|5 | Database | Values stored here are added by setting configurations in the Magento Admin. Note that configurations set using any of the preceding methods are locked (greyed out) and cannot be edited from the Magento Admin.|
|6 | `config.xml` | Many configurations have default values set in a the `config.xml` file for a module. If Magento cannot find any value set by any of the preceding methods, it falls back to the default value, if set.|

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also mention .magento.env.yaml as data from some configurations (e.g. service configurations) will override data in env.php

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed but that is separate from this. This is a table for Magento application configuration hierarchy. This page is about "Configuration management for store settings" not service configurations. I had a long conversation with @meker12 last night and .magento.env.yaml is a different type of configuration (service & platform).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BarnyShergold agree. This is about system configurations only. Probably I was confused by MAGENTO_CLOUD_RELATIONSHIPS mentioned above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - I think this whole page needs a rework, especially after your comments earlier. I'm going to raise an issue so we look at it. 👍

## Procedure to manage your settings

The following illustrates a high-level overview of this process:
Expand Down Expand Up @@ -170,8 +183,10 @@ This process **overwrites** the store configuration; only do the following if th
[app-yaml]: {{ site.baseurl }}/cloud/project/magento-app.html
[commerce-dump]: {{ site.baseurl }}/guides/v2.3/reference/cli/magento-commerce.html#appconfigdump
[env-yaml]: {{ site.baseurl }}/cloud/project/magento-env-yaml.html
[environment configuration variables]: {{ site.baseurl }}/cloud/project/projects.html#environment-configuration-variables
[export]: {{ site.baseurl }}/config-guide/cli/config-cli-subcommands-config-mgmt-export.html
[Optimize deployment]: {{ site.baseurl }}/cloud/deploy/optimize-cloud-deployment.html
[Pipeline deployment]: {{ site.baseurl }}/guides/v2.3/config-guide/deployment/pipeline/technical-details.html
[quick]: {{ site.baseurl }}/cloud/env/variables-build.html#scd_strategy
[scd]: {{ site.baseurl }}/cloud/deploy/static-content-deployment.html
[scd]: {{ site.baseurl }}/cloud/deploy/static-content-deployment.html
[Sensitive or system-specific settings]: {{ site.baseurl }}/guides/v2.4/config-guide/prod/config-reference-sens.html