Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Autoscaling Group Initial Instance not attaching ENI & other fixes #5

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

thathaneydude
Copy link
Collaborator

Description

Bastion Module Bug
Fixed an issue with the Bastion module where the EIP was being attached before the instance was available

Autoscaling Group Bug
Fixed an issue where the autoscaling group was not provisioning the initial instance using the lambda to attach the second ENI. This was due to a race condition where the lambda IAM policy was waiting for the ASG to fully spin up its first instance prior to assigning the role to the lambda. By the time the ASG finished, it was too late to run the lambda on the first instance.

wait_for_capacity_timeout = 0 was added so the TF module does not wait for the first instance to be provisioned and provides the lambda IAM policy with the ASG ARN before the first instance is created. Also moved the lifecycle hook into the ASG config as the initial_lifecycle_hook so that it will be triggered on the first instance provisioned.

Type of change

Please delete options that are not relevant.

  • Bug Fix
  • New Feature
  • This change requires a documentation update

How Has This Been Tested?

Deploy several times with local version of the code. It consistently deployed all resources correctly

Copy link
Collaborator

@simdugas simdugas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find. Added a minor comment, looks good overall.

modules/iam/lambda/main.tf Show resolved Hide resolved
@thathaneydude thathaneydude merged commit d67865f into main Jul 22, 2024
2 checks passed
@thathaneydude thathaneydude deleted the asg-variable-fix branch July 22, 2024 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants