Skip to content

Commit

Permalink
Documentation update for setting up Terraform with Axual Trial enviro…
Browse files Browse the repository at this point in the history
…nment
  • Loading branch information
kasparAxual committed Oct 11, 2022
1 parent 36647b3 commit 5659a76
Show file tree
Hide file tree
Showing 12 changed files with 164 additions and 10 deletions.
77 changes: 77 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,83 @@ Axual Provider allows using Axual's Self-Service for Apache Kafka functionality
- Manual approval will be supported in later version of Axual Terraform Provider.

# Getting started

## Axual Trial setup

- First please request a trial environment by filling in the form https://axual.com/trial/
- Please confirm your e-mail
- You will receive an e-mail with trial credentials
- Please fill in provider like this:

```shell
terraform {
required_providers {
axual = {
source = "Axual/axual"
version = "1.0.0"
}
}
}
provider "axual" {
apiurl = "https://selfservice.axual.cloud/api"
realm = "<REPLACE_WITH_REALM> " # Replace realm with the realm from the URL in the email you received: https://selfservice.axual.cloud/login/<REPLACE_WITH_REALM>
username = "<REPLACE_WITH_USERNAME>"
password = "<REPLACE_WITH_PASSWORD>"
clientid = "self-service"
authurl = "https://selfservice.axual.cloud/auth/realms/<REPLACE_WITH_REALM>/protocol/openid-connect/token" # Replace realm with the realm from the URL in the email you received: https://selfservice.axual.cloud/login/<REPLACE_WITH_REALM>
scopes = ["openid", "profile", "email"]
}
```
- Next, let's test if everything works:
```shell
terraform init
```
- Next, we can either import User and Group or hardcode user and group UID-s in other resources

### Importing user and group

- To import, please go to user page and replace these values:
```shell
resource "axual_user" "gitops_user" {
first_name = "<REPLACE WITH FIRST NAME>"
last_name = "<REPLACE WITH LAST NAME>"
email_address = "<REPLACE WITH EMAIL>"
roles = [
{ name = "STREAM_ADMIN" },
{ name = "APPLICATION_ADMIN" },
{ name = "ENVIRONMENT_ADMIN" },
]
}
resource "axual_group" "gitops_group" {
name = "default"
members = [
axual_user.gitops_user.id,
]
}
```
- Then on user page we can look at user and group UID-s from network tab:
- Request to https://selfservice.axual.cloud/api/group contains the group UID
- Request to https://selfservice.axual.cloud/api/user contains the user UID
- Now we can import user and group:
```shell
terraform import axual_user.gitops_user <USER_UID>
terraform import axual_group.gitops_group <GROUP_UID>
```
### Hardcoded values
- To use hardcoded values, we replace group UID for owners value in other resources, for example:
```shell
resource "axual_stream" "gitops_test_stream2" {
name = "gitops_test_stream2"
key_type = "String"
value_type = "String"
owners = "221771776652211ea556db870b084631"
retention_policy = "delete"
properties = { }
}
```
<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/application_access_grant.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ resource "axual_application_access_grant" "terra_grant_1" {

## Import

Import is supported using the following syntax:
Import is not currently supported.
2 changes: 1 addition & 1 deletion docs/resources/application_principal.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ resource "axual_application_principal" "test_application_principal" {

## Import

Import is supported using the following syntax:
Import is not currently supported.
2 changes: 1 addition & 1 deletion docs/resources/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ resource "axual_stream" "gitops_test_stream3" {
Import is supported using the following syntax:

```shell
terraform import axual_stream.<LOCAL NAME> <GROUP UID>
terraform import axual_stream.<LOCAL NAME> <STREAM UID>
terraform import axual_stream.test_stream b21cf1d63a55436391463cee3f56e393
```
2 changes: 1 addition & 1 deletion docs/resources/stream_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ resource "axual_stream_config" "gitops_test_stream_config_3" {
Import is supported using the following syntax:

```shell
terraform import axual_stream_config.<LOCAL NAME> <GROUP UID>
terraform import axual_stream_config.<LOCAL NAME> <STREAM CONFIG UID>
terraform import axual_stream_config.test_stream_config b21cf1d63a55436391463cee3f56e393
```
2 changes: 1 addition & 1 deletion docs/resources/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ resource "axual_user" "gitops_user2" {
Import is supported using the following syntax:

```shell
terraform import axual_user.<LOCAL NAME> <GROUP UID>
terraform import axual_user.<LOCAL NAME> <USER UID>
terraform import axual_user.test_user b21cf1d63a55436391463cee3f56e393
```
77 changes: 77 additions & 0 deletions templates/index.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,83 @@ Axual Provider allows using Axual's Self-Service for Apache Kafka functionality
- Manual approval will be supported in later version of Axual Terraform Provider.

# Getting started

## Axual Trial setup

- First please request a trial environment by filling in the form https://axual.com/trial/
- Please confirm your e-mail
- You will receive an e-mail with trial credentials
- Please fill in provider like this:

```shell
terraform {
required_providers {
axual = {
source = "Axual/axual"
version = "1.0.0"
}
}
}
provider "axual" {
apiurl = "https://selfservice.axual.cloud/api"
realm = "<REPLACE_WITH_REALM> " # Replace realm with the realm from the URL in the email you received: https://selfservice.axual.cloud/login/<REPLACE_WITH_REALM>
username = "<REPLACE_WITH_USERNAME>"
password = "<REPLACE_WITH_PASSWORD>"
clientid = "self-service"
authurl = "https://selfservice.axual.cloud/auth/realms/<REPLACE_WITH_REALM>/protocol/openid-connect/token" # Replace realm with the realm from the URL in the email you received: https://selfservice.axual.cloud/login/<REPLACE_WITH_REALM>
scopes = ["openid", "profile", "email"]
}
```
- Next, let's test if everything works:
```shell
terraform init
```
- Next, we can either import User and Group or hardcode user and group UID-s in other resources

### Importing user and group

- To import, please go to user page and replace these values:
```shell
resource "axual_user" "gitops_user" {
first_name = "<REPLACE WITH FIRST NAME>"
last_name = "<REPLACE WITH LAST NAME>"
email_address = "<REPLACE WITH EMAIL>"
roles = [
{ name = "STREAM_ADMIN" },
{ name = "APPLICATION_ADMIN" },
{ name = "ENVIRONMENT_ADMIN" },
]
}
resource "axual_group" "gitops_group" {
name = "default"
members = [
axual_user.gitops_user.id,
]
}
```
- Then on user page we can look at user and group UID-s from network tab:
- Request to https://selfservice.axual.cloud/api/group contains the group UID
- Request to https://selfservice.axual.cloud/api/user contains the user UID

- Now we can import user and group:

```shell
terraform import axual_user.gitops_user <USER_UID>
terraform import axual_group.gitops_group <GROUP_UID>
```

### Hardcoded values
- To use hardcoded values, we replace group UID for owners value in other resources, for example:
```shell
resource "axual_stream" "gitops_test_stream2" {
name = "gitops_test_stream2"
key_type = "String"
value_type = "String"
owners = "221771776652211ea556db870b084631"
retention_policy = "delete"
properties = { }
}
```
<!-- schema generated by tfplugindocs -->
## Schema

Expand Down
2 changes: 1 addition & 1 deletion templates/resources/application_access_grant.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

## Import

Import is supported using the following syntax:
Import is not currently supported.
2 changes: 1 addition & 1 deletion templates/resources/application_principal.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

## Import

Import is supported using the following syntax:
Import is not currently supported.
2 changes: 1 addition & 1 deletion templates/resources/stream.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Axual Terraform Provider does not support AVRO key type and AVRO value type. AVR
Import is supported using the following syntax:

```shell
terraform import axual_stream.<LOCAL NAME> <GROUP UID>
terraform import axual_stream.<LOCAL NAME> <STREAM UID>
terraform import axual_stream.test_stream b21cf1d63a55436391463cee3f56e393
```
2 changes: 1 addition & 1 deletion templates/resources/stream_config.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
Import is supported using the following syntax:

```shell
terraform import axual_stream_config.<LOCAL NAME> <GROUP UID>
terraform import axual_stream_config.<LOCAL NAME> <STREAM CONFIG UID>
terraform import axual_stream_config.test_stream_config b21cf1d63a55436391463cee3f56e393
```
2 changes: 1 addition & 1 deletion templates/resources/user.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
Import is supported using the following syntax:

```shell
terraform import axual_user.<LOCAL NAME> <GROUP UID>
terraform import axual_user.<LOCAL NAME> <USER UID>
terraform import axual_user.test_user b21cf1d63a55436391463cee3f56e393
```

0 comments on commit 5659a76

Please sign in to comment.