-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add service account tokens #186
Conversation
ServiceAccountId types.Int64 `tfsdk:"service_account_id"` | ||
Secret types.String `tfsdk:"secret"` | ||
Description types.String `tfsdk:"description"` | ||
ExpiresAt types.String `tfsdk:"expires_at"` |
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.
Notably I've excluded a few fields that I don't think make sense:
- LastSeen: doesn't seem to be useful for a terraform integration
- UserId: also doesn't seem to be useful for a terraform integration
This is really just to reduce public dependencies. These can be added later if they're needed but adding them now means making them sticky
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.
Looks great! It seems it has some conflicts with your previous PR but nothing worring
PlanModifiers: []planmodifier.Int64{ | ||
int64planmodifier.RequiresReplace(), | ||
}, |
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.
TIL "to mark the accessible properties as requiring a plan change. This means that any update to a service account token will trigger a delete and then recreate it from scratch"
Nice! I think this might be handy for #163 as well.
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.
Me too! Thank you ChatGPT cough
Oh cheers, might be valuable to be able to address that issue actually!
}) | ||
} | ||
|
||
func TestAccServiceAccountTokenResourceUpdatingDescriptionGeneratesNewToken(t *testing.T) { |
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.
🤩 nice!
a08f8ae
to
b57c4bb
Compare
Adds service account tokens to the service accounts. This one's a bit more hairy than the last because of sensitivity reasons and how we handle tokens on service accounts for a few reasons:
Because of these reasons, I've chosen to mark the accessible properties as requiring a plan change. This means that any update to a service account token will trigger a delete and then recreate it from scratch