I have this lambda function
<code>def lambda_handler(event, context):
response = client.describe_maintenance_windows(
Filters=[
{
'Key': 'Name',
'Values': [
'test',
]
},
],
)
MWId = response["WindowIdentities"]
return(MWId)
</code>
<code>def lambda_handler(event, context):
response = client.describe_maintenance_windows(
Filters=[
{
'Key': 'Name',
'Values': [
'test',
]
},
],
)
MWId = response["WindowIdentities"]
return(MWId)
</code>
def lambda_handler(event, context):
response = client.describe_maintenance_windows(
Filters=[
{
'Key': 'Name',
'Values': [
'test',
]
},
],
)
MWId = response["WindowIdentities"]
return(MWId)
I got below response Response structure
<code>[
{
"WindowId": "mw-0154acefa2151234",
"Name": "test",
"Enabled": true,
"Duration": 4,
"Cutoff": 0,
"Schedule": "cron(0 0 11 ? * SUN#4 *)",
"NextExecutionTime": "2024-08-25T11:00Z"
}
]
</code>
<code>[
{
"WindowId": "mw-0154acefa2151234",
"Name": "test",
"Enabled": true,
"Duration": 4,
"Cutoff": 0,
"Schedule": "cron(0 0 11 ? * SUN#4 *)",
"NextExecutionTime": "2024-08-25T11:00Z"
}
]
</code>
[
{
"WindowId": "mw-0154acefa2151234",
"Name": "test",
"Enabled": true,
"Duration": 4,
"Cutoff": 0,
"Schedule": "cron(0 0 11 ? * SUN#4 *)",
"NextExecutionTime": "2024-08-25T11:00Z"
}
]
How do I get the value of WindowId so I can pass it to a variable? I tried below but I am getting “errorMessage”: “‘list’ object is not callable”
<code>mwidvalue = MWId("WindowId")
</code>
<code>mwidvalue = MWId("WindowId")
</code>
mwidvalue = MWId("WindowId")