text: #  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  #  SPDX-License-Identifier: Apache-2.0
  
  import luigi
  
  from servicecatalog_puppet.workflow.service_control_policies import (
      service_control_policies_for_task,
  )
  
  
  class ServiceControlPoliciesTask(
      service_control_policies_for_task.ServiceControlPoliciesForTask
  ):
      service_control_policies_name = luigi.Parameter()
      puppet_account_id = luigi.Parameter()
  
      def params_for_results_display(self):
          return {
              "puppet_account_id": self.puppet_account_id,
              "service_control_policies_name": self.service_control_policies_name,
              "cache_invalidator": self.cache_invalidator,
          }
  
      def requires(self):
          requirements = list()
  
          klass = self.get_klass_for_provisioning()
          for (
              account_id,
              regions,
          ) in self.manifest.get_account_ids_and_regions_used_for_section_item(
              self.puppet_account_id,
              self.section_name,
              self.service_control_policies_name,
          ).items():
              for region in regions:
                  for task in self.manifest.get_tasks_for_launch_and_account_and_region(
                      self.puppet_account_id,
                      self.section_name,
                      self.service_control_policies_name,
                      account_id,
                      region,
                  ):
                      requirements.append(
                          klass(**task, manifest_file_path=self.manifest_file_path)
                      )
  
          return requirements
  
      def run(self):
          self.write_output(self.params_for_results_display())
  