in AWS Cloudformation I could use the cloudformation package
command via CLI. This works for example with Lambdas:
lambda:
Type: AWS::Lambda::Function
Properties:
Handler: helloWorld.lambda_handler
Role: !GetAtt lambda.Arn
Code: lambda/helloWorld.py
Now, I would like to to the same like Code: lambda/helloWorld.py
within Systems Manager automation documents.
For example instead of the line Restart-Computer -Force
under commands:
I would like to use external skripts like this below (commands: scripts/restart.ps1
):
#---Original
[...]
- name: restartEC2Instance
action: aws:runCommand
maxAttempts: 3
timeoutSeconds: 600
inputs:
DocumentName: AWS-RunPowerShellScript
InstanceIds:
- "{{ InstanceId }}"
Parameters:
commands: |
Restart-Computer -Force
executionTimeout: "600"
[...]
#---Desired
[...]
- name: restartEC2Instance
action: aws:runCommand
maxAttempts: 3
timeoutSeconds: 600
inputs:
DocumentName: AWS-RunPowerShellScript
InstanceIds:
- "{{ InstanceId }}"
Parameters:
commands: scripts/restart.ps1
executionTimeout: "600"
[...]
Do you know any possibility to realize this? Thanks in advance!