How to Integrate

Last updated on
12 August 2021

1. Project:

  • Create your own project for a contributed module at d.o.

2. Module:

  • In your project, implement a module, which can be a sub-module as a cloud service provider of cloud module. You can learn about how you implement a sub-module from the following modules:
    • cloud/modules/cloud_service_providers/aws_cloud
    • cloud/modules/cloud_service_providers/k8s
    • cloud/modules/cloud_service_providers/openstack
    • cloud/modules/cloud_service_providers/terraform
    • cloud/modules/cloud_service_providers/vmware

3. CloudConfigPlugin:

  • In your sub-module, you need to add <ModuleName>ConfigPlugin which implements CloudConfigPluginManagerInterface, that is responsible for loading credentials.
  • You can learn about CloudConfigPlugin from the following implementations:
    • cloud/modules/cloud_service_providers/aws_cloud/src/Plugin/cloud/config/AwsCloudConfigPlugin.php
    • cloud/modules/cloud_service_providers/k8s/src/Plugin/cloud/config/K8sConfigPlugin.php
    • cloud/modules/cloud_service_providers/openstack/src/Plugin/cloud/config/OpenStackCloudConfigPlugin.php
    • cloud/modules/cloud_service_providers/terraform/src/Plugin/cloud/config/TerraformCloudConfigPlugin.php
    • cloud/modules/cloud_service_providers/vmware/src/Plugin/cloud/config/VmwareCloudConfigPlugin.php

4. Service:

  • Add <ModuleName>ServiceInterface and implement <ModuleName>Service to access to your cloud service (or the third-party cloud service) API.

5. Entity:

  • Add some Drupal's entities which are corresponding to your cloud entities.

6. View:

  • Add list views for your cloud service from Drupal UI. Export YAML configuration from Drupal site and import them to config/install directory in the your (sub-) module.

7. Form:

  • Add CRUD forms for your module. Each form should call <ModuleName>Service to interact with the your cloud service API.

8. PHP Composer:

  • Create composer.json; it should include drupal/cloud for your module.

Help improve this page

Page status: No known problems

You can: