Skip to content
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

Add possibility to retry/delay/timeout on data sources #11342

Closed
obourdon opened this issue Dec 18, 2019 · 7 comments · Fixed by #26121
Closed

Add possibility to retry/delay/timeout on data sources #11342

obourdon opened this issue Dec 18, 2019 · 7 comments · Fixed by #26121
Labels
enhancement Requests to existing resources that expand the functionality or scope. provider Pertains to the provider itself, rather than any interaction with AWS. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@obourdon
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

First of all, I was not sure if I needed to post this feature request here or in terraform core itself but as we are using AWS provider intensely in the first place and considering that this is also requiring changes in its corresponding code, I thought this was the best place to post this FR

Second, do not flame me right away as I know this is not really matching the "philosophical" way terraform and providers are supposed to work, but considering all others questions I have seen here and there concerning similar things I thought there is room/legitimity for this enhancement

Third, as I did look at the source code and more specifically aws/data_source_aws_instances.go, I think this could be done quite easily/effortlessly

OK so here is my concern: let's assume we are using Autoscaling group and need to specify a dedicated target group rule for each instance (like a monitoring agent, ...). This could be done via Lambda code plugged to autoscaling events of course or also within the HCL code using a workaround/hack with null_resources, local-exec, sleep and data sources but as far as what I read so far:

  1. null_resources + local_exec + sleep are highly discouraged
  2. if the sleep time you specify is too short, you need to write another identical section and this is very painful

New or Affected Resource(s)

All data sources concerning dynamic resources

Potential Terraform Configuration

data "aws_instances" "asg_instances" {
  instance_state_names = ["running", "pending"]

  filter = {
    name   = "instance.group-id"
    values = ["${aws_security_group.cluster.id}"]
  }

  poll = {
    delay = 20
    interval = 10
    retry_count = 10
    timeout = 60
  }
}

References

@obourdon obourdon added the enhancement Requests to existing resources that expand the functionality or scope. label Dec 18, 2019
@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Dec 18, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 18, 2019
@Z3R6
Copy link

Z3R6 commented Jan 12, 2021

any updates?

@dtphuc
Copy link

dtphuc commented Jun 10, 2021

Hi Team,

Any updates on the ticket?

I'm looking forward to hearing from you guys.

Thanks

@breathingdust breathingdust added provider Pertains to the provider itself, rather than any interaction with AWS. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 22, 2021
@obourdon
Copy link
Contributor Author

Any updates ?

@Deasel011
Copy link

Any updates on this issue??
Would like to retry until my query returns at least 1 result :'[

@dbarkin
Copy link

dbarkin commented Jan 27, 2022

Any updates? or at least offer workaround (don't offer re-running with apply)

@github-actions
Copy link

github-actions bot commented Aug 4, 2022

This functionality has been released in v4.25.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Sep 4, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. provider Pertains to the provider itself, rather than any interaction with AWS. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
6 participants