Magento 2.1.18 is the final 2.1.x release. After June 2019, Magento 2.1.x will no longer receive security patches, quality fixes, or documentation updates.
To maintain your site's performance, security, and PCI compliance, upgrade to the latest version of Magento.

Services

Use the services.yaml file to configure all of your services supported and used by Magento Commerce Cloud. These services include MySQL, Redis, ElasticSearch (for 2.1.X and later), and so on. You do not need to subscribe to external service providers.This file is located in the .magento directory in your project. See the latest sample of the services.yaml file.

When you push your Git branch, our deploy script uses the values defined by configuration files in the .magento directory. After deployment, the script deletes the directory and its contents. Your local development environment is not affected.

For Pro projects, the changes you make using this YAML file affects your Integration environment only. To make these changes in a Staging or Production environment, you must create a Support ticket.

How this file works

The .magento.app.yaml and services.yaml files set the services, applications, and configurations to build and include in an environment. If you add services with specific versions, the initial push and deployment of your branches with these updated files directs the PaaS environment to provision the environment with those services. When you make changes to the services, the environment updates.

This affects the following environments:

  • All Starter environments including Production master
  • Pro Integration environments

To install and update services in Pro Staging and Production environments (IaaS), you must enter a Support ticket. Indicate the service changes needed and your updated .magento.app.yaml and services.yaml files in the ticket.

Default services

The following is the default services.yaml file:

1
2
3
4
5
6
mysql:
    type: mysql:10.0
    disk: 2048

redis:
    type: redis:3.0

Modify this file to use specific and additional services in your deployment. See the type section to see the services we support and deploy for you if you add them to the file.

Service values

To add a service, you add the following data to services.yaml:

1
2
3
name:
    type: name:version
    disk: value

For example:

1
2
3
mysql:
    type: mysql:10.0
    disk: 2048

name

Identifies the service in the project. The name can consist only of lower case alphanumeric characters: a to z and 0 to 9. For example, Redis is entered as redis.

You can have multiple instances of each service type. For example, you could have multiple Redis instances. For example, we use multiple Redis instances, one for session and one for cache.

1
2
3
4
5
redis:
    type: redis:3.0

redis2:
    type: redis:3.0

Be aware, if you rename a service in the services.yaml file, the following is permanently removed:

  • The existing service before creating a new service with the new name you specify.
  • All existing data for the service is removed. We strongly recommend you snapshot your environment before you change the name of an existing service.

type

The type of your service in the format: type:version

We support and deploy the following services:

disk

Specifies the size of the persistent disk storage (in MB) allocated to the service.

For example, the current default storage amount per project is 5GB, or 5120MB. You can distribute this amount between your application and each of its services. See relationships.

Using the services

For services to be available to an application in your project, you must specify relationships between applications and services in .magento.app.yaml.

Updated