コード例 #1
0
 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);
 }
コード例 #2
0
 /**
  * @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);
 }
コード例 #3
0
 public function getStackName()
 {
     $stackName = $this->valueResolver->resolvePlaceholders($this->name, $this, 'stackname');
     Validator::validateStackname($stackName);
     return $stackName;
 }
コード例 #4
0
 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;
 }
コード例 #5
0
 /**
  * @param string $stackName
  * @throws \Exception
  * @test
  * @dataProvider invalidStackNameProvider
  */
 public function invalidStackName($stackName)
 {
     $this->setExpectedException('Exception');
     Validator::validateStackname($stackName);
 }