Releases: cloudposse/terraform-aws-ec2-instance
v1.6.1
fix: allow stopping instance before detachment and/or forced ebs detachments @Hamza-Olol (#212)
Added support to the EBS volume attachment resource for the `force_detach` and `stop_instance_before_detaching` arguments.These changes allow users to:
- Force the detachment of EBS volumes.
- Stop instances before detaching volumes, ensuring smooth resource teardown during Terraform destroy operations.
why
I cannot delete my Terraform resources using a standard Terraform destroy because I have attached additional ebs volumes to my instance and then ran disk configuration changes in my instance, for example, combined multiple ebs volumes into a striped disk config.
Business use cases may require additional EBS volumes, along with specific disk configurations for the volumes attached to EC2 instances.
When attempting to delete resources via Terraform, the destroy process fails due to issues with EBS volume attachments. These issues include timeouts or the inability to delete volumes because they are in a "busy" state.
The problem arises because Terraform attempts to detach EBS volumes before deleting/stopping the EC2 instance, leading to failures if the volume cannot be detached.
To address this, Terraform introduced the force_detach
and stop_instance_before_detaching
arguments, which allows forced detachment and/or stopping of the instance prior to detaching volumes. These enhancements mitigate the destroy-time failures and ensure smoother resource cleanup.
references
The force_detach
and stop_instance_before_detaching
arguments were introduced in Terraform AWS provider version v3.62.0.
Additional details and discussion about this issue can be found in this GitHub thread.
🤖 Automatic Updates
Migrate new test account @osterman (#210)
## what - Update `.github/settings.yml` - Update `.github/chatops.yml` fileswhy
- Re-apply
.github/settings.yml
from org level to getterratest
environment - Migrate to new
test
account
References
- DEV-388 Automate clean up of test account in new organization
- DEV-387 Update terratest to work on a shared workflow instead of a dispatch action
- DEV-386 Update terratest to use new testing account with GitHub OIDC
v1.6.0
fix: remove lifecycle ignore changes for ami argument @nitrocode (#205)
## what- remove lifecycle ignore changes for ami argument
why
- This change looks unintentional based on the PR description
- We'd like to allow AMIs to recreate the EC2 for singletons that aren't production facing
references
v1.5.0
feat: Add missed tags @MaxymVlasov (#204)
## whatAdd tags to resources where they missed
🤖 Automatic Updates
Update .github/settings.yml @osterman (#201)
## what - Update `.github/settings.yml` - Drop `.github/auto-release.yml` fileswhy
- Re-apply
.github/settings.yml
from org level - Use organization level auto-release settings
references
- DEV-1242 Add protected tags with Repository Rulesets on GitHub
v1.4.1
feat: disable_api_stop option @flightlesstux (#197)
what
Control your EC2 Disable API with your Terraform
why
Because, AWS SDK and cli are supporting.
references
🤖 Automatic Updates
Update GitHub Workflows to Fix ReviewDog TFLint Action @osterman (#196)
what
- Update workflows (
.github/workflows
) to addissue: write
permission needed by ReviewDogtflint
action
why
- The ReviewDog action will comment with line-level suggestions based on linting failures
v1.4.0
🚀 Enhancements
Add tags to additional eip @bwmetcalf (#190)
what
- Add tags to additional eip's
why
- Ensure consistent tagging
references
- Closes #189
v1.3.0
Add user_data_replace_on_change @bwmetcalf (#188)
what
Support user_data_replace_on_change
:
[user_data_replace_on_change](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance#user_data_replace_on_change) - (Optional) When used in combination with user_data or user_data_base64 will trigger a destroy and recreate when set to true. Defaults to false if not set.
Bumps minimum aws provider version to support this parameter.
why
Force a rebuild if user data has changed.
v1.2.2
🚀 Enhancements
Remove optional `domain` attribute from `aws_eip` resource @mariot8 (#173)
what
- remove
aws_eip
optionaldomain
attribute
why
- optional
domain
attribute causes terraform to fail plan EC2 instance
references
- closes #172
🤖 Automatic Updates
Add GitHub Settings @osterman (#187)
what
- Install a repository config (
.github/settings.yaml
)
why
- Programmatically manage GitHub repo settings
Update README.md and docs @cloudpossebot (#185)
what
This is an auto-generated PR that updates the README.md and docs
why
To have most recent changes of README.md and doc from origin templates
v1.2.1
🚀 Enhancements
feat(aws_instance): treat missing data on cloudwatchmetric @haidargit (#184)
what
The PR enables the treat_missing_data argument for the cloudwatch metric alarm resource on this ec2 module.
https://github.com/cloudposse/terraform-aws-ec2-instance/blob/bf54345e18c6c2d1d85997d3af3b73a0e03c489f/cloudwatch-alarm.tf#L11
why
Users may have specific run schedules, triggering alerts in CloudWatch, e.g., for missing data during offline periods (instance stopped state, hibernate, restart, etc.).
This treat_missing_data
variable will enable the CloudWatch alarms to set custom responses, which are "missing
", "ignore
", "breaching
" and "notBreaching
", for the data gaps that occur and keep the EC2 alarms condition in a desired state.
references
- closes feature request #130
Kindly review this PR for any possible improvements. Thank you
v1.2.0
feat(aws_instance): conditional IAM instance profile @haidargit (#182)
what
This PR enables a conditional iam_instance_profile variable for the ec2 module.
why
This feature request offers users the flexibility to decide whether to associate an IAM instance profile with their instances.
references
- closes feature request #180
Kindly review this PR for module improvements. Thank you
v1.1.1
feature/disable-alarm-action @kris-Nabis (#145)
what
- Disables the use of Alarm Actions
why
- Unable to create the resource if execution user doesn't have
iam:CreateServiceLinkedRole
- Somewhat random reboot triggers. Alarm Action
reboot
is triggered pretty consistently, even while EC2 Resource is not in an alarm state.
references
- closes #131
🤖 Automatic Updates
Update README.md and docs @cloudpossebot (#175)
what
This is an auto-generated PR that updates the README.md and docs
why
To have most recent changes of README.md and doc from origin templates