austoonz
2/6/2019 - 5:29 PM

Create an AWS Systems Manager Association with CloudFormation

A CloudFormation template to create a PowerShell based AWS Systems Manager Association with inline PowerShell.

---
AWSTemplateFormatVersion: '2010-09-09'

Description: "Systems Manager Association"

Resources:

  Association:
    Type: AWS::SSM::Association
    Properties:
      AssociationName: AssociationName
      Name: AWS-RunPowerShellScript
      Parameters:
        commands:
          - |
            Write-Host 'This is some embedded PowerShell!'
        executionTimeout:
          - '300'
      ScheduleExpression: 'rate(1 day)'
      Targets:
        - Key: 'tag:Service'
          Values:
            - 'ServiceName'