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 certificate timeouts #185

Merged
merged 12 commits into from
Mar 13, 2024
Merged

Add certificate timeouts #185

merged 12 commits into from
Mar 13, 2024

Conversation

AGS4NO
Copy link
Contributor

@AGS4NO AGS4NO commented Jan 17, 2024

Adds read timeout with retry function to dnsimple_certificate data source.

  • Timout can be set in the plan data source definition and defaults to 5 minutes.
  • Retry checks are on the certificate state and run every 20 seconds.
  • During testing, certificates were issued between 40 seconds and 5 minutes after submitting the order.

Fixes #110

Info logs show the retry calls with the state as 'requesting'; the certificate data source completes the read after 1m20s from a new certificate order.

2024-01-18T21:20:59.552Z [INFO]  provider.terraform-provider-dnsimple: configuring server automatic mTLS: timestamp=2024-01-18T21:20:59.552Z
dnsimple_lets_encrypt_certificate.certificate_order: Creating...
2024-01-18T21:20:59.574Z [INFO]  Starting apply for dnsimple_lets_encrypt_certificate.certificate_order
2024-01-18T21:21:00.497Z [INFO]  provider.terraform-provider-dnsimple: purchased Let's Encrypt Certificate: tf_provider_addr=registry.terraform.io/dnsimple/dnsimple tf_req_id=dfb1ac9b-7733-728c-1289-03a75b098d0d @caller=/workspaces/terraform-provider-dnsimple/internal/framework/resources/lets_encrypt_certificate_resource.go:197 tf_mux_provider="*proto6server.Server" tf_rpc=ApplyResourceChange @module=dnsimple id=map[] tf_resource_type=dnsimple_lets_encrypt_certificate timestamp=2024-01-18T21:21:00.496Z
dnsimple_lets_encrypt_certificate.certificate_order: Creation complete after 1s
data.dnsimple_certificate.certificate: Reading...
2024-01-18T21:21:00.566Z [INFO]  provider.terraform-provider-dnsimple: [RETRYING] Certificate order is not complete, current state: requesting: @caller=/workspaces/terraform-provider-dnsimple/internal/framework/datasources/certificate_data_source.go:210 tf_data_source_type=dnsimple_certificate tf_mux_provider="*proto6server.Server" tf_provider_addr=registry.terraform.io/dnsimple/dnsimple @module=dnsimple tf_req_id=04183a3f-a7a1-ffc4-aa11-8a26022fd293 tf_rpc=ReadDataSource timestamp=2024-01-18T21:21:00.565Z
data.dnsimple_certificate.certificate: Still reading... [10s elapsed]
data.dnsimple_certificate.certificate: Still reading... [20s elapsed]
2024-01-18T21:21:20.732Z [INFO]  provider.terraform-provider-dnsimple: [RETRYING] Certificate order is not complete, current state: requesting: @module=dnsimple tf_mux_provider="*proto6server.Server" tf_data_source_type=dnsimple_certificate tf_provider_addr=registry.terraform.io/dnsimple/dnsimple tf_req_id=04183a3f-a7a1-ffc4-aa11-8a26022fd293 tf_rpc=ReadDataSource @caller=/workspaces/terraform-provider-dnsimple/internal/framework/datasources/certificate_data_source.go:210 timestamp=2024-01-18T21:21:20.732Z
data.dnsimple_certificate.certificate: Still reading... [30s elapsed]
data.dnsimple_certificate.certificate: Still reading... [40s elapsed]
2024-01-18T21:21:40.879Z [INFO]  provider.terraform-provider-dnsimple: [RETRYING] Certificate order is not complete, current state: requesting: tf_provider_addr=registry.terraform.io/dnsimple/dnsimple tf_rpc=ReadDataSource @module=dnsimple tf_data_source_type=dnsimple_certificate tf_mux_provider="*proto6server.Server" tf_req_id=04183a3f-a7a1-ffc4-aa11-8a26022fd293 @caller=/workspaces/terraform-provider-dnsimple/internal/framework/datasources/certificate_data_source.go:210 timestamp=2024-01-18T21:21:40.878Z
data.dnsimple_certificate.certificate: Still reading... [50s elapsed]
data.dnsimple_certificate.certificate: Still reading... [1m0s elapsed]
2024-01-18T21:22:01.027Z [INFO]  provider.terraform-provider-dnsimple: [RETRYING] Certificate order is not complete, current state: requesting: tf_data_source_type=dnsimple_certificate tf_mux_provider="*proto6server.Server" tf_provider_addr=registry.terraform.io/dnsimple/dnsimple tf_rpc=ReadDataSource @caller=/workspaces/terraform-provider-dnsimple/internal/framework/datasources/certificate_data_source.go:210 @module=dnsimple tf_req_id=04183a3f-a7a1-ffc4-aa11-8a26022fd293 timestamp=2024-01-18T21:22:01.025Z
data.dnsimple_certificate.certificate: Still reading... [1m10s elapsed]
data.dnsimple_certificate.certificate: Still reading... [1m20s elapsed]
data.dnsimple_certificate.certificate: Read complete after 1m20s [id=2024-01-18 21:22:21.359896086 +0000 UTC]

@AGS4NO AGS4NO self-assigned this Jan 17, 2024
@AGS4NO AGS4NO marked this pull request as ready for review January 18, 2024 21:45
@AGS4NO AGS4NO requested a review from a team January 18, 2024 21:45
@weppos weppos changed the title Enhancement/certificate timeouts Add certificate timeouts Jan 19, 2024
@weppos weppos added the bug label Jan 19, 2024
@AGS4NO AGS4NO requested a review from DXTimer March 8, 2024 14:01
Copy link
Contributor

@DXTimer DXTimer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this I was able to verify the behaviour.

@DXTimer
Copy link
Contributor

DXTimer commented Mar 13, 2024

Merging. The failing specs are due to registrar errors.

@DXTimer DXTimer merged commit 36d619e into main Mar 13, 2024
4 of 6 checks passed
@DXTimer DXTimer deleted the enhancement/certificate-timeouts branch March 13, 2024 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

data "dnsimple_certificate" fails for certs created in the same apply
3 participants