Last active
February 11, 2020 05:01
-
-
Save leandrosiow/99104a058d622de6af91417dafc91609 to your computer and use it in GitHub Desktop.
Here is a workaround for ECS Windows GitHub Issue: [Windows Credential Proxy Unavailable after EC2 Stop/Start #2135] https://github.com/aws/amazon-ecs-agent/issues/2135
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <powershell> | |
| C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 -Schedule | |
| netsh interface portproxy delete v4tov4 80 169.254.170.2 | out-null | |
| [Environment]::SetEnvironmentVariable('ECS_DISABLE_METRICS', 'false', 'Machine') | |
| [Environment]::SetEnvironmentVariable('ECS_ENABLE_AWSLOGS_EXECUTIONROLE_OVERRIDE', $TRUE, 'Machine') | |
| Initialize-ECSAgent -Cluster Windows -EnableTaskIAMRole -LoggingDrivers '["json-file","awslogs"]' | |
| </powershell> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Windows Credential Proxy Unavailable after EC2 Stop/Start #2135
aws/amazon-ecs-agent#2135 (comment)
The Workaround
Run the following command after a Start/Stop
Please refer to the above userdata.ps for the full UserData script.
The Error
[INFO] TaskHandler: batching container event: arn:aws:ecs:eu-west-1:ACCOUNT_ID:task/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX windows -> STOPPED, Reason CannotStartContainerError: Error response from daemon: failed to initialize logging driver: failed to create Cloudwatch log stream: CredentialsEndpointError: failed to load credentials
caused by: RequestError: send request failed
caused by: Get http://169.254.170.2/v2/credentials/12f7f583-f11f-45f9-9a07-e7b237b72a72: dial tcp 169.254.170.2:80: connectex: A socket operation was attempted to an unreachable network., Known Sent: NONE