feat: a couple of starter ssm documents which uses aws:loop
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
schemaVersion: '0.3'
|
||||
mainSteps:
|
||||
- name: ListAccounts
|
||||
action: aws:executeAwsApi
|
||||
nextStep: Loop
|
||||
isEnd: false
|
||||
inputs:
|
||||
Service: organizations
|
||||
Api: ListAccounts
|
||||
outputs:
|
||||
- Type: StringList
|
||||
Name: Accounts
|
||||
Selector: $.Accounts..Id
|
||||
- name: Loop
|
||||
action: aws:loop
|
||||
isEnd: true
|
||||
inputs:
|
||||
Iterators: '{{ ListAccounts.Accounts }}'
|
||||
IteratorDataType: StringList
|
||||
Steps:
|
||||
- name: PrintInput
|
||||
action: aws:executeScript
|
||||
isEnd: true
|
||||
inputs:
|
||||
Runtime: python3.11
|
||||
Handler: script_handler
|
||||
InputPayload:
|
||||
accountId: '{{Loop.CurrentIteratorValue}}'
|
||||
Script: |
|
||||
def script_handler(events,context):
|
||||
return {"accountId": events.get('accountId')}
|
||||
|
||||
Reference in New Issue
Block a user