-
-
Notifications
You must be signed in to change notification settings - Fork 220
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
instance_profile error with invalid count on first apply #194
Comments
I am still seeing this error with the 1.6.0 tag.
|
The cause is: locals {
instance_profile_count = module.this.enabled && var.instance_profile_enabled && var.instance_profile == "" ? 1 : 0
} This is then subsequently used as a The only workaround currently seems to be if you can predict the name of the created profile and just have that as a string literal passed to the |
Or you can change it to locals {
- instance_profile_count = module.this.enabled && var.instance_profile_enabled && var.instance_profile == "" ? 1 : 0
+ instance_profile_count = module.this.enabled && var.instance_profile_enabled ? 1 : 0
} Also side note that it seems like a bug that |
I don't think that is a bug. There are three modes:
I think breaking those last two out with a boolean flag like |
Describe the Bug
Input instance_profile will throw the below error on apply
Expected Behavior
Expected behavior is that the instance will use the precreated instance profile
Steps to Reproduce
Module
Will throw the earlier Error "Invalid count argument"
Comment instance_profile and it will work
After initial apply, you can then un-comment instance_profile and it will apply
Screenshots
No response
Environment
Mac OS
TF 1.8.2
Additional Context
No response
The text was updated successfully, but these errors were encountered: