Open raphsack opened 3 years ago
@raphsack to clarify: you're looking for a way to start an execution of an automation, not to define it (for that there's AWS:SSM::Document, although that is still missing some things).
In that case, I think a better name for the resource would be AWS::SSM::AutomationExecution, to differentiate it from the AutomationDocument
Good point @benbridts, appreciate it and tweaked accordingly :)
Do you mean to execute this as custom resource? i don't see the reason of executing automation via CloudFormation. Cfn don't trigger update if there is no state change for the property. on top of it, it should also support the CREATE/UPDATE/DELETE actions. which doesn't seem to align with "run execution"
You might want to run something once the first time your template is deployed (similar to user data in ec2). Or you could pass data to it in the parameters that might change (eg. if you want to run something everytime an EC2 is started, you could !Ref the instance in the Parameters)
Create and update could both start a new run, delete is tricky, because there is no DeleteExecution action. I don't think that should necessarily be a blocker for it to be a resource.
I've built something similar for CodeBuild. you can see the resource provider here..
I guess it doesn't hurt to have additional custom resource provider beside lambda. But it do feel overlapping with what lambda custom resource is already doing
I think the use case can be slightly different from custom resources (and I recommend moving to Resource Types for most of the Custom Resources use cases).
You can definitely solve the same thing in multiple ways, for context here are some differences (from the top of my head, so don't hold me to any):
Lambda:
Logs to CloudWatch
Codebuild:
Logs to CloudWatch and/or S3
SSM:
Being able to trigger a scripted workflow in SSM as part of a deployment is the ask here.
While everything is possible (CW Events, Custom Resources to name two), each has their limitations and hence the request :)
Natively it doesn't support but integrate with Lambda, you definitely can perform SSM automation as custom resource
AWS::SSM::AutomationExecution
Details
Scope: new resource type, providing the ability to invoke an SSM Automation from CloudFormation.
Expected behavior: just as with the Console or API, allow invoking a Document (that could be created within the same template or pre-existing).