-
Notifications
You must be signed in to change notification settings - Fork 9
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
feature: temporalcloud_user_namespace_access #122
Draft
swgillespie
wants to merge
1
commit into
main
Choose a base branch
from
swgillespie/namespace-user-access
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "temporalcloud_user_namespace_access Resource - terraform-provider-temporalcloud" | ||
subcategory: "" | ||
description: |- | ||
|
||
--- | ||
|
||
# temporalcloud_user_namespace_access (Resource) | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
terraform { | ||
required_providers { | ||
temporalcloud = { | ||
source = "temporalio/temporalcloud" | ||
} | ||
} | ||
} | ||
|
||
provider "temporalcloud" { | ||
} | ||
|
||
resource "temporalcloud_namespace" "terraform" { | ||
name = "terraform-users" | ||
regions = ["aws-us-east-1"] | ||
accepted_client_ca = base64encode(file("${path.module}/ca.pem")) | ||
retention_days = 14 | ||
} | ||
|
||
resource "temporalcloud_namespace" "second_ns" { | ||
name = "terraform-users-2" | ||
regions = ["aws-us-east-1"] | ||
accepted_client_ca = base64encode(file("${path.module}/ca.pem")) | ||
retention_days = 14 | ||
} | ||
|
||
resource "temporalcloud_user" "namespace_admin" { | ||
email = "[email protected]" | ||
account_access = "developer" | ||
} | ||
|
||
resource "temporalcloud_user" "namespace_write" { | ||
email = "[email protected]" | ||
account_access = "developer" | ||
} | ||
|
||
resource "temporalcloud_user" "namespace_read" { | ||
email = "[email protected]" | ||
account_access = "developer" | ||
} | ||
|
||
resource "temporalcloud_user_namespace_access" "admin" { | ||
user_id = temporalcloud_user.namespace_admin.id | ||
namespace_id = temporalcloud_namespace.terraform.id | ||
permission = "admin" | ||
} | ||
|
||
resource "temporalcloud_user_namespace_access" "write" { | ||
user_id = temporalcloud_user.namespace_write.id | ||
namespace_id = temporalcloud_namespace.terraform.id | ||
permission = "write" | ||
} | ||
|
||
resource "temporalcloud_user_namespace_access" "read" { | ||
user_id = temporalcloud_user.namespace_read.id | ||
namespace_id = temporalcloud_namespace.terraform.id | ||
permission = "read" | ||
} | ||
|
||
resource "temporalcloud_user_namespace_access" "read_second_ns" { | ||
user_id = temporalcloud_user.namespace_read.id | ||
namespace_id = temporalcloud_namespace.second_ns.id | ||
permission = "read" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `namespace_id` (String) The ID of the namespace to which this user should be given the requested role | ||
- `permission` (String) The permission to grant the user in the namespace | ||
- `user_id` (String) The ID of the user to which this namespace access should be granted | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The unique identifier for the user namespace access. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
terraform import temporalcloud_user_namespace_access myuserid/terraform.badf00d | ||
``` |
12 changes: 12 additions & 0 deletions
12
examples/resources/temporalcloud_user_namespace_access/ca.pem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIBxjCCAU2gAwIBAgIRAlyZ5KUmunPLeFAupDwGL8AwCgYIKoZIzj0EAwMwEjEQ | ||
MA4GA1UEChMHdGVzdGluZzAeFw0yNDA4MTMyMzQ2NThaFw0yNTA4MTMyMzQ3NTha | ||
MBIxEDAOBgNVBAoTB3Rlc3RpbmcwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARG+EuL | ||
uKRsNWs7Rbz6ciaJQB7QINTRLmTgGGE8H/wAs+KjvctjPdDdqFPZrxShRY3PUdk2 | ||
pgQKRugMTe3N52pxBx4Iablz8felfdv4kyLQbdsJzY9XmCYX3D68/9Hxsl2jZzBl | ||
MA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSYC5/u | ||
K78bK1M8Fv1M6ELMjF2ZMDAjBgNVHREEHDAaghhjbGllbnQucm9vdC50ZXN0aW5n | ||
LjBycDUwCgYIKoZIzj0EAwMDZwAwZAIwSycjxxmYTgV5eSJbaGMINr5LQgyKQUHQ | ||
ryBKSGLKASa/e2ntyhsqRhj77gJ8DmkZAjAIlpDacF+Sq1kpZ5tMV7ZLElcujzj4 | ||
US8pEmNuIiCguEGwi+pb5CWfabETEHApxmo= | ||
-----END CERTIFICATE----- |
1 change: 1 addition & 0 deletions
1
examples/resources/temporalcloud_user_namespace_access/import.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
terraform import temporalcloud_user_namespace_access myuserid/terraform.badf00d |
63 changes: 63 additions & 0 deletions
63
examples/resources/temporalcloud_user_namespace_access/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
terraform { | ||
required_providers { | ||
temporalcloud = { | ||
source = "temporalio/temporalcloud" | ||
} | ||
} | ||
} | ||
|
||
provider "temporalcloud" { | ||
} | ||
|
||
resource "temporalcloud_namespace" "terraform" { | ||
name = "terraform-users" | ||
regions = ["aws-us-east-1"] | ||
accepted_client_ca = base64encode(file("${path.module}/ca.pem")) | ||
retention_days = 14 | ||
} | ||
|
||
resource "temporalcloud_namespace" "second_ns" { | ||
name = "terraform-users-2" | ||
regions = ["aws-us-east-1"] | ||
accepted_client_ca = base64encode(file("${path.module}/ca.pem")) | ||
retention_days = 14 | ||
} | ||
|
||
resource "temporalcloud_user" "namespace_admin" { | ||
email = "[email protected]" | ||
account_access = "developer" | ||
} | ||
|
||
resource "temporalcloud_user" "namespace_write" { | ||
email = "[email protected]" | ||
account_access = "developer" | ||
} | ||
|
||
resource "temporalcloud_user" "namespace_read" { | ||
email = "[email protected]" | ||
account_access = "developer" | ||
} | ||
|
||
resource "temporalcloud_user_namespace_access" "admin" { | ||
user_id = temporalcloud_user.namespace_admin.id | ||
namespace_id = temporalcloud_namespace.terraform.id | ||
permission = "admin" | ||
} | ||
|
||
resource "temporalcloud_user_namespace_access" "write" { | ||
user_id = temporalcloud_user.namespace_write.id | ||
namespace_id = temporalcloud_namespace.terraform.id | ||
permission = "write" | ||
} | ||
|
||
resource "temporalcloud_user_namespace_access" "read" { | ||
user_id = temporalcloud_user.namespace_read.id | ||
namespace_id = temporalcloud_namespace.terraform.id | ||
permission = "read" | ||
} | ||
|
||
resource "temporalcloud_user_namespace_access" "read_second_ns" { | ||
user_id = temporalcloud_user.namespace_read.id | ||
namespace_id = temporalcloud_namespace.second_ns.id | ||
permission = "read" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
is the user_id the internal id of the user or the email address of the user? If internal ID, recommend this is specified that it's internal to Temporal as this ID is not exposed in the UI and only exposed in response messages to GetUsers, for example.
For context, I believe we are adding a GetUser by email_adder (externally facing user id) to the api soon.
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.
Yeah, and I think the internal ID is probably what we want here given that it's the primary key that the API expects to use when performing operations. GetUser by email address should be exposed as a data source, when that functionality exists.