Skip to content

Commit

Permalink
Fix docs examples
Browse files Browse the repository at this point in the history
  • Loading branch information
wcmjunior committed Nov 2, 2023
1 parent 7edd5d8 commit 66aed7c
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 100 deletions.
7 changes: 5 additions & 2 deletions docs/resources/repository_datamap.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ Manages [Data Map](https://cyral.com/docs/policy/datamap).
resource "cyral_repository" "example-pg" {
name = "example-pg"
type = "postgresql"
host = "pg.example.com"
port = 5432
repo_node {
host = "pg.example.com"
port = 5432
}
}
# Create custom labels
Expand Down
91 changes: 43 additions & 48 deletions docs/resources/repository_user_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,93 +11,88 @@ account in the Cyral Control Plane.
```terraform
# Test Repo to use in examples.
resource "cyral_repository" "tf_test_repo" {
name = "tf_test_repo"
type = "postgresql"
repo_node {
host = "postgresql.mycompany.com"
name = "tf_test_repo"
port = 5432
type = "postgresql"
}
}
# cyral_repository_user_account with auth scheme aws_iam
resource "cyral_repository_user_account" "aws_iam" {
name = "hbf_aws_iam"
repository_id = cyral_repository.tf_test_repo.id
name = "hbf_aws_iam"
repository_id = cyral_repository.tf_test_repo.id
auth_scheme {
aws_iam {
role_arn = "role_arn"
}
auth_scheme {
aws_iam {
role_arn = "role_arn"
}
}
}
# cyral_repository_user_account with auth scheme aws_secrets will be created
resource "cyral_repository_user_account" "aws_secrets" {
name = "hbf_aws_secrets"
repository_id = cyral_repository.tf_test_repo.id
name = "hbf_aws_secrets"
repository_id = cyral_repository.tf_test_repo.id
auth_scheme {
aws_secrets_manager {
secret_arn = "secret_arn"
}
auth_scheme {
aws_secrets_manager {
secret_arn = "secret_arn"
}
}
}
# cyral_repository_user_account with auth scheme env_var will be created
resource "cyral_repository_user_account" "env_var" {
name = "hbf_env_var"
repository_id = cyral_repository.tf_test_repo.id
name = "hbf_env_var"
repository_id = cyral_repository.tf_test_repo.id
auth_scheme {
environment_variable {
variable_name = "some-env-var"
}
auth_scheme {
environment_variable {
variable_name = "some-env-var"
}
}
}
# cyral_repository_user_account with auth scheme gcp_secrets will be created
resource "cyral_repository_user_account" "gcp_secrets" {
name = "hbf_gcp_secrets"
repository_id = cyral_repository.tf_test_repo.id
name = "hbf_gcp_secrets"
repository_id = cyral_repository.tf_test_repo.id
auth_scheme {
gcp_secrets_manager {
secret_name = "secret_name"
}
auth_scheme {
gcp_secrets_manager {
secret_name = "secret_name"
}
}
}
# cyral_repository_user_account with auth scheme hashicorp will be created
resource "cyral_repository_user_account" "hashicorp" {
name = "hbf_hashicorp"
repository_id = cyral_repository.tf_test_repo.id
name = "hbf_hashicorp"
repository_id = cyral_repository.tf_test_repo.id
auth_scheme {
hashicorp_vault {
path = "some-path"
is_dynamic_user_account = false
}
auth_scheme {
hashicorp_vault {
path = "some-path"
is_dynamic_user_account = false
}
}
}
# cyral_repository_user_account with auth scheme kubernetes will be created
resource "cyral_repository_user_account" "kubernetes" {
name = "hbf_kubernetes"
repository_id = cyral_repository.tf_test_repo.id
name = "hbf_kubernetes"
repository_id = cyral_repository.tf_test_repo.id
auth_scheme {
kubernetes_secret {
secret_key = "secret_key"
secret_name = "secret_name"
}
auth_scheme {
kubernetes_secret {
secret_key = "secret_key"
secret_name = "secret_name"
}
}
}
```

Expand Down
7 changes: 5 additions & 2 deletions examples/resources/cyral_repository_datamap/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
resource "cyral_repository" "example-pg" {
name = "example-pg"
type = "postgresql"
host = "pg.example.com"
port = 5432

repo_node {
host = "pg.example.com"
port = 5432
}
}

# Create custom labels
Expand Down
91 changes: 43 additions & 48 deletions examples/resources/cyral_repository_user_account/resource.tf
Original file line number Diff line number Diff line change
@@ -1,90 +1,85 @@
# Test Repo to use in examples.
resource "cyral_repository" "tf_test_repo" {
name = "tf_test_repo"
type = "postgresql"

repo_node {
host = "postgresql.mycompany.com"
name = "tf_test_repo"
port = 5432
type = "postgresql"
}
}


# cyral_repository_user_account with auth scheme aws_iam
resource "cyral_repository_user_account" "aws_iam" {
name = "hbf_aws_iam"
repository_id = cyral_repository.tf_test_repo.id
name = "hbf_aws_iam"
repository_id = cyral_repository.tf_test_repo.id

auth_scheme {
aws_iam {
role_arn = "role_arn"
}
auth_scheme {
aws_iam {
role_arn = "role_arn"
}
}
}

# cyral_repository_user_account with auth scheme aws_secrets will be created
resource "cyral_repository_user_account" "aws_secrets" {
name = "hbf_aws_secrets"
repository_id = cyral_repository.tf_test_repo.id

name = "hbf_aws_secrets"
repository_id = cyral_repository.tf_test_repo.id

auth_scheme {
aws_secrets_manager {
secret_arn = "secret_arn"
}
auth_scheme {
aws_secrets_manager {
secret_arn = "secret_arn"
}
}
}

# cyral_repository_user_account with auth scheme env_var will be created
resource "cyral_repository_user_account" "env_var" {
name = "hbf_env_var"
repository_id = cyral_repository.tf_test_repo.id

name = "hbf_env_var"
repository_id = cyral_repository.tf_test_repo.id

auth_scheme {

environment_variable {
variable_name = "some-env-var"
}
auth_scheme {
environment_variable {
variable_name = "some-env-var"
}
}
}

# cyral_repository_user_account with auth scheme gcp_secrets will be created
resource "cyral_repository_user_account" "gcp_secrets" {
name = "hbf_gcp_secrets"
repository_id = cyral_repository.tf_test_repo.id

name = "hbf_gcp_secrets"
repository_id = cyral_repository.tf_test_repo.id

auth_scheme {

gcp_secrets_manager {
secret_name = "secret_name"
}
auth_scheme {
gcp_secrets_manager {
secret_name = "secret_name"
}
}
}

# cyral_repository_user_account with auth scheme hashicorp will be created
resource "cyral_repository_user_account" "hashicorp" {
name = "hbf_hashicorp"
repository_id = cyral_repository.tf_test_repo.id

name = "hbf_hashicorp"
repository_id = cyral_repository.tf_test_repo.id

auth_scheme {
hashicorp_vault {
path = "some-path"
is_dynamic_user_account = false
}
auth_scheme {
hashicorp_vault {
path = "some-path"
is_dynamic_user_account = false
}
}
}

# cyral_repository_user_account with auth scheme kubernetes will be created
resource "cyral_repository_user_account" "kubernetes" {
name = "hbf_kubernetes"
repository_id = cyral_repository.tf_test_repo.id

name = "hbf_kubernetes"
repository_id = cyral_repository.tf_test_repo.id

auth_scheme {

kubernetes_secret {
secret_key = "secret_key"
secret_name = "secret_name"
}
auth_scheme {
kubernetes_secret {
secret_key = "secret_key"
secret_name = "secret_name"
}
}
}

0 comments on commit 66aed7c

Please sign in to comment.