Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
46a93de
added log
v-kasghosh Jan 6, 2026
e55cf66
Transform AWS SSM Inventory response to Azure format
v-kasghosh Jan 6, 2026
2ab7c50
Add logging for parsed parameters in GetInventory
v-kasghosh Jan 6, 2026
a9aa160
Return raw AWS SSM Inventory response in GetInventory
v-kasghosh Jan 6, 2026
1551180
Transform AWS SSM Inventory response for Azure compatibility
v-kasghosh Jan 6, 2026
85f49c4
Revert "Transform AWS SSM Inventory response for Azure compatibility"
v-kasghosh Jan 6, 2026
d327209
Update SSM inventory response format
v-kasghosh Jan 6, 2026
4513080
Add nextLink URL construction in GetInventory response
v-kasghosh Jan 6, 2026
3ae8199
Update AWS SSM solution to version 3.0.2 and improve inventory handling
v-kasghosh Jan 7, 2026
bbaf727
Update ReleaseNotes.md
v-kasghosh Jan 7, 2026
82b2365
revert some changes
v-kasghosh Jan 7, 2026
1d26fac
Fix JSON parsing in GetInventory main function
v-kasghosh Jan 7, 2026
b1fc67f
Fix JSON parsing in GetInventory function
v-kasghosh Jan 7, 2026
7ccef78
Updated
v-utpalkumar Jan 9, 2026
41876ca
Updated for pagination issue
v-utpalkumar Jan 12, 2026
36f57f7
Zip updated for GetInventory
v-utpalkumar Jan 12, 2026
679ee87
Updated for pagination
v-utpalkumar Jan 12, 2026
19fa8bf
Zip updated for pagination
v-utpalkumar Jan 12, 2026
4b6e28e
Updated to count how many times the while loop runs
v-utpalkumar Jan 12, 2026
9c6fef8
Zip updated
v-utpalkumar Jan 12, 2026
cf3bd5c
Readme file updated
v-utpalkumar Jan 13, 2026
aef9caa
Updated the logic app
v-utpalkumar Jan 13, 2026
a679485
Updated the zip
v-kasghosh Jan 14, 2026
df31ff4
update the zip
v-kasghosh Jan 14, 2026
e395c29
Fix Validations
v-kasghosh Jan 14, 2026
12b8459
Updated release notes
v-utpalkumar Jan 14, 2026
802a056
Removed few logging statements
v-utpalkumar Jan 14, 2026
4dc9c5a
Updated logging info
v-utpalkumar Jan 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Solutions/AWS Systems Manager/Package/3.0.2.zip
Binary file not shown.
188 changes: 107 additions & 81 deletions Solutions/AWS Systems Manager/Package/mainTemplate.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ Once deployment is complete, authorize each connection.
#### d. Function App Settings Update Instructions
Refer to [AWS Systems Manager API Function App Connector](../../CustomConnector/AWS_SSM_FunctionAppConnector/readme.md) documentation for Function App **Application Settings (Access Key ID, Secret Access Key and Region)** update instruction.

#### e. Additional instruction while playbook configuration:
When configuring the playbook, ensure that pagination is disabled for GetInventory, as pagination is already handled by the connector.

![alt text](image.png)

# References
- [AWS Systems Manager API Documentation](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_DeleteDocument.html)
- [AWS Systems Manager User Guide](https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-systems-manager.html)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def main(req: func.HttpRequest) -> func.HttpResponse:

if not (filters and aggregators and result_attributes and next_token and max_results):
try:
req_body = json.loads(req.get_json())
req_body = req.get_json()
except ValueError:
pass
else:
Expand All @@ -49,6 +49,7 @@ def main(req: func.HttpRequest) -> func.HttpResponse:
next_token = req_body.get('NextToken')
max_results = req_body.get('MaxResults')

logging.info(f'Parsed Parameters - Filters: {filters}, Aggregators: {aggregators}, ResultAttributes: {result_attributes}, MaxResults: {max_results}')
# Set parameter dictionary based on the request parameters
kwargs = {}
if filters:
Expand All @@ -58,7 +59,7 @@ def main(req: func.HttpRequest) -> func.HttpResponse:
if result_attributes:
kwargs['DocumentVersion'] = result_attributes
if next_token:
kwargs['DocumentFormat'] = next_token
kwargs['NextToken'] = next_token
if max_results:
kwargs['MaxResults'] = max_results

Expand All @@ -72,18 +73,41 @@ def main(req: func.HttpRequest) -> func.HttpResponse:
)

try:
logging.info('Calling function to get AWS SSM Inventory.')
logging.info('Pagination handling.')

all_entities = []
next_token = kwargs.get('NextToken')
while True:
if next_token:
kwargs['NextToken'] = next_token
else:
kwargs.pop('NextToken', None)

logging.info('Calling function to get AWS SSM Inventory.')

results = ssm_client.get_inventory(**kwargs)

logging.info('Call to get AWS SSM Inventory successful.')

results = ssm_client.get_inventory(**kwargs)
all_entities.extend(results.get("Entities", []))

next_token = results.get("NextToken")
if not next_token:
break

logging.info('Pagination handling completed.')

logging.info('Call to get AWS SSM Inventory successful.')
base_url = req.url.split('?')[0]

# Return the results
response = {
"value": all_entities,
"nextLink": None
}
return func.HttpResponse(
json.dumps(results),
headers = {"Content-Type": "application/json"},
status_code = 200
)
json.dumps(response),
headers={"Content-Type": "application/json"},
status_code=200
)

except ssm_client.exceptions.InternalServerError as ex:
logging.error(f"Internal Server Exception: {str(ex)}")
Expand Down Expand Up @@ -120,4 +144,4 @@ def main(req: func.HttpRequest) -> func.HttpResponse:

except Exception as ex:
logging.error(f"Exception Occured: {str(ex)}")
return func.HttpResponse("Internal Server Exception", status_code=500)
return func.HttpResponse("Internal Server Exception", status_code=500)
1 change: 1 addition & 0 deletions Solutions/AWS Systems Manager/ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
| **Version** | **Date Modified (DD-MM-YYYY)** | **Change History** |
|-------------|--------------------------------|---------------------------------------------------------------------------|
| 3.0.2 | 01-14-2026 | Fixed AWS-SSM-GetInstancePatches Playbook and updated Function App pagination |
| 3.0.1 | 29-01-2024 | App insights to LA change in data connector and repackage |

Loading