Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Terraform Provider: Use updated APIs for Users, Roles, & Auth Connectors #978

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

rosstimothy
Copy link
Contributor

@rosstimothy rosstimothy commented Dec 4, 2023

The resources now all expose a Create, Update, Upsert RPC which returns the resource and an error. The generated code now uses Create for creating resources and Upsert for updating resources. The Update RPC is not used because it enforces optimistic locking which breaks the ownership model expected by the provider. Additionally, the GetUser RPC now takes a context so the hack to accommodate it has been removed.

- Do Not Merge Until v15 -

The APIs used in this PR are not being backported to v14 so this cannot land until the gravitational/teleport-plugins repo is updated to point to branch/v15 of gravitational/teleport. go.mod was updated in this PR to point at a commit of master from gravitational/teleport so that the functionality could be validated.

@rosstimothy rosstimothy force-pushed the tross/update_apis branch 3 times, most recently from b27c487 to 902b2a2 Compare December 4, 2023 19:18
@rosstimothy rosstimothy marked this pull request as ready for review December 4, 2023 19:22
Copy link
Contributor

@marcoandredinis marcoandredinis left a comment

Choose a reason for hiding this comment

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

LGTM
Did you run this locally against a v15/master build?
The tests fail because we are probably using a v14.x version on the CI/CD

@rosstimothy rosstimothy force-pushed the tross/update_apis branch 2 times, most recently from 89c3f46 to f4ec9de Compare December 5, 2023 21:53
@strideynet
Copy link
Contributor

If we're switching to the APIs which return the created/updated resource, we can probably remove the logic which tries to Get the resource after the create/update.

@rosstimothy
Copy link
Contributor Author

If we're switching to the APIs which return the created/updated resource, we can probably remove the logic which tries to Get the resource after the create/update.

I was under the impression that behavior existed to prevent cache propagation delay from impacting future calls to Get.

@rosstimothy rosstimothy force-pushed the tross/update_apis branch 2 times, most recently from 01a44c0 to 130284b Compare January 16, 2024 14:58
Copy link

@orca-security-us orca-security-us bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Failed Failed Vulnerabilities high 0   medium 1   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca

The resources now all expose a Create, Update, Upsert RPC which
returns the resource and an error. The generated code now uses Create
for creating resources and Upsert for updating resources. The Update
RPC is not used because it enforces optimistic locking which breaks
the ownership model expected by the provider. Additionally, the
GetUser RPC now takes a context so the hack to accommodate it has
been removed.
@hugoShaka hugoShaka enabled auto-merge (squash) January 31, 2024 13:58
@hugoShaka hugoShaka merged commit 5ec5c8b into master Jan 31, 2024
13 checks passed
@hugoShaka hugoShaka deleted the tross/update_apis branch January 31, 2024 13:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants