-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff167ab
commit a02952f
Showing
122 changed files
with
20,184 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
title: CrateDB | ||
meta_desc: Provides an overview of the CrateDB Provider for Pulumi. | ||
layout: package | ||
--- | ||
|
||
The CrateDB provider for Pulumi can be used to provision the resources available in [CrateDB](https://www.cratedb.com/). | ||
|
||
The CrateDB provider must be configured with credentials to deploy and update resources in CrateDB; see [Installation & Configuration](./installation-configuration) for instructions. | ||
|
||
## Example | ||
|
||
{{< chooser language "typescript,python,go" >}} | ||
{{% choosable language typescript %}} | ||
|
||
```typescript | ||
import * as pulumi from "@pulumi/pulumi"; | ||
import * as cratedb from "@komminarlabs/cratedb"; | ||
|
||
// Create a new Bucket | ||
export const database = new cratedb.Database("signals", { | ||
name: "signals", | ||
retentionPeriod: 604800, | ||
}); | ||
|
||
// Get the id of the new bucket as an output | ||
export const databaseId = database.id; | ||
``` | ||
|
||
{{% /choosable %}} | ||
{{% choosable language python %}} | ||
|
||
```python | ||
import komminarlabs_cratedb as cratedb | ||
|
||
database = cratedb.Database( | ||
"signals", | ||
name="signals", | ||
retention_period=604800, | ||
) | ||
``` | ||
|
||
{{% /choosable %}} | ||
{{% choosable language go %}} | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
"github.com/komminarlabs/pulumi-cratedb/sdk/go/cratedb" | ||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi" | ||
) | ||
|
||
func main() { | ||
pulumi.Run(func(ctx *pulumi.Context) error { | ||
signals, err := cratedb.NewDatabase(ctx, "signals", &cratedb.DatabaseArgs{ | ||
Name: pulumi.String("signals"), | ||
RetentionPeriod: pulumi.Int(604800), | ||
}) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
ctx.Export("databaseId", signals.ID()) | ||
return nil | ||
}) | ||
} | ||
``` | ||
|
||
{{% /choosable %}} | ||
|
||
{{< /chooser >}} |
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,33 @@ | ||
--- | ||
title: CrateDB Installation & Configuration | ||
meta_desc: Information on how to install the CrateDB provider. | ||
layout: package | ||
--- | ||
|
||
## Installation | ||
|
||
The Pulumi CrateDB provider is available as a package in all Pulumi languages: | ||
|
||
* JavaScript/TypeScript: [`@komminarlabs/cratedb`](https://www.npmjs.com/package/@komminarlabs/cratedb) | ||
* Python: [`komminarlabs_cratedb`](https://pypi.org/project/komminarlabs_cratedb/) | ||
* Go: [`github.com/komminarlabs/pulumi-cratedb/sdk/go/cratedb`](https://pkg.go.dev/github.com/komminarlabs/pulumi-cratedb/sdk/go/cratedb) | ||
* .NET: [`KomminarLabs.CrateDB`](https://www.nuget.org/packages/KomminarLabs.CrateDB) | ||
|
||
|
||
## Configuration | ||
|
||
The following configuration points are available for the `cratedb` provider: | ||
|
||
- `cratedb:api_key` (environment: `CRATEDB_API_KEY`) - The API key | ||
- `cratedb:api_secret` (environment: `CRATEDB_API_SECRET`) - The API secret | ||
- `cratedb:url` (environment: `CRATEDB_URL`) - The CrateDB Cloud URL | ||
|
||
### Provider Binary | ||
|
||
The CrateDB provider binary is a third party binary. It can be installed using the `pulumi plugin` command. | ||
|
||
```bash | ||
pulumi plugin install resource cratedb <version> --server github://api.github.com/komminarlabs | ||
``` | ||
|
||
Replace the version string `<version>` with your desired version. |
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 @@ | ||
schema.go |
Empty file.
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,45 @@ | ||
{ | ||
"auto-aliasing": { | ||
"resources": { | ||
"cratedb_cluster": { | ||
"current": "cratedb:index/cluster:Cluster", | ||
"fields": { | ||
"ip_whitelist": { | ||
"maxItemsOne": false | ||
} | ||
} | ||
}, | ||
"cratedb_organization": { | ||
"current": "cratedb:index/organization:Organization" | ||
}, | ||
"cratedb_project": { | ||
"current": "cratedb:index/project:Project" | ||
} | ||
}, | ||
"datasources": { | ||
"cratedb_cluster": { | ||
"current": "cratedb:index/getCluster:getCluster", | ||
"fields": { | ||
"ip_whitelist": { | ||
"maxItemsOne": false | ||
} | ||
} | ||
}, | ||
"cratedb_organization": { | ||
"current": "cratedb:index/getOrganization:getOrganization" | ||
}, | ||
"cratedb_organizations": { | ||
"current": "cratedb:index/getOrganizations:getOrganizations", | ||
"fields": { | ||
"organizations": { | ||
"maxItemsOne": false | ||
} | ||
} | ||
}, | ||
"cratedb_project": { | ||
"current": "cratedb:index/getProject:getProject" | ||
} | ||
} | ||
}, | ||
"auto-settings": {} | ||
} |
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,49 @@ | ||
//go:build ignore | ||
|
||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"errors" | ||
"io/fs" | ||
"io/ioutil" | ||
"log" | ||
"os" | ||
|
||
"github.com/pulumi/pulumi/pkg/v3/codegen/schema" | ||
) | ||
|
||
func main() { | ||
version, found := os.LookupEnv("VERSION") | ||
if !found { | ||
log.Fatal("version not found") | ||
} | ||
|
||
schemaContents, err := ioutil.ReadFile("./schema.json") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
var packageSpec schema.PackageSpec | ||
err = json.Unmarshal(schemaContents, &packageSpec) | ||
if err != nil { | ||
log.Fatalf("cannot deserialize schema: %v", err) | ||
} | ||
|
||
packageSpec.Version = version | ||
versionedContents, err := json.Marshal(packageSpec) | ||
if err != nil { | ||
log.Fatalf("cannot reserialize schema: %v", err) | ||
} | ||
|
||
// Clean up schema.go as it may be present & gitignored and tolerate an error if the file isn't present. | ||
err = os.Remove("./schema.go") | ||
if err != nil && !errors.Is(err, fs.ErrNotExist) { | ||
log.Fatal(err) | ||
} | ||
|
||
err = ioutil.WriteFile("./schema-embed.json", versionedContents, 0600) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
} |
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,24 @@ | ||
//go:generate go run ./generate.go | ||
|
||
package main | ||
|
||
import ( | ||
"context" | ||
|
||
_ "embed" | ||
|
||
"github.com/pulumi/pulumi-terraform-bridge/pf/tfbridge" | ||
|
||
cratedb "github.com/komminarlabs/pulumi-cratedb/provider" | ||
) | ||
|
||
//go:embed schema-embed.json | ||
var pulumiSchema []byte | ||
|
||
//go:embed bridge-metadata.json | ||
var bridgeMetadata []byte | ||
|
||
func main() { | ||
meta := tfbridge.ProviderMetadata{PackageSchema: pulumiSchema, BridgeMetadata: bridgeMetadata} | ||
tfbridge.Main(context.Background(), "cratedb", cratedb.Provider(), meta) | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.