protected final function execute(InputInterface $input, OutputInterface $output)
 {
     $stackName = $input->getArgument('stack');
     Validator::validateStackname($stackName);
     $stack = $this->getStackFactory()->getStack($stackName);
     return $this->executeWithStack($stack, $input, $output);
 }
 /**
  * @test
  */
 public function moreThanTenTags()
 {
     $this->setExpectedException('Exception', 'No more than 10 tags are allowed');
     $tags = [];
     for ($i = 0; $i < 11; $i++) {
         $tags[] = ['Key' => "Key{$i}", 'Value' => "Value{$i}"];
     }
     Validator::validateTags($tags);
 }
 public function getStackName()
 {
     $stackName = $this->valueResolver->resolvePlaceholders($this->name, $this, 'stackname');
     Validator::validateStackname($stackName);
     return $stackName;
 }
 protected function prepareArguments($force = false)
 {
     if ($this->output && !$this->output->isQuiet()) {
         $this->output->write("Preparing parameters... ");
     }
     $parameters = $this->blueprint->getParameters();
     if ($this->output && !$this->output->isQuiet()) {
         $this->output->writeln("done.");
     }
     if ($this->output && !$this->output->isQuiet()) {
         $this->output->write("Preparing template... ");
     }
     $template = $this->blueprint->getPreprocessedTemplate($force);
     if ($this->output && !$this->output->isQuiet()) {
         $this->output->writeln("done.");
     }
     $arguments = ['StackName' => $this->blueprint->getStackName(), 'Parameters' => $parameters, 'TemplateBody' => $template, 'Tags' => $this->blueprint->getTags()];
     if ($capabilities = $this->blueprint->getCapabilities()) {
         $arguments['Capabilities'] = $capabilities;
     }
     if ($policy = $this->blueprint->getStackPolicy()) {
         $arguments['StackPolicyBody'] = $policy;
     }
     Validator::validateTags($arguments['Tags']);
     return $arguments;
 }
 /**
  * @param string $stackName
  * @throws \Exception
  * @test
  * @dataProvider invalidStackNameProvider
  */
 public function invalidStackName($stackName)
 {
     $this->setExpectedException('Exception');
     Validator::validateStackname($stackName);
 }