NAME
CCfnX::DeployerResourceTypeHandler
DESCRIPTION
This role is to be applied to Deployers as a security mechanism to prevent deployers from trying to deploy resources they cannot handle. While they may fail immediately, they can cause difficult to debug and repair half-complete states.
The philosophy is that a Deployer should get to act on a Stack if it can deploy all of its resources.
Remember that a deployer does not need to deploy itself the resources it handles, but can delegate to other deployers if needed. This role exists as a bridge between the old way of doing deployers and the new DeploymentEngine
that will dispatch resources to deployment engines. Thus, the deployment engine deployer will handle of type of resources except for AWS CloudFormation resources which are still handled by the CloudFormationDeployer
until the CloudFormationDeployer
is transformed to a DeploymentEngine
Engine
.
USAGE
package SomeSystemDeployer {
use Moose;
with 'CCfnX::DeployerResourceTypeHandler' => {
resource_type_prefixes => [
'Monitoring',
'Azure'
]
};
before 'deploy' => sub {
#do something
};
}
PARAMETERS
resource_type_prefixes
Defines what type of resources this deployer can handle. The prefixes of the package names of the resources it can handle. For example, if it can handle AWS::* and Azure::* resources, the prefixes would be [ 'AWS', 'Azure' ].
METHODS
can_handle_stack
For a given set of resources, this method returns whether this deployer can handle all resources from this stack. A resource is an object that extends Cfn::Resource
.
arguments
stack_resources
An ArrayRef of Cfn:Resource
can_handle_resource
For a given resource, this method returns whether this deployer can handle it. A resource is an object that extends Cfn::Resource
.
arguments
resource
A Cfn:Resource