-
Notifications
You must be signed in to change notification settings - Fork 626
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
Cloudflare service token rotation #1057
Cloudflare service token rotation #1057
Conversation
I would also like to explore an integration test for this behaviour however I don't exactly have a good approach planned out yet. Thoughts? |
For an integration test I see two tests possibly:
|
@jacobbednarz I've added an acceptance test & updated a few things with the PR. Let me know if you have any further suggestions. |
@@ -100,6 +137,7 @@ func resourceCloudflareAccessServiceTokenCreate(d *schema.ResourceData, meta int | |||
d.Set("name", serviceToken.Name) | |||
d.Set("client_id", serviceToken.ClientID) | |||
d.Set("client_secret", serviceToken.ClientSecret) | |||
d.Set("expires_at", serviceToken.ExpiresAt.Format(time.RFC3339)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cloudflare.AccessServiceTokenCreateResponse
doesn't have an ExpiresAt
field - see https://github.com/cloudflare/cloudflare-go/blob/master/access_service_tokens.go#L37-L44. we'll need to get this into cloudflare-go first
looks like a good approach! other than adding the field into cloudflare-go, this is looking ace. thanks! |
this is now ready to update from master to get this prepared for merge |
695626d
to
cdaca76
Compare
@jacobbednarz I've rebased from master... let me know if you need anything else to get this merged. |
thanks, looks great and the integration tests are passing locally 🎉 |
This PR closes #1041
It adds support for cloudflare_access_service_token renewal if terraform is ran within the timeperiod defined in min_days_for_renewal.
See example usage: