AWS AmazonECS documentation change
Summary
Added PowerShell examples for Windows container task protection configuration
Security assessment
Expands documentation for an existing security feature (task scale-in protection) by adding Windows examples. Enhances security documentation but doesn't address a new vulnerability.
Diff
diff --git a/AmazonECS/latest/developerguide/task-scale-in-protection-endpoint.md b/AmazonECS/latest/developerguide/task-scale-in-protection-endpoint.md index c633f7cec..e3a837125 100644 --- a//AmazonECS/latest/developerguide/task-scale-in-protection-endpoint.md +++ b//AmazonECS/latest/developerguide/task-scale-in-protection-endpoint.md @@ -63,0 +64,25 @@ This example shows how to protect a task for 24 hours using the `expiresInMinute +**Examples for Windows containers** + +For Windows containers, you can use PowerShell's `Invoke-RestMethod` cmdlet instead of curl. The following examples show the PowerShell equivalents of the previous curl commands. + +**Example of how to protect a Windows container task with the default time period** + +This example shows how to protect a task with the default time period of 2 hours using PowerShell. + + + Invoke-RestMethod -Uri $env:ECS_AGENT_URI/task-protection/v1/state -Method Put -Body '{"ProtectionEnabled":true}' -ContentType 'application/json' + +**Example of how to protect a Windows container task for 60 minutes** + +This example shows how to protect a task for 60 minutes using the `expiresInMinutes` parameter with PowerShell. + + + Invoke-RestMethod -Uri $env:ECS_AGENT_URI/task-protection/v1/state -Method Put -Body '{"ProtectionEnabled":true,"ExpiresInMinutes":60}' -ContentType 'application/json' + +**Example of how to protect a Windows container task for 24 hours** + +This example shows how to protect a task for 24 hours using the `expiresInMinutes` parameter with PowerShell. + + + Invoke-RestMethod -Uri $env:ECS_AGENT_URI/task-protection/v1/state -Method Put -Body '{"ProtectionEnabled":true,"ExpiresInMinutes":1440}' -ContentType 'application/json' + @@ -98,0 +124,5 @@ The following example shows the details returned for a protected task. +For Windows containers, use the following PowerShell command to get the protection status: + + + Invoke-RestMethod -Uri $env:ECS_AGENT_URI/task-protection/v1/state -Method Get +