Coder Social home page Coder Social logo

pulumi / pulumi-aiven Goto Github PK

View Code? Open in Web Editor NEW
12.0 23.0 2.0 20.75 MB

An Aiven Pulumi resource package, providing multi-language access to Aiven

License: Apache License 2.0

Makefile 32.79% Go 47.06% Shell 19.07% Dockerfile 1.08%
pulumi python typescript javascript golang go dotnet csharp aiven

pulumi-aiven's Introduction

Actions Status Slack NPM version Python version NuGet version PkgGoDev License

Aiven Resource Provider

The Aiven resource provider for Pulumi lets you manage Aiven resources in your cloud programs. To use this package, please install the Pulumi CLI first.

Installing

This package is available in many languages in the standard packaging formats.

Node.js (Java/TypeScript)

To use from JavaScript or TypeScript in Node.js, install using either npm:

$ npm install @pulumi/aiven

or yarn:

$ yarn add @pulumi/aiven

Python

To use from Python, install using pip:

$ pip install pulumi_aiven

Go

To use from Go, use go get to grab the latest version of the library

$ go get github.com/pulumi/pulumi-aiven/sdk/v5

.NET

To use from .NET, install using dotnet add package:

$ dotnet add package Pulumi.Aiven

Configuration

The following configuration points are available:

  • aiven:apiToken - (Optional) This is the API token to interact with your Aiven account. May be set via the AIVEN_TOKEN environment variable.

Reference

For further information, please visit the Aiven provider docs or for detailed reference documentation, please visit the API docs.

pulumi-aiven's People

Contributors

aaronfriel avatar aq17 avatar cnunciato avatar dependabot[bot] avatar ellismg avatar guineveresaenger avatar iwahbe avatar jaxxstorm avatar jen20 avatar jkodroff avatar mikhailshilkov avatar pulumi-bot avatar roachmd avatar stack72 avatar t0yv0 avatar thomas11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

pulumi-aiven's Issues

`Unsupported pg user config key pg_stat_statements.track` for Postgres Service

When updating the maintenance time for the aiven.Service resource with serviceType: 'pg', the error Unsupported pg user config key pg_stat_statements.track happens.

Expected behavior

It should update the maintenance time of the Aiven service.

Current behavior

Diagnostics:
  pulumi:pulumi:Stack (aiven-might-have-a-bug-dev):
    panic: Unsupported pg user config key pg_stat_statements.track
    goroutine 81 [running]:

Steps to reproduce

  1. Create a new Pulumi TypeScript project. Here's my package.json.
{
    "name": "aiven-might-have-a-bug",
    "devDependencies": {
        "@types/node": "^10.0.0"
    },
    "dependencies": {
        "@pulumi/aiven": "^3.5.1",
        "@pulumi/pulumi": "^2.0.0"
    }
}
  1. Create a new Service of type pg.
const pgUserConfig: aiven.types.input.ServicePgUserConfig = {
  adminUsername: 'master',
  adminPassword: '<somepassword>',
  pgVersion: '12',
  backupHour: '2',
  backupMinute: '0',
};

new aiven.Service(
  'postgres',
  {
    project: '<project-name>',
    cloudName: 'google-us-east4',
    plan: 'business-4',
    serviceName: `foo-postgres`,
    serviceType: 'pg',
    pgUserConfig,
    maintenanceWindowDow: 'sunday',
    maintenanceWindowTime: '14:00:00',
  },
);
  1. Update the maintenanceWindowTime.
-    maintenanceWindowTime: '14:00:00',
+    maintenanceWindowTime: '15:00:00',
  1. Panic! panic: Unsupported pg user config key pg_stat_statements.track

Note that these are the steps I was able to reproduce this with. It's likely there are other ways to reproduce this as well.

Context (Environment)

We're trying to update the maintenance time so our users are less affected by Aiven's maintenance upgrades! (Which don't always go so smoothly..)

Note that we use Pulumi with Node.js and TypeScript

Affected feature

PostgreSQL

AIVEN_API_TOKEN environment variable not recognised under Python

Expected behavior

The documentation says that we can configure the Aiven token by setting up the environment variable AIVEN_API_TOKEN. This is not working for Python projects. I haven't tried other languages.

Current behavior

Pulumi complains:

    error: 1 error occurred:
        * missing required configuration key "aiven:apiToken": Aiven Authentication Token
    Set a value using the command `pulumi config set aiven:apiToken <value>`.

Steps to reproduce

Set up AIVEN_API_TOKEN environment variable and try to create any Aiven resource. For example:

aiven.Account("dev",
              name="Dev",
              tenant_id="timescale")

Context (Environment)

A potential caveat here is that I'm running the Aiven provider against Timescale Cloud, which uses Aiven underneath. Having said that, this workaround works:

provider = aiven.Provider("dev",
                          api_token=os.environ['AIVEN_API_TOKEN'])

aiven.Account("dev",
              name="Dev",
              tenant_id="timescale",
              opts=pulumi.ResourceOptions(provider=provider))

This proves that the environment variable is set up correctly, but being ignored by pulumi-aiven.

Unable to use function GetAccountTeam, error in "account_id"

When using the function GetAccountTeam, I get the following error:

    TypeError: get_account_team() got multiple values for argument 'account_id'

Steps to reproduce

# Create an account
account = aiven.Account("test",
                        name="test",
                        tenant_id="timescale")

# Create a team, this finishes successfully
aiven.AccountTeam("developers",
                  account_id=account.account_id,
                  name="Developers")

# Get a team, this fails
aiven.get_account_team("owners",
                       account_id=account.account_id,
                       name="Account Owners")

I also tried to use a string with the correct value and I get the same error.

kafkaUserConfig.kafka.logCleanerMinCleanableRatio being cast to 0

First of all, thank you guys for your awesome work on this project! We're super grateful for the Pulumi team ๐Ÿ˜ƒ


When upgrading from @pulumi/aiven 3.5.1 to 3.6.1, the value kafkaUserConfig.kafka.logCleanerMinCleanableRatio has a new default value โ€”ย 0. Which is an invalid value.

The field means "if 50% of the log has already been compacted, don't allow the log cleaner to compact any more". So, "if none of the log has already been compacted, don't allow the log cleaner to compact any more" -> "so never compact" (when compaction is selected as the cleanup policy).

Furthermore, the Aiven API rejects the value of 0. You get this error message

{
  "errors": [
    {
      "message": "Invalid user_config: Invalid input for kafka: 0 is less than the minimum of 0.2",
      "status": 400
    }
  ],
  "message": "Invalid user_config: Invalid input for kafka: 0 is less than the minimum of 0.2"
}

Expected behavior

The default value should be 0.5, like in Kafka itself. I'd argue 0 is an invalid value, but I could be wrong there.

Current behavior

Match Kafka's default value of 0.5.

Steps to reproduce

  1. Create an aiven.Service of serviceType: 'kafka', with @pulumi/aiven: 3.5.1. Don't specify kafkaUserConfig.kafka.logCleanerMinCleanableRatio.
  2. Upgrade to @pulumi/aiven: 3.6.1

Note that you can then see the code work if you do specify the value, at 0.5.

Context (Environment)

I want to upgrade to the newest version :)

