-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
data_source_aws_instances.go hard coded for instance-state-name running #3339
Comments
Hi @Gibby
what kind of maintenance do you plan to build and how do you plan to perform it within the context of Terraform? Thanks. |
Hi @radeksimko We have some instances that are only powered on during the week when the developers need them. However we still power them on every Sunday to patch and perform maintenance. To build the maintenance window in terraform we had to hardcode the instance ID's instead of using a tag since the filter is hardcoded for running only. Having it hard coded for running does not follow the documentation which says you can use any filter from the AWS CLI reference. |
I'm afraid I still don't fully understand how you perform the maintenance, where presumably the very first operation (as you mentioned) is turning the instance on. We have some plans to possibly eventually support changing state of the instance through Terraform, but it's a little bit more complex topic, so that is likely going to take some time. Regardless, this is not an option currently available in the provider, so my question is how are you turning these instances on? Thanks. |
There are 2 ways we are starting instances for maintenance managed with our terraform templates. However, we have to hardcode the instance ID's in templates since we can not filter on non-running instances. We have maintenance windows in systems manager that we also manage with terraform templates. Ways we start instances with terraform:
|
I see, so AWS SSM or Lambda does that trick for you, to either of which you'd like to pass IDs dynamically via interpolation in Terraform. That makes sense. Thanks for all your patience in explaining the use case @Gibby , I think it's worth supporting this and we'd be happy to accept PR. |
In version 1.26.0 of the AWS provider, releasing tonight or tomorrow, the |
This has been released in version 1.26.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Affected Resource(s)
Please list the resources as a list, for example:
We are trying to grab instance id's for instances that are not running for building a maintenance window task using data source of aws_instances, however instance-state-name is hardcoded and filtering on only running instances.
The text was updated successfully, but these errors were encountered: