pulumiverse / pulumi-grafana Goto Github PK
View Code? Open in Web Editor NEWPulumi provider for Grafana
License: Apache License 2.0
Pulumi provider for Grafana
License: Apache License 2.0
Currently, the Grafana Providers grafana.RoleAssignment
controls all role assignments for a given role. The terraform provider nowadays also has a RoleAssignmentItem which can add the assignment to a single actor. This functionality should be lifted in, as exhaustively providing all teams/users for which a role is to be added is not always the simple approach.
This seems to have been introduced in 2.18.0 of the Terraform provider.
Creating a new provider returns an error
_, err = grafana_client.NewProvider(ctx, "grafana-provider", &grafana_client.ProviderArgs{
Auth: pulumi.String("something"),
Url: pulumi.String("https://web.url"),
})
error: could not validate provider configuration: 1 error occurred:
* Missing required argument: "auth": one of `auth,cloud_api_key,oncall_access_token,sm_access_token` must be specified
Maybe I am doing something wrong?
Any advice?
Thanks!
(I tried v0.0.7 and v0.0.8)
The current terraform provider powering the Pulumi provider generation is 2.4.0. This should be upgraded to the latest version (currently 2.13.0) to ensure feature parity.
One feature missing that I need is grafana_sso_configuration
.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
.devcontainer/Dockerfile
.github/workflows/command-dispatch.yml
actions/checkout v4
peter-evans/slash-command-dispatch v4
.github/workflows/main.yml
actions/checkout v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
actions/setup-node v4
actions/setup-dotnet v4
actions/setup-python v5
actions/download-artifact v4
actions/upload-artifact v4
actions/checkout v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
jaxxstorm/action-install-gh-release v1.12.0
actions/upload-artifact v4
actions/checkout v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
actions/setup-node v4
actions/setup-dotnet v4
actions/setup-python v5
actions/download-artifact v4
actions/download-artifact v4
.github/workflows/pr-automation.yml
pascalgn/automerge-action v0.16.3
.github/workflows/prerelease.yml
actions/checkout v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
actions/setup-node v4
actions/setup-dotnet v4
actions/setup-python v5
actions/download-artifact v4
actions/upload-artifact v4
actions/checkout v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
jaxxstorm/action-install-gh-release v1.12.0
actions/upload-artifact v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
goreleaser/goreleaser-action v5
actions/checkout v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
actions/setup-node v4
actions/setup-dotnet v4
actions/setup-python v5
actions/download-artifact v4
actions/download-artifact v4
actions/download-artifact v4
actions/checkout v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
actions/setup-node v4
actions/setup-dotnet v4
actions/setup-python v5
actions/download-artifact v4
actions/download-artifact v4
.github/workflows/pull-request.yml
actions/checkout v4
thollander/actions-comment-pull-request v2.5.0
.github/workflows/release.yml
actions/checkout v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
actions/setup-node v4
actions/setup-dotnet v4
actions/setup-python v5
actions/download-artifact v4
actions/upload-artifact v4
actions/checkout v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
jaxxstorm/action-install-gh-release v1.12.0
actions/upload-artifact v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
goreleaser/goreleaser-action v5
actions/checkout v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
actions/setup-node v4
actions/setup-dotnet v4
actions/setup-python v5
actions/download-artifact v4
actions/download-artifact v4
actions/download-artifact v4
actions/checkout v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
actions/setup-node v4
actions/setup-dotnet v4
actions/setup-python v5
actions/download-artifact v4
actions/download-artifact v4
.github/workflows/resync-build.yml
actions/checkout v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
actions/setup-dotnet v4
actions/setup-node v4
actions/setup-python v5
peter-evans/create-pull-request v6.0.5
.github/workflows/run-acceptance-tests.yml
actions/checkout v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
actions/setup-node v4
actions/setup-dotnet v4
actions/setup-python v5
actions/download-artifact v4
actions/upload-artifact v4
peter-evans/create-or-update-comment v4
actions/checkout v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
jaxxstorm/action-install-gh-release v1.12.0
actions/upload-artifact v4
actions/checkout v4
actions/checkout v4
actions/setup-go v5
jaxxstorm/action-install-gh-release v1.12.0
pulumi/actions v5
actions/setup-node v4
actions/setup-dotnet v4
actions/setup-python v5
actions/download-artifact v4
actions/download-artifact v4
.github/workflows/upgrade-bridge.yml
pulumi/pulumi-upgrade-provider-action v0.0.12
.github/workflows/upgrade-provider.yml
pulumi/pulumi-upgrade-provider-action v0.0.12
examples/go.mod
go 1.21
github.com/pulumi/pulumi/pkg/v3 v3.112.0
provider/go.mod
go 1.21
github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20240229143312-4f60ee4e2975@4f60ee4e2975
github.com/grafana/terraform-provider-grafana/v2 v2.14.3
github.com/pulumi/pulumi-terraform-bridge/pf v0.33.0
github.com/pulumi/pulumi-terraform-bridge/v3 v3.80.0
github.com/pulumi/pulumi/sdk/v3 v3.112.0
sdk/go.mod
go 1.21
github.com/blang/semver v3.5.1+incompatible
github.com/pulumi/pulumi/sdk/v3 v3.112.0
examples/typescript/service_account/package.json
@pulumi/pulumi ^3.0.0
@pulumi/random ^4.8.2
@types/node ^14
examples/python/explicit_provider/requirements.txt
pulumi >=3.0.0,<4.0.0
pulumi-random >=4.0.0,<5.0.0
examples/python/service_account/requirements.txt
pulumi >=3.0.0,<4.0.0
Hi, thanks for this great provider!
I'd like to disable provenance by setting the x-disable-provenance
http header (grafana/terraform-provider-grafana#845), however it appears you removed the http_headers setting from the provider settings due to some python binding issues #27 .
Is there a chance we could add the http_headers back? Or maybe simply expose a disableProvenance
setting that under the hood sets these headers.
Thoughts?
I was able to get the Grafana Provider to work when I set GRAFANA_AUTH and GRAFANA_URL as env vars on my linux machine. I can also get it to work when I have both values in my code:
new grafana.Provider("provider",
{
auth: "test",
url: "test",
});
The issue occurs when I split it up. So I have GRAFANA_AUTH an an env var and then the url in my code.
We are looking to adopt the plugin but when using the python flavor we are getting an error:
import lbrlabs_pulumi_grafana as grafana
/usr/local/lib/python3.9/site-packages/lbrlabs_pulumi_grafana/__init__.py:56: in <module>
from .provider import *
E File "/usr/local/lib/python3.9/site-packages/lbrlabs_pulumi_grafana/provider.py", line 455
E __props__.__dict__["http_headers"] = None if pulumi.Output.from_input(http_headers).apply(pulumi.runtime.to_json) if http_headers is not None else None is None else pulumi.Output.secret(pulumi.Output.from_input(http_headers).apply(pulumi.runtime.to_json) if http_headers is not None else None)
E ^
E SyntaxError: invalid syntax
Looking at the code on that line it doesn't appear to be valid syntax. If we correct it in our local filesystem we are able to get around it and everything works great!
I was taking a look to see if I could resolve the issue. I removed all the references of http_headers
or httpHeaders
in schema.json
and resources.go
but everything appears to just continue to be overwritten.
When we create a new release, we need to add a sdk/{{tag}}
tag for the Go SDK.
We need this to be automated so our intrepid maintainer doesn't forget
Hi,
It appears the archives uploaded to the repository release page reference scaleway
an not grafana
.
Thanks
When specifying an org_id
as an attribute for a RuleGroup
resource, it is ignored and the rule group is always created in the org with id 1
. Example (leaving the rule definitions empty for brevity):
import lbrlabs_pulumi_grafana as grafana
from pulumi import ResourceOptions
provider = grafana.Provider(
"provider",
auth="user:pwd",
url="https://my.grafana.net",
)
opts = ResourceOptions(provider=provider)
org_id = "3"
folder = grafana.Folder(
"example",
grafana.FolderArgs(title="example", org_id=org_id),
opts=opts,
)
grafana.RuleGroup(
"example",
grafana.RuleGroupArgs(
folder_uid=folder.uid,
interval_seconds=60,
rules=[],
name="example rules",
org_id=org_id,
),
opts=opts,
)
When I run this, the folder will get created in the correct org (id=3), but no rule groups show up even though pulumi thinks it has created them. If I look at the outputs for the RuleGroup resource, I see the "orgId": "1"
, and when I re-run the pulumi up command, the diff shows:
+-grafana:index/ruleGroup:RuleGroup: (replace)
[id=ea7ab555-d6f9-4fcb-8482-d9842b47f9a1;example]
[urn=urn:pulumi:cody-test::monitoring::monitoring:grafana:GrafanaHDX$grafana:index/ruleGroup:RuleGroup::example]
[provider=urn:pulumi:cody-test::monitoring::monitoring:grafana:GrafanaHDX$pulumi:providers:grafana::cody-grafana-provider::a062207a-261a-4b8c-8ffb-3c0922b4c0d0]
~ orgId : "1" => "3"
I have to hardcode the folder_uid
to an id of a folder I created manually in orgId 1, but then I can see that alerts do actually get created there.
If I change the provider to use the org_id
attribute as such:
provider = grafana.Provider(
"provider",
auth="user:pwd",
url="https://my.grafana.net",
org_id=3,
)
And then don't pass org_id
in the RuleGroup args, things work as expected and the alerts get created in the correct org. However I get these deprecation warnings:
warning: org_id is deprecated: Use the `org_id` attributes on resources instead.
warning: org_id is deprecated: Use the `org_id` attributes on resources instead.
warning: provider config warning: Use the `org_id` attributes on resources instead.
warning: provider config warning: Use the `org_id` attributes on resources instead.
Expected Behavior:
I should be able to set org_id
as a kwarg when creating a RuleGroup
(like the deprecation warning suggests) and have the rules get created in the correct org
The provider (and this goes for Terraform as well) currently lacks a way to fetch all teams. It requires specifying a single team to fetch. I would like to see the ability to fetch all teams (with a getTeams
function, much like getUsers
). The endpoint api/teams/search
can be used (with pagination) to accomplish this.
Hi, pulumi-grafana authors!
I'm trying to automatically configure some grafana alerts for my infra, but following the official doc I could only find a RuleGroup
resource, which is not exactly the same thing as a singular alert.
I'm wondering if I'm missing something or if there's a reason it's not implemented.
Thanks for any help!
Hi, it possible to play with it?
When I try pulumi plugin install resource grafana v0.0.3
is error: [resource plugin grafana-0.0.3] downloading from : failed to download plugin: grafana-0.0.3: 403 HTTP error fetching plugin from https://get.pulumi.com/releases/plugins/pulumi-resource-grafana-v0.0.3-linux-amd64.tar.gz
How to deal with it?
Thanks
In the documentation, most of the resources can take a OrgId as input documented like that:
The Organization ID. If not set, the Org ID defined in the provider block will be used.
But OrgId is mandatory for RuleGroup and enforced here:
https://github.com/lbrlabs/pulumi-grafana/blob/5561b3334f91460d165fb2ac938857086a0f443a/sdk/go/grafana/ruleGroup.go#L180
But on the terraform side, it is optional:
https://github.com/grafana/terraform-provider-grafana/blob/f2a3013f6cd24acfcc27fe95b020190c316bf95a/internal/resources/grafana/oss_org_id.go#L18
Since the SDK code is generated, I do not understand where the code ensuring that it is not nil comes from. Therefore, I cannot provide a pr for a fix.
I understand now: Terraform made the change not long ago:
grafana/terraform-provider-grafana@f3b1845
Is the update of the terraform provider is automated and can be triggered or a pull request must be opened ?
I started seeing this error suddenly:
Unable to Update Slo with ID: me9j8x38oo8fww5d6o9p5: API Error Message:status: 400, body: {"code":400,"error":"SLO failed validation: invalid input - DestinationDatasource field cannot be nil. please refer to the docs here: https://grafana.com/docs/grafana-cloud/alerting-and-irm/slo/set-up/terraform/#provision-slo-resources and try using a DestinationDatasourceUID of: grafanacloud-prom"}
when trying to create SLOs, this is a new error that didn't happened before. Probably something changed in grafana API
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.