Affected feature

aiven.Service of serviceType: 'kafka'. This is also not a huge deal, because there's a workaround. (specify the value of 0.5 for kafkaUserConfig.kafka.logCleanerMinCleanableRatio).

`stdout: EOF` panic from bridge update

It looks like the bridge update in 3.4.0 has caused a panic when using this provider.

Current behavior

The code below will panic for any @pulumi/aiven version 3.4.0 and greater.

Panic

% pulumi pre                           
Previewing update (dev)

View Live: https://app.pulumi.com/clstokes/aiven-stdout-eof/dev/previews/97cf9572-fce7-4964-8a0d-075b5ebe6370

     Type                       Name                  Plan       Info
 +   pulumi:pulumi:Stack        aiven-stdout-eof-dev  create     8 messages     โ””โ”€ pulumi:providers:aiven  main                             1 error
 
Diagnostics:
  pulumi:pulumi:Stack (aiven-stdout-eof-dev):
    panic: strconv.ParseUint: parsing "": invalid syntax
    goroutine 1 [running]:
    github.com/pulumi/pulumi-terraform-bridge/v2/pkg/tfbridge.GetModuleMajorVersion(0x0, 0x0, 0xc00055daf0, 0x1)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/[email protected]/pkg/tfbridge/info.go:730 +0x1d9
    github.com/pulumi/pulumi-aiven/provider/v3.Provider(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/runner/work/pulumi-aiven/pulumi-aiven/provider/resources.go:256 +0x45ea
    main.main()
        /home/runner/work/pulumi-aiven/pulumi-aiven/provider/cmd/pulumi-resource-aiven/main.go:27 +0x37
 
  pulumi:providers:aiven (main):
    error: could not read plugin [/Users/clstokes/.pulumi/plugins/resource-aiven-v3.4.3/pulumi-resource-aiven] stdout: EOF

Code to reproduce

import * as aiven from "@pulumi/aiven";

const aProvider = new aiven.Provider("main",{
    apiToken: "asdf",
});

Steps to reproduce

  1. pulumi new typescript -y
  2. overwrite the index.ts with the code above
  3. npm i @pulumi/aiven
  4. pulumi pre
    • observe preview fails
  5. npm i @pulumi/[email protected]
  6. pulumi pre
    • observe preview completes successfully

Context (Environment)

% pulumi version
v2.20.0

Import types

I want to import existing Aiven resources with pulumi import but I can't figure out how to do it.
The Terraform provider support importing, so I'd assume Pulumi can support it as well.

I asked in the Pulumi Community Slack and user jaxxstorm told me it was possible but the "docs might not have generated the import types".

Can this be fixed?

Prepare for Releases

Tracking items for release:

  • Depend on the most recent release of the upstream Terraform provider and have mapped all data sources and resources which make sense.
  • Have the various configuration options for the provider listed in the README file such that package consumers can easily find them.
  • Have documentation ready to publish (in the pulumi/docs repo)
  • Have at least one example running in CI against the provider
  • Tag a version and ensure it's published as latest

error: could not read plugin [/.pulumi/plugins/resource-aiven-v1.1.0/pulumi-resource-aiven] stdout: EOF

Pulumi preview fails to deploy pulumi resouces because of error in title

Here is my pulumi aiven file:

import * as pulumi from '@pulumi/pulumi';
import * as aiven from '@pulumi/aiven';
import * as random from '@pulumi/random';
interface Postgres {
  plan: string;
  cloudName: string;
}
const config = new pulumi.Config('aiven');
const postgresConfig = config.requireObject<Postgres>('postgres');
export const service = new aiven.Service('postgres', {
  project: 'ware2go',
  cloudName: postgresConfig.cloudName,
  plan: postgresConfig.plan,
  serviceName: `${pulumi.getStack()}-postgres`,
  serviceType: 'postgres',
  pgUserConfig: {
    adminUsername: 'master',
    adminPassword: new random.RandomPassword('postgresAdminPassword', {
      length: 20,
      special: true,
      overrideSpecial: '/@',
    }).result,
  },
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.