PHP code example of mammatus / terraform-events

1. Go to this page and download the library: Download mammatus/terraform-events library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mammatus / terraform-events example snippets




declare(strict_types=1);

namespace MyApp\Terraform;

use Mammatus\Terraform\Events\Variables;
use Mammatus\Terraform\Events\Variables\Registry\Entry;
use WyriHaximus\Broadcast\Contracts\Listener;

final class VariablesListener implements Listener
{
    public function vars(Variables $variables): void
    {
        $variables->add(new Entry('app_name', 'mammatus-demo'));
        $variables->add(new Entry('replicas', 3));
    }
}