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

feat: add service_account_token resource #86

Merged

Conversation

srevinsaju
Copy link
Contributor

  • adds a new resource doppler_service_account_token
  • added example usage
  • autogenerated docs for newly added resource

Sample deployment

terraform {
  required_providers {
    doppler = {
      source = "doppler.com/core/doppler"
      version = "0.0.1"
    }
  }
}

provider "doppler" {
  doppler_token = "..."
}

resource "doppler_service_account" "ci" {
  name = "ci"
  workplace_role = "no_access"
}

resource "doppler_service_account_token" "builder_ci_token" {
  service_account_slug = doppler_service_account.ci.slug
  name            = "Builder CI Token"
  expires_at      = "2024-05-30T11:00:00.000Z"
}

output "service_account_token_slug" {
  value = doppler_service_account_token.builder_ci_token.slug
}

output "service_account_token_api_key" {
  sensitive = true
  value = doppler_service_account_token.builder_ci_token.api_key
}

What is tested:

  • Creation (with expiry date)
  • Creation (without expiry date)
  • Update from no expiry date to having an expiry date, and vice versa - which should do a full CRUD test

Copy link
Member

@nmanoogian nmanoogian left a comment

Choose a reason for hiding this comment

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

Thanks so much for your submission, @srevinsaju! This works great from my local testing. I left a few minor comments with recommended patches.

If you aren't familiar, you can apply any of the patches by copying their contents and pasting (or piping) into git apply.

doppler/api.go Outdated Show resolved Hide resolved
doppler/api.go Outdated Show resolved Hide resolved
doppler/resource_service_account_token.go Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
* adds a new resource `doppler_service_account_token`
* added example usage
* autogenerated docs for newly added resource
@srevinsaju srevinsaju force-pushed the feature/service-account-token branch from 43298b7 to c11e379 Compare May 28, 2024 19:00
@srevinsaju
Copy link
Contributor Author

Thanks for the review @nmanoogian, I have updated with your suggested patches!

