Skip to content

Commit bd95adb

Browse files
authored
fix: eip race condition when updating ASG
Add a second EIP, when we decide to use EIP for the manager. This way, when we update the ASG, a free EIP is available to pick by the `aws-ec2-assign-elastic-ip` tool. This fix the rolling update, and allow for a smoother transition (instead of trying to work around the removing of the EIP association). The caveats is that we require two EIP for this use case, but I guess it's okay, as long the user is aware of it.
1 parent 4b170bc commit bd95adb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ resource "aws_iam_instance_profile" "instance" {
359359

360360
resource "aws_eip" "gitlab_runner" {
361361
# checkov:skip=CKV2_AWS_19:We can't use NAT gateway here as we are contacted from the outside.
362-
count = var.runner_instance.use_eip ? 1 : 0
362+
count = var.runner_instance.use_eip ? 2 : 0
363363

364364
tags = local.tags
365365
}

0 commit comments

Comments
 (0)