CloudFormation client

This page contains some example usage for CloudFormation. There are other resources that explain authentication and configuration.

The CloudFormation package could be installed with Composer.

composer require async-aws/cloud-formation

Usage

List stacks

use AsyncAws\CloudFormation\CloudFormationClient; $cloudFormation = new CloudFormationClient(); $result = $cloudFormation->describeStacks(); foreach ($result->getStacks() as $stack) { echo $stack->getStackName().'-'.$stack->getStackStatus().PHP_EOL; }

List stack's events

use AsyncAws\CloudFormation\CloudFormationClient; use AsyncAws\CloudFormation\Input\DescribeStackEventsInput; $cloudFormation = new CloudFormationClient(); $result = $cloudFormation->describeStackEvents(new DescribeStackEventsInput([ 'StackName' => 'cluster-prod', ])); foreach ($result->getStackEvents() as $event) { echo $event->getResourceType().'-'.$event->getResourceStatus().PHP_EOL; }