---
<%
  require 'dotenv'
  Dotenv.load
%>

driver:
  name: ec2
  associate_public_ip: false
  instance_type: <%= ENV['EC2_INSTANCE_TYPE_AMD64'] || 't3.medium' %>
  interface: private
  region: <%= ENV['AWS_REGION'] || 'us-east-1' %>
  security_group_filter:
    name: <%= ENV['EC2_SECURITY_GROUP_NAME'] %>
  subnet_filter:
    tag: Name
    value: <%= ENV['EC2_SUBNET_NAME'] %>
  tags:
    Name: <%= ENV['EC2_INSTANCE_NAME'] %>

provisioner:
  name: chef_zero
  product_name: cinc
  product_version: 18.8.11
  chef_license: accept

verifier:
  name: inspec

platforms:
  - name: debian-12
    driver:
      instance_type: <%= ENV['EC2_INSTANCE_TYPE_AMD64'] || 't3.medium' %>
      image_id: <%= ENV['BASE_AMI_DEBIAN_12_AMD64'] %>
    lifecycle:
      post_create:
        - remote: sudo apt update

suites:
  - name: default
    run_list:
      - recipe[irrigate-php::default]
      - recipe[irrigate-php::php82]
      - recipe[irrigate-php::deploy_qa_user]
      - recipe[irrigate-php::composer]
    verifier:
      inspec_tests:
        - test/smoke/default.rb
        - test/smoke/php82.rb
        - test/smoke/deploy_qa_user.rb
        - test/smoke/composer.rb
    attributes:
      php:
        deploy_group_members: ['deploy']
    data_bags_path: <%= ENV['DATA_BAGS_PATH'] || '../../data_bags' %>
    encrypted_data_bag_secret_key_path: <%= ENV['ENCRYPTED_DATA_BAG_SECRET_KEY_PATH'] || '/etc/chef/encrypted_data_bag_secret' %>
