Skip to content

Releases: cloudposse/terraform-aws-ec2-instance

v1.6.1

27 Nov 00:41
Compare
Choose a tag to compare
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` files

why

  • Re-apply .github/settings.yml from org level to get terratest 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
Update .github/settings.yml @osterman (#207) ## what - Update `.github/settings.yml` - Drop `.github/auto-release.yml` files

why

  • 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
Update .github/settings.yml @osterman (#206) ## what - Update `.github/settings.yml` - Drop `.github/auto-release.yml` files

why

  • 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.6.0

17 Aug 23:03
c4be480
Compare
Choose a tag to compare
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

08 Aug 14:56
cb75595
Compare
Choose a tag to compare
feat: Add missed tags @MaxymVlasov (#204) ## what

Add tags to resources where they missed

🤖 Automatic Updates

Update .github/settings.yml @osterman (#201) ## what - Update `.github/settings.yml` - Drop `.github/auto-release.yml` files

why

  • 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
Update release workflow to allow pull-requests: write @osterman (#199) ## what - Update workflow (`.github/workflows/release.yaml`) to have permission to comment on PR

why

  • So we can support commenting on PRs with a link to the release
Update GitHub Workflows to use shared workflows from '.github' repo @osterman (#198) ## what - Update workflows (`.github/workflows`) to use shared workflows from `.github` repo

why

  • Reduce nested levels of reusable workflows

v1.4.1

14 May 16:24
Compare
Choose a tag to compare
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

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance#disable_api_stop

🤖 Automatic Updates

Update GitHub Workflows to Fix ReviewDog TFLint Action @osterman (#196)

what

  • Update workflows (.github/workflows) to add issue: write permission needed by ReviewDog tflint action

why

  • The ReviewDog action will comment with line-level suggestions based on linting failures
Update GitHub workflows @osterman (#195)

what

  • Update workflows (.github/workflows/settings.yaml)

why

  • Support new readme generation workflow.
  • Generate banners
Use GitHub Action Workflows from `cloudposse/.github` Repo @osterman (#192)

what

  • Install latest GitHub Action Workflows

why

  • Use shared workflows from cldouposse/.github repository
  • Simplify management of workflows from centralized hub of configuration

v1.4.0

27 Mar 16:02
1084223
Compare
Choose a tag to compare

🚀 Enhancements

Add tags to additional eip @bwmetcalf (#190)

what

  • Add tags to additional eip's

why

  • Ensure consistent tagging

references

v1.3.0

25 Mar 04:18
a8a3214
Compare
Choose a tag to compare
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

20 Mar 02:14
5dd574d
Compare
Choose a tag to compare

🚀 Enhancements

Remove optional `domain` attribute from `aws_eip` resource @mariot8 (#173)

what

  • remove aws_eip optional domain attribute

why

  • optional domain attribute causes terraform to fail plan EC2 instance

references

🤖 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

Update Scaffolding @osterman (#186)

what

  • Reran make readme to rebuild README.md from README.yaml
  • Migrate to square badges
  • Add scaffolding for repo settings and Mergify

why

  • Upstream template changed in the .github repo
  • Work better with repository rulesets
  • Modernize look & feel

v1.2.1

09 Feb 04:00
9010cc0
Compare
Choose a tag to compare

🚀 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

24 Jan 01:34
bf54345
Compare
Choose a tag to compare
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

03 Nov 21:13
d4045d9
Compare
Choose a tag to compare
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

🤖 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