Skip to content

Instantly share code, notes, and snippets.

View abjrcode's full-sized avatar
👊
I do my best

Ibrahim Najjar abjrcode

👊
I do my best
View GitHub Profile
@abjrcode
abjrcode / ecs-awaiter.md
Last active April 4, 2024 18:39
Pulumi TypeScript component resource to avoid "serial" ECS service updates while still having proper CD

Pulumi has a limitation when it comes to its AWSX Fragate service component as per these two issues:

If you have multiple ECS services, they will update one-by-one instead of in-parallel when continueBeforeSteadyState flag is set to false The flag is essential if you want your deployment build to actually fail when services aren't deployed successfully due to whatever reason Disabling the flag will make everything update in-parallel but if one of the services is not healthy or rolled back then your CI will still not know unless you build custom integrations with AWS EventBridge events

The following is a pulumi component resource that does what Pulumi should do by default and it behaves exactly as you would expect:

@abjrcode
abjrcode / chmod-400.cmd
Created July 9, 2019 16:07 — forked from jaskiratr/chmod-400.cmd
Set permission of file equivalent to chmod 400 on Windows.
# Source: https://stackoverflow.com/a/43317244
$path = ".\aws-ec2-key.pem"
# Reset to remove explict permissions
icacls.exe $path /reset
# Give current user explicit read-permission
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
# Disable inheritance and remove inherited permissions
icacls.exe $path /inheritance:r