@nmanoogian nmanoogian merged commit aee7d65 into DopplerHQ:master May 28, 2024
1 check passed
github-merge-queue bot referenced this pull request in dotkom/monoweb Aug 20, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [doppler](https://registry.terraform.io/providers/dopplerhq/doppler)
([source](https://togithub.com/DopplerHQ/terraform-provider-doppler)) |
required_provider | minor | `~> 1.3.0` -> `~> 1.9.0` |

---

### Release Notes

<details>
<summary>DopplerHQ/terraform-provider-doppler (doppler)</summary>

###
[`v1.9.0`](https://togithub.com/DopplerHQ/terraform-provider-doppler/releases/tag/v1.9.0)

[Compare
Source](https://togithub.com/DopplerHQ/terraform-provider-doppler/compare/v1.8.0...v1.9.0)

#### What's Changed

- Add Fly.io integration + sync and delete_behavior field by
[@&#8203;nmanoogian](https://togithub.com/nmanoogian) in
[https://github.com/DopplerHQ/terraform-provider-doppler/pull/93](https://togithub.com/DopplerHQ/terraform-provider-doppler/pull/93)
- Update Go version to v1.22 by
[@&#8203;nmanoogian](https://togithub.com/nmanoogian) in
[https://github.com/DopplerHQ/terraform-provider-doppler/pull/89](https://togithub.com/DopplerHQ/terraform-provider-doppler/pull/89)
- Add personal_configs field to environment resource by
[@&#8203;nmanoogian](https://togithub.com/nmanoogian) in
[https://github.com/DopplerHQ/terraform-provider-doppler/pull/92](https://togithub.com/DopplerHQ/terraform-provider-doppler/pull/92)
- Add support for kms_key_id in AWS Secrets Manager and Parameter Store
syncs by [@&#8203;nmanoogian](https://togithub.com/nmanoogian) in
[https://github.com/DopplerHQ/terraform-provider-doppler/pull/94](https://togithub.com/DopplerHQ/terraform-provider-doppler/pull/94)

**Full Changelog**:
DopplerHQ/terraform-provider-doppler@v1.8.0...v1.9.0

###
[`v1.8.0`](https://togithub.com/DopplerHQ/terraform-provider-doppler/releases/tag/v1.8.0)

[Compare
Source](https://togithub.com/DopplerHQ/terraform-provider-doppler/compare/v1.7.1...v1.8.0)

#### What's Changed

- Add service_account_token resource by
[@&#8203;srevinsaju](https://togithub.com/srevinsaju) in
[https://github.com/DopplerHQ/terraform-provider-doppler/pull/86](https://togithub.com/DopplerHQ/terraform-provider-doppler/pull/86)
- Add doppler_project_role resource by
[@&#8203;nmanoogian](https://togithub.com/nmanoogian) in
[https://github.com/DopplerHQ/terraform-provider-doppler/pull/88](https://togithub.com/DopplerHQ/terraform-provider-doppler/pull/88)
- Add webhook resource by
[@&#8203;kyle-mcguire](https://togithub.com/kyle-mcguire) in
[https://github.com/DopplerHQ/terraform-provider-doppler/pull/87](https://togithub.com/DopplerHQ/terraform-provider-doppler/pull/87)

#### New Contributors

- 🎉 [@&#8203;srevinsaju](https://togithub.com/srevinsaju) made their
first contribution in
[https://github.com/DopplerHQ/terraform-provider-doppler/pull/86](https://togithub.com/DopplerHQ/terraform-provider-doppler/pull/86)
- 🎉 [@&#8203;kyle-mcguire](https://togithub.com/kyle-mcguire) made their
first contribution in
[https://github.com/DopplerHQ/terraform-provider-doppler/pull/87](https://togithub.com/DopplerHQ/terraform-provider-doppler/pull/87)

**Full Changelog**:
DopplerHQ/terraform-provider-doppler@v1.7.1...v1.8.0

###
[`v1.7.1`](https://togithub.com/DopplerHQ/terraform-provider-doppler/releases/tag/v1.7.1)

[Compare
Source](https://togithub.com/DopplerHQ/terraform-provider-doppler/compare/v1.7.0...v1.7.1)

- Update dependency versions and add import examples by
[@&#8203;nmanoogian](https://togithub.com/nmanoogian) in
[https://github.com/DopplerHQ/terraform-provider-doppler/pull/83](https://togithub.com/DopplerHQ/terraform-provider-doppler/pull/83)

**Full Changelog**:
DopplerHQ/terraform-provider-doppler@v1.7.0...v1.7.1

###
[`v1.7.0`](https://togithub.com/DopplerHQ/terraform-provider-doppler/releases/tag/v1.7.0)

[Compare
Source](https://togithub.com/DopplerHQ/terraform-provider-doppler/compare/v1.6.2...v1.7.0)

- Add `doppler_secrets_sync_github_actions` resource by
[@&#8203;watsonian](https://togithub.com/watsonian) in
[#&#8203;81](https://togithub.com/DopplerHQ/terraform-provider-doppler/issues/81)

**Full Changelog**:
DopplerHQ/terraform-provider-doppler@v1.6.2...v1.7.0

###
[`v1.6.2`](https://togithub.com/DopplerHQ/terraform-provider-doppler/releases/tag/v1.6.2)

[Compare
Source](https://togithub.com/DopplerHQ/terraform-provider-doppler/compare/v1.6.1...v1.6.2)

- Set ForceNew for `doppler_secret` project and config by
[@&#8203;nmanoogian](https://togithub.com/nmanoogian) in
[https://github.com/DopplerHQ/terraform-provider-doppler/pull/78](https://togithub.com/DopplerHQ/terraform-provider-doppler/pull/78)
- Ignore order of project_member environments by
[@&#8203;rgharris](https://togithub.com/rgharris) in
[https://github.com/DopplerHQ/terraform-provider-doppler/pull/79](https://togithub.com/DopplerHQ/terraform-provider-doppler/pull/79)

**Full Changelog**:
DopplerHQ/terraform-provider-doppler@v1.6.1...v1.6.2

###
[`v1.6.1`](https://togithub.com/DopplerHQ/terraform-provider-doppler/releases/tag/v1.6.1)

[Compare
Source](https://togithub.com/DopplerHQ/terraform-provider-doppler/compare/v1.6.0...v1.6.1)

- Fix typo in User data source docs by
[@&#8203;rgharris](https://togithub.com/rgharris) in
[https://github.com/DopplerHQ/terraform-provider-doppler/pull/76](https://togithub.com/DopplerHQ/terraform-provider-doppler/pull/76)

**Full Changelog**:
DopplerHQ/terraform-provider-doppler@v1.6.0...v1.6.1

###
[`v1.6.0`](https://togithub.com/DopplerHQ/terraform-provider-doppler/releases/tag/v1.6.0)

[Compare
Source](https://togithub.com/DopplerHQ/terraform-provider-doppler/compare/v1.5.0...v1.6.0)

- Add resources for managing users in groups by
[@&#8203;rgharris](https://togithub.com/rgharris) in
[https://github.com/DopplerHQ/terraform-provider-doppler/pull/72](https://togithub.com/DopplerHQ/terraform-provider-doppler/pull/72)
- chore: Workflows update by
[@&#8203;ViacheslavKudinov](https://togithub.com/ViacheslavKudinov) in
[https://github.com/DopplerHQ/terraform-provider-doppler/pull/75](https://togithub.com/DopplerHQ/terraform-provider-doppler/pull/75)

**Full Changelog**:
DopplerHQ/terraform-provider-doppler@v1.5.0...v1.6.0

###
[`v1.5.0`](https://togithub.com/DopplerHQ/terraform-provider-doppler/releases/tag/v1.5.0)

[Compare
Source](https://togithub.com/DopplerHQ/terraform-provider-doppler/compare/v1.4.0...v1.5.0)

- Added resources for Terraform Cloud sync integrations (thanks to
[@&#8203;sbrudz](https://togithub.com/sbrudz)!)
- Updated auth documentation to include environment variable support
(thanks to [@&#8203;kaldorn](https://togithub.com/kaldorn)!)

###
[`v1.4.0`](https://togithub.com/DopplerHQ/terraform-provider-doppler/releases/tag/v1.4.0)

[Compare
Source](https://togithub.com/DopplerHQ/terraform-provider-doppler/compare/v1.3.0...v1.4.0)

- Updated from Go 1.19 to 1.21 along with some dependency version bumps
- Added support for specifying tags to
`doppler_secrets_sync_aws_secrets_manager`

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job log](https://developer.mend.io/github/dotkom/monoweb).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants