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

[APP-16093] add smart classes to tf provider #229

Merged
merged 5 commits into from
Jan 17, 2025
Merged

[APP-16093] add smart classes to tf provider #229

merged 5 commits into from
Jan 17, 2025

Conversation

ryan-willis
Copy link
Contributor

No description provided.

jupiterone/resource_smart_class.go Show resolved Hide resolved
jupiterone/resource_smart_class_tag.go Show resolved Hide resolved
README.md Show resolved Hide resolved
@ryan-willis ryan-willis marked this pull request as ready for review January 16, 2025 22:01
@ryan-willis ryan-willis requested a review from a team as a code owner January 16, 2025 22:01
@bjoepfeiffer
Copy link
Contributor

Testing steps:

  • Pull branch
  • Go install
  • Create main.tf with the example from the smart class docs in this PR
  • Got the following error:
╷
│ Error: Failed to create smart class
│ 
│   with jupiterone_smart_class.example,
│   on main.tf line 10, in resource "jupiterone_smart_class" "example":
│   10: resource "jupiterone_smart_class" "example" {
│ 
│ input: createSmartClass Unexpected error value: { errorType: "USER_ERROR", message: "Must be PascalCase", statusCode: 400, expose: true }
│ 
  • Updated the tag_name to be Example
  • Terraform apply worked ✅
  • Verified the smart class showed up in the UI, and my assets were tagged with the smart class and additional tag ✅
  • Made some changes to the resources and verified they were reflected in the UI ✅
  • Changed that smart class tag_name and verified that it forced replacement and verified changes in UI ✅

README.md Show resolved Hide resolved
examples/resources/jupiterone_smart_class/resource.tf Outdated Show resolved Hide resolved
@@ -85,7 +85,10 @@ func (rt *RetryTransport) RoundTrip(req *http.Request) (*http.Response, error) {
// Setting the body for the request
req.Body = io.NopCloser(bytes.NewBuffer(bodyBytes))

resp, _ = rt.Transport.RoundTrip(req)
resp, err = rt.Transport.RoundTrip(req)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

This won't have any repercussions for other resources?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely shouldn't because all the client resources hit the same endpoint, and the only time this returns both a response and error is when alternate transports are used.

jupiterone/resource_smart_class.go Outdated Show resolved Hide resolved
@ryan-willis ryan-willis merged commit 843569b into main Jan 17, 2025
7 checks passed
@ryan-willis ryan-willis deleted the APP-16093 branch January 17, 2025 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants