From c847453556272462fc91c33c7e592804d86579c0 Mon Sep 17 00:00:00 2001 From: Ringo De Smet Date: Mon, 5 Aug 2024 05:26:43 +0000 Subject: [PATCH] make build_sdks --- sdk/dotnet/ServiceAccountToken.cs | 47 ++++++----- sdk/go/grafana/getUser.go | 4 +- sdk/go/grafana/oss/getUser.go | 4 +- sdk/go/grafana/serviceAccountToken.go | 66 +++++++-------- sdk/nodejs/serviceAccountToken.ts | 38 +++------ sdk/python/pulumiverse_grafana/_utilities.py | 44 +++++++++- .../pulumiverse_grafana/oncall/escalation.py | 4 +- .../oncall/escalation_chain.py | 4 +- .../oncall/outgoing_webhook.py | 4 +- .../pulumiverse_grafana/oncall_escalation.py | 4 +- .../oncall_escalation_chain.py | 4 +- .../oncall_outgoing_webhook.py | 4 +- .../service_account_token.py | 82 +++++++------------ .../synthetic_monitoring_installation.py | 16 ++-- .../syntheticmonitoring/installation.py | 16 ++-- 15 files changed, 165 insertions(+), 176 deletions(-) diff --git a/sdk/dotnet/ServiceAccountToken.cs b/sdk/dotnet/ServiceAccountToken.cs index aaa0c2dc..a8cc51e6 100644 --- a/sdk/dotnet/ServiceAccountToken.cs +++ b/sdk/dotnet/ServiceAccountToken.cs @@ -26,23 +26,28 @@ namespace Pulumiverse.Grafana /// /// return await Deployment.RunAsync(() => /// { - /// var admin = new Grafana.Oss.ServiceAccount("admin", new() + /// var test = new Grafana.Oss.ServiceAccount("test", new() /// { - /// IsDisabled = false, - /// Role = "Admin", + /// Role = "Viewer", /// }); /// - /// }); - /// ``` - /// - /// ## Import + /// var foo = new Grafana.Oss.ServiceAccountToken("foo", new() + /// { + /// ServiceAccountId = test.Id, + /// }); /// - /// ```sh - /// $ pulumi import grafana:index/serviceAccountToken:ServiceAccountToken name "{{ id }}" - /// ``` + /// var bar = new Grafana.Oss.ServiceAccountToken("bar", new() + /// { + /// ServiceAccountId = test.Id, + /// SecondsToLive = 30, + /// }); /// - /// ```sh - /// $ pulumi import grafana:index/serviceAccountToken:ServiceAccountToken name "{{ orgID }}:{{ id }}" + /// return new Dictionary<string, object?> + /// { + /// ["serviceAccountTokenFooKeyOnly"] = foo.Key, + /// ["serviceAccountTokenBar"] = bar, + /// }; + /// }); /// ``` /// [Obsolete(@"grafana.index/serviceaccounttoken.ServiceAccountToken has been deprecated in favor of grafana.oss/serviceaccounttoken.ServiceAccountToken")] @@ -68,15 +73,13 @@ public partial class ServiceAccountToken : global::Pulumi.CustomResource public Output Key { get; private set; } = null!; /// - /// The name of the service account. + /// The name of the service account token. /// [Output("name")] public Output Name { get; private set; } = null!; /// - /// The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - /// is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will - /// never expire. + /// The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will never expire. /// [Output("secondsToLive")] public Output SecondsToLive { get; private set; } = null!; @@ -143,15 +146,13 @@ public static ServiceAccountToken Get(string name, Input id, ServiceAcco public sealed class ServiceAccountTokenArgs : global::Pulumi.ResourceArgs { /// - /// The name of the service account. + /// The name of the service account token. /// [Input("name")] public Input? Name { get; set; } /// - /// The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - /// is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will - /// never expire. + /// The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will never expire. /// [Input("secondsToLive")] public Input? SecondsToLive { get; set; } @@ -199,15 +200,13 @@ public Input? Key } /// - /// The name of the service account. + /// The name of the service account token. /// [Input("name")] public Input? Name { get; set; } /// - /// The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - /// is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will - /// never expire. + /// The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will never expire. /// [Input("secondsToLive")] public Input? SecondsToLive { get; set; } diff --git a/sdk/go/grafana/getUser.go b/sdk/go/grafana/getUser.go index 033fd73b..d7bdffa8 100644 --- a/sdk/go/grafana/getUser.go +++ b/sdk/go/grafana/getUser.go @@ -47,9 +47,9 @@ import ( // Email: test.Email, // }, nil) // _ = test.Login.ApplyT(func(login *string) (oss.GetUserResult, error) { -// return oss.LookupUserOutput(ctx, oss.GetUserOutputArgs{ +// return oss.GetUserResult(interface{}(oss.LookupUserOutput(ctx, oss.GetUserOutputArgs{ // Login: login, -// }, nil), nil +// }, nil))), nil // }).(oss.GetUserResultOutput) // return nil // }) diff --git a/sdk/go/grafana/oss/getUser.go b/sdk/go/grafana/oss/getUser.go index 120fe612..a328b999 100644 --- a/sdk/go/grafana/oss/getUser.go +++ b/sdk/go/grafana/oss/getUser.go @@ -47,9 +47,9 @@ import ( // Email: test.Email, // }, nil) // _ = test.Login.ApplyT(func(login *string) (oss.GetUserResult, error) { -// return oss.LookupUserOutput(ctx, oss.GetUserOutputArgs{ +// return oss.GetUserResult(interface{}(oss.LookupUserOutput(ctx, oss.GetUserOutputArgs{ // Login: login, -// }, nil), nil +// }, nil))), nil // }).(oss.GetUserResultOutput) // return nil // }) diff --git a/sdk/go/grafana/serviceAccountToken.go b/sdk/go/grafana/serviceAccountToken.go index 5371d8e6..4da3407e 100644 --- a/sdk/go/grafana/serviceAccountToken.go +++ b/sdk/go/grafana/serviceAccountToken.go @@ -31,29 +31,33 @@ import ( // // func main() { // pulumi.Run(func(ctx *pulumi.Context) error { -// _, err := oss.NewServiceAccount(ctx, "admin", &oss.ServiceAccountArgs{ -// IsDisabled: pulumi.Bool(false), -// Role: pulumi.String("Admin"), +// test, err := oss.NewServiceAccount(ctx, "test", &oss.ServiceAccountArgs{ +// Role: pulumi.String("Viewer"), // }) // if err != nil { // return err // } +// foo, err := oss.NewServiceAccountToken(ctx, "foo", &oss.ServiceAccountTokenArgs{ +// ServiceAccountId: test.ID(), +// }) +// if err != nil { +// return err +// } +// bar, err := oss.NewServiceAccountToken(ctx, "bar", &oss.ServiceAccountTokenArgs{ +// ServiceAccountId: test.ID(), +// SecondsToLive: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// ctx.Export("serviceAccountTokenFooKeyOnly", foo.Key) +// ctx.Export("serviceAccountTokenBar", bar) // return nil // }) // } // // ``` // -// ## Import -// -// ```sh -// $ pulumi import grafana:index/serviceAccountToken:ServiceAccountToken name "{{ id }}" -// ``` -// -// ```sh -// $ pulumi import grafana:index/serviceAccountToken:ServiceAccountToken name "{{ orgID }}:{{ id }}" -// ``` -// // Deprecated: grafana.index/serviceaccounttoken.ServiceAccountToken has been deprecated in favor of grafana.oss/serviceaccounttoken.ServiceAccountToken type ServiceAccountToken struct { pulumi.CustomResourceState @@ -64,11 +68,9 @@ type ServiceAccountToken struct { HasExpired pulumi.BoolOutput `pulumi:"hasExpired"` // The key of the service account token. Key pulumi.StringOutput `pulumi:"key"` - // The name of the service account. + // The name of the service account token. Name pulumi.StringOutput `pulumi:"name"` - // The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - // is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never - // expire. + // The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never expire. SecondsToLive pulumi.IntPtrOutput `pulumi:"secondsToLive"` // The ID of the service account to which the token belongs. ServiceAccountId pulumi.StringOutput `pulumi:"serviceAccountId"` @@ -123,11 +125,9 @@ type serviceAccountTokenState struct { HasExpired *bool `pulumi:"hasExpired"` // The key of the service account token. Key *string `pulumi:"key"` - // The name of the service account. + // The name of the service account token. Name *string `pulumi:"name"` - // The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - // is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never - // expire. + // The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never expire. SecondsToLive *int `pulumi:"secondsToLive"` // The ID of the service account to which the token belongs. ServiceAccountId *string `pulumi:"serviceAccountId"` @@ -140,11 +140,9 @@ type ServiceAccountTokenState struct { HasExpired pulumi.BoolPtrInput // The key of the service account token. Key pulumi.StringPtrInput - // The name of the service account. + // The name of the service account token. Name pulumi.StringPtrInput - // The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - // is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never - // expire. + // The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never expire. SecondsToLive pulumi.IntPtrInput // The ID of the service account to which the token belongs. ServiceAccountId pulumi.StringPtrInput @@ -155,11 +153,9 @@ func (ServiceAccountTokenState) ElementType() reflect.Type { } type serviceAccountTokenArgs struct { - // The name of the service account. + // The name of the service account token. Name *string `pulumi:"name"` - // The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - // is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never - // expire. + // The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never expire. SecondsToLive *int `pulumi:"secondsToLive"` // The ID of the service account to which the token belongs. ServiceAccountId string `pulumi:"serviceAccountId"` @@ -167,11 +163,9 @@ type serviceAccountTokenArgs struct { // The set of arguments for constructing a ServiceAccountToken resource. type ServiceAccountTokenArgs struct { - // The name of the service account. + // The name of the service account token. Name pulumi.StringPtrInput - // The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - // is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never - // expire. + // The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never expire. SecondsToLive pulumi.IntPtrInput // The ID of the service account to which the token belongs. ServiceAccountId pulumi.StringInput @@ -279,14 +273,12 @@ func (o ServiceAccountTokenOutput) Key() pulumi.StringOutput { return o.ApplyT(func(v *ServiceAccountToken) pulumi.StringOutput { return v.Key }).(pulumi.StringOutput) } -// The name of the service account. +// The name of the service account token. func (o ServiceAccountTokenOutput) Name() pulumi.StringOutput { return o.ApplyT(func(v *ServiceAccountToken) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) } -// The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it -// is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never -// expire. +// The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never expire. func (o ServiceAccountTokenOutput) SecondsToLive() pulumi.IntPtrOutput { return o.ApplyT(func(v *ServiceAccountToken) pulumi.IntPtrOutput { return v.SecondsToLive }).(pulumi.IntPtrOutput) } diff --git a/sdk/nodejs/serviceAccountToken.ts b/sdk/nodejs/serviceAccountToken.ts index e74721ed..216ac609 100644 --- a/sdk/nodejs/serviceAccountToken.ts +++ b/sdk/nodejs/serviceAccountToken.ts @@ -16,20 +16,14 @@ import * as utilities from "./utilities"; * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * - * const admin = new grafana.oss.ServiceAccount("admin", { - * isDisabled: false, - * role: "Admin", + * const test = new grafana.oss.ServiceAccount("test", {role: "Viewer"}); + * const foo = new grafana.oss.ServiceAccountToken("foo", {serviceAccountId: test.id}); + * const bar = new grafana.oss.ServiceAccountToken("bar", { + * serviceAccountId: test.id, + * secondsToLive: 30, * }); - * ``` - * - * ## Import - * - * ```sh - * $ pulumi import grafana:index/serviceAccountToken:ServiceAccountToken name "{{ id }}" - * ``` - * - * ```sh - * $ pulumi import grafana:index/serviceAccountToken:ServiceAccountToken name "{{ orgID }}:{{ id }}" + * export const serviceAccountTokenFooKeyOnly = foo.key; + * export const serviceAccountTokenBar = bar; * ``` * * @deprecated grafana.index/serviceaccounttoken.ServiceAccountToken has been deprecated in favor of grafana.oss/serviceaccounttoken.ServiceAccountToken @@ -76,13 +70,11 @@ export class ServiceAccountToken extends pulumi.CustomResource { */ public /*out*/ readonly key!: pulumi.Output; /** - * The name of the service account. + * The name of the service account token. */ public readonly name!: pulumi.Output; /** - * The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - * is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never - * expire. + * The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never expire. */ public readonly secondsToLive!: pulumi.Output; /** @@ -150,13 +142,11 @@ export interface ServiceAccountTokenState { */ key?: pulumi.Input; /** - * The name of the service account. + * The name of the service account token. */ name?: pulumi.Input; /** - * The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - * is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never - * expire. + * The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never expire. */ secondsToLive?: pulumi.Input; /** @@ -170,13 +160,11 @@ export interface ServiceAccountTokenState { */ export interface ServiceAccountTokenArgs { /** - * The name of the service account. + * The name of the service account token. */ name?: pulumi.Input; /** - * The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - * is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never - * expire. + * The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `apiKeyMaxSecondsToLive` configuration option is set) the key will never expire. */ secondsToLive?: pulumi.Input; /** diff --git a/sdk/python/pulumiverse_grafana/_utilities.py b/sdk/python/pulumiverse_grafana/_utilities.py index b7a29b8a..e1b33722 100644 --- a/sdk/python/pulumiverse_grafana/_utilities.py +++ b/sdk/python/pulumiverse_grafana/_utilities.py @@ -4,6 +4,7 @@ import asyncio +import functools import importlib.metadata import importlib.util import inspect @@ -11,14 +12,19 @@ import os import sys import typing +import warnings +import base64 import pulumi import pulumi.runtime from pulumi.runtime.sync_await import _sync_await +from pulumi.runtime.proto import resource_pb2 from semver import VersionInfo as SemverVersion from parver import Version as PEP440Version +C = typing.TypeVar("C", bound=typing.Callable) + def get_env(*args): for v in args: @@ -96,10 +102,6 @@ def _get_semver_version(): _version = _get_semver_version() _version_str = str(_version) - -def get_version(): - return _version_str - def get_resource_opts_defaults() -> pulumi.ResourceOptions: return pulumi.ResourceOptions( version=get_version(), @@ -287,5 +289,39 @@ async def _await_output(o: pulumi.Output[typing.Any]) -> typing.Tuple[object, bo await o._resources, ) + +# This is included to provide an upgrade path for users who are using a version +# of the Pulumi SDK (<3.121.0) that does not include the `deprecated` decorator. +def deprecated(message: str) -> typing.Callable[[C], C]: + """ + Decorator to indicate a function is deprecated. + + As well as inserting appropriate statements to indicate that the function is + deprecated, this decorator also tags the function with a special attribute + so that Pulumi code can detect that it is deprecated and react appropriately + in certain situations. + + message is the deprecation message that should be printed if the function is called. + """ + + def decorator(fn: C) -> C: + if not callable(fn): + raise TypeError("Expected fn to be callable") + + @functools.wraps(fn) + def deprecated_fn(*args, **kwargs): + warnings.warn(message) + pulumi.warn(f"{fn.__name__} is deprecated: {message}") + + return fn(*args, **kwargs) + + deprecated_fn.__dict__["_pulumi_deprecated_callable"] = fn + return typing.cast(C, deprecated_fn) + + return decorator + def get_plugin_download_url(): return "github://api.github.com/pulumiverse" + +def get_version(): + return _version_str diff --git a/sdk/python/pulumiverse_grafana/oncall/escalation.py b/sdk/python/pulumiverse_grafana/oncall/escalation.py index 77009bf8..d475d4be 100644 --- a/sdk/python/pulumiverse_grafana/oncall/escalation.py +++ b/sdk/python/pulumiverse_grafana/oncall/escalation.py @@ -470,7 +470,7 @@ def __init__(__self__, import pulumi_grafana as grafana import pulumiverse_grafana as grafana - default = grafana.on_call.EscalationChain("default", opts=pulumi.ResourceOptions(provider=grafana["oncall"])) + default = grafana.on_call.EscalationChain("default", opts = pulumi.ResourceOptions(provider=grafana["oncall"])) alex = grafana.onCall.get_user(username="alex") # Notify step example_notify_step_escalation = grafana.on_call.Escalation("exampleNotifyStepEscalation", @@ -532,7 +532,7 @@ def __init__(__self__, import pulumi_grafana as grafana import pulumiverse_grafana as grafana - default = grafana.on_call.EscalationChain("default", opts=pulumi.ResourceOptions(provider=grafana["oncall"])) + default = grafana.on_call.EscalationChain("default", opts = pulumi.ResourceOptions(provider=grafana["oncall"])) alex = grafana.onCall.get_user(username="alex") # Notify step example_notify_step_escalation = grafana.on_call.Escalation("exampleNotifyStepEscalation", diff --git a/sdk/python/pulumiverse_grafana/oncall/escalation_chain.py b/sdk/python/pulumiverse_grafana/oncall/escalation_chain.py index 083ad654..76f97850 100644 --- a/sdk/python/pulumiverse_grafana/oncall/escalation_chain.py +++ b/sdk/python/pulumiverse_grafana/oncall/escalation_chain.py @@ -108,7 +108,7 @@ def __init__(__self__, import pulumi import pulumiverse_grafana as grafana - default = grafana.on_call.EscalationChain("default", opts=pulumi.ResourceOptions(provider=grafana["oncall"])) + default = grafana.on_call.EscalationChain("default", opts = pulumi.ResourceOptions(provider=grafana["oncall"])) ``` ## Import @@ -137,7 +137,7 @@ def __init__(__self__, import pulumi import pulumiverse_grafana as grafana - default = grafana.on_call.EscalationChain("default", opts=pulumi.ResourceOptions(provider=grafana["oncall"])) + default = grafana.on_call.EscalationChain("default", opts = pulumi.ResourceOptions(provider=grafana["oncall"])) ``` ## Import diff --git a/sdk/python/pulumiverse_grafana/oncall/outgoing_webhook.py b/sdk/python/pulumiverse_grafana/oncall/outgoing_webhook.py index 9fa1daf5..7fdeb9ff 100644 --- a/sdk/python/pulumiverse_grafana/oncall/outgoing_webhook.py +++ b/sdk/python/pulumiverse_grafana/oncall/outgoing_webhook.py @@ -504,7 +504,7 @@ def __init__(__self__, import pulumiverse_grafana as grafana test_acc_outgoing_webhook = grafana.on_call.OutgoingWebhook("test-acc-outgoingWebhook", url="https://example.com/", - opts=pulumi.ResourceOptions(provider=grafana["oncall"])) + opts = pulumi.ResourceOptions(provider=grafana["oncall"])) ``` ## Import @@ -546,7 +546,7 @@ def __init__(__self__, import pulumiverse_grafana as grafana test_acc_outgoing_webhook = grafana.on_call.OutgoingWebhook("test-acc-outgoingWebhook", url="https://example.com/", - opts=pulumi.ResourceOptions(provider=grafana["oncall"])) + opts = pulumi.ResourceOptions(provider=grafana["oncall"])) ``` ## Import diff --git a/sdk/python/pulumiverse_grafana/oncall_escalation.py b/sdk/python/pulumiverse_grafana/oncall_escalation.py index 2494d30b..ef1e5f6d 100644 --- a/sdk/python/pulumiverse_grafana/oncall_escalation.py +++ b/sdk/python/pulumiverse_grafana/oncall_escalation.py @@ -475,7 +475,7 @@ def __init__(__self__, import pulumi_grafana as grafana import pulumiverse_grafana as grafana - default = grafana.on_call.EscalationChain("default", opts=pulumi.ResourceOptions(provider=grafana["oncall"])) + default = grafana.on_call.EscalationChain("default", opts = pulumi.ResourceOptions(provider=grafana["oncall"])) alex = grafana.onCall.get_user(username="alex") # Notify step example_notify_step_escalation = grafana.on_call.Escalation("exampleNotifyStepEscalation", @@ -537,7 +537,7 @@ def __init__(__self__, import pulumi_grafana as grafana import pulumiverse_grafana as grafana - default = grafana.on_call.EscalationChain("default", opts=pulumi.ResourceOptions(provider=grafana["oncall"])) + default = grafana.on_call.EscalationChain("default", opts = pulumi.ResourceOptions(provider=grafana["oncall"])) alex = grafana.onCall.get_user(username="alex") # Notify step example_notify_step_escalation = grafana.on_call.Escalation("exampleNotifyStepEscalation", diff --git a/sdk/python/pulumiverse_grafana/oncall_escalation_chain.py b/sdk/python/pulumiverse_grafana/oncall_escalation_chain.py index 726641db..6259388f 100644 --- a/sdk/python/pulumiverse_grafana/oncall_escalation_chain.py +++ b/sdk/python/pulumiverse_grafana/oncall_escalation_chain.py @@ -113,7 +113,7 @@ def __init__(__self__, import pulumi import pulumiverse_grafana as grafana - default = grafana.on_call.EscalationChain("default", opts=pulumi.ResourceOptions(provider=grafana["oncall"])) + default = grafana.on_call.EscalationChain("default", opts = pulumi.ResourceOptions(provider=grafana["oncall"])) ``` ## Import @@ -142,7 +142,7 @@ def __init__(__self__, import pulumi import pulumiverse_grafana as grafana - default = grafana.on_call.EscalationChain("default", opts=pulumi.ResourceOptions(provider=grafana["oncall"])) + default = grafana.on_call.EscalationChain("default", opts = pulumi.ResourceOptions(provider=grafana["oncall"])) ``` ## Import diff --git a/sdk/python/pulumiverse_grafana/oncall_outgoing_webhook.py b/sdk/python/pulumiverse_grafana/oncall_outgoing_webhook.py index 3f99ddab..6b68f6ab 100644 --- a/sdk/python/pulumiverse_grafana/oncall_outgoing_webhook.py +++ b/sdk/python/pulumiverse_grafana/oncall_outgoing_webhook.py @@ -509,7 +509,7 @@ def __init__(__self__, import pulumiverse_grafana as grafana test_acc_outgoing_webhook = grafana.on_call.OutgoingWebhook("test-acc-outgoingWebhook", url="https://example.com/", - opts=pulumi.ResourceOptions(provider=grafana["oncall"])) + opts = pulumi.ResourceOptions(provider=grafana["oncall"])) ``` ## Import @@ -551,7 +551,7 @@ def __init__(__self__, import pulumiverse_grafana as grafana test_acc_outgoing_webhook = grafana.on_call.OutgoingWebhook("test-acc-outgoingWebhook", url="https://example.com/", - opts=pulumi.ResourceOptions(provider=grafana["oncall"])) + opts = pulumi.ResourceOptions(provider=grafana["oncall"])) ``` ## Import diff --git a/sdk/python/pulumiverse_grafana/service_account_token.py b/sdk/python/pulumiverse_grafana/service_account_token.py index 53a6696d..99dbd023 100644 --- a/sdk/python/pulumiverse_grafana/service_account_token.py +++ b/sdk/python/pulumiverse_grafana/service_account_token.py @@ -20,10 +20,8 @@ def __init__(__self__, *, """ The set of arguments for constructing a ServiceAccountToken resource. :param pulumi.Input[str] service_account_id: The ID of the service account to which the token belongs. - :param pulumi.Input[str] name: The name of the service account. - :param pulumi.Input[int] seconds_to_live: The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will - never expire. + :param pulumi.Input[str] name: The name of the service account token. + :param pulumi.Input[int] seconds_to_live: The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will never expire. """ pulumi.set(__self__, "service_account_id", service_account_id) if name is not None: @@ -47,7 +45,7 @@ def service_account_id(self, value: pulumi.Input[str]): @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: """ - The name of the service account. + The name of the service account token. """ return pulumi.get(self, "name") @@ -59,9 +57,7 @@ def name(self, value: Optional[pulumi.Input[str]]): @pulumi.getter(name="secondsToLive") def seconds_to_live(self) -> Optional[pulumi.Input[int]]: """ - The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will - never expire. + The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will never expire. """ return pulumi.get(self, "seconds_to_live") @@ -84,10 +80,8 @@ def __init__(__self__, *, :param pulumi.Input[str] expiration: The expiration date of the service account token. :param pulumi.Input[bool] has_expired: The status of the service account token. :param pulumi.Input[str] key: The key of the service account token. - :param pulumi.Input[str] name: The name of the service account. - :param pulumi.Input[int] seconds_to_live: The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will - never expire. + :param pulumi.Input[str] name: The name of the service account token. + :param pulumi.Input[int] seconds_to_live: The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will never expire. :param pulumi.Input[str] service_account_id: The ID of the service account to which the token belongs. """ if expiration is not None: @@ -143,7 +137,7 @@ def key(self, value: Optional[pulumi.Input[str]]): @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: """ - The name of the service account. + The name of the service account token. """ return pulumi.get(self, "name") @@ -155,9 +149,7 @@ def name(self, value: Optional[pulumi.Input[str]]): @pulumi.getter(name="secondsToLive") def seconds_to_live(self) -> Optional[pulumi.Input[int]]: """ - The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will - never expire. + The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will never expire. """ return pulumi.get(self, "seconds_to_live") @@ -204,27 +196,19 @@ def __init__(__self__, import pulumi import pulumiverse_grafana as grafana - admin = grafana.oss.ServiceAccount("admin", - is_disabled=False, - role="Admin") - ``` - - ## Import - - ```sh - $ pulumi import grafana:index/serviceAccountToken:ServiceAccountToken name "{{ id }}" - ``` - - ```sh - $ pulumi import grafana:index/serviceAccountToken:ServiceAccountToken name "{{ orgID }}:{{ id }}" + test = grafana.oss.ServiceAccount("test", role="Viewer") + foo = grafana.oss.ServiceAccountToken("foo", service_account_id=test.id) + bar = grafana.oss.ServiceAccountToken("bar", + service_account_id=test.id, + seconds_to_live=30) + pulumi.export("serviceAccountTokenFooKeyOnly", foo.key) + pulumi.export("serviceAccountTokenBar", bar) ``` :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. - :param pulumi.Input[str] name: The name of the service account. - :param pulumi.Input[int] seconds_to_live: The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will - never expire. + :param pulumi.Input[str] name: The name of the service account token. + :param pulumi.Input[int] seconds_to_live: The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will never expire. :param pulumi.Input[str] service_account_id: The ID of the service account to which the token belongs. """ ... @@ -245,19 +229,13 @@ def __init__(__self__, import pulumi import pulumiverse_grafana as grafana - admin = grafana.oss.ServiceAccount("admin", - is_disabled=False, - role="Admin") - ``` - - ## Import - - ```sh - $ pulumi import grafana:index/serviceAccountToken:ServiceAccountToken name "{{ id }}" - ``` - - ```sh - $ pulumi import grafana:index/serviceAccountToken:ServiceAccountToken name "{{ orgID }}:{{ id }}" + test = grafana.oss.ServiceAccount("test", role="Viewer") + foo = grafana.oss.ServiceAccountToken("foo", service_account_id=test.id) + bar = grafana.oss.ServiceAccountToken("bar", + service_account_id=test.id, + seconds_to_live=30) + pulumi.export("serviceAccountTokenFooKeyOnly", foo.key) + pulumi.export("serviceAccountTokenBar", bar) ``` :param str resource_name: The name of the resource. @@ -326,10 +304,8 @@ def get(resource_name: str, :param pulumi.Input[str] expiration: The expiration date of the service account token. :param pulumi.Input[bool] has_expired: The status of the service account token. :param pulumi.Input[str] key: The key of the service account token. - :param pulumi.Input[str] name: The name of the service account. - :param pulumi.Input[int] seconds_to_live: The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will - never expire. + :param pulumi.Input[str] name: The name of the service account token. + :param pulumi.Input[int] seconds_to_live: The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will never expire. :param pulumi.Input[str] service_account_id: The ID of the service account to which the token belongs. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) @@ -372,7 +348,7 @@ def key(self) -> pulumi.Output[str]: @pulumi.getter def name(self) -> pulumi.Output[str]: """ - The name of the service account. + The name of the service account token. """ return pulumi.get(self, "name") @@ -380,9 +356,7 @@ def name(self) -> pulumi.Output[str]: @pulumi.getter(name="secondsToLive") def seconds_to_live(self) -> pulumi.Output[Optional[int]]: """ - The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it - is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will - never expire. + The key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will never expire. """ return pulumi.get(self, "seconds_to_live") diff --git a/sdk/python/pulumiverse_grafana/synthetic_monitoring_installation.py b/sdk/python/pulumiverse_grafana/synthetic_monitoring_installation.py index d9d463b7..cf9f7a03 100644 --- a/sdk/python/pulumiverse_grafana/synthetic_monitoring_installation.py +++ b/sdk/python/pulumiverse_grafana/synthetic_monitoring_installation.py @@ -183,7 +183,7 @@ def __init__(__self__, sm_stack_stack = grafana.cloud.Stack("smStackStack", slug=stack_slug, region_slug=cloud_region, - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) # Step 2: Install Synthetic Monitoring on the stack sm_metrics_publish_access_policy = grafana.cloud.AccessPolicy("smMetricsPublishAccessPolicy", region=cloud_region, @@ -197,15 +197,15 @@ def __init__(__self__, type="stack", identifier=sm_stack_stack.id, )], - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) sm_metrics_publish_access_policy_token = grafana.cloud.AccessPolicyToken("smMetricsPublishAccessPolicyToken", region=cloud_region, access_policy_id=sm_metrics_publish_access_policy.policy_id, - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) sm_stack_installation = grafana.synthetic_monitoring.Installation("smStackInstallation", stack_id=sm_stack_stack.id, metrics_publisher_key=sm_metrics_publish_access_policy_token.token, - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) # Step 3: Interact with Synthetic Monitoring sm = grafana.Provider("sm", sm_access_token=sm_stack_installation.sm_access_token, @@ -257,7 +257,7 @@ def __init__(__self__, sm_stack_stack = grafana.cloud.Stack("smStackStack", slug=stack_slug, region_slug=cloud_region, - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) # Step 2: Install Synthetic Monitoring on the stack sm_metrics_publish_access_policy = grafana.cloud.AccessPolicy("smMetricsPublishAccessPolicy", region=cloud_region, @@ -271,15 +271,15 @@ def __init__(__self__, type="stack", identifier=sm_stack_stack.id, )], - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) sm_metrics_publish_access_policy_token = grafana.cloud.AccessPolicyToken("smMetricsPublishAccessPolicyToken", region=cloud_region, access_policy_id=sm_metrics_publish_access_policy.policy_id, - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) sm_stack_installation = grafana.synthetic_monitoring.Installation("smStackInstallation", stack_id=sm_stack_stack.id, metrics_publisher_key=sm_metrics_publish_access_policy_token.token, - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) # Step 3: Interact with Synthetic Monitoring sm = grafana.Provider("sm", sm_access_token=sm_stack_installation.sm_access_token, diff --git a/sdk/python/pulumiverse_grafana/syntheticmonitoring/installation.py b/sdk/python/pulumiverse_grafana/syntheticmonitoring/installation.py index 1bace605..fb3a84f3 100644 --- a/sdk/python/pulumiverse_grafana/syntheticmonitoring/installation.py +++ b/sdk/python/pulumiverse_grafana/syntheticmonitoring/installation.py @@ -178,7 +178,7 @@ def __init__(__self__, sm_stack_stack = grafana.cloud.Stack("smStackStack", slug=stack_slug, region_slug=cloud_region, - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) # Step 2: Install Synthetic Monitoring on the stack sm_metrics_publish_access_policy = grafana.cloud.AccessPolicy("smMetricsPublishAccessPolicy", region=cloud_region, @@ -192,15 +192,15 @@ def __init__(__self__, type="stack", identifier=sm_stack_stack.id, )], - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) sm_metrics_publish_access_policy_token = grafana.cloud.AccessPolicyToken("smMetricsPublishAccessPolicyToken", region=cloud_region, access_policy_id=sm_metrics_publish_access_policy.policy_id, - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) sm_stack_installation = grafana.synthetic_monitoring.Installation("smStackInstallation", stack_id=sm_stack_stack.id, metrics_publisher_key=sm_metrics_publish_access_policy_token.token, - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) # Step 3: Interact with Synthetic Monitoring sm = grafana.Provider("sm", sm_access_token=sm_stack_installation.sm_access_token, @@ -252,7 +252,7 @@ def __init__(__self__, sm_stack_stack = grafana.cloud.Stack("smStackStack", slug=stack_slug, region_slug=cloud_region, - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) # Step 2: Install Synthetic Monitoring on the stack sm_metrics_publish_access_policy = grafana.cloud.AccessPolicy("smMetricsPublishAccessPolicy", region=cloud_region, @@ -266,15 +266,15 @@ def __init__(__self__, type="stack", identifier=sm_stack_stack.id, )], - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) sm_metrics_publish_access_policy_token = grafana.cloud.AccessPolicyToken("smMetricsPublishAccessPolicyToken", region=cloud_region, access_policy_id=sm_metrics_publish_access_policy.policy_id, - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) sm_stack_installation = grafana.synthetic_monitoring.Installation("smStackInstallation", stack_id=sm_stack_stack.id, metrics_publisher_key=sm_metrics_publish_access_policy_token.token, - opts=pulumi.ResourceOptions(provider=grafana["cloud"])) + opts = pulumi.ResourceOptions(provider=grafana["cloud"])) # Step 3: Interact with Synthetic Monitoring sm = grafana.Provider("sm", sm_access_token=sm_stack_installation.sm_access_token,