Commit af640ef
fix: ignore security group drift on existing AWS instances (#175)
Pre-existing workspaces failed to start after the coder-workspace-egress
change. Terraform saw the instance's security group differ from the template
and planned an in-place swap, which needs a permission the provisioner role
does not have:
Error: updating EC2 Instance (i-015f7199b07d72549): modifying network
interface: UnauthorizedOperation: not authorized to perform
ec2:ModifyNetworkInterfaceAttribute on security-group/sg-04e29c7df56b05c4f
The role is create-and-describe only. subnet_id and
associate_public_ip_address were already ignored because they force a
replacement; vpc_security_group_ids was the one network attribute left able to
drift, so add it.
New instances still get the current subnet, public IP, and security group,
since ignore_changes only affects updates. Existing workspaces keep what they
were built with and must be recreated to pick up the fix, which they need
anyway: their instances have no public IP and so no egress.
The security group lookup itself works; it resolved sg-04e29c7df56b05c4f.
Co-authored-by: Noah Boyers <noah@coder.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent dee5257 commit af640ef
2 files changed
Lines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
107 | | - | |
| 111 | + | |
| 112 | + | |
108 | 113 | | |
109 | 114 | | |
110 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
129 | 139 | | |
130 | 140 | | |
131 | 141 | | |
132 | | - | |
| 142 | + | |
| 143 | + | |
133 | 144 | | |
134 | 145 | | |
135 | 146 | | |
| |||
0 commit comments