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
Updating instance profile used by elasticbeanstalk environment breaks #6729
Comments
Hey @oillio – do you have an sample configuration that demonstrates how you're connecting the IAM instance profile and your Beanstalk env? That will help me dig into this. Thanks! |
This is a simplified example which shows the link. If it isn't obvious from this, I can write up a complete test example. If this applied, change
|
Having a similar issue but my instance profile is hardcoded. It's never changing. However, each time I run terraform apply, it changes my IamInstanceProfile: Apply complete! Resources: 0 added, 4 changed, 0 destroyed.
|
@bobbydeveaux in that case, I would recommend just using the profile name for now. The Elastic Beanstalk API doesn't store the whole arn, so when the environment is read there will always be a diff if your Terraform document contains the arn. There are a few other normalization issues similar to this, so I might create a separate issue to track those. Unfortunately, there isn't really a good general solution for this, and it will have to be fixed on a case by case basis. |
@oillio Would using |
Ah - perfect, thanks @dharrisio :) |
Yep. I can find a workaround to make it work. I would rather an error message than what happened. If possible, I'd just like to avoid anyone else going down the path I did. |
I think I'm having an issue related to this although my problem it's causing is slightly different. In my configuration I'm specifying the Instance Profile ARN as the Terraform docs and AWS docs seem to indicate is acceptable. That is working fine to associate the profile with the instances (yay!) but I am having the same issue described above where every time I run To resolve this I went with the instance profile name in my configuration which did indeed stop the constant rebuilds. But I just noticed it also stopped being applied correctly in elastic beanstalk. My instance now are coming up with no instance profile associated with them which is noticeably worse than the constant rebuilds. |
This definitely appears to be a bug in Terraform and it's a little annoying. Not breaking anything but it's frustrating nonetheless. Right now I'm using a config like this:
And that ends up with
In this instance |
+1, also hitting @arsdehnel issue under a very similar configuration:
|
I confirm that the same problem is happening for us. We are passing the arn but a change is detected everytime. Terraform v0.8.8 According to the AWS documentation:
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I am not sure this is in scope for Terraform or not.
I have an aws_iam_instance_profile that is referenced by an aws_elastic_beanstalk_environment.
If the profile is modified, Terraform may need to delete and re-create the profile (in my case, the name changed).
Terraform deletes and re-creates the profile before updating the beanstalk environment to point to the new profile. It appears that, when the original profile is deleted, elastic beanstalk gets into an invalid state and has some very odd behavior.
Ideally, Terraform would create the new profile, update the elastic beanstalk environment, and only then delete the old profile.
The text was updated successfully, but these errors were encountered: