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

🚀 Add Project controller #309

Merged
merged 11 commits into from
Jan 16, 2024
Merged

🚀 Add Project controller #309

merged 11 commits into from
Jan 16, 2024

Conversation

arybolovlev
Copy link
Contributor

@arybolovlev arybolovlev commented Dec 14, 2023

Description

This PR adds a new controller Project that extends the operator with the ability to manage Terraform Cloud Projects.

Schema:

apiVersion: app.terraform.io/v1alpha2
kind: Project
metadata:
  name: <NAME>
spec:
  name: <PROJECT-NAME>
  teamAccess:
  - team:
      name: <TEAM-NAME>
      id: <TEAM-ID>
    access: < admin | custom | maintain | read | write >
    # `custom` can and must be set only when `access` is `custom`
    custom:
      projectAccess: < delete | read | update >
      teamManagement: < manage | none | read >
      createWorkspace: <BOOL>
      deleteWorkspace: <BOOL>
      moveWorkspace: <BOOL>
      lockWorkspace: <BOOL>
      runs: < apply | plan | read >
      runTasks: <BOOL>
      sentinelMocks: < none | read >
      stateVersions: < none | read | read-outputs | write >
      variables: < none | read | write >
status:
  name: <PROJECT-NAME>
  id: <PROJECT-ID>

Usage Example

Project without team access:

apiVersion: app.terraform.io/v1alpha2
kind: Project
metadata:
  name: this
spec:
  organization: kubernetes-operator
  token:
    secretKeyRef:
      name: tfc-operator
      key: token
  name: project-demo

Project with team access(permission groups):

apiVersion: app.terraform.io/v1alpha2
kind: Project
metadata:
  name: this
spec:
  organization: kubernetes-operator
  token:
    secretKeyRef:
      name: tfc-operator
      key: token
  name: project-demo
  teamAccess:
  - team:
      name: demo
    access: admin

E2E:

Release Note

Release note for CHANGELOG:

`Project`: add a new controller `Project` allows managing Terraform Cloud Projects.

References

Community Note

  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

@arybolovlev arybolovlev force-pushed the add-project-controller branch 3 times, most recently from 4a41c23 to dd94d56 Compare December 15, 2023 10:59
@arybolovlev arybolovlev marked this pull request as ready for review December 18, 2023 09:40
@arybolovlev arybolovlev requested a review from a team as a code owner December 18, 2023 09:40
Copy link
Contributor

@jrhouston jrhouston left a comment

Choose a reason for hiding this comment

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

Tried this out, works great 🚀

@arybolovlev arybolovlev merged commit 2d0d6d3 into main Jan 16, 2024
7 checks passed
@arybolovlev arybolovlev deleted the add-project-controller branch January 16, 2024 08:20
@willhughes-au
Copy link

willhughes-au commented Jan 22, 2024

Did you test that this works when upgrading from 2.1.0 -> 2.2.0, or just a clean install?

I think this has broken upgrades because the CRDs didn't get upgraded to include this new resource.

e: I'll come back with more detail soon.

@arybolovlev arybolovlev mentioned this pull request Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚀Support for Terraform Cloud Projects
3 participants