Skip to main content

Pantheon Get Secrets - Config Notes

These notes are for setting up a SMTP Authentication for Drupal sites hosted on Pantheon.  Pantheon provides a nice tool for securing API Keys and other credentials, so they do not need to be stored in configuration files as plain text.

The function pantheon_get_secret() may be used to fetch the value of a single secret.

if (function_exists('pantheon_get_secret')) {
  $smtp_password = pantheon_get_secret('smtp_password');
  if ($smtp_password) {
    $config['smtp.settings']['smtp_password'] = $smtp_password;
  }
}

// Set Secret, escape the password if needed
terminus secret:site:set rsvp-system-org smtp_password 2600\;haxorz --scope=web

// show secrets
terminus secret:site:list rsvp-system-org

// delete, use if you need to adjust scope
terminus secret:site:delete rsvp-system-org-house api-key
 

Image
Pantheon Get Secret
Attribution
This work "Pantheon Get Secrets - Config Notes" by S.Groundwater | Gluebox.com LLC is licensed under Creative Commons Attribution Non Commercial 4.0 International