---
- name: Digital Marketplace API Elastic Beanstalk app ({{state}})
  cloudformation:
    stack_name: "digitalmarketplace-api-{{ environment_name }}"
    state: "{{ state }}"
    region: "{{ aws_region }}"
    disable_rollback: false
    template: ../cloudformation_templates/aws_digitalmarketplace_api_app.json
    template_parameters:
      ApplicationName: "digitalmarketplace-api"
  register: digitalmarketplace_api_app_stack

- name: Digital Marketplace API Elastic Beanstalk env ({{state}})
  cloudformation:
    stack_name: "digitalmarketplace-api-{{ name_suffix }}"
    state: "{{ state }}"
    region: "{{ aws_region }}"
    disable_rollback: false
    template: ../cloudformation_templates/aws_digitalmarketplace_api_env.json
    template_parameters:
      ApplicationName: "digitalmarketplace-api"
      EnvironmentName: "dmapi-{{ name_suffix_short }}"
  register: digitalmarketplace_api_env_stack

---
- name: Digital Marketplace API Elastic Beanstalk app ({{state}})
  cloudformation:
    stack_name: "digitalmarketplace-api-{{ environment_name }}"
    state: "{{ state }}"
    region: "{{ aws_region }}"
    disable_rollback: false
    template: ../cloudformation_templates/aws_digitalmarketplace_api_app.json
    template_parameters:
      ApplicationName: "digitalmarketplace-api"
  register: digitalmarketplace_api_app_stack
  when: skip_base is not defined

- name: Digital Marketplace API Elastic Beanstalk env ({{state}})
  cloudformation:
    stack_name: "digitalmarketplace-api-{{ name_suffix }}"
    state: "{{ state }}"
    region: "{{ aws_region }}"
    disable_rollback: false
    template: ../cloudformation_templates/aws_digitalmarketplace_api_env.json
    template_parameters:
      ApplicationName: "digitalmarketplace-api"
      EnvironmentName: "dmapi-{{ name_suffix_short }}"
  register: digitalmarketplace_api_env_stack

Add skip_base variable to only remove env on teardown
Add skip_base variable to only remove env on teardown
