-
Notifications
You must be signed in to change notification settings - Fork 0
chore: rework account group resource and data source [ENG-5061] #17
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
Conversation
94df2ac
to
a3c00f9
Compare
e68a983
to
27aa3c9
Compare
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.
LGTM, thanks, a few thoughts but nothing that should block progress
3. Build the provider: | ||
```bash | ||
go build -o terraform-provider-stacklet | ||
just build |
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.
we might need an "install just" step :)
resource "stacklet_account_group" "production" { | ||
name = "production-accounts" | ||
cloud_provider = "aws" | ||
description = "Production AWS accounts" |
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.
this one should definitely need regions
internal/api/account_group.go
Outdated
if uuid != "" { | ||
variables["uuid"] = graphql.String(uuid) | ||
} | ||
if name != "" { |
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.
would this be the place to enforce? or is there somewhere earlier we can reject overspecified data sources?
(or do we want to get clever and always ask by uuid if it's present, and then check name matches? or, arguably, do we want to skip the identify-by-name bit, 'cos that's not a stable identifier and will probably cause more pain than just disallowing it would…)
} | ||
variables := map[string]any{"uuid": graphql.String(uuid)} | ||
if err := a.c.Mutate(ctx, &mutation, variables); err != nil { | ||
return APIError{"Client error", err.Error()} |
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.
this is probably too minor to fret about rn, but – what about this is specifically a client error?
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.
this is from what was there before, I guess "client" in the sense of API client
352d652
to
b4e36fb
Compare
[ENG-5061](https://stacklet.atlassian.net/browse/ENG-5061) [ENG-5070](https://stacklet.atlassian.net/browse/ENG-5070) ### what - extract API queries related to account groups - refactor resource and data source code - fix resource import ### why making code more consistent ### testing unit tests and sandbox ### docs updated here
b4e36fb
to
cb3a84b
Compare
ENG-5061
ENG-5070
what
why
making code more consistent
testing
unit tests and sandbox
docs
updated here