2017-06-12 42 views
-2

我使用AWS CLI创建CloudFormation堆栈。有什么方法可以使用PHP任务调度程序创建堆栈?使用php任务调度程序创建堆栈

我有一个使用AWS服务的AWS托管的在线工具学习网站。我使用了此AWS CLI命令:

aws cloudformation create-stack --stack-name $Event_name-$emp_Id --template-body https://s3.ap-south-1.amazonaws.com 

在Amazon CloudFormation中创建堆栈。

任何人都可以帮助我创建CloudFormaion堆栈,而无需AWS CLI命令的帮助并使用PHP来安排任务吗?

回答

0

可以使用AWS SDK for PHP 3.x调用createStack() command

$result = $client->createStack([ 
    'Capabilities' => ['<string>', ...], 
    'ClientRequestToken' => '<string>', 
    'DisableRollback' => true || false, 
    'NotificationARNs' => ['<string>', ...], 
    'OnFailure' => 'DO_NOTHING|ROLLBACK|DELETE', 
    'Parameters' => [ 
     [ 
      'ParameterKey' => '<string>', 
      'ParameterValue' => '<string>', 
      'UsePreviousValue' => true || false, 
     ], 
     // ... 
    ], 
    'ResourceTypes' => ['<string>', ...], 
    'RoleARN' => '<string>', 
    'StackName' => '<string>', // REQUIRED 
    'StackPolicyBody' => '<string>', 
    'StackPolicyURL' => '<string>', 
    'Tags' => [ 
     [ 
      'Key' => '<string>', 
      'Value' => '<string>', 
     ], 
     // ... 
    ], 
    'TemplateBody' => '<string>', 
    'TemplateURL' => '<string>', 
    'TimeoutInMinutes' => <integer>, 
]);