Skip to content

Commit

Permalink
Improve pulumi documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
wparad committed May 31, 2023
1 parent 5b931b3 commit 5ad27ec
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 20 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
sdk
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"cSpell.words": [
"choosable",
"Pulumi",
"tfbridge",
"tfgen"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions contributing/README-Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
26 changes: 25 additions & 1 deletion docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 %}}

Expand Down
19 changes: 14 additions & 5 deletions docs/installation-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<option>`.

| Option | Required/Optional | Description |
| Option | Required | Description |
|-----------|-------------------|-------------------------------------------------------------------|
| `customDomain` | Required | Authress Custom Domain. [Configured a custom domain for Account](https://authress.io/app/#/settings?focus=domain) |
| `accessKey` | Required | Authress API access key, automatically injected in via your [CI/CD Provider](https://authress.io/knowledge-base/docs/category/cicd).|
| `customDomain` | Required | Authress Custom Domain. [Configure a custom domain for your Authress account](https://authress.io/app/#/settings?focus=domain) |
| `accessKey` | Required (Automatically Injected) | Authress API access key, automatically injected in via your [CI/CD Provider](https://authress.io/knowledge-base/docs/category/cicd).|

When using on your local machine, set the accessKey using `pulumi config set --secret authress:accessKey ACCESS_KEY`. `--secret` is required to keep these credentials a secret. To get an access key Create an [Authress Service Client](https://authress.io/app/#/settings?focus=clients).
4 changes: 2 additions & 2 deletions examples/typescript-example/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import * as Authress from "@pulumi/authress";
// pulumi config set --secret authress:accessKey $AUTHRESS_KEY
//
// const authress = new Authress.Provider("authress", {
// // Your Authress custom domain. [Configured a custom domain for Account](https://authress.io/app/#/settings?focus=domain)
// // 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).
// customDomain: '',

// // 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.
// // 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.
// accessKey: process.env.AUTHRESS_KEY || ''
// });
Expand Down
5 changes: 4 additions & 1 deletion provider/cmd/pulumi-resource-authress/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"authress",
"category/cloud",
"authorization",
"authentication"
"authentication",
"access control",
"policies",
"api"
],
"homepage": "https://authress.io",
"license": "Apache-2.0",
Expand Down
7 changes: 6 additions & 1 deletion provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func Provider() pf.ProviderInfo {
PluginDownloadURL: "github://api.github.com/Authress/pulumi-authress",
Description: "A Pulumi package for creating and managing Authress resources.",
// https://www.pulumi.com/docs/guides/pulumi-packages/schema/#package.
Keywords: []string{"pulumi", "authress", "category/cloud", "authorization", "authentication"},
Keywords: []string{"pulumi", "authress", "category/cloud", "authorization", "authentication", "access control", "policies", "api"},
License: "Apache-2.0",
Homepage: "https://authress.io",
Repository: "https://github.com/Authress/pulumi-authress",
Expand All @@ -57,6 +57,11 @@ func Provider() pf.ProviderInfo {
// "accessKey": {
// Default: &tfbridge.DefaultInfo{EnvVars: []string{"AUTHRESS_KEY"}},
// },

// There is something likely broken with the PF bridge so this kep needs to be added here
"pluginDownloadURL": {
Default: &tfbridge.DefaultInfo{},
},
},

MetadataInfo: tfbridge.NewProviderMetadata(metadata),
Expand Down

0 comments on commit 5ad27ec

Please sign in to comment.