From 5ad27ec73d6ce80ddb83774eec3d280de84ce705 Mon Sep 17 00:00:00 2001 From: Warren Parad Date: Wed, 31 May 2023 14:27:54 +0200 Subject: [PATCH] Improve pulumi documentation. --- .gitignore | 6 +---- .vscode/settings.json | 1 + README.md | 4 +-- contributing/README-Contributing.md | 3 --- docs/_index.md | 26 ++++++++++++++++++- docs/installation-configuration.md | 19 ++++++++++---- examples/typescript-example/index.ts | 4 +-- .../cmd/pulumi-resource-authress/schema.json | 5 +++- provider/resources.go | 7 ++++- 9 files changed, 55 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 53a58d7..e3f5225 100644 --- a/.gitignore +++ b/.gitignore @@ -25,8 +25,4 @@ ci-scripts **/schema.go **/schema-embed.json -sdk/java/build -sdk/java/.gradle -sdk/java/gradle -sdk/java/gradlew -sdk/java/gradlew.bat \ No newline at end of file +sdk diff --git a/.vscode/settings.json b/.vscode/settings.json index f91a34f..ad38b30 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "cSpell.words": [ + "choosable", "Pulumi", "tfbridge", "tfgen" diff --git a/README.md b/README.md index e5d554f..23ae7e0 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,8 @@ dotnet add package Pulumi.Authress The following configuration points are available for the `Authress` provider: -- `autherss:accessKey` - The access key for the Authress API. Should be [configured by your CI/CD](https://authress.io/knowledge-base/docs/category/cicd) for more information. Or it can be overridden directly here. Do not commit this plaintext value to your source code. -- `authress:customDomain` - Your Authress custom domain. [Configured a custom domain for Account](https://authress.io/app/#/settings?focus=domain) or use [provided domain](https://authress.io/app/#/api?route=overview). +- `authress:accessKey` - The access key for the Authress API. Should be [configured by your CI/CD](https://authress.io/knowledge-base/docs/category/cicd) automatically. Or it can be overridden directly here. Do not commit this plaintext value to your source code. +- `authress:customDomain` - Your Authress custom domain. [Configure a custom domain for your Authress account](https://authress.io/app/#/settings?focus=domain) or use [provided domain](https://authress.io/app/#/api?route=overview). ## Reference Examples diff --git a/contributing/README-Contributing.md b/contributing/README-Contributing.md index a954f8c..e653ebb 100644 --- a/contributing/README-Contributing.md +++ b/contributing/README-Contributing.md @@ -23,9 +23,6 @@ cd provider go mod tidy ``` -### Regenerate TF conversion -Blocked on https://github.com/pulumi/pulumi-terraform-bridge/issues/956 - ```sh export VERSION=v1.1.31 export PATH="/home/$USER/git/authress/sdk/pulumi:/home/$USER/git/authress/sdk/pulumi/bin:/home/$USER/git/authress/sdk/pulumi/provider/cmd:$PATH" diff --git a/docs/_index.md b/docs/_index.md index 6eb0f3d..871030d 100644 --- a/docs/_index.md +++ b/docs/_index.md @@ -9,7 +9,8 @@ The Authress provider must be configured with credentials to deploy and update r ## Example -{{< chooser language "typescript,python,go,csharp" >}} +{{< chooser language "typescript,javascript,python,go,csharp" >}} + {{% choosable language typescript %}} ```typescript @@ -31,6 +32,29 @@ const authressRole = new Authress.Role("TestRole", { export let authressTestRoleId = authressRole.roleId; ``` +{{% /choosable %}} + +{{% choosable language javascript %}} + +```javascript +const pulumi = require("@pulumi/pulumi"); +const Authress = require("@pulumi/authress"); + + +const authressRole = new Authress.Role("TestRole", { + roleId: 'test-role', + name: "Test Role", + description: "An example description for this Role", + permissions: { + "documents:read": { + allow: true + } + } +}); + +module.exports.authressTestRoleId = authressRole.roleId; +``` + {{% /choosable %}} {{% choosable language python %}} diff --git a/docs/installation-configuration.md b/docs/installation-configuration.md index 0bf815d..492d730 100644 --- a/docs/installation-configuration.md +++ b/docs/installation-configuration.md @@ -13,15 +13,24 @@ The Pulumi Authress provider is available as a package in all Pulumi languages: * Go: [`github.com/authress/pulumi-authress/sdk/go/authress`](https://pkg.go.dev/github.com/authress/pulumi-authress/sdk) * .NET: [`Pulumi.Authress`](https://www.nuget.org/packages/Pulumi.Authress) -## Setup +## Configuration Options To provision resources with the Pulumi Authress provider, you need to provide the `customDomain` and `accessKey`. -## Configuration Options +Pulumi relies on the Authress SDK to authenticate requests from your computer to Authress. Your credentials are never sent to pulumi.com. The Pulumi Authress Provider needs to be configured with Authress credentials before it can be used to create resources. Once the credentials are obtained, there are two ways to communicate your authorization tokens to Pulumi: + +1. CI / CD. Automatically inject in the credentials from your CI/CD platform such as GitHub or GitLab. + +See [setting up GitHub/GitLab CI/CD credentials for Pulumi](https://authress.io/knowledge-base/docs/category/cicd). + +2. Directly specify the credentials using the `pulumi config set` + Use `pulumi config set authress: