https://github.com/leanercloud/ec2-repair-crowdstrike
Terraform code creating an ASG that fixes the Crowdstrike BSOD for all your instances. This hasn't been tested, and looking for testers.
https://github.com/leanercloud/ec2-repair-crowdstrike
Last synced: over 1 year ago
JSON representation
Terraform code creating an ASG that fixes the Crowdstrike BSOD for all your instances. This hasn't been tested, and looking for testers.
- Host: GitHub
- URL: https://github.com/leanercloud/ec2-repair-crowdstrike
- Owner: LeanerCloud
- License: mit
- Created: 2024-07-19T15:02:34.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-19T20:56:25.000Z (about 2 years ago)
- Last Synced: 2025-04-15T03:46:50.701Z (over 1 year ago)
- Language: PowerShell
- Homepage: https://leanercloud.com
- Size: 7.81 KB
- Stars: 16
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EC2 Crowdstrike Repair (EXPERIMENTAL, NEEDS TESTERS)
This Terraform configuration sets up an Auto Scaling Group (ASG) that runs a PowerShell script to repair unhealthy EC2 instances across all Availability Zones in the current AWS region.
## Features
- Launches instances across all available Availability Zones in an ASG, with a single instance per AZ.
- Each instance runs a custom PowerShell repair script, that iterates over all unhealthy instance form the current AZ:
1. detaches the root volume from the current unhealthy instance.
2. attaches it to the current instance.
3. attempts to delete the broken CrowdStrike update file.
4. detaches and re-attaches the volume to the initial instance.
5. restarts the initial instance.
## Prerequisites
- Terraform installed (version 0.12 or later)
## Usage
1. Clone this repository
2. Initialize the Terraform working directory:
```shell
terraform init
```
3. Review the planned changes:
```shell
terraform plan
```
4. Apply the Terraform configuration:
```shell
terraform apply
```
5. Confirm the changes by typing `yes` when prompted.
## Customization
- To use a different Windows Server version, modify the `name` parameter in the `aws_ssm_parameter` data source.
- Adjust the `instance_type` in the launch template if you need more powerful instances.
- Modify the `min_size`, `max_size`, and `desired_capacity` in the ASG resource if you want a different scaling behavior.
## Clean Up
To remove all created resources:
```shell
terraform destroy
```
## Contributing
Feel free to submit issues or pull requests if you have suggestions for improvements or bug fixes.
## License
This code is (C) 2024 Cristian Magherusan-Stanciu, and released under the MIT license.
Check out more of our OSS repos at [LeanerCloud.com](https://github.com/LeanerCloud).