From b913619597e9b2068b436bed7d007719c52c9ae2 Mon Sep 17 00:00:00 2001 From: Guinevere Saenger Date: Wed, 20 Sep 2023 10:06:40 -0700 Subject: [PATCH] make tfgen --- Makefile | 2 +- sdk/dotnet/Certificate.cs | 73 +++-- sdk/dotnet/Config/Config.cs | 2 +- sdk/dotnet/Consumer.cs | 31 +- sdk/dotnet/ConsumerAcl.cs | 53 ++-- sdk/dotnet/ConsumerBasicAuth.cs | 51 ++-- sdk/dotnet/ConsumerJwtAuth.cs | 51 ++-- sdk/dotnet/ConsumerKeyAuth.cs | 81 +++-- sdk/dotnet/ConsumerOauth2.cs | 63 ++-- sdk/dotnet/Inputs/RouteDestinationArgs.cs | 3 +- sdk/dotnet/Inputs/RouteDestinationGetArgs.cs | 3 +- sdk/dotnet/Inputs/RouteHeaderArgs.cs | 3 +- sdk/dotnet/Inputs/RouteHeaderGetArgs.cs | 3 +- sdk/dotnet/Inputs/RouteSourceArgs.cs | 3 +- sdk/dotnet/Inputs/RouteSourceGetArgs.cs | 3 +- .../Inputs/UpstreamHealthchecksActiveArgs.cs | 3 +- .../UpstreamHealthchecksActiveGetArgs.cs | 3 +- .../UpstreamHealthchecksActiveHealthyArgs.cs | 3 +- ...pstreamHealthchecksActiveHealthyGetArgs.cs | 3 +- ...UpstreamHealthchecksActiveUnhealthyArgs.cs | 3 +- ...treamHealthchecksActiveUnhealthyGetArgs.cs | 3 +- sdk/dotnet/Inputs/UpstreamHealthchecksArgs.cs | 3 +- .../Inputs/UpstreamHealthchecksGetArgs.cs | 3 +- .../Inputs/UpstreamHealthchecksPassiveArgs.cs | 3 +- .../UpstreamHealthchecksPassiveGetArgs.cs | 3 +- .../UpstreamHealthchecksPassiveHealthyArgs.cs | 3 +- ...streamHealthchecksPassiveHealthyGetArgs.cs | 3 +- ...pstreamHealthchecksPassiveUnhealthyArgs.cs | 3 +- ...reamHealthchecksPassiveUnhealthyGetArgs.cs | 3 +- sdk/dotnet/Plugin.cs | 109 +++---- sdk/dotnet/Provider.cs | 5 +- sdk/dotnet/Pulumi.Kong.csproj | 5 +- sdk/dotnet/Route.cs | 140 ++++----- sdk/dotnet/Service.cs | 102 ++++--- sdk/dotnet/Target.cs | 27 +- sdk/dotnet/Upstream.cs | 158 +++++----- sdk/dotnet/Utilities.cs | 2 +- sdk/go.mod | 2 +- sdk/go/kong/certificate.go | 67 ++++- sdk/go/kong/config/config.go | 15 +- sdk/go/kong/consumer.go | 54 ++++ sdk/go/kong/consumerAcl.go | 60 +++- sdk/go/kong/consumerBasicAuth.go | 61 +++- sdk/go/kong/consumerJwtAuth.go | 75 ++++- sdk/go/kong/consumerKeyAuth.go | 63 +++- sdk/go/kong/consumerOauth2.go | 89 +++++- sdk/go/kong/init.go | 6 +- .../{config => internal}/pulumiUtilities.go | 42 ++- sdk/go/kong/internal/pulumiVersion.go | 11 + sdk/go/kong/jwtAuth.go | 284 ------------------ sdk/go/kong/plugin.go | 98 +++++- sdk/go/kong/provider.go | 59 +++- sdk/go/kong/pulumiTypes.go | 244 +++++++++++++++ sdk/go/kong/pulumiUtilities.go | 87 ------ sdk/go/kong/route.go | 145 ++++++++- sdk/go/kong/service.go | 121 +++++++- sdk/go/kong/target.go | 61 +++- sdk/go/kong/upstream.go | 139 ++++++++- .../java/com/pulumi/kong/Certificate.java | 36 +++ .../main/java/com/pulumi/kong/Consumer.java | 30 ++ .../java/com/pulumi/kong/ConsumerAcl.java | 50 +++ .../com/pulumi/kong/ConsumerBasicAuth.java | 43 +++ .../java/com/pulumi/kong/ConsumerJwtAuth.java | 50 +++ .../java/com/pulumi/kong/ConsumerKeyAuth.java | 45 +++ .../java/com/pulumi/kong/ConsumerOauth2.java | 56 ++++ .../src/main/java/com/pulumi/kong/Plugin.java | 166 ++++++++++ .../src/main/java/com/pulumi/kong/Route.java | 94 ++++++ .../main/java/com/pulumi/kong/Service.java | 100 ++++++ .../src/main/java/com/pulumi/kong/Target.java | 30 ++ .../main/java/com/pulumi/kong/Upstream.java | 107 +++++++ sdk/nodejs/README.md | 4 +- sdk/nodejs/certificate.ts | 4 +- sdk/nodejs/consumerAcl.ts | 11 +- sdk/nodejs/consumerBasicAuth.ts | 6 +- sdk/nodejs/consumerJwtAuth.ts | 11 +- sdk/nodejs/consumerKeyAuth.ts | 4 +- sdk/nodejs/consumerOauth2.ts | 11 +- sdk/nodejs/index.ts | 95 ++++-- sdk/nodejs/package.json | 6 +- sdk/nodejs/plugin.ts | 18 +- sdk/nodejs/provider.ts | 2 +- sdk/nodejs/route.ts | 3 +- sdk/nodejs/scripts/install-pulumi-plugin.js | 26 -- sdk/nodejs/target.ts | 2 +- sdk/nodejs/types/index.ts | 2 + sdk/nodejs/types/input.ts | 3 +- sdk/nodejs/types/output.ts | 3 +- sdk/nodejs/upstream.ts | 3 +- sdk/nodejs/utilities.ts | 12 + sdk/python/pulumi_kong/README.md | 4 +- sdk/python/pulumi_kong/_inputs.py | 1 + sdk/python/pulumi_kong/_utilities.py | 14 + sdk/python/pulumi_kong/certificate.py | 10 +- sdk/python/pulumi_kong/config/__init__.pyi | 1 + sdk/python/pulumi_kong/config/vars.py | 1 + sdk/python/pulumi_kong/consumer.py | 6 +- sdk/python/pulumi_kong/consumer_acl.py | 6 +- sdk/python/pulumi_kong/consumer_basic_auth.py | 6 +- sdk/python/pulumi_kong/consumer_jwt_auth.py | 6 +- sdk/python/pulumi_kong/consumer_key_auth.py | 10 +- sdk/python/pulumi_kong/consumer_oauth2.py | 6 +- sdk/python/pulumi_kong/outputs.py | 1 + sdk/python/pulumi_kong/plugin.py | 6 +- sdk/python/pulumi_kong/provider.py | 6 +- sdk/python/pulumi_kong/route.py | 6 +- sdk/python/pulumi_kong/service.py | 6 +- sdk/python/pulumi_kong/target.py | 6 +- sdk/python/pulumi_kong/upstream.py | 6 +- sdk/python/setup.py | 24 +- 109 files changed, 2880 insertions(+), 1083 deletions(-) rename sdk/go/kong/{config => internal}/pulumiUtilities.go (59%) create mode 100644 sdk/go/kong/internal/pulumiVersion.go delete mode 100644 sdk/go/kong/jwtAuth.go delete mode 100644 sdk/go/kong/pulumiUtilities.go delete mode 100644 sdk/nodejs/scripts/install-pulumi-plugin.js diff --git a/Makefile b/Makefile index e941eaef..980ef618 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ TFGEN := pulumi-tfgen-$(PACK) PROVIDER := pulumi-resource-$(PACK) VERSION := $(shell pulumictl get version) JAVA_GEN := pulumi-java-gen -JAVA_GEN_VERSION := v0.5.4 +JAVA_GEN_VERSION := v0.9.5 TESTPARALLELISM := 10 WORKING_DIR := $(shell pwd) diff --git a/sdk/dotnet/Certificate.cs b/sdk/dotnet/Certificate.cs index 606c5432..88d18ea1 100644 --- a/sdk/dotnet/Certificate.cs +++ b/sdk/dotnet/Certificate.cs @@ -17,30 +17,29 @@ namespace Pulumi.Kong /// ## Example Usage /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var certificate = new Kong.Certificate("certificate", new() /// { - /// var certificate = new Kong.Certificate("certificate", new Kong.CertificateArgs + /// Cert = "public key --- 123 ----", + /// PrivateKey = "private key --- 456 ----", + /// Snis = new[] /// { - /// Certificate = "public key --- 123 ----", - /// PrivateKey = "private key --- 456 ----", - /// Snis = - /// { - /// "foo.com", - /// "bar.com", - /// }, - /// Tags = - /// { - /// "myTag", - /// }, - /// }); - /// } + /// "foo.com", + /// "bar.com", + /// }, + /// Tags = new[] + /// { + /// "myTag", + /// }, + /// }); /// - /// } + /// }); /// ``` /// /// ## Import @@ -52,7 +51,7 @@ namespace Pulumi.Kong /// ``` /// [KongResourceType("kong:index/certificate:Certificate")] - public partial class Certificate : Pulumi.CustomResource + public partial class Certificate : global::Pulumi.CustomResource { /// /// should be the public key of your certificate it is mapped to the `Cert` parameter on the Kong API. @@ -98,6 +97,10 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? var defaultOptions = new CustomResourceOptions { Version = Utilities.Version, + AdditionalSecretOutputs = + { + "privateKey", + }, }; var merged = CustomResourceOptions.Merge(defaultOptions, options); // Override the ID if one was specified for consistency with other language SDKs. @@ -119,7 +122,7 @@ public static Certificate Get(string name, Input id, CertificateState? s } } - public sealed class CertificateArgs : Pulumi.ResourceArgs + public sealed class CertificateArgs : global::Pulumi.ResourceArgs { /// /// should be the public key of your certificate it is mapped to the `Cert` parameter on the Kong API. @@ -127,11 +130,21 @@ public sealed class CertificateArgs : Pulumi.ResourceArgs [Input("certificate", required: true)] public Input Cert { get; set; } = null!; + [Input("privateKey")] + private Input? _privateKey; + /// /// should be the private key of your certificate it is mapped to the `Key` parameter on the Kong API. /// - [Input("privateKey")] - public Input? PrivateKey { get; set; } + public Input? PrivateKey + { + get => _privateKey; + set + { + var emptySecret = Output.CreateSecret(0); + _privateKey = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } [Input("snis")] private InputList? _snis; @@ -156,9 +169,10 @@ public InputList Tags public CertificateArgs() { } + public static new CertificateArgs Empty => new CertificateArgs(); } - public sealed class CertificateState : Pulumi.ResourceArgs + public sealed class CertificateState : global::Pulumi.ResourceArgs { /// /// should be the public key of your certificate it is mapped to the `Cert` parameter on the Kong API. @@ -166,11 +180,21 @@ public sealed class CertificateState : Pulumi.ResourceArgs [Input("certificate")] public Input? Cert { get; set; } + [Input("privateKey")] + private Input? _privateKey; + /// /// should be the private key of your certificate it is mapped to the `Key` parameter on the Kong API. /// - [Input("privateKey")] - public Input? PrivateKey { get; set; } + public Input? PrivateKey + { + get => _privateKey; + set + { + var emptySecret = Output.CreateSecret(0); + _privateKey = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } [Input("snis")] private InputList? _snis; @@ -195,5 +219,6 @@ public InputList Tags public CertificateState() { } + public static new CertificateState Empty => new CertificateState(); } } diff --git a/sdk/dotnet/Config/Config.cs b/sdk/dotnet/Config/Config.cs index 9683f152..94bf35a0 100644 --- a/sdk/dotnet/Config/Config.cs +++ b/sdk/dotnet/Config/Config.cs @@ -30,7 +30,7 @@ public void Set(T value) } } - private static readonly Pulumi.Config __config = new Pulumi.Config("kong"); + private static readonly global::Pulumi.Config __config = new global::Pulumi.Config("kong"); private static readonly __Value _kongAdminPassword = new __Value(() => __config.Get("kongAdminPassword")); /// diff --git a/sdk/dotnet/Consumer.cs b/sdk/dotnet/Consumer.cs index 9b9561f8..bb256fa9 100644 --- a/sdk/dotnet/Consumer.cs +++ b/sdk/dotnet/Consumer.cs @@ -17,25 +17,24 @@ namespace Pulumi.Kong /// ## Example Usage /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var consumer = new Kong.Consumer("consumer", new() /// { - /// var consumer = new Kong.Consumer("consumer", new Kong.ConsumerArgs + /// CustomId = "123", + /// Tags = new[] /// { - /// CustomId = "123", - /// Tags = - /// { - /// "mySuperTag", - /// }, - /// Username = "User1", - /// }); - /// } + /// "mySuperTag", + /// }, + /// Username = "User1", + /// }); /// - /// } + /// }); /// ``` /// /// ## Import @@ -47,7 +46,7 @@ namespace Pulumi.Kong /// ``` /// [KongResourceType("kong:index/consumer:Consumer")] - public partial class Consumer : Pulumi.CustomResource + public partial class Consumer : global::Pulumi.CustomResource { /// /// A custom id for the consumer, you must set either the username or custom_id @@ -111,7 +110,7 @@ public static Consumer Get(string name, Input id, ConsumerState? state = } } - public sealed class ConsumerArgs : Pulumi.ResourceArgs + public sealed class ConsumerArgs : global::Pulumi.ResourceArgs { /// /// A custom id for the consumer, you must set either the username or custom_id @@ -140,9 +139,10 @@ public InputList Tags public ConsumerArgs() { } + public static new ConsumerArgs Empty => new ConsumerArgs(); } - public sealed class ConsumerState : Pulumi.ResourceArgs + public sealed class ConsumerState : global::Pulumi.ResourceArgs { /// /// A custom id for the consumer, you must set either the username or custom_id @@ -171,5 +171,6 @@ public InputList Tags public ConsumerState() { } + public static new ConsumerState Empty => new ConsumerState(); } } diff --git a/sdk/dotnet/ConsumerAcl.cs b/sdk/dotnet/ConsumerAcl.cs index 3b5dcfda..7bf1ceee 100644 --- a/sdk/dotnet/ConsumerAcl.cs +++ b/sdk/dotnet/ConsumerAcl.cs @@ -17,43 +17,44 @@ namespace Pulumi.Kong /// ## Example Usage /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var myConsumer = new Kong.Consumer("myConsumer", new() /// { - /// var myConsumer = new Kong.Consumer("myConsumer", new Kong.ConsumerArgs - /// { - /// CustomId = "123", - /// Username = "User1", - /// }); - /// var aclPlugin = new Kong.Plugin("aclPlugin", new Kong.PluginArgs - /// { - /// ConfigJson = @" { + /// CustomId = "123", + /// Username = "User1", + /// }); + /// + /// var aclPlugin = new Kong.Plugin("aclPlugin", new() + /// { + /// ConfigJson = @" { /// ""allow"": [""group1"", ""group2""] /// } /// /// ", - /// }); - /// var consumerAcl = new Kong.ConsumerAcl("consumerAcl", new Kong.ConsumerAclArgs + /// }); + /// + /// var consumerAcl = new Kong.ConsumerAcl("consumerAcl", new() + /// { + /// ConsumerId = myConsumer.Id, + /// Group = "group2", + /// Tags = new[] /// { - /// ConsumerId = myConsumer.Id, - /// Group = "group2", - /// Tags = - /// { - /// "myTag", - /// "otherTag", - /// }, - /// }); - /// } + /// "myTag", + /// "otherTag", + /// }, + /// }); /// - /// } + /// }); /// ``` /// [KongResourceType("kong:index/consumerAcl:ConsumerAcl")] - public partial class ConsumerAcl : Pulumi.CustomResource + public partial class ConsumerAcl : global::Pulumi.CustomResource { /// /// the id of the consumer to be configured @@ -117,7 +118,7 @@ public static ConsumerAcl Get(string name, Input id, ConsumerAclState? s } } - public sealed class ConsumerAclArgs : Pulumi.ResourceArgs + public sealed class ConsumerAclArgs : global::Pulumi.ResourceArgs { /// /// the id of the consumer to be configured @@ -146,9 +147,10 @@ public InputList Tags public ConsumerAclArgs() { } + public static new ConsumerAclArgs Empty => new ConsumerAclArgs(); } - public sealed class ConsumerAclState : Pulumi.ResourceArgs + public sealed class ConsumerAclState : global::Pulumi.ResourceArgs { /// /// the id of the consumer to be configured @@ -177,5 +179,6 @@ public InputList Tags public ConsumerAclState() { } + public static new ConsumerAclState Empty => new ConsumerAclState(); } } diff --git a/sdk/dotnet/ConsumerBasicAuth.cs b/sdk/dotnet/ConsumerBasicAuth.cs index 26af7e02..abc77e5b 100644 --- a/sdk/dotnet/ConsumerBasicAuth.cs +++ b/sdk/dotnet/ConsumerBasicAuth.cs @@ -17,39 +17,38 @@ namespace Pulumi.Kong /// ## Example Usage /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var myConsumer = new Kong.Consumer("myConsumer", new() /// { - /// var myConsumer = new Kong.Consumer("myConsumer", new Kong.ConsumerArgs - /// { - /// CustomId = "123", - /// Username = "User1", - /// }); - /// var basicAuthPlugin = new Kong.Plugin("basicAuthPlugin", new Kong.PluginArgs - /// { - /// }); - /// var consumerBasicAuth = new Kong.ConsumerBasicAuth("consumerBasicAuth", new Kong.ConsumerBasicAuthArgs + /// CustomId = "123", + /// Username = "User1", + /// }); + /// + /// var basicAuthPlugin = new Kong.Plugin("basicAuthPlugin"); + /// + /// var consumerBasicAuth = new Kong.ConsumerBasicAuth("consumerBasicAuth", new() + /// { + /// ConsumerId = myConsumer.Id, + /// Password = "bar_updated", + /// Tags = new[] /// { - /// ConsumerId = myConsumer.Id, - /// Password = "bar_updated", - /// Tags = - /// { - /// "myTag", - /// "anotherTag", - /// }, - /// Username = "foo_updated", - /// }); - /// } + /// "myTag", + /// "anotherTag", + /// }, + /// Username = "foo_updated", + /// }); /// - /// } + /// }); /// ``` /// [KongResourceType("kong:index/consumerBasicAuth:ConsumerBasicAuth")] - public partial class ConsumerBasicAuth : Pulumi.CustomResource + public partial class ConsumerBasicAuth : global::Pulumi.CustomResource { /// /// the id of the consumer to be configured with basic auth @@ -119,7 +118,7 @@ public static ConsumerBasicAuth Get(string name, Input id, ConsumerBasic } } - public sealed class ConsumerBasicAuthArgs : Pulumi.ResourceArgs + public sealed class ConsumerBasicAuthArgs : global::Pulumi.ResourceArgs { /// /// the id of the consumer to be configured with basic auth @@ -154,9 +153,10 @@ public InputList Tags public ConsumerBasicAuthArgs() { } + public static new ConsumerBasicAuthArgs Empty => new ConsumerBasicAuthArgs(); } - public sealed class ConsumerBasicAuthState : Pulumi.ResourceArgs + public sealed class ConsumerBasicAuthState : global::Pulumi.ResourceArgs { /// /// the id of the consumer to be configured with basic auth @@ -191,5 +191,6 @@ public InputList Tags public ConsumerBasicAuthState() { } + public static new ConsumerBasicAuthState Empty => new ConsumerBasicAuthState(); } } diff --git a/sdk/dotnet/ConsumerJwtAuth.cs b/sdk/dotnet/ConsumerJwtAuth.cs index 658a888c..fd7fdf53 100644 --- a/sdk/dotnet/ConsumerJwtAuth.cs +++ b/sdk/dotnet/ConsumerJwtAuth.cs @@ -17,41 +17,42 @@ namespace Pulumi.Kong /// ## Example Usage /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var myConsumer = new Kong.Consumer("myConsumer", new() /// { - /// var myConsumer = new Kong.Consumer("myConsumer", new Kong.ConsumerArgs - /// { - /// CustomId = "123", - /// Username = "User1", - /// }); - /// var jwtPlugin = new Kong.Plugin("jwtPlugin", new Kong.PluginArgs - /// { - /// ConfigJson = @" { + /// CustomId = "123", + /// Username = "User1", + /// }); + /// + /// var jwtPlugin = new Kong.Plugin("jwtPlugin", new() + /// { + /// ConfigJson = @" { /// ""claims_to_verify"": [""exp""] /// } /// /// ", - /// }); - /// var consumerJwtConfig = new Kong.ConsumerJwtAuth("consumerJwtConfig", new Kong.ConsumerJwtAuthArgs - /// { - /// Algorithm = "HS256", - /// ConsumerId = myConsumer.Id, - /// Key = "my_key", - /// RsaPublicKey = "foo", - /// Secret = "my_secret", - /// }); - /// } + /// }); + /// + /// var consumerJwtConfig = new Kong.ConsumerJwtAuth("consumerJwtConfig", new() + /// { + /// Algorithm = "HS256", + /// ConsumerId = myConsumer.Id, + /// Key = "my_key", + /// RsaPublicKey = "foo", + /// Secret = "my_secret", + /// }); /// - /// } + /// }); /// ``` /// [KongResourceType("kong:index/consumerJwtAuth:ConsumerJwtAuth")] - public partial class ConsumerJwtAuth : Pulumi.CustomResource + public partial class ConsumerJwtAuth : global::Pulumi.CustomResource { /// /// The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is `HS256` @@ -133,7 +134,7 @@ public static ConsumerJwtAuth Get(string name, Input id, ConsumerJwtAuth } } - public sealed class ConsumerJwtAuthArgs : Pulumi.ResourceArgs + public sealed class ConsumerJwtAuthArgs : global::Pulumi.ResourceArgs { /// /// The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is `HS256` @@ -180,9 +181,10 @@ public InputList Tags public ConsumerJwtAuthArgs() { } + public static new ConsumerJwtAuthArgs Empty => new ConsumerJwtAuthArgs(); } - public sealed class ConsumerJwtAuthState : Pulumi.ResourceArgs + public sealed class ConsumerJwtAuthState : global::Pulumi.ResourceArgs { /// /// The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is `HS256` @@ -229,5 +231,6 @@ public InputList Tags public ConsumerJwtAuthState() { } + public static new ConsumerJwtAuthState Empty => new ConsumerJwtAuthState(); } } diff --git a/sdk/dotnet/ConsumerKeyAuth.cs b/sdk/dotnet/ConsumerKeyAuth.cs index 848b4312..05d59fdf 100644 --- a/sdk/dotnet/ConsumerKeyAuth.cs +++ b/sdk/dotnet/ConsumerKeyAuth.cs @@ -17,38 +17,37 @@ namespace Pulumi.Kong /// ## Example Usage /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var myConsumer = new Kong.Consumer("myConsumer", new() /// { - /// var myConsumer = new Kong.Consumer("myConsumer", new Kong.ConsumerArgs - /// { - /// Username = "User1", - /// CustomId = "123", - /// }); - /// var keyAuthPlugin = new Kong.Plugin("keyAuthPlugin", new Kong.PluginArgs - /// { - /// }); - /// var consumerKeyAuth = new Kong.ConsumerKeyAuth("consumerKeyAuth", new Kong.ConsumerKeyAuthArgs + /// Username = "User1", + /// CustomId = "123", + /// }); + /// + /// var keyAuthPlugin = new Kong.Plugin("keyAuthPlugin"); + /// + /// var consumerKeyAuth = new Kong.ConsumerKeyAuth("consumerKeyAuth", new() + /// { + /// ConsumerId = myConsumer.Id, + /// Key = "secret", + /// Tags = new[] /// { - /// ConsumerId = myConsumer.Id, - /// Key = "secret", - /// Tags = - /// { - /// "myTag", - /// "anotherTag", - /// }, - /// }); - /// } + /// "myTag", + /// "anotherTag", + /// }, + /// }); /// - /// } + /// }); /// ``` /// [KongResourceType("kong:index/consumerKeyAuth:ConsumerKeyAuth")] - public partial class ConsumerKeyAuth : Pulumi.CustomResource + public partial class ConsumerKeyAuth : global::Pulumi.CustomResource { /// /// the id of the consumer to associate the credentials to @@ -91,6 +90,10 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? var defaultOptions = new CustomResourceOptions { Version = Utilities.Version, + AdditionalSecretOutputs = + { + "key", + }, }; var merged = CustomResourceOptions.Merge(defaultOptions, options); // Override the ID if one was specified for consistency with other language SDKs. @@ -112,7 +115,7 @@ public static ConsumerKeyAuth Get(string name, Input id, ConsumerKeyAuth } } - public sealed class ConsumerKeyAuthArgs : Pulumi.ResourceArgs + public sealed class ConsumerKeyAuthArgs : global::Pulumi.ResourceArgs { /// /// the id of the consumer to associate the credentials to @@ -120,11 +123,21 @@ public sealed class ConsumerKeyAuthArgs : Pulumi.ResourceArgs [Input("consumerId", required: true)] public Input ConsumerId { get; set; } = null!; + [Input("key")] + private Input? _key; + /// /// Unique key to authenticate the client; if omitted the plugin will generate one /// - [Input("key")] - public Input? Key { get; set; } + public Input? Key + { + get => _key; + set + { + var emptySecret = Output.CreateSecret(0); + _key = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } [Input("tags")] private InputList? _tags; @@ -141,9 +154,10 @@ public InputList Tags public ConsumerKeyAuthArgs() { } + public static new ConsumerKeyAuthArgs Empty => new ConsumerKeyAuthArgs(); } - public sealed class ConsumerKeyAuthState : Pulumi.ResourceArgs + public sealed class ConsumerKeyAuthState : global::Pulumi.ResourceArgs { /// /// the id of the consumer to associate the credentials to @@ -151,11 +165,21 @@ public sealed class ConsumerKeyAuthState : Pulumi.ResourceArgs [Input("consumerId")] public Input? ConsumerId { get; set; } + [Input("key")] + private Input? _key; + /// /// Unique key to authenticate the client; if omitted the plugin will generate one /// - [Input("key")] - public Input? Key { get; set; } + public Input? Key + { + get => _key; + set + { + var emptySecret = Output.CreateSecret(0); + _key = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } [Input("tags")] private InputList? _tags; @@ -172,5 +196,6 @@ public InputList Tags public ConsumerKeyAuthState() { } + public static new ConsumerKeyAuthState Empty => new ConsumerKeyAuthState(); } } diff --git a/sdk/dotnet/ConsumerOauth2.cs b/sdk/dotnet/ConsumerOauth2.cs index 3be40519..b52aa5b4 100644 --- a/sdk/dotnet/ConsumerOauth2.cs +++ b/sdk/dotnet/ConsumerOauth2.cs @@ -17,21 +17,22 @@ namespace Pulumi.Kong /// ## Example Usage /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var myConsumer = new Kong.Consumer("myConsumer", new() /// { - /// var myConsumer = new Kong.Consumer("myConsumer", new Kong.ConsumerArgs - /// { - /// CustomId = "123", - /// Username = "User1", - /// }); - /// var oauth2Plugin = new Kong.Plugin("oauth2Plugin", new Kong.PluginArgs - /// { - /// ConfigJson = @" { + /// CustomId = "123", + /// Username = "User1", + /// }); + /// + /// var oauth2Plugin = new Kong.Plugin("oauth2Plugin", new() + /// { + /// ConfigJson = @" { /// ""global_credentials"": true, /// ""enable_password_grant"": true, /// ""token_expiration"": 180, @@ -40,29 +41,29 @@ namespace Pulumi.Kong /// } /// /// ", - /// }); - /// var consumerOauth2 = new Kong.ConsumerOauth2("consumerOauth2", new Kong.ConsumerOauth2Args + /// }); + /// + /// var consumerOauth2 = new Kong.ConsumerOauth2("consumerOauth2", new() + /// { + /// ClientId = "client_id", + /// ClientSecret = "client_secret", + /// ConsumerId = myConsumer.Id, + /// RedirectUris = new[] + /// { + /// "https://asdf.com/callback", + /// "https://test.cl/callback", + /// }, + /// Tags = new[] /// { - /// ClientId = "client_id", - /// ClientSecret = "client_secret", - /// ConsumerId = myConsumer.Id, - /// RedirectUris = - /// { - /// "https://asdf.com/callback", - /// "https://test.cl/callback", - /// }, - /// Tags = - /// { - /// "myTag", - /// }, - /// }); - /// } + /// "myTag", + /// }, + /// }); /// - /// } + /// }); /// ``` /// [KongResourceType("kong:index/consumerOauth2:ConsumerOauth2")] - public partial class ConsumerOauth2 : Pulumi.CustomResource + public partial class ConsumerOauth2 : global::Pulumi.CustomResource { /// /// Unique oauth2 client id. If not set, the oauth2 plugin will generate one @@ -150,7 +151,7 @@ public static ConsumerOauth2 Get(string name, Input id, ConsumerOauth2St } } - public sealed class ConsumerOauth2Args : Pulumi.ResourceArgs + public sealed class ConsumerOauth2Args : global::Pulumi.ResourceArgs { /// /// Unique oauth2 client id. If not set, the oauth2 plugin will generate one @@ -209,9 +210,10 @@ public InputList Tags public ConsumerOauth2Args() { } + public static new ConsumerOauth2Args Empty => new ConsumerOauth2Args(); } - public sealed class ConsumerOauth2State : Pulumi.ResourceArgs + public sealed class ConsumerOauth2State : global::Pulumi.ResourceArgs { /// /// Unique oauth2 client id. If not set, the oauth2 plugin will generate one @@ -270,5 +272,6 @@ public InputList Tags public ConsumerOauth2State() { } + public static new ConsumerOauth2State Empty => new ConsumerOauth2State(); } } diff --git a/sdk/dotnet/Inputs/RouteDestinationArgs.cs b/sdk/dotnet/Inputs/RouteDestinationArgs.cs index 9d37b8e6..f04541d9 100644 --- a/sdk/dotnet/Inputs/RouteDestinationArgs.cs +++ b/sdk/dotnet/Inputs/RouteDestinationArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class RouteDestinationArgs : Pulumi.ResourceArgs + public sealed class RouteDestinationArgs : global::Pulumi.ResourceArgs { [Input("ip")] public Input? Ip { get; set; } @@ -21,5 +21,6 @@ public sealed class RouteDestinationArgs : Pulumi.ResourceArgs public RouteDestinationArgs() { } + public static new RouteDestinationArgs Empty => new RouteDestinationArgs(); } } diff --git a/sdk/dotnet/Inputs/RouteDestinationGetArgs.cs b/sdk/dotnet/Inputs/RouteDestinationGetArgs.cs index 66047097..c8719f68 100644 --- a/sdk/dotnet/Inputs/RouteDestinationGetArgs.cs +++ b/sdk/dotnet/Inputs/RouteDestinationGetArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class RouteDestinationGetArgs : Pulumi.ResourceArgs + public sealed class RouteDestinationGetArgs : global::Pulumi.ResourceArgs { [Input("ip")] public Input? Ip { get; set; } @@ -21,5 +21,6 @@ public sealed class RouteDestinationGetArgs : Pulumi.ResourceArgs public RouteDestinationGetArgs() { } + public static new RouteDestinationGetArgs Empty => new RouteDestinationGetArgs(); } } diff --git a/sdk/dotnet/Inputs/RouteHeaderArgs.cs b/sdk/dotnet/Inputs/RouteHeaderArgs.cs index db6a0344..312150fc 100644 --- a/sdk/dotnet/Inputs/RouteHeaderArgs.cs +++ b/sdk/dotnet/Inputs/RouteHeaderArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class RouteHeaderArgs : Pulumi.ResourceArgs + public sealed class RouteHeaderArgs : global::Pulumi.ResourceArgs { /// /// The name of the route @@ -29,5 +29,6 @@ public InputList Values public RouteHeaderArgs() { } + public static new RouteHeaderArgs Empty => new RouteHeaderArgs(); } } diff --git a/sdk/dotnet/Inputs/RouteHeaderGetArgs.cs b/sdk/dotnet/Inputs/RouteHeaderGetArgs.cs index 4811f044..3627e5c0 100644 --- a/sdk/dotnet/Inputs/RouteHeaderGetArgs.cs +++ b/sdk/dotnet/Inputs/RouteHeaderGetArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class RouteHeaderGetArgs : Pulumi.ResourceArgs + public sealed class RouteHeaderGetArgs : global::Pulumi.ResourceArgs { /// /// The name of the route @@ -29,5 +29,6 @@ public InputList Values public RouteHeaderGetArgs() { } + public static new RouteHeaderGetArgs Empty => new RouteHeaderGetArgs(); } } diff --git a/sdk/dotnet/Inputs/RouteSourceArgs.cs b/sdk/dotnet/Inputs/RouteSourceArgs.cs index 95adfaf1..b94571e6 100644 --- a/sdk/dotnet/Inputs/RouteSourceArgs.cs +++ b/sdk/dotnet/Inputs/RouteSourceArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class RouteSourceArgs : Pulumi.ResourceArgs + public sealed class RouteSourceArgs : global::Pulumi.ResourceArgs { [Input("ip")] public Input? Ip { get; set; } @@ -21,5 +21,6 @@ public sealed class RouteSourceArgs : Pulumi.ResourceArgs public RouteSourceArgs() { } + public static new RouteSourceArgs Empty => new RouteSourceArgs(); } } diff --git a/sdk/dotnet/Inputs/RouteSourceGetArgs.cs b/sdk/dotnet/Inputs/RouteSourceGetArgs.cs index bf4d04f4..1cd2800f 100644 --- a/sdk/dotnet/Inputs/RouteSourceGetArgs.cs +++ b/sdk/dotnet/Inputs/RouteSourceGetArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class RouteSourceGetArgs : Pulumi.ResourceArgs + public sealed class RouteSourceGetArgs : global::Pulumi.ResourceArgs { [Input("ip")] public Input? Ip { get; set; } @@ -21,5 +21,6 @@ public sealed class RouteSourceGetArgs : Pulumi.ResourceArgs public RouteSourceGetArgs() { } + public static new RouteSourceGetArgs Empty => new RouteSourceGetArgs(); } } diff --git a/sdk/dotnet/Inputs/UpstreamHealthchecksActiveArgs.cs b/sdk/dotnet/Inputs/UpstreamHealthchecksActiveArgs.cs index 59d2ec81..31f575c1 100644 --- a/sdk/dotnet/Inputs/UpstreamHealthchecksActiveArgs.cs +++ b/sdk/dotnet/Inputs/UpstreamHealthchecksActiveArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class UpstreamHealthchecksActiveArgs : Pulumi.ResourceArgs + public sealed class UpstreamHealthchecksActiveArgs : global::Pulumi.ResourceArgs { [Input("concurrency")] public Input? Concurrency { get; set; } @@ -39,5 +39,6 @@ public sealed class UpstreamHealthchecksActiveArgs : Pulumi.ResourceArgs public UpstreamHealthchecksActiveArgs() { } + public static new UpstreamHealthchecksActiveArgs Empty => new UpstreamHealthchecksActiveArgs(); } } diff --git a/sdk/dotnet/Inputs/UpstreamHealthchecksActiveGetArgs.cs b/sdk/dotnet/Inputs/UpstreamHealthchecksActiveGetArgs.cs index d3540ac6..fce0f17c 100644 --- a/sdk/dotnet/Inputs/UpstreamHealthchecksActiveGetArgs.cs +++ b/sdk/dotnet/Inputs/UpstreamHealthchecksActiveGetArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class UpstreamHealthchecksActiveGetArgs : Pulumi.ResourceArgs + public sealed class UpstreamHealthchecksActiveGetArgs : global::Pulumi.ResourceArgs { [Input("concurrency")] public Input? Concurrency { get; set; } @@ -39,5 +39,6 @@ public sealed class UpstreamHealthchecksActiveGetArgs : Pulumi.ResourceArgs public UpstreamHealthchecksActiveGetArgs() { } + public static new UpstreamHealthchecksActiveGetArgs Empty => new UpstreamHealthchecksActiveGetArgs(); } } diff --git a/sdk/dotnet/Inputs/UpstreamHealthchecksActiveHealthyArgs.cs b/sdk/dotnet/Inputs/UpstreamHealthchecksActiveHealthyArgs.cs index 7aec6756..1152e9bf 100644 --- a/sdk/dotnet/Inputs/UpstreamHealthchecksActiveHealthyArgs.cs +++ b/sdk/dotnet/Inputs/UpstreamHealthchecksActiveHealthyArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class UpstreamHealthchecksActiveHealthyArgs : Pulumi.ResourceArgs + public sealed class UpstreamHealthchecksActiveHealthyArgs : global::Pulumi.ResourceArgs { [Input("httpStatuses")] private InputList? _httpStatuses; @@ -29,5 +29,6 @@ public InputList HttpStatuses public UpstreamHealthchecksActiveHealthyArgs() { } + public static new UpstreamHealthchecksActiveHealthyArgs Empty => new UpstreamHealthchecksActiveHealthyArgs(); } } diff --git a/sdk/dotnet/Inputs/UpstreamHealthchecksActiveHealthyGetArgs.cs b/sdk/dotnet/Inputs/UpstreamHealthchecksActiveHealthyGetArgs.cs index 93339260..f515de1a 100644 --- a/sdk/dotnet/Inputs/UpstreamHealthchecksActiveHealthyGetArgs.cs +++ b/sdk/dotnet/Inputs/UpstreamHealthchecksActiveHealthyGetArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class UpstreamHealthchecksActiveHealthyGetArgs : Pulumi.ResourceArgs + public sealed class UpstreamHealthchecksActiveHealthyGetArgs : global::Pulumi.ResourceArgs { [Input("httpStatuses")] private InputList? _httpStatuses; @@ -29,5 +29,6 @@ public InputList HttpStatuses public UpstreamHealthchecksActiveHealthyGetArgs() { } + public static new UpstreamHealthchecksActiveHealthyGetArgs Empty => new UpstreamHealthchecksActiveHealthyGetArgs(); } } diff --git a/sdk/dotnet/Inputs/UpstreamHealthchecksActiveUnhealthyArgs.cs b/sdk/dotnet/Inputs/UpstreamHealthchecksActiveUnhealthyArgs.cs index 66fd55be..f1c68954 100644 --- a/sdk/dotnet/Inputs/UpstreamHealthchecksActiveUnhealthyArgs.cs +++ b/sdk/dotnet/Inputs/UpstreamHealthchecksActiveUnhealthyArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class UpstreamHealthchecksActiveUnhealthyArgs : Pulumi.ResourceArgs + public sealed class UpstreamHealthchecksActiveUnhealthyArgs : global::Pulumi.ResourceArgs { [Input("httpFailures")] public Input? HttpFailures { get; set; } @@ -35,5 +35,6 @@ public InputList HttpStatuses public UpstreamHealthchecksActiveUnhealthyArgs() { } + public static new UpstreamHealthchecksActiveUnhealthyArgs Empty => new UpstreamHealthchecksActiveUnhealthyArgs(); } } diff --git a/sdk/dotnet/Inputs/UpstreamHealthchecksActiveUnhealthyGetArgs.cs b/sdk/dotnet/Inputs/UpstreamHealthchecksActiveUnhealthyGetArgs.cs index 3c311fd2..0e7e99e5 100644 --- a/sdk/dotnet/Inputs/UpstreamHealthchecksActiveUnhealthyGetArgs.cs +++ b/sdk/dotnet/Inputs/UpstreamHealthchecksActiveUnhealthyGetArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class UpstreamHealthchecksActiveUnhealthyGetArgs : Pulumi.ResourceArgs + public sealed class UpstreamHealthchecksActiveUnhealthyGetArgs : global::Pulumi.ResourceArgs { [Input("httpFailures")] public Input? HttpFailures { get; set; } @@ -35,5 +35,6 @@ public InputList HttpStatuses public UpstreamHealthchecksActiveUnhealthyGetArgs() { } + public static new UpstreamHealthchecksActiveUnhealthyGetArgs Empty => new UpstreamHealthchecksActiveUnhealthyGetArgs(); } } diff --git a/sdk/dotnet/Inputs/UpstreamHealthchecksArgs.cs b/sdk/dotnet/Inputs/UpstreamHealthchecksArgs.cs index 83106300..f89bac22 100644 --- a/sdk/dotnet/Inputs/UpstreamHealthchecksArgs.cs +++ b/sdk/dotnet/Inputs/UpstreamHealthchecksArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class UpstreamHealthchecksArgs : Pulumi.ResourceArgs + public sealed class UpstreamHealthchecksArgs : global::Pulumi.ResourceArgs { [Input("active")] public Input? Active { get; set; } @@ -21,5 +21,6 @@ public sealed class UpstreamHealthchecksArgs : Pulumi.ResourceArgs public UpstreamHealthchecksArgs() { } + public static new UpstreamHealthchecksArgs Empty => new UpstreamHealthchecksArgs(); } } diff --git a/sdk/dotnet/Inputs/UpstreamHealthchecksGetArgs.cs b/sdk/dotnet/Inputs/UpstreamHealthchecksGetArgs.cs index 5fa03196..8afca701 100644 --- a/sdk/dotnet/Inputs/UpstreamHealthchecksGetArgs.cs +++ b/sdk/dotnet/Inputs/UpstreamHealthchecksGetArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class UpstreamHealthchecksGetArgs : Pulumi.ResourceArgs + public sealed class UpstreamHealthchecksGetArgs : global::Pulumi.ResourceArgs { [Input("active")] public Input? Active { get; set; } @@ -21,5 +21,6 @@ public sealed class UpstreamHealthchecksGetArgs : Pulumi.ResourceArgs public UpstreamHealthchecksGetArgs() { } + public static new UpstreamHealthchecksGetArgs Empty => new UpstreamHealthchecksGetArgs(); } } diff --git a/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveArgs.cs b/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveArgs.cs index 67b13454..99a7d9c5 100644 --- a/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveArgs.cs +++ b/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class UpstreamHealthchecksPassiveArgs : Pulumi.ResourceArgs + public sealed class UpstreamHealthchecksPassiveArgs : global::Pulumi.ResourceArgs { [Input("healthy")] public Input? Healthy { get; set; } @@ -24,5 +24,6 @@ public sealed class UpstreamHealthchecksPassiveArgs : Pulumi.ResourceArgs public UpstreamHealthchecksPassiveArgs() { } + public static new UpstreamHealthchecksPassiveArgs Empty => new UpstreamHealthchecksPassiveArgs(); } } diff --git a/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveGetArgs.cs b/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveGetArgs.cs index 8106c3a4..dc55e111 100644 --- a/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveGetArgs.cs +++ b/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveGetArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class UpstreamHealthchecksPassiveGetArgs : Pulumi.ResourceArgs + public sealed class UpstreamHealthchecksPassiveGetArgs : global::Pulumi.ResourceArgs { [Input("healthy")] public Input? Healthy { get; set; } @@ -24,5 +24,6 @@ public sealed class UpstreamHealthchecksPassiveGetArgs : Pulumi.ResourceArgs public UpstreamHealthchecksPassiveGetArgs() { } + public static new UpstreamHealthchecksPassiveGetArgs Empty => new UpstreamHealthchecksPassiveGetArgs(); } } diff --git a/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveHealthyArgs.cs b/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveHealthyArgs.cs index ece57a0c..7b6e8d83 100644 --- a/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveHealthyArgs.cs +++ b/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveHealthyArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class UpstreamHealthchecksPassiveHealthyArgs : Pulumi.ResourceArgs + public sealed class UpstreamHealthchecksPassiveHealthyArgs : global::Pulumi.ResourceArgs { [Input("httpStatuses")] private InputList? _httpStatuses; @@ -26,5 +26,6 @@ public InputList HttpStatuses public UpstreamHealthchecksPassiveHealthyArgs() { } + public static new UpstreamHealthchecksPassiveHealthyArgs Empty => new UpstreamHealthchecksPassiveHealthyArgs(); } } diff --git a/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveHealthyGetArgs.cs b/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveHealthyGetArgs.cs index bfe67a54..bb8b51c1 100644 --- a/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveHealthyGetArgs.cs +++ b/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveHealthyGetArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class UpstreamHealthchecksPassiveHealthyGetArgs : Pulumi.ResourceArgs + public sealed class UpstreamHealthchecksPassiveHealthyGetArgs : global::Pulumi.ResourceArgs { [Input("httpStatuses")] private InputList? _httpStatuses; @@ -26,5 +26,6 @@ public InputList HttpStatuses public UpstreamHealthchecksPassiveHealthyGetArgs() { } + public static new UpstreamHealthchecksPassiveHealthyGetArgs Empty => new UpstreamHealthchecksPassiveHealthyGetArgs(); } } diff --git a/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveUnhealthyArgs.cs b/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveUnhealthyArgs.cs index 7363b418..e9d323f0 100644 --- a/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveUnhealthyArgs.cs +++ b/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveUnhealthyArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class UpstreamHealthchecksPassiveUnhealthyArgs : Pulumi.ResourceArgs + public sealed class UpstreamHealthchecksPassiveUnhealthyArgs : global::Pulumi.ResourceArgs { [Input("httpFailures")] public Input? HttpFailures { get; set; } @@ -32,5 +32,6 @@ public InputList HttpStatuses public UpstreamHealthchecksPassiveUnhealthyArgs() { } + public static new UpstreamHealthchecksPassiveUnhealthyArgs Empty => new UpstreamHealthchecksPassiveUnhealthyArgs(); } } diff --git a/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveUnhealthyGetArgs.cs b/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveUnhealthyGetArgs.cs index 679f8712..805d55a1 100644 --- a/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveUnhealthyGetArgs.cs +++ b/sdk/dotnet/Inputs/UpstreamHealthchecksPassiveUnhealthyGetArgs.cs @@ -10,7 +10,7 @@ namespace Pulumi.Kong.Inputs { - public sealed class UpstreamHealthchecksPassiveUnhealthyGetArgs : Pulumi.ResourceArgs + public sealed class UpstreamHealthchecksPassiveUnhealthyGetArgs : global::Pulumi.ResourceArgs { [Input("httpFailures")] public Input? HttpFailures { get; set; } @@ -32,5 +32,6 @@ public InputList HttpStatuses public UpstreamHealthchecksPassiveUnhealthyGetArgs() { } + public static new UpstreamHealthchecksPassiveUnhealthyGetArgs Empty => new UpstreamHealthchecksPassiveUnhealthyGetArgs(); } } diff --git a/sdk/dotnet/Plugin.cs b/sdk/dotnet/Plugin.cs index d45da583..a89ac36f 100644 --- a/sdk/dotnet/Plugin.cs +++ b/sdk/dotnet/Plugin.cs @@ -18,115 +18,114 @@ namespace Pulumi.Kong /// ## Example Usage /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var rateLimit = new Kong.Plugin("rateLimit", new() /// { - /// var rateLimit = new Kong.Plugin("rateLimit", new Kong.PluginArgs - /// { - /// ConfigJson = @" { + /// ConfigJson = @" { /// ""second"": 5, /// ""hour"" : 1000 /// } /// /// ", - /// }); - /// } + /// }); /// - /// } + /// }); /// ``` /// To apply a plugin to a consumer use the `consumer_id` property, for example: /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var pluginConsumer = new Kong.Consumer("pluginConsumer", new() /// { - /// var pluginConsumer = new Kong.Consumer("pluginConsumer", new Kong.ConsumerArgs - /// { - /// CustomId = "567", - /// Username = "PluginUser", - /// }); - /// var rateLimit = new Kong.Plugin("rateLimit", new Kong.PluginArgs - /// { - /// ConfigJson = @" { + /// CustomId = "567", + /// Username = "PluginUser", + /// }); + /// + /// var rateLimit = new Kong.Plugin("rateLimit", new() + /// { + /// ConfigJson = @" { /// ""second"": 5, /// ""hour"" : 1000 /// } /// /// ", - /// ConsumerId = pluginConsumer.Id, - /// }); - /// } + /// ConsumerId = pluginConsumer.Id, + /// }); /// - /// } + /// }); /// ``` /// /// To apply a plugin to a service use the `service_id` property, for example: /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var service = new Kong.Service("service", new() + /// { + /// Host = "test.org", + /// Protocol = "http", + /// }); + /// + /// var rateLimit = new Kong.Plugin("rateLimit", new() /// { - /// var service = new Kong.Service("service", new Kong.ServiceArgs - /// { - /// Host = "test.org", - /// Protocol = "http", - /// }); - /// var rateLimit = new Kong.Plugin("rateLimit", new Kong.PluginArgs - /// { - /// ConfigJson = @" { + /// ConfigJson = @" { /// ""second"": 10, /// ""hour"" : 2000 /// } /// /// ", - /// ServiceId = service.Id, - /// }); - /// } + /// ServiceId = service.Id, + /// }); /// - /// } + /// }); /// ``` /// /// To apply a plugin to a route use the `route_id` property, for example: /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var service = new Kong.Service("service", new() + /// { + /// Host = "test.org", + /// Protocol = "http", + /// }); + /// + /// var rateLimit = new Kong.Plugin("rateLimit", new() /// { - /// var service = new Kong.Service("service", new Kong.ServiceArgs - /// { - /// Host = "test.org", - /// Protocol = "http", - /// }); - /// var rateLimit = new Kong.Plugin("rateLimit", new Kong.PluginArgs - /// { - /// ConfigJson = @" { + /// ConfigJson = @" { /// ""second"": 11, /// ""hour"" : 4000 /// } /// /// ", - /// Enabled = true, - /// ServiceId = service.Id, - /// }); - /// } + /// Enabled = true, + /// ServiceId = service.Id, + /// }); /// - /// } + /// }); /// ``` /// /// ## Import @@ -138,7 +137,7 @@ namespace Pulumi.Kong /// ``` /// [KongResourceType("kong:index/plugin:Plugin")] - public partial class Plugin : Pulumi.CustomResource + public partial class Plugin : global::Pulumi.CustomResource { [Output("computedConfig")] public Output ComputedConfig { get; private set; } = null!; @@ -230,7 +229,7 @@ public static Plugin Get(string name, Input id, PluginState? state = nul } } - public sealed class PluginArgs : Pulumi.ResourceArgs + public sealed class PluginArgs : global::Pulumi.ResourceArgs { /// /// this is the configuration json for how you want to configure the plugin. The json is passed straight through to kong as is. You can get the json config from the Kong documentation @@ -284,9 +283,10 @@ public InputList Tags public PluginArgs() { } + public static new PluginArgs Empty => new PluginArgs(); } - public sealed class PluginState : Pulumi.ResourceArgs + public sealed class PluginState : global::Pulumi.ResourceArgs { [Input("computedConfig")] public Input? ComputedConfig { get; set; } @@ -343,5 +343,6 @@ public InputList Tags public PluginState() { } + public static new PluginState Empty => new PluginState(); } } diff --git a/sdk/dotnet/Provider.cs b/sdk/dotnet/Provider.cs index 8981fda7..64aec711 100644 --- a/sdk/dotnet/Provider.cs +++ b/sdk/dotnet/Provider.cs @@ -16,7 +16,7 @@ namespace Pulumi.Kong /// [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information. /// [KongResourceType("pulumi:providers:kong")] - public partial class Provider : Pulumi.ProviderResource + public partial class Provider : global::Pulumi.ProviderResource { /// /// An basic auth password for kong admin @@ -80,7 +80,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? } } - public sealed class ProviderArgs : Pulumi.ResourceArgs + public sealed class ProviderArgs : global::Pulumi.ResourceArgs { /// /// An basic auth password for kong admin @@ -135,5 +135,6 @@ public ProviderArgs() StrictPluginsMatch = Utilities.GetEnvBoolean("STRICT_PLUGINS_MATCH"); TlsSkipVerify = Utilities.GetEnvBoolean("TLS_SKIP_VERIFY") ?? false; } + public static new ProviderArgs Empty => new ProviderArgs(); } } diff --git a/sdk/dotnet/Pulumi.Kong.csproj b/sdk/dotnet/Pulumi.Kong.csproj index bfb481cb..e3909842 100644 --- a/sdk/dotnet/Pulumi.Kong.csproj +++ b/sdk/dotnet/Pulumi.Kong.csproj @@ -10,9 +10,8 @@ https://github.com/pulumi/pulumi-kong logo.png - netcoreapp3.1 + net6.0 enable - false @@ -39,7 +38,7 @@ - + diff --git a/sdk/dotnet/Route.cs b/sdk/dotnet/Route.cs index db5d1de4..1b8c0f6c 100644 --- a/sdk/dotnet/Route.cs +++ b/sdk/dotnet/Route.cs @@ -19,102 +19,100 @@ namespace Pulumi.Kong /// ## Example Usage /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var route = new Kong.Route("route", new() /// { - /// var route = new Kong.Route("route", new Kong.RouteArgs + /// Protocols = new[] /// { - /// Protocols = - /// { - /// "http", - /// "https", - /// }, - /// Methods = - /// { - /// "GET", - /// "POST", - /// }, - /// Hosts = - /// { - /// "example2.com", - /// }, - /// Paths = - /// { - /// "/test", - /// }, - /// StripPath = false, - /// PreserveHost = true, - /// RegexPriority = 1, - /// ServiceId = kong_service.Service.Id, - /// Headers = + /// "http", + /// "https", + /// }, + /// Methods = new[] + /// { + /// "GET", + /// "POST", + /// }, + /// Hosts = new[] + /// { + /// "example2.com", + /// }, + /// Paths = new[] + /// { + /// "/test", + /// }, + /// StripPath = false, + /// PreserveHost = true, + /// RegexPriority = 1, + /// ServiceId = kong_service.Service.Id, + /// Headers = new[] + /// { + /// new Kong.Inputs.RouteHeaderArgs /// { - /// new Kong.Inputs.RouteHeaderArgs + /// Name = "x-test-1", + /// Values = new[] /// { - /// Name = "x-test-1", - /// Values = - /// { - /// "a", - /// "b", - /// }, + /// "a", + /// "b", /// }, /// }, - /// }); - /// } + /// }, + /// }); /// - /// } + /// }); /// ``` /// /// To create a tcp/tls route you set `sources` and `destinations` by repeating the corresponding element (`source` or `destination`) for each source or destination you want, for example: /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var route = new Kong.Route("route", new() /// { - /// var route = new Kong.Route("route", new Kong.RouteArgs + /// Protocols = new[] /// { - /// Protocols = + /// "tcp", + /// }, + /// StripPath = true, + /// PreserveHost = false, + /// Sources = new[] + /// { + /// new Kong.Inputs.RouteSourceArgs /// { - /// "tcp", + /// Ip = "192.168.1.1", + /// Port = 80, /// }, - /// StripPath = true, - /// PreserveHost = false, - /// Sources = + /// new Kong.Inputs.RouteSourceArgs /// { - /// new Kong.Inputs.RouteSourceArgs - /// { - /// Ip = "192.168.1.1", - /// Port = 80, - /// }, - /// new Kong.Inputs.RouteSourceArgs - /// { - /// Ip = "192.168.1.2", - /// }, + /// Ip = "192.168.1.2", /// }, - /// Destinations = - /// { - /// new Kong.Inputs.RouteDestinationArgs - /// { - /// Ip = "172.10.1.1", - /// Port = 81, - /// }, - /// }, - /// Snis = + /// }, + /// Destinations = new[] + /// { + /// new Kong.Inputs.RouteDestinationArgs /// { - /// "foo.com", + /// Ip = "172.10.1.1", + /// Port = 81, /// }, - /// ServiceId = kong_service.Service.Id, - /// }); - /// } + /// }, + /// Snis = new[] + /// { + /// "foo.com", + /// }, + /// ServiceId = kong_service.Service.Id, + /// }); /// - /// } + /// }); /// ``` /// /// ## Import @@ -126,7 +124,7 @@ namespace Pulumi.Kong /// ``` /// [KongResourceType("kong:index/route:Route")] - public partial class Route : Pulumi.CustomResource + public partial class Route : global::Pulumi.CustomResource { /// /// A list of destination `ip` and `port` @@ -280,7 +278,7 @@ public static Route Get(string name, Input id, RouteState? state = null, } } - public sealed class RouteArgs : Pulumi.ResourceArgs + public sealed class RouteArgs : global::Pulumi.ResourceArgs { [Input("destinations")] private InputList? _destinations; @@ -447,9 +445,10 @@ public InputList Tags public RouteArgs() { } + public static new RouteArgs Empty => new RouteArgs(); } - public sealed class RouteState : Pulumi.ResourceArgs + public sealed class RouteState : global::Pulumi.ResourceArgs { [Input("destinations")] private InputList? _destinations; @@ -616,5 +615,6 @@ public InputList Tags public RouteState() { } + public static new RouteState Empty => new RouteState(); } } diff --git a/sdk/dotnet/Service.cs b/sdk/dotnet/Service.cs index 86b20426..5343e373 100644 --- a/sdk/dotnet/Service.cs +++ b/sdk/dotnet/Service.cs @@ -17,84 +17,84 @@ namespace Pulumi.Kong /// ## Example Usage /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var service = new Kong.Service("service", new() /// { - /// var service = new Kong.Service("service", new Kong.ServiceArgs - /// { - /// ConnectTimeout = 1000, - /// Host = "test.org", - /// Path = "/mypath", - /// Port = 8080, - /// Protocol = "http", - /// ReadTimeout = 3000, - /// Retries = 5, - /// WriteTimeout = 2000, - /// }); - /// } + /// ConnectTimeout = 1000, + /// Host = "test.org", + /// Path = "/mypath", + /// Port = 8080, + /// Protocol = "http", + /// ReadTimeout = 3000, + /// Retries = 5, + /// WriteTimeout = 2000, + /// }); /// - /// } + /// }); /// ``` /// /// To use a client certificate and ca certificates combine with certificate resource (note protocol must be `https`): /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var certificate = new Kong.Certificate("certificate", new() /// { - /// var certificate = new Kong.Certificate("certificate", new Kong.CertificateArgs - /// { - /// Certificate = @" -----BEGIN CERTIFICATE----- + /// Cert = @" -----BEGIN CERTIFICATE----- /// ...... /// -----END CERTIFICATE----- /// ", - /// PrivateKey = @" -----BEGIN PRIVATE KEY----- + /// PrivateKey = @" -----BEGIN PRIVATE KEY----- /// ..... /// -----END PRIVATE KEY----- /// ", - /// Snis = - /// { - /// "foo.com", - /// }, - /// }); - /// var ca = new Kong.Certificate("ca", new Kong.CertificateArgs + /// Snis = new[] /// { - /// Certificate = @" -----BEGIN CERTIFICATE----- + /// "foo.com", + /// }, + /// }); + /// + /// var ca = new Kong.Certificate("ca", new() + /// { + /// Cert = @" -----BEGIN CERTIFICATE----- /// ...... /// -----END CERTIFICATE----- /// ", - /// PrivateKey = @" -----BEGIN PRIVATE KEY----- + /// PrivateKey = @" -----BEGIN PRIVATE KEY----- /// ..... /// -----END PRIVATE KEY----- /// ", - /// Snis = - /// { - /// "ca.com", - /// }, - /// }); - /// var service = new Kong.Service("service", new Kong.ServiceArgs + /// Snis = new[] + /// { + /// "ca.com", + /// }, + /// }); + /// + /// var service = new Kong.Service("service", new() + /// { + /// Protocol = "https", + /// Host = "test.org", + /// TlsVerify = true, + /// TlsVerifyDepth = 2, + /// ClientCertificateId = certificate.Id, + /// CaCertificateIds = new[] /// { - /// Protocol = "https", - /// Host = "test.org", - /// TlsVerify = true, - /// TlsVerifyDepth = 2, - /// ClientCertificateId = certificate.Id, - /// CaCertificateIds = - /// { - /// ca.Id, - /// }, - /// }); - /// } + /// ca.Id, + /// }, + /// }); /// - /// } + /// }); /// ``` /// /// ## Import @@ -106,7 +106,7 @@ namespace Pulumi.Kong /// ``` /// [KongResourceType("kong:index/service:Service")] - public partial class Service : Pulumi.CustomResource + public partial class Service : global::Pulumi.CustomResource { /// /// A of CA Certificate IDs (created from the certificate resource). that are used to build the trust store while verifying upstream server’s TLS certificate. @@ -236,7 +236,7 @@ public static Service Get(string name, Input id, ServiceState? state = n } } - public sealed class ServiceArgs : Pulumi.ResourceArgs + public sealed class ServiceArgs : global::Pulumi.ResourceArgs { [Input("caCertificateIds")] private InputList? _caCertificateIds; @@ -337,9 +337,10 @@ public InputList Tags public ServiceArgs() { } + public static new ServiceArgs Empty => new ServiceArgs(); } - public sealed class ServiceState : Pulumi.ResourceArgs + public sealed class ServiceState : global::Pulumi.ResourceArgs { [Input("caCertificateIds")] private InputList? _caCertificateIds; @@ -440,5 +441,6 @@ public InputList Tags public ServiceState() { } + public static new ServiceState Empty => new ServiceState(); } } diff --git a/sdk/dotnet/Target.cs b/sdk/dotnet/Target.cs index 05d51539..2893f299 100644 --- a/sdk/dotnet/Target.cs +++ b/sdk/dotnet/Target.cs @@ -13,22 +13,21 @@ namespace Pulumi.Kong /// ## Example Usage /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var target = new Kong.Target("target", new() /// { - /// var target = new Kong.Target("target", new Kong.TargetArgs - /// { - /// Target = "sample_target:80", - /// UpstreamId = kong_upstream.Upstream.Id, - /// Weight = 10, - /// }); - /// } + /// TargetAddress = "sample_target:80", + /// UpstreamId = kong_upstream.Upstream.Id, + /// Weight = 10, + /// }); /// - /// } + /// }); /// ``` /// /// ## Import @@ -40,7 +39,7 @@ namespace Pulumi.Kong /// ``` /// [KongResourceType("kong:index/target:Target")] - public partial class Target : Pulumi.CustomResource + public partial class Target : global::Pulumi.CustomResource { /// /// A list set of strings associated with the Plugin for grouping and filtering @@ -110,7 +109,7 @@ public static Target Get(string name, Input id, TargetState? state = nul } } - public sealed class TargetArgs : Pulumi.ResourceArgs + public sealed class TargetArgs : global::Pulumi.ResourceArgs { [Input("tags")] private InputList? _tags; @@ -145,9 +144,10 @@ public InputList Tags public TargetArgs() { } + public static new TargetArgs Empty => new TargetArgs(); } - public sealed class TargetState : Pulumi.ResourceArgs + public sealed class TargetState : global::Pulumi.ResourceArgs { [Input("tags")] private InputList? _tags; @@ -182,5 +182,6 @@ public InputList Tags public TargetState() { } + public static new TargetState Empty => new TargetState(); } } diff --git a/sdk/dotnet/Upstream.cs b/sdk/dotnet/Upstream.cs index fef9afbe..5db64616 100644 --- a/sdk/dotnet/Upstream.cs +++ b/sdk/dotnet/Upstream.cs @@ -13,108 +13,108 @@ namespace Pulumi.Kong /// ## Example Usage /// /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; /// using Pulumi; /// using Kong = Pulumi.Kong; /// - /// class MyStack : Stack + /// return await Deployment.RunAsync(() => /// { - /// public MyStack() + /// var certificate = new Kong.Certificate("certificate", new() /// { - /// var certificate = new Kong.Certificate("certificate", new Kong.CertificateArgs - /// { - /// Certificate = @" -----BEGIN CERTIFICATE----- + /// Cert = @" -----BEGIN CERTIFICATE----- /// ...... /// -----END CERTIFICATE----- /// ", - /// PrivateKey = @" -----BEGIN PRIVATE KEY----- + /// PrivateKey = @" -----BEGIN PRIVATE KEY----- /// ..... /// -----END PRIVATE KEY----- /// ", - /// Snis = - /// { - /// "foo.com", - /// }, - /// }); - /// var upstream = new Kong.Upstream("upstream", new Kong.UpstreamArgs + /// Snis = new[] /// { - /// Slots = 10, - /// HashOn = "header", - /// HashFallback = "cookie", - /// HashOnHeader = "HeaderName", - /// HashFallbackHeader = "FallbackHeaderName", - /// HashOnCookie = "CookieName", - /// HashOnCookiePath = "/path", - /// HostHeader = "x-host", - /// Tags = - /// { - /// "a", - /// "b", - /// }, - /// ClientCertificateId = certificate.Id, - /// Healthchecks = new Kong.Inputs.UpstreamHealthchecksArgs + /// "foo.com", + /// }, + /// }); + /// + /// var upstream = new Kong.Upstream("upstream", new() + /// { + /// Slots = 10, + /// HashOn = "header", + /// HashFallback = "cookie", + /// HashOnHeader = "HeaderName", + /// HashFallbackHeader = "FallbackHeaderName", + /// HashOnCookie = "CookieName", + /// HashOnCookiePath = "/path", + /// HostHeader = "x-host", + /// Tags = new[] + /// { + /// "a", + /// "b", + /// }, + /// ClientCertificateId = certificate.Id, + /// Healthchecks = new Kong.Inputs.UpstreamHealthchecksArgs + /// { + /// Active = new Kong.Inputs.UpstreamHealthchecksActiveArgs /// { - /// Active = new Kong.Inputs.UpstreamHealthchecksActiveArgs + /// Type = "https", + /// HttpPath = "/status", + /// Timeout = 10, + /// Concurrency = 20, + /// HttpsVerifyCertificate = false, + /// HttpsSni = "some.domain.com", + /// Healthy = new Kong.Inputs.UpstreamHealthchecksActiveHealthyArgs /// { - /// Type = "https", - /// HttpPath = "/status", - /// Timeout = 10, - /// Concurrency = 20, - /// HttpsVerifyCertificate = false, - /// HttpsSni = "some.domain.com", - /// Healthy = new Kong.Inputs.UpstreamHealthchecksActiveHealthyArgs + /// Successes = 1, + /// Interval = 5, + /// HttpStatuses = new[] /// { - /// Successes = 1, - /// Interval = 5, - /// HttpStatuses = - /// { - /// 200, - /// 201, - /// }, + /// 200, + /// 201, /// }, - /// Unhealthy = new Kong.Inputs.UpstreamHealthchecksActiveUnhealthyArgs + /// }, + /// Unhealthy = new Kong.Inputs.UpstreamHealthchecksActiveUnhealthyArgs + /// { + /// Timeouts = 7, + /// Interval = 3, + /// TcpFailures = 1, + /// HttpFailures = 2, + /// HttpStatuses = new[] /// { - /// Timeouts = 7, - /// Interval = 3, - /// TcpFailures = 1, - /// HttpFailures = 2, - /// HttpStatuses = - /// { - /// 500, - /// 501, - /// }, + /// 500, + /// 501, /// }, /// }, - /// Passive = new Kong.Inputs.UpstreamHealthchecksPassiveArgs + /// }, + /// Passive = new Kong.Inputs.UpstreamHealthchecksPassiveArgs + /// { + /// Type = "https", + /// Healthy = new Kong.Inputs.UpstreamHealthchecksPassiveHealthyArgs /// { - /// Type = "https", - /// Healthy = new Kong.Inputs.UpstreamHealthchecksPassiveHealthyArgs + /// Successes = 1, + /// HttpStatuses = new[] /// { - /// Successes = 1, - /// HttpStatuses = - /// { - /// 200, - /// 201, - /// 202, - /// }, + /// 200, + /// 201, + /// 202, /// }, - /// Unhealthy = new Kong.Inputs.UpstreamHealthchecksPassiveUnhealthyArgs + /// }, + /// Unhealthy = new Kong.Inputs.UpstreamHealthchecksPassiveUnhealthyArgs + /// { + /// Timeouts = 3, + /// TcpFailures = 5, + /// HttpFailures = 6, + /// HttpStatuses = new[] /// { - /// Timeouts = 3, - /// TcpFailures = 5, - /// HttpFailures = 6, - /// HttpStatuses = - /// { - /// 500, - /// 501, - /// 502, - /// }, + /// 500, + /// 501, + /// 502, /// }, /// }, /// }, - /// }); - /// } + /// }, + /// }); /// - /// } + /// }); /// ``` /// /// ## Import @@ -126,7 +126,7 @@ namespace Pulumi.Kong /// ``` /// [KongResourceType("kong:index/upstream:Upstream")] - public partial class Upstream : Pulumi.CustomResource + public partial class Upstream : global::Pulumi.CustomResource { /// /// The ID of the client certificate to use (from certificate resource) while TLS handshaking to the upstream server. @@ -262,7 +262,7 @@ public static Upstream Get(string name, Input id, UpstreamState? state = } } - public sealed class UpstreamArgs : Pulumi.ResourceArgs + public sealed class UpstreamArgs : global::Pulumi.ResourceArgs { /// /// The ID of the client certificate to use (from certificate resource) while TLS handshaking to the upstream server. @@ -363,9 +363,10 @@ public InputList Tags public UpstreamArgs() { } + public static new UpstreamArgs Empty => new UpstreamArgs(); } - public sealed class UpstreamState : Pulumi.ResourceArgs + public sealed class UpstreamState : global::Pulumi.ResourceArgs { /// /// The ID of the client certificate to use (from certificate resource) while TLS handshaking to the upstream server. @@ -466,5 +467,6 @@ public InputList Tags public UpstreamState() { } + public static new UpstreamState Empty => new UpstreamState(); } } diff --git a/sdk/dotnet/Utilities.cs b/sdk/dotnet/Utilities.cs index 8c0e1d51..b954f3c6 100644 --- a/sdk/dotnet/Utilities.cs +++ b/sdk/dotnet/Utilities.cs @@ -74,7 +74,7 @@ static Utilities() } } - internal sealed class KongResourceTypeAttribute : Pulumi.ResourceTypeAttribute + internal sealed class KongResourceTypeAttribute : global::Pulumi.ResourceTypeAttribute { public KongResourceTypeAttribute(string type) : base(type, Utilities.Version) { diff --git a/sdk/go.mod b/sdk/go.mod index 9559e66b..6fd28c2b 100644 --- a/sdk/go.mod +++ b/sdk/go.mod @@ -4,7 +4,6 @@ go 1.21 require ( github.com/blang/semver v3.5.1+incompatible - github.com/pkg/errors v0.9.1 github.com/pulumi/pulumi/sdk/v3 v3.81.0 ) @@ -52,6 +51,7 @@ require ( github.com/opentracing/basictracer-go v1.1.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect + github.com/pkg/errors v0.9.1 // indirect github.com/pkg/term v1.1.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/rogpeppe/go-internal v1.9.0 // indirect diff --git a/sdk/go/kong/certificate.go b/sdk/go/kong/certificate.go index b1185557..4cf3dcb6 100644 --- a/sdk/go/kong/certificate.go +++ b/sdk/go/kong/certificate.go @@ -7,8 +7,10 @@ import ( "context" "reflect" - "github.com/pkg/errors" + "errors" + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) // ## # Certificate @@ -80,6 +82,14 @@ func NewCertificate(ctx *pulumi.Context, if args.Certificate == nil { return nil, errors.New("invalid value for required argument 'Certificate'") } + if args.PrivateKey != nil { + args.PrivateKey = pulumi.ToSecret(args.PrivateKey).(pulumi.StringPtrInput) + } + secrets := pulumi.AdditionalSecretOutputs([]string{ + "privateKey", + }) + opts = append(opts, secrets) + opts = internal.PkgResourceDefaultOpts(opts) var resource Certificate err := ctx.RegisterResource("kong:index/certificate:Certificate", name, args, &resource, opts...) if err != nil { @@ -169,6 +179,12 @@ func (i *Certificate) ToCertificateOutputWithContext(ctx context.Context) Certif return pulumi.ToOutputWithContext(ctx, i).(CertificateOutput) } +func (i *Certificate) ToOutput(ctx context.Context) pulumix.Output[*Certificate] { + return pulumix.Output[*Certificate]{ + OutputState: i.ToCertificateOutputWithContext(ctx).OutputState, + } +} + // CertificateArrayInput is an input type that accepts CertificateArray and CertificateArrayOutput values. // You can construct a concrete instance of `CertificateArrayInput` via: // @@ -194,6 +210,12 @@ func (i CertificateArray) ToCertificateArrayOutputWithContext(ctx context.Contex return pulumi.ToOutputWithContext(ctx, i).(CertificateArrayOutput) } +func (i CertificateArray) ToOutput(ctx context.Context) pulumix.Output[[]*Certificate] { + return pulumix.Output[[]*Certificate]{ + OutputState: i.ToCertificateArrayOutputWithContext(ctx).OutputState, + } +} + // CertificateMapInput is an input type that accepts CertificateMap and CertificateMapOutput values. // You can construct a concrete instance of `CertificateMapInput` via: // @@ -219,6 +241,12 @@ func (i CertificateMap) ToCertificateMapOutputWithContext(ctx context.Context) C return pulumi.ToOutputWithContext(ctx, i).(CertificateMapOutput) } +func (i CertificateMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*Certificate] { + return pulumix.Output[map[string]*Certificate]{ + OutputState: i.ToCertificateMapOutputWithContext(ctx).OutputState, + } +} + type CertificateOutput struct{ *pulumi.OutputState } func (CertificateOutput) ElementType() reflect.Type { @@ -233,6 +261,31 @@ func (o CertificateOutput) ToCertificateOutputWithContext(ctx context.Context) C return o } +func (o CertificateOutput) ToOutput(ctx context.Context) pulumix.Output[*Certificate] { + return pulumix.Output[*Certificate]{ + OutputState: o.OutputState, + } +} + +// should be the public key of your certificate it is mapped to the `Cert` parameter on the Kong API. +func (o CertificateOutput) Certificate() pulumi.StringOutput { + return o.ApplyT(func(v *Certificate) pulumi.StringOutput { return v.Certificate }).(pulumi.StringOutput) +} + +// should be the private key of your certificate it is mapped to the `Key` parameter on the Kong API. +func (o CertificateOutput) PrivateKey() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Certificate) pulumi.StringPtrOutput { return v.PrivateKey }).(pulumi.StringPtrOutput) +} + +// A list of strings associated with the Certificate for grouping and filtering +func (o CertificateOutput) Snis() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Certificate) pulumi.StringArrayOutput { return v.Snis }).(pulumi.StringArrayOutput) +} + +func (o CertificateOutput) Tags() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Certificate) pulumi.StringArrayOutput { return v.Tags }).(pulumi.StringArrayOutput) +} + type CertificateArrayOutput struct{ *pulumi.OutputState } func (CertificateArrayOutput) ElementType() reflect.Type { @@ -247,6 +300,12 @@ func (o CertificateArrayOutput) ToCertificateArrayOutputWithContext(ctx context. return o } +func (o CertificateArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*Certificate] { + return pulumix.Output[[]*Certificate]{ + OutputState: o.OutputState, + } +} + func (o CertificateArrayOutput) Index(i pulumi.IntInput) CertificateOutput { return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Certificate { return vs[0].([]*Certificate)[vs[1].(int)] @@ -267,6 +326,12 @@ func (o CertificateMapOutput) ToCertificateMapOutputWithContext(ctx context.Cont return o } +func (o CertificateMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*Certificate] { + return pulumix.Output[map[string]*Certificate]{ + OutputState: o.OutputState, + } +} + func (o CertificateMapOutput) MapIndex(k pulumi.StringInput) CertificateOutput { return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Certificate { return vs[0].(map[string]*Certificate)[vs[1].(string)] diff --git a/sdk/go/kong/config/config.go b/sdk/go/kong/config/config.go index 4360b7b3..b4cb8746 100644 --- a/sdk/go/kong/config/config.go +++ b/sdk/go/kong/config/config.go @@ -4,10 +4,13 @@ package config import ( + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" ) +var _ = internal.GetEnvOrDefault + // An basic auth password for kong admin func GetKongAdminPassword(ctx *pulumi.Context) string { return config.Get(ctx, "kong:kongAdminPassword") @@ -44,7 +47,11 @@ func GetStrictPluginsMatch(ctx *pulumi.Context) bool { if err == nil { return v } - return getEnvOrDefault(false, parseEnvBool, "STRICT_PLUGINS_MATCH").(bool) + var value bool + if d := internal.GetEnvOrDefault(nil, internal.ParseEnvBool, "STRICT_PLUGINS_MATCH"); d != nil { + value = d.(bool) + } + return value } // Whether to skip tls verify for https kong api endpoint using self signed or untrusted certs @@ -53,5 +60,9 @@ func GetTlsSkipVerify(ctx *pulumi.Context) bool { if err == nil { return v } - return getEnvOrDefault(false, parseEnvBool, "TLS_SKIP_VERIFY").(bool) + var value bool + if d := internal.GetEnvOrDefault(false, internal.ParseEnvBool, "TLS_SKIP_VERIFY"); d != nil { + value = d.(bool) + } + return value } diff --git a/sdk/go/kong/consumer.go b/sdk/go/kong/consumer.go index c4cea01d..a8149822 100644 --- a/sdk/go/kong/consumer.go +++ b/sdk/go/kong/consumer.go @@ -7,7 +7,9 @@ import ( "context" "reflect" + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) // ## # Consumer @@ -71,6 +73,7 @@ func NewConsumer(ctx *pulumi.Context, args = &ConsumerArgs{} } + opts = internal.PkgResourceDefaultOpts(opts) var resource Consumer err := ctx.RegisterResource("kong:index/consumer:Consumer", name, args, &resource, opts...) if err != nil { @@ -156,6 +159,12 @@ func (i *Consumer) ToConsumerOutputWithContext(ctx context.Context) ConsumerOutp return pulumi.ToOutputWithContext(ctx, i).(ConsumerOutput) } +func (i *Consumer) ToOutput(ctx context.Context) pulumix.Output[*Consumer] { + return pulumix.Output[*Consumer]{ + OutputState: i.ToConsumerOutputWithContext(ctx).OutputState, + } +} + // ConsumerArrayInput is an input type that accepts ConsumerArray and ConsumerArrayOutput values. // You can construct a concrete instance of `ConsumerArrayInput` via: // @@ -181,6 +190,12 @@ func (i ConsumerArray) ToConsumerArrayOutputWithContext(ctx context.Context) Con return pulumi.ToOutputWithContext(ctx, i).(ConsumerArrayOutput) } +func (i ConsumerArray) ToOutput(ctx context.Context) pulumix.Output[[]*Consumer] { + return pulumix.Output[[]*Consumer]{ + OutputState: i.ToConsumerArrayOutputWithContext(ctx).OutputState, + } +} + // ConsumerMapInput is an input type that accepts ConsumerMap and ConsumerMapOutput values. // You can construct a concrete instance of `ConsumerMapInput` via: // @@ -206,6 +221,12 @@ func (i ConsumerMap) ToConsumerMapOutputWithContext(ctx context.Context) Consume return pulumi.ToOutputWithContext(ctx, i).(ConsumerMapOutput) } +func (i ConsumerMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*Consumer] { + return pulumix.Output[map[string]*Consumer]{ + OutputState: i.ToConsumerMapOutputWithContext(ctx).OutputState, + } +} + type ConsumerOutput struct{ *pulumi.OutputState } func (ConsumerOutput) ElementType() reflect.Type { @@ -220,6 +241,27 @@ func (o ConsumerOutput) ToConsumerOutputWithContext(ctx context.Context) Consume return o } +func (o ConsumerOutput) ToOutput(ctx context.Context) pulumix.Output[*Consumer] { + return pulumix.Output[*Consumer]{ + OutputState: o.OutputState, + } +} + +// A custom id for the consumer, you must set either the username or custom_id +func (o ConsumerOutput) CustomId() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Consumer) pulumi.StringPtrOutput { return v.CustomId }).(pulumi.StringPtrOutput) +} + +// A list of strings associated with the Consumer for grouping and filtering +func (o ConsumerOutput) Tags() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Consumer) pulumi.StringArrayOutput { return v.Tags }).(pulumi.StringArrayOutput) +} + +// The username to use, you must set either the username or custom_id +func (o ConsumerOutput) Username() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Consumer) pulumi.StringPtrOutput { return v.Username }).(pulumi.StringPtrOutput) +} + type ConsumerArrayOutput struct{ *pulumi.OutputState } func (ConsumerArrayOutput) ElementType() reflect.Type { @@ -234,6 +276,12 @@ func (o ConsumerArrayOutput) ToConsumerArrayOutputWithContext(ctx context.Contex return o } +func (o ConsumerArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*Consumer] { + return pulumix.Output[[]*Consumer]{ + OutputState: o.OutputState, + } +} + func (o ConsumerArrayOutput) Index(i pulumi.IntInput) ConsumerOutput { return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Consumer { return vs[0].([]*Consumer)[vs[1].(int)] @@ -254,6 +302,12 @@ func (o ConsumerMapOutput) ToConsumerMapOutputWithContext(ctx context.Context) C return o } +func (o ConsumerMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*Consumer] { + return pulumix.Output[map[string]*Consumer]{ + OutputState: o.OutputState, + } +} + func (o ConsumerMapOutput) MapIndex(k pulumi.StringInput) ConsumerOutput { return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Consumer { return vs[0].(map[string]*Consumer)[vs[1].(string)] diff --git a/sdk/go/kong/consumerAcl.go b/sdk/go/kong/consumerAcl.go index 967f7455..19012ef4 100644 --- a/sdk/go/kong/consumerAcl.go +++ b/sdk/go/kong/consumerAcl.go @@ -7,8 +7,10 @@ import ( "context" "reflect" - "github.com/pkg/errors" + "errors" + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) // ## # ConsumerAcl @@ -22,8 +24,6 @@ import ( // // import ( // -// "fmt" -// // "github.com/pulumi/pulumi-kong/sdk/v4/go/kong" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // @@ -39,7 +39,7 @@ import ( // return err // } // _, err = kong.NewPlugin(ctx, "aclPlugin", &kong.PluginArgs{ -// ConfigJson: pulumi.String(fmt.Sprintf("%v%v%v%v", " {\n", " \"allow\": [\"group1\", \"group2\"]\n", " }\n", "\n")), +// ConfigJson: pulumi.String(" {\n \"allow\": [\"group1\", \"group2\"]\n }\n\n"), // }) // if err != nil { // return err @@ -84,6 +84,7 @@ func NewConsumerAcl(ctx *pulumi.Context, if args.Group == nil { return nil, errors.New("invalid value for required argument 'Group'") } + opts = internal.PkgResourceDefaultOpts(opts) var resource ConsumerAcl err := ctx.RegisterResource("kong:index/consumerAcl:ConsumerAcl", name, args, &resource, opts...) if err != nil { @@ -169,6 +170,12 @@ func (i *ConsumerAcl) ToConsumerAclOutputWithContext(ctx context.Context) Consum return pulumi.ToOutputWithContext(ctx, i).(ConsumerAclOutput) } +func (i *ConsumerAcl) ToOutput(ctx context.Context) pulumix.Output[*ConsumerAcl] { + return pulumix.Output[*ConsumerAcl]{ + OutputState: i.ToConsumerAclOutputWithContext(ctx).OutputState, + } +} + // ConsumerAclArrayInput is an input type that accepts ConsumerAclArray and ConsumerAclArrayOutput values. // You can construct a concrete instance of `ConsumerAclArrayInput` via: // @@ -194,6 +201,12 @@ func (i ConsumerAclArray) ToConsumerAclArrayOutputWithContext(ctx context.Contex return pulumi.ToOutputWithContext(ctx, i).(ConsumerAclArrayOutput) } +func (i ConsumerAclArray) ToOutput(ctx context.Context) pulumix.Output[[]*ConsumerAcl] { + return pulumix.Output[[]*ConsumerAcl]{ + OutputState: i.ToConsumerAclArrayOutputWithContext(ctx).OutputState, + } +} + // ConsumerAclMapInput is an input type that accepts ConsumerAclMap and ConsumerAclMapOutput values. // You can construct a concrete instance of `ConsumerAclMapInput` via: // @@ -219,6 +232,12 @@ func (i ConsumerAclMap) ToConsumerAclMapOutputWithContext(ctx context.Context) C return pulumi.ToOutputWithContext(ctx, i).(ConsumerAclMapOutput) } +func (i ConsumerAclMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*ConsumerAcl] { + return pulumix.Output[map[string]*ConsumerAcl]{ + OutputState: i.ToConsumerAclMapOutputWithContext(ctx).OutputState, + } +} + type ConsumerAclOutput struct{ *pulumi.OutputState } func (ConsumerAclOutput) ElementType() reflect.Type { @@ -233,6 +252,27 @@ func (o ConsumerAclOutput) ToConsumerAclOutputWithContext(ctx context.Context) C return o } +func (o ConsumerAclOutput) ToOutput(ctx context.Context) pulumix.Output[*ConsumerAcl] { + return pulumix.Output[*ConsumerAcl]{ + OutputState: o.OutputState, + } +} + +// the id of the consumer to be configured +func (o ConsumerAclOutput) ConsumerId() pulumi.StringOutput { + return o.ApplyT(func(v *ConsumerAcl) pulumi.StringOutput { return v.ConsumerId }).(pulumi.StringOutput) +} + +// the acl group +func (o ConsumerAclOutput) Group() pulumi.StringOutput { + return o.ApplyT(func(v *ConsumerAcl) pulumi.StringOutput { return v.Group }).(pulumi.StringOutput) +} + +// A list of strings associated with the consumer acl for grouping and filtering +func (o ConsumerAclOutput) Tags() pulumi.StringArrayOutput { + return o.ApplyT(func(v *ConsumerAcl) pulumi.StringArrayOutput { return v.Tags }).(pulumi.StringArrayOutput) +} + type ConsumerAclArrayOutput struct{ *pulumi.OutputState } func (ConsumerAclArrayOutput) ElementType() reflect.Type { @@ -247,6 +287,12 @@ func (o ConsumerAclArrayOutput) ToConsumerAclArrayOutputWithContext(ctx context. return o } +func (o ConsumerAclArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*ConsumerAcl] { + return pulumix.Output[[]*ConsumerAcl]{ + OutputState: o.OutputState, + } +} + func (o ConsumerAclArrayOutput) Index(i pulumi.IntInput) ConsumerAclOutput { return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ConsumerAcl { return vs[0].([]*ConsumerAcl)[vs[1].(int)] @@ -267,6 +313,12 @@ func (o ConsumerAclMapOutput) ToConsumerAclMapOutputWithContext(ctx context.Cont return o } +func (o ConsumerAclMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*ConsumerAcl] { + return pulumix.Output[map[string]*ConsumerAcl]{ + OutputState: o.OutputState, + } +} + func (o ConsumerAclMapOutput) MapIndex(k pulumi.StringInput) ConsumerAclOutput { return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ConsumerAcl { return vs[0].(map[string]*ConsumerAcl)[vs[1].(string)] diff --git a/sdk/go/kong/consumerBasicAuth.go b/sdk/go/kong/consumerBasicAuth.go index d00e5eb7..51415534 100644 --- a/sdk/go/kong/consumerBasicAuth.go +++ b/sdk/go/kong/consumerBasicAuth.go @@ -7,8 +7,10 @@ import ( "context" "reflect" - "github.com/pkg/errors" + "errors" + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) // ## # ConsumerBasicAuth @@ -86,6 +88,7 @@ func NewConsumerBasicAuth(ctx *pulumi.Context, if args.Username == nil { return nil, errors.New("invalid value for required argument 'Username'") } + opts = internal.PkgResourceDefaultOpts(opts) var resource ConsumerBasicAuth err := ctx.RegisterResource("kong:index/consumerBasicAuth:ConsumerBasicAuth", name, args, &resource, opts...) if err != nil { @@ -179,6 +182,12 @@ func (i *ConsumerBasicAuth) ToConsumerBasicAuthOutputWithContext(ctx context.Con return pulumi.ToOutputWithContext(ctx, i).(ConsumerBasicAuthOutput) } +func (i *ConsumerBasicAuth) ToOutput(ctx context.Context) pulumix.Output[*ConsumerBasicAuth] { + return pulumix.Output[*ConsumerBasicAuth]{ + OutputState: i.ToConsumerBasicAuthOutputWithContext(ctx).OutputState, + } +} + // ConsumerBasicAuthArrayInput is an input type that accepts ConsumerBasicAuthArray and ConsumerBasicAuthArrayOutput values. // You can construct a concrete instance of `ConsumerBasicAuthArrayInput` via: // @@ -204,6 +213,12 @@ func (i ConsumerBasicAuthArray) ToConsumerBasicAuthArrayOutputWithContext(ctx co return pulumi.ToOutputWithContext(ctx, i).(ConsumerBasicAuthArrayOutput) } +func (i ConsumerBasicAuthArray) ToOutput(ctx context.Context) pulumix.Output[[]*ConsumerBasicAuth] { + return pulumix.Output[[]*ConsumerBasicAuth]{ + OutputState: i.ToConsumerBasicAuthArrayOutputWithContext(ctx).OutputState, + } +} + // ConsumerBasicAuthMapInput is an input type that accepts ConsumerBasicAuthMap and ConsumerBasicAuthMapOutput values. // You can construct a concrete instance of `ConsumerBasicAuthMapInput` via: // @@ -229,6 +244,12 @@ func (i ConsumerBasicAuthMap) ToConsumerBasicAuthMapOutputWithContext(ctx contex return pulumi.ToOutputWithContext(ctx, i).(ConsumerBasicAuthMapOutput) } +func (i ConsumerBasicAuthMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*ConsumerBasicAuth] { + return pulumix.Output[map[string]*ConsumerBasicAuth]{ + OutputState: i.ToConsumerBasicAuthMapOutputWithContext(ctx).OutputState, + } +} + type ConsumerBasicAuthOutput struct{ *pulumi.OutputState } func (ConsumerBasicAuthOutput) ElementType() reflect.Type { @@ -243,6 +264,32 @@ func (o ConsumerBasicAuthOutput) ToConsumerBasicAuthOutputWithContext(ctx contex return o } +func (o ConsumerBasicAuthOutput) ToOutput(ctx context.Context) pulumix.Output[*ConsumerBasicAuth] { + return pulumix.Output[*ConsumerBasicAuth]{ + OutputState: o.OutputState, + } +} + +// the id of the consumer to be configured with basic auth +func (o ConsumerBasicAuthOutput) ConsumerId() pulumi.StringOutput { + return o.ApplyT(func(v *ConsumerBasicAuth) pulumi.StringOutput { return v.ConsumerId }).(pulumi.StringOutput) +} + +// password to be used for basic auth +func (o ConsumerBasicAuthOutput) Password() pulumi.StringOutput { + return o.ApplyT(func(v *ConsumerBasicAuth) pulumi.StringOutput { return v.Password }).(pulumi.StringOutput) +} + +// A list of strings associated with the consumer basic auth for grouping and filtering +func (o ConsumerBasicAuthOutput) Tags() pulumi.StringArrayOutput { + return o.ApplyT(func(v *ConsumerBasicAuth) pulumi.StringArrayOutput { return v.Tags }).(pulumi.StringArrayOutput) +} + +// username to be used for basic auth +func (o ConsumerBasicAuthOutput) Username() pulumi.StringOutput { + return o.ApplyT(func(v *ConsumerBasicAuth) pulumi.StringOutput { return v.Username }).(pulumi.StringOutput) +} + type ConsumerBasicAuthArrayOutput struct{ *pulumi.OutputState } func (ConsumerBasicAuthArrayOutput) ElementType() reflect.Type { @@ -257,6 +304,12 @@ func (o ConsumerBasicAuthArrayOutput) ToConsumerBasicAuthArrayOutputWithContext( return o } +func (o ConsumerBasicAuthArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*ConsumerBasicAuth] { + return pulumix.Output[[]*ConsumerBasicAuth]{ + OutputState: o.OutputState, + } +} + func (o ConsumerBasicAuthArrayOutput) Index(i pulumi.IntInput) ConsumerBasicAuthOutput { return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ConsumerBasicAuth { return vs[0].([]*ConsumerBasicAuth)[vs[1].(int)] @@ -277,6 +330,12 @@ func (o ConsumerBasicAuthMapOutput) ToConsumerBasicAuthMapOutputWithContext(ctx return o } +func (o ConsumerBasicAuthMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*ConsumerBasicAuth] { + return pulumix.Output[map[string]*ConsumerBasicAuth]{ + OutputState: o.OutputState, + } +} + func (o ConsumerBasicAuthMapOutput) MapIndex(k pulumi.StringInput) ConsumerBasicAuthOutput { return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ConsumerBasicAuth { return vs[0].(map[string]*ConsumerBasicAuth)[vs[1].(string)] diff --git a/sdk/go/kong/consumerJwtAuth.go b/sdk/go/kong/consumerJwtAuth.go index 23cf0898..e38255e4 100644 --- a/sdk/go/kong/consumerJwtAuth.go +++ b/sdk/go/kong/consumerJwtAuth.go @@ -7,8 +7,10 @@ import ( "context" "reflect" - "github.com/pkg/errors" + "errors" + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) // ## # ConsumerJwtAuth @@ -22,8 +24,6 @@ import ( // // import ( // -// "fmt" -// // "github.com/pulumi/pulumi-kong/sdk/v4/go/kong" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // @@ -39,7 +39,7 @@ import ( // return err // } // _, err = kong.NewPlugin(ctx, "jwtPlugin", &kong.PluginArgs{ -// ConfigJson: pulumi.String(fmt.Sprintf("%v%v%v%v", " {\n", " \"claims_to_verify\": [\"exp\"]\n", " }\n", "\n")), +// ConfigJson: pulumi.String(" {\n \"claims_to_verify\": [\"exp\"]\n }\n\n"), // }) // if err != nil { // return err @@ -89,6 +89,7 @@ func NewConsumerJwtAuth(ctx *pulumi.Context, if args.RsaPublicKey == nil { return nil, errors.New("invalid value for required argument 'RsaPublicKey'") } + opts = internal.PkgResourceDefaultOpts(opts) var resource ConsumerJwtAuth err := ctx.RegisterResource("kong:index/consumerJwtAuth:ConsumerJwtAuth", name, args, &resource, opts...) if err != nil { @@ -198,6 +199,12 @@ func (i *ConsumerJwtAuth) ToConsumerJwtAuthOutputWithContext(ctx context.Context return pulumi.ToOutputWithContext(ctx, i).(ConsumerJwtAuthOutput) } +func (i *ConsumerJwtAuth) ToOutput(ctx context.Context) pulumix.Output[*ConsumerJwtAuth] { + return pulumix.Output[*ConsumerJwtAuth]{ + OutputState: i.ToConsumerJwtAuthOutputWithContext(ctx).OutputState, + } +} + // ConsumerJwtAuthArrayInput is an input type that accepts ConsumerJwtAuthArray and ConsumerJwtAuthArrayOutput values. // You can construct a concrete instance of `ConsumerJwtAuthArrayInput` via: // @@ -223,6 +230,12 @@ func (i ConsumerJwtAuthArray) ToConsumerJwtAuthArrayOutputWithContext(ctx contex return pulumi.ToOutputWithContext(ctx, i).(ConsumerJwtAuthArrayOutput) } +func (i ConsumerJwtAuthArray) ToOutput(ctx context.Context) pulumix.Output[[]*ConsumerJwtAuth] { + return pulumix.Output[[]*ConsumerJwtAuth]{ + OutputState: i.ToConsumerJwtAuthArrayOutputWithContext(ctx).OutputState, + } +} + // ConsumerJwtAuthMapInput is an input type that accepts ConsumerJwtAuthMap and ConsumerJwtAuthMapOutput values. // You can construct a concrete instance of `ConsumerJwtAuthMapInput` via: // @@ -248,6 +261,12 @@ func (i ConsumerJwtAuthMap) ToConsumerJwtAuthMapOutputWithContext(ctx context.Co return pulumi.ToOutputWithContext(ctx, i).(ConsumerJwtAuthMapOutput) } +func (i ConsumerJwtAuthMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*ConsumerJwtAuth] { + return pulumix.Output[map[string]*ConsumerJwtAuth]{ + OutputState: i.ToConsumerJwtAuthMapOutputWithContext(ctx).OutputState, + } +} + type ConsumerJwtAuthOutput struct{ *pulumi.OutputState } func (ConsumerJwtAuthOutput) ElementType() reflect.Type { @@ -262,6 +281,42 @@ func (o ConsumerJwtAuthOutput) ToConsumerJwtAuthOutputWithContext(ctx context.Co return o } +func (o ConsumerJwtAuthOutput) ToOutput(ctx context.Context) pulumix.Output[*ConsumerJwtAuth] { + return pulumix.Output[*ConsumerJwtAuth]{ + OutputState: o.OutputState, + } +} + +// The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is `HS256` +func (o ConsumerJwtAuthOutput) Algorithm() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ConsumerJwtAuth) pulumi.StringPtrOutput { return v.Algorithm }).(pulumi.StringPtrOutput) +} + +// the id of the consumer to be configured with jwt auth +func (o ConsumerJwtAuthOutput) ConsumerId() pulumi.StringOutput { + return o.ApplyT(func(v *ConsumerJwtAuth) pulumi.StringOutput { return v.ConsumerId }).(pulumi.StringOutput) +} + +// A unique string identifying the credential. If left out, it will be auto-generated. +func (o ConsumerJwtAuthOutput) Key() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ConsumerJwtAuth) pulumi.StringPtrOutput { return v.Key }).(pulumi.StringPtrOutput) +} + +// If algorithm is `RS256` or `ES256`, the public key (in PEM format) to use to verify the token’s signature +func (o ConsumerJwtAuthOutput) RsaPublicKey() pulumi.StringOutput { + return o.ApplyT(func(v *ConsumerJwtAuth) pulumi.StringOutput { return v.RsaPublicKey }).(pulumi.StringOutput) +} + +// If algorithm is `HS256` or `ES256`, the secret used to sign JWTs for this credential. If left out, will be auto-generated +func (o ConsumerJwtAuthOutput) Secret() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ConsumerJwtAuth) pulumi.StringPtrOutput { return v.Secret }).(pulumi.StringPtrOutput) +} + +// A list of strings associated with the consumer JWT auth for grouping and filtering +func (o ConsumerJwtAuthOutput) Tags() pulumi.StringArrayOutput { + return o.ApplyT(func(v *ConsumerJwtAuth) pulumi.StringArrayOutput { return v.Tags }).(pulumi.StringArrayOutput) +} + type ConsumerJwtAuthArrayOutput struct{ *pulumi.OutputState } func (ConsumerJwtAuthArrayOutput) ElementType() reflect.Type { @@ -276,6 +331,12 @@ func (o ConsumerJwtAuthArrayOutput) ToConsumerJwtAuthArrayOutputWithContext(ctx return o } +func (o ConsumerJwtAuthArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*ConsumerJwtAuth] { + return pulumix.Output[[]*ConsumerJwtAuth]{ + OutputState: o.OutputState, + } +} + func (o ConsumerJwtAuthArrayOutput) Index(i pulumi.IntInput) ConsumerJwtAuthOutput { return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ConsumerJwtAuth { return vs[0].([]*ConsumerJwtAuth)[vs[1].(int)] @@ -296,6 +357,12 @@ func (o ConsumerJwtAuthMapOutput) ToConsumerJwtAuthMapOutputWithContext(ctx cont return o } +func (o ConsumerJwtAuthMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*ConsumerJwtAuth] { + return pulumix.Output[map[string]*ConsumerJwtAuth]{ + OutputState: o.OutputState, + } +} + func (o ConsumerJwtAuthMapOutput) MapIndex(k pulumi.StringInput) ConsumerJwtAuthOutput { return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ConsumerJwtAuth { return vs[0].(map[string]*ConsumerJwtAuth)[vs[1].(string)] diff --git a/sdk/go/kong/consumerKeyAuth.go b/sdk/go/kong/consumerKeyAuth.go index 63b7c99b..6e25212d 100644 --- a/sdk/go/kong/consumerKeyAuth.go +++ b/sdk/go/kong/consumerKeyAuth.go @@ -7,8 +7,10 @@ import ( "context" "reflect" - "github.com/pkg/errors" + "errors" + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) // ## # ConsumerKeyAuth @@ -77,6 +79,14 @@ func NewConsumerKeyAuth(ctx *pulumi.Context, if args.ConsumerId == nil { return nil, errors.New("invalid value for required argument 'ConsumerId'") } + if args.Key != nil { + args.Key = pulumi.ToSecret(args.Key).(pulumi.StringPtrInput) + } + secrets := pulumi.AdditionalSecretOutputs([]string{ + "key", + }) + opts = append(opts, secrets) + opts = internal.PkgResourceDefaultOpts(opts) var resource ConsumerKeyAuth err := ctx.RegisterResource("kong:index/consumerKeyAuth:ConsumerKeyAuth", name, args, &resource, opts...) if err != nil { @@ -162,6 +172,12 @@ func (i *ConsumerKeyAuth) ToConsumerKeyAuthOutputWithContext(ctx context.Context return pulumi.ToOutputWithContext(ctx, i).(ConsumerKeyAuthOutput) } +func (i *ConsumerKeyAuth) ToOutput(ctx context.Context) pulumix.Output[*ConsumerKeyAuth] { + return pulumix.Output[*ConsumerKeyAuth]{ + OutputState: i.ToConsumerKeyAuthOutputWithContext(ctx).OutputState, + } +} + // ConsumerKeyAuthArrayInput is an input type that accepts ConsumerKeyAuthArray and ConsumerKeyAuthArrayOutput values. // You can construct a concrete instance of `ConsumerKeyAuthArrayInput` via: // @@ -187,6 +203,12 @@ func (i ConsumerKeyAuthArray) ToConsumerKeyAuthArrayOutputWithContext(ctx contex return pulumi.ToOutputWithContext(ctx, i).(ConsumerKeyAuthArrayOutput) } +func (i ConsumerKeyAuthArray) ToOutput(ctx context.Context) pulumix.Output[[]*ConsumerKeyAuth] { + return pulumix.Output[[]*ConsumerKeyAuth]{ + OutputState: i.ToConsumerKeyAuthArrayOutputWithContext(ctx).OutputState, + } +} + // ConsumerKeyAuthMapInput is an input type that accepts ConsumerKeyAuthMap and ConsumerKeyAuthMapOutput values. // You can construct a concrete instance of `ConsumerKeyAuthMapInput` via: // @@ -212,6 +234,12 @@ func (i ConsumerKeyAuthMap) ToConsumerKeyAuthMapOutputWithContext(ctx context.Co return pulumi.ToOutputWithContext(ctx, i).(ConsumerKeyAuthMapOutput) } +func (i ConsumerKeyAuthMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*ConsumerKeyAuth] { + return pulumix.Output[map[string]*ConsumerKeyAuth]{ + OutputState: i.ToConsumerKeyAuthMapOutputWithContext(ctx).OutputState, + } +} + type ConsumerKeyAuthOutput struct{ *pulumi.OutputState } func (ConsumerKeyAuthOutput) ElementType() reflect.Type { @@ -226,6 +254,27 @@ func (o ConsumerKeyAuthOutput) ToConsumerKeyAuthOutputWithContext(ctx context.Co return o } +func (o ConsumerKeyAuthOutput) ToOutput(ctx context.Context) pulumix.Output[*ConsumerKeyAuth] { + return pulumix.Output[*ConsumerKeyAuth]{ + OutputState: o.OutputState, + } +} + +// the id of the consumer to associate the credentials to +func (o ConsumerKeyAuthOutput) ConsumerId() pulumi.StringOutput { + return o.ApplyT(func(v *ConsumerKeyAuth) pulumi.StringOutput { return v.ConsumerId }).(pulumi.StringOutput) +} + +// Unique key to authenticate the client; if omitted the plugin will generate one +func (o ConsumerKeyAuthOutput) Key() pulumi.StringOutput { + return o.ApplyT(func(v *ConsumerKeyAuth) pulumi.StringOutput { return v.Key }).(pulumi.StringOutput) +} + +// A list of strings associated with the consumer key auth for grouping and filtering +func (o ConsumerKeyAuthOutput) Tags() pulumi.StringArrayOutput { + return o.ApplyT(func(v *ConsumerKeyAuth) pulumi.StringArrayOutput { return v.Tags }).(pulumi.StringArrayOutput) +} + type ConsumerKeyAuthArrayOutput struct{ *pulumi.OutputState } func (ConsumerKeyAuthArrayOutput) ElementType() reflect.Type { @@ -240,6 +289,12 @@ func (o ConsumerKeyAuthArrayOutput) ToConsumerKeyAuthArrayOutputWithContext(ctx return o } +func (o ConsumerKeyAuthArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*ConsumerKeyAuth] { + return pulumix.Output[[]*ConsumerKeyAuth]{ + OutputState: o.OutputState, + } +} + func (o ConsumerKeyAuthArrayOutput) Index(i pulumi.IntInput) ConsumerKeyAuthOutput { return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ConsumerKeyAuth { return vs[0].([]*ConsumerKeyAuth)[vs[1].(int)] @@ -260,6 +315,12 @@ func (o ConsumerKeyAuthMapOutput) ToConsumerKeyAuthMapOutputWithContext(ctx cont return o } +func (o ConsumerKeyAuthMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*ConsumerKeyAuth] { + return pulumix.Output[map[string]*ConsumerKeyAuth]{ + OutputState: o.OutputState, + } +} + func (o ConsumerKeyAuthMapOutput) MapIndex(k pulumi.StringInput) ConsumerKeyAuthOutput { return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ConsumerKeyAuth { return vs[0].(map[string]*ConsumerKeyAuth)[vs[1].(string)] diff --git a/sdk/go/kong/consumerOauth2.go b/sdk/go/kong/consumerOauth2.go index 9fd32194..5d22876b 100644 --- a/sdk/go/kong/consumerOauth2.go +++ b/sdk/go/kong/consumerOauth2.go @@ -7,8 +7,10 @@ import ( "context" "reflect" - "github.com/pkg/errors" + "errors" + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) // ## # ConsumerOauth2 @@ -22,8 +24,6 @@ import ( // // import ( // -// "fmt" -// // "github.com/pulumi/pulumi-kong/sdk/v4/go/kong" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // @@ -39,7 +39,16 @@ import ( // return err // } // _, err = kong.NewPlugin(ctx, "oauth2Plugin", &kong.PluginArgs{ -// ConfigJson: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v", " {\n", " \"global_credentials\": true,\n", " \"enable_password_grant\": true,\n", " \"token_expiration\": 180,\n", " \"refresh_token_ttl\": 180,\n", " \"provision_key\": \"testprovisionkey\"\n", " }\n", "\n")), +// ConfigJson: pulumi.String(` { +// "global_credentials": true, +// "enable_password_grant": true, +// "token_expiration": 180, +// "refresh_token_ttl": 180, +// "provision_key": "testprovisionkey" +// } +// +// `), +// // }) // if err != nil { // return err @@ -96,6 +105,7 @@ func NewConsumerOauth2(ctx *pulumi.Context, if args.RedirectUris == nil { return nil, errors.New("invalid value for required argument 'RedirectUris'") } + opts = internal.PkgResourceDefaultOpts(opts) var resource ConsumerOauth2 err := ctx.RegisterResource("kong:index/consumerOauth2:ConsumerOauth2", name, args, &resource, opts...) if err != nil { @@ -213,6 +223,12 @@ func (i *ConsumerOauth2) ToConsumerOauth2OutputWithContext(ctx context.Context) return pulumi.ToOutputWithContext(ctx, i).(ConsumerOauth2Output) } +func (i *ConsumerOauth2) ToOutput(ctx context.Context) pulumix.Output[*ConsumerOauth2] { + return pulumix.Output[*ConsumerOauth2]{ + OutputState: i.ToConsumerOauth2OutputWithContext(ctx).OutputState, + } +} + // ConsumerOauth2ArrayInput is an input type that accepts ConsumerOauth2Array and ConsumerOauth2ArrayOutput values. // You can construct a concrete instance of `ConsumerOauth2ArrayInput` via: // @@ -238,6 +254,12 @@ func (i ConsumerOauth2Array) ToConsumerOauth2ArrayOutputWithContext(ctx context. return pulumi.ToOutputWithContext(ctx, i).(ConsumerOauth2ArrayOutput) } +func (i ConsumerOauth2Array) ToOutput(ctx context.Context) pulumix.Output[[]*ConsumerOauth2] { + return pulumix.Output[[]*ConsumerOauth2]{ + OutputState: i.ToConsumerOauth2ArrayOutputWithContext(ctx).OutputState, + } +} + // ConsumerOauth2MapInput is an input type that accepts ConsumerOauth2Map and ConsumerOauth2MapOutput values. // You can construct a concrete instance of `ConsumerOauth2MapInput` via: // @@ -263,6 +285,12 @@ func (i ConsumerOauth2Map) ToConsumerOauth2MapOutputWithContext(ctx context.Cont return pulumi.ToOutputWithContext(ctx, i).(ConsumerOauth2MapOutput) } +func (i ConsumerOauth2Map) ToOutput(ctx context.Context) pulumix.Output[map[string]*ConsumerOauth2] { + return pulumix.Output[map[string]*ConsumerOauth2]{ + OutputState: i.ToConsumerOauth2MapOutputWithContext(ctx).OutputState, + } +} + type ConsumerOauth2Output struct{ *pulumi.OutputState } func (ConsumerOauth2Output) ElementType() reflect.Type { @@ -277,6 +305,47 @@ func (o ConsumerOauth2Output) ToConsumerOauth2OutputWithContext(ctx context.Cont return o } +func (o ConsumerOauth2Output) ToOutput(ctx context.Context) pulumix.Output[*ConsumerOauth2] { + return pulumix.Output[*ConsumerOauth2]{ + OutputState: o.OutputState, + } +} + +// Unique oauth2 client id. If not set, the oauth2 plugin will generate one +func (o ConsumerOauth2Output) ClientId() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ConsumerOauth2) pulumi.StringPtrOutput { return v.ClientId }).(pulumi.StringPtrOutput) +} + +// Unique oauth2 client secret. If not set, the oauth2 plugin will generate one +func (o ConsumerOauth2Output) ClientSecret() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ConsumerOauth2) pulumi.StringPtrOutput { return v.ClientSecret }).(pulumi.StringPtrOutput) +} + +// The id of the consumer to be configured with oauth2. +func (o ConsumerOauth2Output) ConsumerId() pulumi.StringOutput { + return o.ApplyT(func(v *ConsumerOauth2) pulumi.StringOutput { return v.ConsumerId }).(pulumi.StringOutput) +} + +// A boolean flag that indicates whether the clientSecret field will be stored in hashed form. If enabled on existing plugin instances, client secrets are hashed on the fly upon first usage. Default: `false`. +func (o ConsumerOauth2Output) HashSecret() pulumi.BoolPtrOutput { + return o.ApplyT(func(v *ConsumerOauth2) pulumi.BoolPtrOutput { return v.HashSecret }).(pulumi.BoolPtrOutput) +} + +// The name associated with the credential. +func (o ConsumerOauth2Output) Name() pulumi.StringOutput { + return o.ApplyT(func(v *ConsumerOauth2) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) +} + +// An array with one or more URLs in your app where users will be sent after authorization ([RFC 6742 Section 3.1.2](https://tools.ietf.org/html/rfc6749#section-3.1.2)). +func (o ConsumerOauth2Output) RedirectUris() pulumi.StringArrayOutput { + return o.ApplyT(func(v *ConsumerOauth2) pulumi.StringArrayOutput { return v.RedirectUris }).(pulumi.StringArrayOutput) +} + +// A list of strings associated with the consumer for grouping and filtering. +func (o ConsumerOauth2Output) Tags() pulumi.StringArrayOutput { + return o.ApplyT(func(v *ConsumerOauth2) pulumi.StringArrayOutput { return v.Tags }).(pulumi.StringArrayOutput) +} + type ConsumerOauth2ArrayOutput struct{ *pulumi.OutputState } func (ConsumerOauth2ArrayOutput) ElementType() reflect.Type { @@ -291,6 +360,12 @@ func (o ConsumerOauth2ArrayOutput) ToConsumerOauth2ArrayOutputWithContext(ctx co return o } +func (o ConsumerOauth2ArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*ConsumerOauth2] { + return pulumix.Output[[]*ConsumerOauth2]{ + OutputState: o.OutputState, + } +} + func (o ConsumerOauth2ArrayOutput) Index(i pulumi.IntInput) ConsumerOauth2Output { return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ConsumerOauth2 { return vs[0].([]*ConsumerOauth2)[vs[1].(int)] @@ -311,6 +386,12 @@ func (o ConsumerOauth2MapOutput) ToConsumerOauth2MapOutputWithContext(ctx contex return o } +func (o ConsumerOauth2MapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*ConsumerOauth2] { + return pulumix.Output[map[string]*ConsumerOauth2]{ + OutputState: o.OutputState, + } +} + func (o ConsumerOauth2MapOutput) MapIndex(k pulumi.StringInput) ConsumerOauth2Output { return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ConsumerOauth2 { return vs[0].(map[string]*ConsumerOauth2)[vs[1].(string)] diff --git a/sdk/go/kong/init.go b/sdk/go/kong/init.go index fcc558f8..f7e963b5 100644 --- a/sdk/go/kong/init.go +++ b/sdk/go/kong/init.go @@ -7,6 +7,7 @@ import ( "fmt" "github.com/blang/semver" + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) @@ -71,7 +72,10 @@ func (p *pkg) ConstructProvider(ctx *pulumi.Context, name, typ, urn string) (pul } func init() { - version, _ := PkgVersion() + version, err := internal.PkgVersion() + if err != nil { + version = semver.Version{Major: 1} + } pulumi.RegisterResourceModule( "kong", "index/certificate", diff --git a/sdk/go/kong/config/pulumiUtilities.go b/sdk/go/kong/internal/pulumiUtilities.go similarity index 59% rename from sdk/go/kong/config/pulumiUtilities.go rename to sdk/go/kong/internal/pulumiUtilities.go index dd671cc2..5e694445 100644 --- a/sdk/go/kong/config/pulumiUtilities.go +++ b/sdk/go/kong/internal/pulumiUtilities.go @@ -1,7 +1,7 @@ // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** -package config +package internal import ( "fmt" @@ -17,7 +17,7 @@ import ( type envParser func(v string) interface{} -func parseEnvBool(v string) interface{} { +func ParseEnvBool(v string) interface{} { b, err := strconv.ParseBool(v) if err != nil { return nil @@ -25,7 +25,7 @@ func parseEnvBool(v string) interface{} { return b } -func parseEnvInt(v string) interface{} { +func ParseEnvInt(v string) interface{} { i, err := strconv.ParseInt(v, 0, 0) if err != nil { return nil @@ -33,7 +33,7 @@ func parseEnvInt(v string) interface{} { return int(i) } -func parseEnvFloat(v string) interface{} { +func ParseEnvFloat(v string) interface{} { f, err := strconv.ParseFloat(v, 64) if err != nil { return nil @@ -41,7 +41,7 @@ func parseEnvFloat(v string) interface{} { return f } -func parseEnvStringArray(v string) interface{} { +func ParseEnvStringArray(v string) interface{} { var result pulumi.StringArray for _, item := range strings.Split(v, ";") { result = append(result, pulumi.String(item)) @@ -49,9 +49,9 @@ func parseEnvStringArray(v string) interface{} { return result } -func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { +func GetEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { for _, v := range vars { - if value := os.Getenv(v); value != "" { + if value, ok := os.LookupEnv(v); ok { if parser != nil { return parser(value) } @@ -65,6 +65,10 @@ func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interfac // If a version cannot be determined, v1 will be assumed. The second return // value is always nil. func PkgVersion() (semver.Version, error) { + // emptyVersion defaults to v0.0.0 + if !SdkVersion.Equals(semver.Version{}) { + return SdkVersion, nil + } type sentinal struct{} pkgPath := reflect.TypeOf(sentinal{}).PkgPath() re := regexp.MustCompile("^.*/pulumi-kong/sdk(/v\\d+)?") @@ -79,9 +83,31 @@ func PkgVersion() (semver.Version, error) { } // isZero is a null safe check for if a value is it's types zero value. -func isZero(v interface{}) bool { +func IsZero(v interface{}) bool { if v == nil { return true } return reflect.ValueOf(v).IsZero() } + +// PkgResourceDefaultOpts provides package level defaults to pulumi.OptionResource. +func PkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption { + defaults := []pulumi.ResourceOption{} + + version := SdkVersion + if !version.Equals(semver.Version{}) { + defaults = append(defaults, pulumi.Version(version.String())) + } + return append(defaults, opts...) +} + +// PkgInvokeDefaultOpts provides package level defaults to pulumi.OptionInvoke. +func PkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption { + defaults := []pulumi.InvokeOption{} + + version := SdkVersion + if !version.Equals(semver.Version{}) { + defaults = append(defaults, pulumi.Version(version.String())) + } + return append(defaults, opts...) +} diff --git a/sdk/go/kong/internal/pulumiVersion.go b/sdk/go/kong/internal/pulumiVersion.go new file mode 100644 index 00000000..d5916876 --- /dev/null +++ b/sdk/go/kong/internal/pulumiVersion.go @@ -0,0 +1,11 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package internal + +import ( + "github.com/blang/semver" +) + +var SdkVersion semver.Version = semver.Version{} +var pluginDownloadURL string = "" diff --git a/sdk/go/kong/jwtAuth.go b/sdk/go/kong/jwtAuth.go deleted file mode 100644 index 2714429c..00000000 --- a/sdk/go/kong/jwtAuth.go +++ /dev/null @@ -1,284 +0,0 @@ -// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** -// *** Do not edit by hand unless you're certain you know what you are doing! *** - -package kong - -import ( - "context" - "reflect" - - "github.com/pkg/errors" - "github.com/pulumi/pulumi/sdk/v3/go/pulumi" -) - -type JwtAuth struct { - pulumi.CustomResourceState - - Algorithm pulumi.StringPtrOutput `pulumi:"algorithm"` - ConsumerId pulumi.StringOutput `pulumi:"consumerId"` - Key pulumi.StringPtrOutput `pulumi:"key"` - RsaPublicKey pulumi.StringOutput `pulumi:"rsaPublicKey"` - Secret pulumi.StringPtrOutput `pulumi:"secret"` -} - -// NewJwtAuth registers a new resource with the given unique name, arguments, and options. -func NewJwtAuth(ctx *pulumi.Context, - name string, args *JwtAuthArgs, opts ...pulumi.ResourceOption) (*JwtAuth, error) { - if args == nil { - return nil, errors.New("missing one or more required arguments") - } - - if args.ConsumerId == nil { - return nil, errors.New("invalid value for required argument 'ConsumerId'") - } - if args.RsaPublicKey == nil { - return nil, errors.New("invalid value for required argument 'RsaPublicKey'") - } - var resource JwtAuth - err := ctx.RegisterResource("kong:index/jwtAuth:JwtAuth", name, args, &resource, opts...) - if err != nil { - return nil, err - } - return &resource, nil -} - -// GetJwtAuth gets an existing JwtAuth resource's state with the given name, ID, and optional -// state properties that are used to uniquely qualify the lookup (nil if not required). -func GetJwtAuth(ctx *pulumi.Context, - name string, id pulumi.IDInput, state *JwtAuthState, opts ...pulumi.ResourceOption) (*JwtAuth, error) { - var resource JwtAuth - err := ctx.ReadResource("kong:index/jwtAuth:JwtAuth", name, id, state, &resource, opts...) - if err != nil { - return nil, err - } - return &resource, nil -} - -// Input properties used for looking up and filtering JwtAuth resources. -type jwtAuthState struct { - Algorithm *string `pulumi:"algorithm"` - ConsumerId *string `pulumi:"consumerId"` - Key *string `pulumi:"key"` - RsaPublicKey *string `pulumi:"rsaPublicKey"` - Secret *string `pulumi:"secret"` -} - -type JwtAuthState struct { - Algorithm pulumi.StringPtrInput - ConsumerId pulumi.StringPtrInput - Key pulumi.StringPtrInput - RsaPublicKey pulumi.StringPtrInput - Secret pulumi.StringPtrInput -} - -func (JwtAuthState) ElementType() reflect.Type { - return reflect.TypeOf((*jwtAuthState)(nil)).Elem() -} - -type jwtAuthArgs struct { - Algorithm *string `pulumi:"algorithm"` - ConsumerId string `pulumi:"consumerId"` - Key *string `pulumi:"key"` - RsaPublicKey string `pulumi:"rsaPublicKey"` - Secret *string `pulumi:"secret"` -} - -// The set of arguments for constructing a JwtAuth resource. -type JwtAuthArgs struct { - Algorithm pulumi.StringPtrInput - ConsumerId pulumi.StringInput - Key pulumi.StringPtrInput - RsaPublicKey pulumi.StringInput - Secret pulumi.StringPtrInput -} - -func (JwtAuthArgs) ElementType() reflect.Type { - return reflect.TypeOf((*jwtAuthArgs)(nil)).Elem() -} - -type JwtAuthInput interface { - pulumi.Input - - ToJwtAuthOutput() JwtAuthOutput - ToJwtAuthOutputWithContext(ctx context.Context) JwtAuthOutput -} - -func (*JwtAuth) ElementType() reflect.Type { - return reflect.TypeOf((*JwtAuth)(nil)) -} - -func (i *JwtAuth) ToJwtAuthOutput() JwtAuthOutput { - return i.ToJwtAuthOutputWithContext(context.Background()) -} - -func (i *JwtAuth) ToJwtAuthOutputWithContext(ctx context.Context) JwtAuthOutput { - return pulumi.ToOutputWithContext(ctx, i).(JwtAuthOutput) -} - -func (i *JwtAuth) ToJwtAuthPtrOutput() JwtAuthPtrOutput { - return i.ToJwtAuthPtrOutputWithContext(context.Background()) -} - -func (i *JwtAuth) ToJwtAuthPtrOutputWithContext(ctx context.Context) JwtAuthPtrOutput { - return pulumi.ToOutputWithContext(ctx, i).(JwtAuthPtrOutput) -} - -type JwtAuthPtrInput interface { - pulumi.Input - - ToJwtAuthPtrOutput() JwtAuthPtrOutput - ToJwtAuthPtrOutputWithContext(ctx context.Context) JwtAuthPtrOutput -} - -type jwtAuthPtrType JwtAuthArgs - -func (*jwtAuthPtrType) ElementType() reflect.Type { - return reflect.TypeOf((**JwtAuth)(nil)) -} - -func (i *jwtAuthPtrType) ToJwtAuthPtrOutput() JwtAuthPtrOutput { - return i.ToJwtAuthPtrOutputWithContext(context.Background()) -} - -func (i *jwtAuthPtrType) ToJwtAuthPtrOutputWithContext(ctx context.Context) JwtAuthPtrOutput { - return pulumi.ToOutputWithContext(ctx, i).(JwtAuthPtrOutput) -} - -// JwtAuthArrayInput is an input type that accepts JwtAuthArray and JwtAuthArrayOutput values. -// You can construct a concrete instance of `JwtAuthArrayInput` via: -// -// JwtAuthArray{ JwtAuthArgs{...} } -type JwtAuthArrayInput interface { - pulumi.Input - - ToJwtAuthArrayOutput() JwtAuthArrayOutput - ToJwtAuthArrayOutputWithContext(context.Context) JwtAuthArrayOutput -} - -type JwtAuthArray []JwtAuthInput - -func (JwtAuthArray) ElementType() reflect.Type { - return reflect.TypeOf(([]*JwtAuth)(nil)) -} - -func (i JwtAuthArray) ToJwtAuthArrayOutput() JwtAuthArrayOutput { - return i.ToJwtAuthArrayOutputWithContext(context.Background()) -} - -func (i JwtAuthArray) ToJwtAuthArrayOutputWithContext(ctx context.Context) JwtAuthArrayOutput { - return pulumi.ToOutputWithContext(ctx, i).(JwtAuthArrayOutput) -} - -// JwtAuthMapInput is an input type that accepts JwtAuthMap and JwtAuthMapOutput values. -// You can construct a concrete instance of `JwtAuthMapInput` via: -// -// JwtAuthMap{ "key": JwtAuthArgs{...} } -type JwtAuthMapInput interface { - pulumi.Input - - ToJwtAuthMapOutput() JwtAuthMapOutput - ToJwtAuthMapOutputWithContext(context.Context) JwtAuthMapOutput -} - -type JwtAuthMap map[string]JwtAuthInput - -func (JwtAuthMap) ElementType() reflect.Type { - return reflect.TypeOf((map[string]*JwtAuth)(nil)) -} - -func (i JwtAuthMap) ToJwtAuthMapOutput() JwtAuthMapOutput { - return i.ToJwtAuthMapOutputWithContext(context.Background()) -} - -func (i JwtAuthMap) ToJwtAuthMapOutputWithContext(ctx context.Context) JwtAuthMapOutput { - return pulumi.ToOutputWithContext(ctx, i).(JwtAuthMapOutput) -} - -type JwtAuthOutput struct { - *pulumi.OutputState -} - -func (JwtAuthOutput) ElementType() reflect.Type { - return reflect.TypeOf((*JwtAuth)(nil)) -} - -func (o JwtAuthOutput) ToJwtAuthOutput() JwtAuthOutput { - return o -} - -func (o JwtAuthOutput) ToJwtAuthOutputWithContext(ctx context.Context) JwtAuthOutput { - return o -} - -func (o JwtAuthOutput) ToJwtAuthPtrOutput() JwtAuthPtrOutput { - return o.ToJwtAuthPtrOutputWithContext(context.Background()) -} - -func (o JwtAuthOutput) ToJwtAuthPtrOutputWithContext(ctx context.Context) JwtAuthPtrOutput { - return o.ApplyT(func(v JwtAuth) *JwtAuth { - return &v - }).(JwtAuthPtrOutput) -} - -type JwtAuthPtrOutput struct { - *pulumi.OutputState -} - -func (JwtAuthPtrOutput) ElementType() reflect.Type { - return reflect.TypeOf((**JwtAuth)(nil)) -} - -func (o JwtAuthPtrOutput) ToJwtAuthPtrOutput() JwtAuthPtrOutput { - return o -} - -func (o JwtAuthPtrOutput) ToJwtAuthPtrOutputWithContext(ctx context.Context) JwtAuthPtrOutput { - return o -} - -type JwtAuthArrayOutput struct{ *pulumi.OutputState } - -func (JwtAuthArrayOutput) ElementType() reflect.Type { - return reflect.TypeOf((*[]JwtAuth)(nil)) -} - -func (o JwtAuthArrayOutput) ToJwtAuthArrayOutput() JwtAuthArrayOutput { - return o -} - -func (o JwtAuthArrayOutput) ToJwtAuthArrayOutputWithContext(ctx context.Context) JwtAuthArrayOutput { - return o -} - -func (o JwtAuthArrayOutput) Index(i pulumi.IntInput) JwtAuthOutput { - return pulumi.All(o, i).ApplyT(func(vs []interface{}) JwtAuth { - return vs[0].([]JwtAuth)[vs[1].(int)] - }).(JwtAuthOutput) -} - -type JwtAuthMapOutput struct{ *pulumi.OutputState } - -func (JwtAuthMapOutput) ElementType() reflect.Type { - return reflect.TypeOf((*map[string]JwtAuth)(nil)) -} - -func (o JwtAuthMapOutput) ToJwtAuthMapOutput() JwtAuthMapOutput { - return o -} - -func (o JwtAuthMapOutput) ToJwtAuthMapOutputWithContext(ctx context.Context) JwtAuthMapOutput { - return o -} - -func (o JwtAuthMapOutput) MapIndex(k pulumi.StringInput) JwtAuthOutput { - return pulumi.All(o, k).ApplyT(func(vs []interface{}) JwtAuth { - return vs[0].(map[string]JwtAuth)[vs[1].(string)] - }).(JwtAuthOutput) -} - -func init() { - pulumi.RegisterOutputType(JwtAuthOutput{}) - pulumi.RegisterOutputType(JwtAuthPtrOutput{}) - pulumi.RegisterOutputType(JwtAuthArrayOutput{}) - pulumi.RegisterOutputType(JwtAuthMapOutput{}) -} diff --git a/sdk/go/kong/plugin.go b/sdk/go/kong/plugin.go index 532a0330..8f573221 100644 --- a/sdk/go/kong/plugin.go +++ b/sdk/go/kong/plugin.go @@ -7,7 +7,9 @@ import ( "context" "reflect" + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) // ## # Plugin @@ -22,8 +24,6 @@ import ( // // import ( // -// "fmt" -// // "github.com/pulumi/pulumi-kong/sdk/v4/go/kong" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // @@ -32,7 +32,7 @@ import ( // func main() { // pulumi.Run(func(ctx *pulumi.Context) error { // _, err := kong.NewPlugin(ctx, "rateLimit", &kong.PluginArgs{ -// ConfigJson: pulumi.String(fmt.Sprintf("%v%v%v%v%v", " {\n", " \"second\": 5,\n", " \"hour\" : 1000\n", " }\n", "\n")), +// ConfigJson: pulumi.String(" {\n \"second\": 5,\n \"hour\" : 1000\n }\n\n"), // }) // if err != nil { // return err @@ -49,8 +49,6 @@ import ( // // import ( // -// "fmt" -// // "github.com/pulumi/pulumi-kong/sdk/v4/go/kong" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // @@ -66,7 +64,7 @@ import ( // return err // } // _, err = kong.NewPlugin(ctx, "rateLimit", &kong.PluginArgs{ -// ConfigJson: pulumi.String(fmt.Sprintf("%v%v%v%v%v", " {\n", " \"second\": 5,\n", " \"hour\" : 1000\n", " }\n", "\n")), +// ConfigJson: pulumi.String(" {\n \"second\": 5,\n \"hour\" : 1000\n }\n\n"), // ConsumerId: pluginConsumer.ID(), // }) // if err != nil { @@ -85,8 +83,6 @@ import ( // // import ( // -// "fmt" -// // "github.com/pulumi/pulumi-kong/sdk/v4/go/kong" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // @@ -102,7 +98,7 @@ import ( // return err // } // _, err = kong.NewPlugin(ctx, "rateLimit", &kong.PluginArgs{ -// ConfigJson: pulumi.String(fmt.Sprintf("%v%v%v%v%v", " {\n", " \"second\": 10,\n", " \"hour\" : 2000\n", " }\n", "\n")), +// ConfigJson: pulumi.String(" {\n \"second\": 10,\n \"hour\" : 2000\n }\n\n"), // ServiceId: service.ID(), // }) // if err != nil { @@ -121,8 +117,6 @@ import ( // // import ( // -// "fmt" -// // "github.com/pulumi/pulumi-kong/sdk/v4/go/kong" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // @@ -138,7 +132,7 @@ import ( // return err // } // _, err = kong.NewPlugin(ctx, "rateLimit", &kong.PluginArgs{ -// ConfigJson: pulumi.String(fmt.Sprintf("%v%v%v%v%v", " {\n", " \"second\": 11,\n", " \"hour\" : 4000\n", " }\n", "\n")), +// ConfigJson: pulumi.String(" {\n \"second\": 11,\n \"hour\" : 4000\n }\n\n"), // Enabled: pulumi.Bool(true), // ServiceId: service.ID(), // }) @@ -188,6 +182,7 @@ func NewPlugin(ctx *pulumi.Context, args = &PluginArgs{} } + opts = internal.PkgResourceDefaultOpts(opts) var resource Plugin err := ctx.RegisterResource("kong:index/plugin:Plugin", name, args, &resource, opts...) if err != nil { @@ -311,6 +306,12 @@ func (i *Plugin) ToPluginOutputWithContext(ctx context.Context) PluginOutput { return pulumi.ToOutputWithContext(ctx, i).(PluginOutput) } +func (i *Plugin) ToOutput(ctx context.Context) pulumix.Output[*Plugin] { + return pulumix.Output[*Plugin]{ + OutputState: i.ToPluginOutputWithContext(ctx).OutputState, + } +} + // PluginArrayInput is an input type that accepts PluginArray and PluginArrayOutput values. // You can construct a concrete instance of `PluginArrayInput` via: // @@ -336,6 +337,12 @@ func (i PluginArray) ToPluginArrayOutputWithContext(ctx context.Context) PluginA return pulumi.ToOutputWithContext(ctx, i).(PluginArrayOutput) } +func (i PluginArray) ToOutput(ctx context.Context) pulumix.Output[[]*Plugin] { + return pulumix.Output[[]*Plugin]{ + OutputState: i.ToPluginArrayOutputWithContext(ctx).OutputState, + } +} + // PluginMapInput is an input type that accepts PluginMap and PluginMapOutput values. // You can construct a concrete instance of `PluginMapInput` via: // @@ -361,6 +368,12 @@ func (i PluginMap) ToPluginMapOutputWithContext(ctx context.Context) PluginMapOu return pulumi.ToOutputWithContext(ctx, i).(PluginMapOutput) } +func (i PluginMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*Plugin] { + return pulumix.Output[map[string]*Plugin]{ + OutputState: i.ToPluginMapOutputWithContext(ctx).OutputState, + } +} + type PluginOutput struct{ *pulumi.OutputState } func (PluginOutput) ElementType() reflect.Type { @@ -375,6 +388,55 @@ func (o PluginOutput) ToPluginOutputWithContext(ctx context.Context) PluginOutpu return o } +func (o PluginOutput) ToOutput(ctx context.Context) pulumix.Output[*Plugin] { + return pulumix.Output[*Plugin]{ + OutputState: o.OutputState, + } +} + +func (o PluginOutput) ComputedConfig() pulumi.StringOutput { + return o.ApplyT(func(v *Plugin) pulumi.StringOutput { return v.ComputedConfig }).(pulumi.StringOutput) +} + +// this is the configuration json for how you want to configure the plugin. The json is passed straight through to kong as is. You can get the json config from the Kong documentation +// page of the plugin you are configuring +func (o PluginOutput) ConfigJson() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Plugin) pulumi.StringPtrOutput { return v.ConfigJson }).(pulumi.StringPtrOutput) +} + +// the consumer id you want to configure the plugin for +func (o PluginOutput) ConsumerId() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Plugin) pulumi.StringPtrOutput { return v.ConsumerId }).(pulumi.StringPtrOutput) +} + +// whether the plugin is enabled or not, use if you want to keep the plugin installed but disable it +func (o PluginOutput) Enabled() pulumi.BoolPtrOutput { + return o.ApplyT(func(v *Plugin) pulumi.BoolPtrOutput { return v.Enabled }).(pulumi.BoolPtrOutput) +} + +func (o PluginOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v *Plugin) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) +} + +// the route id that you want to configure the plugin for +func (o PluginOutput) RouteId() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Plugin) pulumi.StringPtrOutput { return v.RouteId }).(pulumi.StringPtrOutput) +} + +// the service id that you want to configure the plugin for +func (o PluginOutput) ServiceId() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Plugin) pulumi.StringPtrOutput { return v.ServiceId }).(pulumi.StringPtrOutput) +} + +func (o PluginOutput) StrictMatch() pulumi.BoolPtrOutput { + return o.ApplyT(func(v *Plugin) pulumi.BoolPtrOutput { return v.StrictMatch }).(pulumi.BoolPtrOutput) +} + +// A list of strings associated with the Plugin for grouping and filtering +func (o PluginOutput) Tags() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Plugin) pulumi.StringArrayOutput { return v.Tags }).(pulumi.StringArrayOutput) +} + type PluginArrayOutput struct{ *pulumi.OutputState } func (PluginArrayOutput) ElementType() reflect.Type { @@ -389,6 +451,12 @@ func (o PluginArrayOutput) ToPluginArrayOutputWithContext(ctx context.Context) P return o } +func (o PluginArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*Plugin] { + return pulumix.Output[[]*Plugin]{ + OutputState: o.OutputState, + } +} + func (o PluginArrayOutput) Index(i pulumi.IntInput) PluginOutput { return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Plugin { return vs[0].([]*Plugin)[vs[1].(int)] @@ -409,6 +477,12 @@ func (o PluginMapOutput) ToPluginMapOutputWithContext(ctx context.Context) Plugi return o } +func (o PluginMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*Plugin] { + return pulumix.Output[map[string]*Plugin]{ + OutputState: o.OutputState, + } +} + func (o PluginMapOutput) MapIndex(k pulumi.StringInput) PluginOutput { return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Plugin { return vs[0].(map[string]*Plugin)[vs[1].(string)] diff --git a/sdk/go/kong/provider.go b/sdk/go/kong/provider.go index bbdb9265..b212859c 100644 --- a/sdk/go/kong/provider.go +++ b/sdk/go/kong/provider.go @@ -7,8 +7,10 @@ import ( "context" "reflect" - "github.com/pkg/errors" + "errors" + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) // The provider type for the kong package. By default, resources use package-wide configuration @@ -42,12 +44,17 @@ func NewProvider(ctx *pulumi.Context, if args.KongAdminUri == nil { return nil, errors.New("invalid value for required argument 'KongAdminUri'") } - if isZero(args.StrictPluginsMatch) { - args.StrictPluginsMatch = pulumi.BoolPtr(getEnvOrDefault(false, parseEnvBool, "STRICT_PLUGINS_MATCH").(bool)) + if args.StrictPluginsMatch == nil { + if d := internal.GetEnvOrDefault(nil, internal.ParseEnvBool, "STRICT_PLUGINS_MATCH"); d != nil { + args.StrictPluginsMatch = pulumi.BoolPtr(d.(bool)) + } } - if isZero(args.TlsSkipVerify) { - args.TlsSkipVerify = pulumi.BoolPtr(getEnvOrDefault(false, parseEnvBool, "TLS_SKIP_VERIFY").(bool)) + if args.TlsSkipVerify == nil { + if d := internal.GetEnvOrDefault(false, internal.ParseEnvBool, "TLS_SKIP_VERIFY"); d != nil { + args.TlsSkipVerify = pulumi.BoolPtr(d.(bool)) + } } + opts = internal.PkgResourceDefaultOpts(opts) var resource Provider err := ctx.RegisterResource("pulumi:providers:kong", name, args, &resource, opts...) if err != nil { @@ -118,6 +125,12 @@ func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutp return pulumi.ToOutputWithContext(ctx, i).(ProviderOutput) } +func (i *Provider) ToOutput(ctx context.Context) pulumix.Output[*Provider] { + return pulumix.Output[*Provider]{ + OutputState: i.ToProviderOutputWithContext(ctx).OutputState, + } +} + type ProviderOutput struct{ *pulumi.OutputState } func (ProviderOutput) ElementType() reflect.Type { @@ -132,6 +145,42 @@ func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) Provide return o } +func (o ProviderOutput) ToOutput(ctx context.Context) pulumix.Output[*Provider] { + return pulumix.Output[*Provider]{ + OutputState: o.OutputState, + } +} + +// An basic auth password for kong admin +func (o ProviderOutput) KongAdminPassword() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.KongAdminPassword }).(pulumi.StringPtrOutput) +} + +// API key for the kong api (Enterprise Edition) +func (o ProviderOutput) KongAdminToken() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.KongAdminToken }).(pulumi.StringPtrOutput) +} + +// The address of the kong admin url e.g. http://localhost:8001 +func (o ProviderOutput) KongAdminUri() pulumi.StringOutput { + return o.ApplyT(func(v *Provider) pulumi.StringOutput { return v.KongAdminUri }).(pulumi.StringOutput) +} + +// An basic auth user for kong admin +func (o ProviderOutput) KongAdminUsername() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.KongAdminUsername }).(pulumi.StringPtrOutput) +} + +// API key for the kong api (if you have locked it down) +func (o ProviderOutput) KongApiKey() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.KongApiKey }).(pulumi.StringPtrOutput) +} + +// Workspace context (Enterprise Edition) +func (o ProviderOutput) KongWorkspace() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.KongWorkspace }).(pulumi.StringPtrOutput) +} + func init() { pulumi.RegisterInputType(reflect.TypeOf((*ProviderInput)(nil)).Elem(), &Provider{}) pulumi.RegisterOutputType(ProviderOutput{}) diff --git a/sdk/go/kong/pulumiTypes.go b/sdk/go/kong/pulumiTypes.go index 58844ae8..b4a4e0b5 100644 --- a/sdk/go/kong/pulumiTypes.go +++ b/sdk/go/kong/pulumiTypes.go @@ -7,9 +7,13 @@ import ( "context" "reflect" + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +var _ = internal.GetEnvOrDefault + type RouteDestination struct { Ip *string `pulumi:"ip"` Port *int `pulumi:"port"` @@ -43,6 +47,12 @@ func (i RouteDestinationArgs) ToRouteDestinationOutputWithContext(ctx context.Co return pulumi.ToOutputWithContext(ctx, i).(RouteDestinationOutput) } +func (i RouteDestinationArgs) ToOutput(ctx context.Context) pulumix.Output[RouteDestination] { + return pulumix.Output[RouteDestination]{ + OutputState: i.ToRouteDestinationOutputWithContext(ctx).OutputState, + } +} + // RouteDestinationArrayInput is an input type that accepts RouteDestinationArray and RouteDestinationArrayOutput values. // You can construct a concrete instance of `RouteDestinationArrayInput` via: // @@ -68,6 +78,12 @@ func (i RouteDestinationArray) ToRouteDestinationArrayOutputWithContext(ctx cont return pulumi.ToOutputWithContext(ctx, i).(RouteDestinationArrayOutput) } +func (i RouteDestinationArray) ToOutput(ctx context.Context) pulumix.Output[[]RouteDestination] { + return pulumix.Output[[]RouteDestination]{ + OutputState: i.ToRouteDestinationArrayOutputWithContext(ctx).OutputState, + } +} + type RouteDestinationOutput struct{ *pulumi.OutputState } func (RouteDestinationOutput) ElementType() reflect.Type { @@ -82,6 +98,12 @@ func (o RouteDestinationOutput) ToRouteDestinationOutputWithContext(ctx context. return o } +func (o RouteDestinationOutput) ToOutput(ctx context.Context) pulumix.Output[RouteDestination] { + return pulumix.Output[RouteDestination]{ + OutputState: o.OutputState, + } +} + func (o RouteDestinationOutput) Ip() pulumi.StringPtrOutput { return o.ApplyT(func(v RouteDestination) *string { return v.Ip }).(pulumi.StringPtrOutput) } @@ -104,6 +126,12 @@ func (o RouteDestinationArrayOutput) ToRouteDestinationArrayOutputWithContext(ct return o } +func (o RouteDestinationArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]RouteDestination] { + return pulumix.Output[[]RouteDestination]{ + OutputState: o.OutputState, + } +} + func (o RouteDestinationArrayOutput) Index(i pulumi.IntInput) RouteDestinationOutput { return pulumi.All(o, i).ApplyT(func(vs []interface{}) RouteDestination { return vs[0].([]RouteDestination)[vs[1].(int)] @@ -145,6 +173,12 @@ func (i RouteHeaderArgs) ToRouteHeaderOutputWithContext(ctx context.Context) Rou return pulumi.ToOutputWithContext(ctx, i).(RouteHeaderOutput) } +func (i RouteHeaderArgs) ToOutput(ctx context.Context) pulumix.Output[RouteHeader] { + return pulumix.Output[RouteHeader]{ + OutputState: i.ToRouteHeaderOutputWithContext(ctx).OutputState, + } +} + // RouteHeaderArrayInput is an input type that accepts RouteHeaderArray and RouteHeaderArrayOutput values. // You can construct a concrete instance of `RouteHeaderArrayInput` via: // @@ -170,6 +204,12 @@ func (i RouteHeaderArray) ToRouteHeaderArrayOutputWithContext(ctx context.Contex return pulumi.ToOutputWithContext(ctx, i).(RouteHeaderArrayOutput) } +func (i RouteHeaderArray) ToOutput(ctx context.Context) pulumix.Output[[]RouteHeader] { + return pulumix.Output[[]RouteHeader]{ + OutputState: i.ToRouteHeaderArrayOutputWithContext(ctx).OutputState, + } +} + type RouteHeaderOutput struct{ *pulumi.OutputState } func (RouteHeaderOutput) ElementType() reflect.Type { @@ -184,6 +224,12 @@ func (o RouteHeaderOutput) ToRouteHeaderOutputWithContext(ctx context.Context) R return o } +func (o RouteHeaderOutput) ToOutput(ctx context.Context) pulumix.Output[RouteHeader] { + return pulumix.Output[RouteHeader]{ + OutputState: o.OutputState, + } +} + // The name of the route func (o RouteHeaderOutput) Name() pulumi.StringOutput { return o.ApplyT(func(v RouteHeader) string { return v.Name }).(pulumi.StringOutput) @@ -207,6 +253,12 @@ func (o RouteHeaderArrayOutput) ToRouteHeaderArrayOutputWithContext(ctx context. return o } +func (o RouteHeaderArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]RouteHeader] { + return pulumix.Output[[]RouteHeader]{ + OutputState: o.OutputState, + } +} + func (o RouteHeaderArrayOutput) Index(i pulumi.IntInput) RouteHeaderOutput { return pulumi.All(o, i).ApplyT(func(vs []interface{}) RouteHeader { return vs[0].([]RouteHeader)[vs[1].(int)] @@ -246,6 +298,12 @@ func (i RouteSourceArgs) ToRouteSourceOutputWithContext(ctx context.Context) Rou return pulumi.ToOutputWithContext(ctx, i).(RouteSourceOutput) } +func (i RouteSourceArgs) ToOutput(ctx context.Context) pulumix.Output[RouteSource] { + return pulumix.Output[RouteSource]{ + OutputState: i.ToRouteSourceOutputWithContext(ctx).OutputState, + } +} + // RouteSourceArrayInput is an input type that accepts RouteSourceArray and RouteSourceArrayOutput values. // You can construct a concrete instance of `RouteSourceArrayInput` via: // @@ -271,6 +329,12 @@ func (i RouteSourceArray) ToRouteSourceArrayOutputWithContext(ctx context.Contex return pulumi.ToOutputWithContext(ctx, i).(RouteSourceArrayOutput) } +func (i RouteSourceArray) ToOutput(ctx context.Context) pulumix.Output[[]RouteSource] { + return pulumix.Output[[]RouteSource]{ + OutputState: i.ToRouteSourceArrayOutputWithContext(ctx).OutputState, + } +} + type RouteSourceOutput struct{ *pulumi.OutputState } func (RouteSourceOutput) ElementType() reflect.Type { @@ -285,6 +349,12 @@ func (o RouteSourceOutput) ToRouteSourceOutputWithContext(ctx context.Context) R return o } +func (o RouteSourceOutput) ToOutput(ctx context.Context) pulumix.Output[RouteSource] { + return pulumix.Output[RouteSource]{ + OutputState: o.OutputState, + } +} + func (o RouteSourceOutput) Ip() pulumi.StringPtrOutput { return o.ApplyT(func(v RouteSource) *string { return v.Ip }).(pulumi.StringPtrOutput) } @@ -307,6 +377,12 @@ func (o RouteSourceArrayOutput) ToRouteSourceArrayOutputWithContext(ctx context. return o } +func (o RouteSourceArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]RouteSource] { + return pulumix.Output[[]RouteSource]{ + OutputState: o.OutputState, + } +} + func (o RouteSourceArrayOutput) Index(i pulumi.IntInput) RouteSourceOutput { return pulumi.All(o, i).ApplyT(func(vs []interface{}) RouteSource { return vs[0].([]RouteSource)[vs[1].(int)] @@ -346,6 +422,12 @@ func (i UpstreamHealthchecksArgs) ToUpstreamHealthchecksOutputWithContext(ctx co return pulumi.ToOutputWithContext(ctx, i).(UpstreamHealthchecksOutput) } +func (i UpstreamHealthchecksArgs) ToOutput(ctx context.Context) pulumix.Output[UpstreamHealthchecks] { + return pulumix.Output[UpstreamHealthchecks]{ + OutputState: i.ToUpstreamHealthchecksOutputWithContext(ctx).OutputState, + } +} + func (i UpstreamHealthchecksArgs) ToUpstreamHealthchecksPtrOutput() UpstreamHealthchecksPtrOutput { return i.ToUpstreamHealthchecksPtrOutputWithContext(context.Background()) } @@ -387,6 +469,12 @@ func (i *upstreamHealthchecksPtrType) ToUpstreamHealthchecksPtrOutputWithContext return pulumi.ToOutputWithContext(ctx, i).(UpstreamHealthchecksPtrOutput) } +func (i *upstreamHealthchecksPtrType) ToOutput(ctx context.Context) pulumix.Output[*UpstreamHealthchecks] { + return pulumix.Output[*UpstreamHealthchecks]{ + OutputState: i.ToUpstreamHealthchecksPtrOutputWithContext(ctx).OutputState, + } +} + type UpstreamHealthchecksOutput struct{ *pulumi.OutputState } func (UpstreamHealthchecksOutput) ElementType() reflect.Type { @@ -411,6 +499,12 @@ func (o UpstreamHealthchecksOutput) ToUpstreamHealthchecksPtrOutputWithContext(c }).(UpstreamHealthchecksPtrOutput) } +func (o UpstreamHealthchecksOutput) ToOutput(ctx context.Context) pulumix.Output[UpstreamHealthchecks] { + return pulumix.Output[UpstreamHealthchecks]{ + OutputState: o.OutputState, + } +} + func (o UpstreamHealthchecksOutput) Active() UpstreamHealthchecksActivePtrOutput { return o.ApplyT(func(v UpstreamHealthchecks) *UpstreamHealthchecksActive { return v.Active }).(UpstreamHealthchecksActivePtrOutput) } @@ -433,6 +527,12 @@ func (o UpstreamHealthchecksPtrOutput) ToUpstreamHealthchecksPtrOutputWithContex return o } +func (o UpstreamHealthchecksPtrOutput) ToOutput(ctx context.Context) pulumix.Output[*UpstreamHealthchecks] { + return pulumix.Output[*UpstreamHealthchecks]{ + OutputState: o.OutputState, + } +} + func (o UpstreamHealthchecksPtrOutput) Elem() UpstreamHealthchecksOutput { return o.ApplyT(func(v *UpstreamHealthchecks) UpstreamHealthchecks { if v != nil { @@ -506,6 +606,12 @@ func (i UpstreamHealthchecksActiveArgs) ToUpstreamHealthchecksActiveOutputWithCo return pulumi.ToOutputWithContext(ctx, i).(UpstreamHealthchecksActiveOutput) } +func (i UpstreamHealthchecksActiveArgs) ToOutput(ctx context.Context) pulumix.Output[UpstreamHealthchecksActive] { + return pulumix.Output[UpstreamHealthchecksActive]{ + OutputState: i.ToUpstreamHealthchecksActiveOutputWithContext(ctx).OutputState, + } +} + func (i UpstreamHealthchecksActiveArgs) ToUpstreamHealthchecksActivePtrOutput() UpstreamHealthchecksActivePtrOutput { return i.ToUpstreamHealthchecksActivePtrOutputWithContext(context.Background()) } @@ -547,6 +653,12 @@ func (i *upstreamHealthchecksActivePtrType) ToUpstreamHealthchecksActivePtrOutpu return pulumi.ToOutputWithContext(ctx, i).(UpstreamHealthchecksActivePtrOutput) } +func (i *upstreamHealthchecksActivePtrType) ToOutput(ctx context.Context) pulumix.Output[*UpstreamHealthchecksActive] { + return pulumix.Output[*UpstreamHealthchecksActive]{ + OutputState: i.ToUpstreamHealthchecksActivePtrOutputWithContext(ctx).OutputState, + } +} + type UpstreamHealthchecksActiveOutput struct{ *pulumi.OutputState } func (UpstreamHealthchecksActiveOutput) ElementType() reflect.Type { @@ -571,6 +683,12 @@ func (o UpstreamHealthchecksActiveOutput) ToUpstreamHealthchecksActivePtrOutputW }).(UpstreamHealthchecksActivePtrOutput) } +func (o UpstreamHealthchecksActiveOutput) ToOutput(ctx context.Context) pulumix.Output[UpstreamHealthchecksActive] { + return pulumix.Output[UpstreamHealthchecksActive]{ + OutputState: o.OutputState, + } +} + func (o UpstreamHealthchecksActiveOutput) Concurrency() pulumi.IntPtrOutput { return o.ApplyT(func(v UpstreamHealthchecksActive) *int { return v.Concurrency }).(pulumi.IntPtrOutput) } @@ -617,6 +735,12 @@ func (o UpstreamHealthchecksActivePtrOutput) ToUpstreamHealthchecksActivePtrOutp return o } +func (o UpstreamHealthchecksActivePtrOutput) ToOutput(ctx context.Context) pulumix.Output[*UpstreamHealthchecksActive] { + return pulumix.Output[*UpstreamHealthchecksActive]{ + OutputState: o.OutputState, + } +} + func (o UpstreamHealthchecksActivePtrOutput) Elem() UpstreamHealthchecksActiveOutput { return o.ApplyT(func(v *UpstreamHealthchecksActive) UpstreamHealthchecksActive { if v != nil { @@ -734,6 +858,12 @@ func (i UpstreamHealthchecksActiveHealthyArgs) ToUpstreamHealthchecksActiveHealt return pulumi.ToOutputWithContext(ctx, i).(UpstreamHealthchecksActiveHealthyOutput) } +func (i UpstreamHealthchecksActiveHealthyArgs) ToOutput(ctx context.Context) pulumix.Output[UpstreamHealthchecksActiveHealthy] { + return pulumix.Output[UpstreamHealthchecksActiveHealthy]{ + OutputState: i.ToUpstreamHealthchecksActiveHealthyOutputWithContext(ctx).OutputState, + } +} + func (i UpstreamHealthchecksActiveHealthyArgs) ToUpstreamHealthchecksActiveHealthyPtrOutput() UpstreamHealthchecksActiveHealthyPtrOutput { return i.ToUpstreamHealthchecksActiveHealthyPtrOutputWithContext(context.Background()) } @@ -775,6 +905,12 @@ func (i *upstreamHealthchecksActiveHealthyPtrType) ToUpstreamHealthchecksActiveH return pulumi.ToOutputWithContext(ctx, i).(UpstreamHealthchecksActiveHealthyPtrOutput) } +func (i *upstreamHealthchecksActiveHealthyPtrType) ToOutput(ctx context.Context) pulumix.Output[*UpstreamHealthchecksActiveHealthy] { + return pulumix.Output[*UpstreamHealthchecksActiveHealthy]{ + OutputState: i.ToUpstreamHealthchecksActiveHealthyPtrOutputWithContext(ctx).OutputState, + } +} + type UpstreamHealthchecksActiveHealthyOutput struct{ *pulumi.OutputState } func (UpstreamHealthchecksActiveHealthyOutput) ElementType() reflect.Type { @@ -799,6 +935,12 @@ func (o UpstreamHealthchecksActiveHealthyOutput) ToUpstreamHealthchecksActiveHea }).(UpstreamHealthchecksActiveHealthyPtrOutput) } +func (o UpstreamHealthchecksActiveHealthyOutput) ToOutput(ctx context.Context) pulumix.Output[UpstreamHealthchecksActiveHealthy] { + return pulumix.Output[UpstreamHealthchecksActiveHealthy]{ + OutputState: o.OutputState, + } +} + func (o UpstreamHealthchecksActiveHealthyOutput) HttpStatuses() pulumi.IntArrayOutput { return o.ApplyT(func(v UpstreamHealthchecksActiveHealthy) []int { return v.HttpStatuses }).(pulumi.IntArrayOutput) } @@ -825,6 +967,12 @@ func (o UpstreamHealthchecksActiveHealthyPtrOutput) ToUpstreamHealthchecksActive return o } +func (o UpstreamHealthchecksActiveHealthyPtrOutput) ToOutput(ctx context.Context) pulumix.Output[*UpstreamHealthchecksActiveHealthy] { + return pulumix.Output[*UpstreamHealthchecksActiveHealthy]{ + OutputState: o.OutputState, + } +} + func (o UpstreamHealthchecksActiveHealthyPtrOutput) Elem() UpstreamHealthchecksActiveHealthyOutput { return o.ApplyT(func(v *UpstreamHealthchecksActiveHealthy) UpstreamHealthchecksActiveHealthy { if v != nil { @@ -901,6 +1049,12 @@ func (i UpstreamHealthchecksActiveUnhealthyArgs) ToUpstreamHealthchecksActiveUnh return pulumi.ToOutputWithContext(ctx, i).(UpstreamHealthchecksActiveUnhealthyOutput) } +func (i UpstreamHealthchecksActiveUnhealthyArgs) ToOutput(ctx context.Context) pulumix.Output[UpstreamHealthchecksActiveUnhealthy] { + return pulumix.Output[UpstreamHealthchecksActiveUnhealthy]{ + OutputState: i.ToUpstreamHealthchecksActiveUnhealthyOutputWithContext(ctx).OutputState, + } +} + func (i UpstreamHealthchecksActiveUnhealthyArgs) ToUpstreamHealthchecksActiveUnhealthyPtrOutput() UpstreamHealthchecksActiveUnhealthyPtrOutput { return i.ToUpstreamHealthchecksActiveUnhealthyPtrOutputWithContext(context.Background()) } @@ -942,6 +1096,12 @@ func (i *upstreamHealthchecksActiveUnhealthyPtrType) ToUpstreamHealthchecksActiv return pulumi.ToOutputWithContext(ctx, i).(UpstreamHealthchecksActiveUnhealthyPtrOutput) } +func (i *upstreamHealthchecksActiveUnhealthyPtrType) ToOutput(ctx context.Context) pulumix.Output[*UpstreamHealthchecksActiveUnhealthy] { + return pulumix.Output[*UpstreamHealthchecksActiveUnhealthy]{ + OutputState: i.ToUpstreamHealthchecksActiveUnhealthyPtrOutputWithContext(ctx).OutputState, + } +} + type UpstreamHealthchecksActiveUnhealthyOutput struct{ *pulumi.OutputState } func (UpstreamHealthchecksActiveUnhealthyOutput) ElementType() reflect.Type { @@ -966,6 +1126,12 @@ func (o UpstreamHealthchecksActiveUnhealthyOutput) ToUpstreamHealthchecksActiveU }).(UpstreamHealthchecksActiveUnhealthyPtrOutput) } +func (o UpstreamHealthchecksActiveUnhealthyOutput) ToOutput(ctx context.Context) pulumix.Output[UpstreamHealthchecksActiveUnhealthy] { + return pulumix.Output[UpstreamHealthchecksActiveUnhealthy]{ + OutputState: o.OutputState, + } +} + func (o UpstreamHealthchecksActiveUnhealthyOutput) HttpFailures() pulumi.IntPtrOutput { return o.ApplyT(func(v UpstreamHealthchecksActiveUnhealthy) *int { return v.HttpFailures }).(pulumi.IntPtrOutput) } @@ -1000,6 +1166,12 @@ func (o UpstreamHealthchecksActiveUnhealthyPtrOutput) ToUpstreamHealthchecksActi return o } +func (o UpstreamHealthchecksActiveUnhealthyPtrOutput) ToOutput(ctx context.Context) pulumix.Output[*UpstreamHealthchecksActiveUnhealthy] { + return pulumix.Output[*UpstreamHealthchecksActiveUnhealthy]{ + OutputState: o.OutputState, + } +} + func (o UpstreamHealthchecksActiveUnhealthyPtrOutput) Elem() UpstreamHealthchecksActiveUnhealthyOutput { return o.ApplyT(func(v *UpstreamHealthchecksActiveUnhealthy) UpstreamHealthchecksActiveUnhealthy { if v != nil { @@ -1090,6 +1262,12 @@ func (i UpstreamHealthchecksPassiveArgs) ToUpstreamHealthchecksPassiveOutputWith return pulumi.ToOutputWithContext(ctx, i).(UpstreamHealthchecksPassiveOutput) } +func (i UpstreamHealthchecksPassiveArgs) ToOutput(ctx context.Context) pulumix.Output[UpstreamHealthchecksPassive] { + return pulumix.Output[UpstreamHealthchecksPassive]{ + OutputState: i.ToUpstreamHealthchecksPassiveOutputWithContext(ctx).OutputState, + } +} + func (i UpstreamHealthchecksPassiveArgs) ToUpstreamHealthchecksPassivePtrOutput() UpstreamHealthchecksPassivePtrOutput { return i.ToUpstreamHealthchecksPassivePtrOutputWithContext(context.Background()) } @@ -1131,6 +1309,12 @@ func (i *upstreamHealthchecksPassivePtrType) ToUpstreamHealthchecksPassivePtrOut return pulumi.ToOutputWithContext(ctx, i).(UpstreamHealthchecksPassivePtrOutput) } +func (i *upstreamHealthchecksPassivePtrType) ToOutput(ctx context.Context) pulumix.Output[*UpstreamHealthchecksPassive] { + return pulumix.Output[*UpstreamHealthchecksPassive]{ + OutputState: i.ToUpstreamHealthchecksPassivePtrOutputWithContext(ctx).OutputState, + } +} + type UpstreamHealthchecksPassiveOutput struct{ *pulumi.OutputState } func (UpstreamHealthchecksPassiveOutput) ElementType() reflect.Type { @@ -1155,6 +1339,12 @@ func (o UpstreamHealthchecksPassiveOutput) ToUpstreamHealthchecksPassivePtrOutpu }).(UpstreamHealthchecksPassivePtrOutput) } +func (o UpstreamHealthchecksPassiveOutput) ToOutput(ctx context.Context) pulumix.Output[UpstreamHealthchecksPassive] { + return pulumix.Output[UpstreamHealthchecksPassive]{ + OutputState: o.OutputState, + } +} + func (o UpstreamHealthchecksPassiveOutput) Healthy() UpstreamHealthchecksPassiveHealthyPtrOutput { return o.ApplyT(func(v UpstreamHealthchecksPassive) *UpstreamHealthchecksPassiveHealthy { return v.Healthy }).(UpstreamHealthchecksPassiveHealthyPtrOutput) } @@ -1181,6 +1371,12 @@ func (o UpstreamHealthchecksPassivePtrOutput) ToUpstreamHealthchecksPassivePtrOu return o } +func (o UpstreamHealthchecksPassivePtrOutput) ToOutput(ctx context.Context) pulumix.Output[*UpstreamHealthchecksPassive] { + return pulumix.Output[*UpstreamHealthchecksPassive]{ + OutputState: o.OutputState, + } +} + func (o UpstreamHealthchecksPassivePtrOutput) Elem() UpstreamHealthchecksPassiveOutput { return o.ApplyT(func(v *UpstreamHealthchecksPassive) UpstreamHealthchecksPassive { if v != nil { @@ -1251,6 +1447,12 @@ func (i UpstreamHealthchecksPassiveHealthyArgs) ToUpstreamHealthchecksPassiveHea return pulumi.ToOutputWithContext(ctx, i).(UpstreamHealthchecksPassiveHealthyOutput) } +func (i UpstreamHealthchecksPassiveHealthyArgs) ToOutput(ctx context.Context) pulumix.Output[UpstreamHealthchecksPassiveHealthy] { + return pulumix.Output[UpstreamHealthchecksPassiveHealthy]{ + OutputState: i.ToUpstreamHealthchecksPassiveHealthyOutputWithContext(ctx).OutputState, + } +} + func (i UpstreamHealthchecksPassiveHealthyArgs) ToUpstreamHealthchecksPassiveHealthyPtrOutput() UpstreamHealthchecksPassiveHealthyPtrOutput { return i.ToUpstreamHealthchecksPassiveHealthyPtrOutputWithContext(context.Background()) } @@ -1292,6 +1494,12 @@ func (i *upstreamHealthchecksPassiveHealthyPtrType) ToUpstreamHealthchecksPassiv return pulumi.ToOutputWithContext(ctx, i).(UpstreamHealthchecksPassiveHealthyPtrOutput) } +func (i *upstreamHealthchecksPassiveHealthyPtrType) ToOutput(ctx context.Context) pulumix.Output[*UpstreamHealthchecksPassiveHealthy] { + return pulumix.Output[*UpstreamHealthchecksPassiveHealthy]{ + OutputState: i.ToUpstreamHealthchecksPassiveHealthyPtrOutputWithContext(ctx).OutputState, + } +} + type UpstreamHealthchecksPassiveHealthyOutput struct{ *pulumi.OutputState } func (UpstreamHealthchecksPassiveHealthyOutput) ElementType() reflect.Type { @@ -1316,6 +1524,12 @@ func (o UpstreamHealthchecksPassiveHealthyOutput) ToUpstreamHealthchecksPassiveH }).(UpstreamHealthchecksPassiveHealthyPtrOutput) } +func (o UpstreamHealthchecksPassiveHealthyOutput) ToOutput(ctx context.Context) pulumix.Output[UpstreamHealthchecksPassiveHealthy] { + return pulumix.Output[UpstreamHealthchecksPassiveHealthy]{ + OutputState: o.OutputState, + } +} + func (o UpstreamHealthchecksPassiveHealthyOutput) HttpStatuses() pulumi.IntArrayOutput { return o.ApplyT(func(v UpstreamHealthchecksPassiveHealthy) []int { return v.HttpStatuses }).(pulumi.IntArrayOutput) } @@ -1338,6 +1552,12 @@ func (o UpstreamHealthchecksPassiveHealthyPtrOutput) ToUpstreamHealthchecksPassi return o } +func (o UpstreamHealthchecksPassiveHealthyPtrOutput) ToOutput(ctx context.Context) pulumix.Output[*UpstreamHealthchecksPassiveHealthy] { + return pulumix.Output[*UpstreamHealthchecksPassiveHealthy]{ + OutputState: o.OutputState, + } +} + func (o UpstreamHealthchecksPassiveHealthyPtrOutput) Elem() UpstreamHealthchecksPassiveHealthyOutput { return o.ApplyT(func(v *UpstreamHealthchecksPassiveHealthy) UpstreamHealthchecksPassiveHealthy { if v != nil { @@ -1403,6 +1623,12 @@ func (i UpstreamHealthchecksPassiveUnhealthyArgs) ToUpstreamHealthchecksPassiveU return pulumi.ToOutputWithContext(ctx, i).(UpstreamHealthchecksPassiveUnhealthyOutput) } +func (i UpstreamHealthchecksPassiveUnhealthyArgs) ToOutput(ctx context.Context) pulumix.Output[UpstreamHealthchecksPassiveUnhealthy] { + return pulumix.Output[UpstreamHealthchecksPassiveUnhealthy]{ + OutputState: i.ToUpstreamHealthchecksPassiveUnhealthyOutputWithContext(ctx).OutputState, + } +} + func (i UpstreamHealthchecksPassiveUnhealthyArgs) ToUpstreamHealthchecksPassiveUnhealthyPtrOutput() UpstreamHealthchecksPassiveUnhealthyPtrOutput { return i.ToUpstreamHealthchecksPassiveUnhealthyPtrOutputWithContext(context.Background()) } @@ -1444,6 +1670,12 @@ func (i *upstreamHealthchecksPassiveUnhealthyPtrType) ToUpstreamHealthchecksPass return pulumi.ToOutputWithContext(ctx, i).(UpstreamHealthchecksPassiveUnhealthyPtrOutput) } +func (i *upstreamHealthchecksPassiveUnhealthyPtrType) ToOutput(ctx context.Context) pulumix.Output[*UpstreamHealthchecksPassiveUnhealthy] { + return pulumix.Output[*UpstreamHealthchecksPassiveUnhealthy]{ + OutputState: i.ToUpstreamHealthchecksPassiveUnhealthyPtrOutputWithContext(ctx).OutputState, + } +} + type UpstreamHealthchecksPassiveUnhealthyOutput struct{ *pulumi.OutputState } func (UpstreamHealthchecksPassiveUnhealthyOutput) ElementType() reflect.Type { @@ -1468,6 +1700,12 @@ func (o UpstreamHealthchecksPassiveUnhealthyOutput) ToUpstreamHealthchecksPassiv }).(UpstreamHealthchecksPassiveUnhealthyPtrOutput) } +func (o UpstreamHealthchecksPassiveUnhealthyOutput) ToOutput(ctx context.Context) pulumix.Output[UpstreamHealthchecksPassiveUnhealthy] { + return pulumix.Output[UpstreamHealthchecksPassiveUnhealthy]{ + OutputState: o.OutputState, + } +} + func (o UpstreamHealthchecksPassiveUnhealthyOutput) HttpFailures() pulumi.IntPtrOutput { return o.ApplyT(func(v UpstreamHealthchecksPassiveUnhealthy) *int { return v.HttpFailures }).(pulumi.IntPtrOutput) } @@ -1498,6 +1736,12 @@ func (o UpstreamHealthchecksPassiveUnhealthyPtrOutput) ToUpstreamHealthchecksPas return o } +func (o UpstreamHealthchecksPassiveUnhealthyPtrOutput) ToOutput(ctx context.Context) pulumix.Output[*UpstreamHealthchecksPassiveUnhealthy] { + return pulumix.Output[*UpstreamHealthchecksPassiveUnhealthy]{ + OutputState: o.OutputState, + } +} + func (o UpstreamHealthchecksPassiveUnhealthyPtrOutput) Elem() UpstreamHealthchecksPassiveUnhealthyOutput { return o.ApplyT(func(v *UpstreamHealthchecksPassiveUnhealthy) UpstreamHealthchecksPassiveUnhealthy { if v != nil { diff --git a/sdk/go/kong/pulumiUtilities.go b/sdk/go/kong/pulumiUtilities.go deleted file mode 100644 index f379001d..00000000 --- a/sdk/go/kong/pulumiUtilities.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. -// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** - -package kong - -import ( - "fmt" - "os" - "reflect" - "regexp" - "strconv" - "strings" - - "github.com/blang/semver" - "github.com/pulumi/pulumi/sdk/v3/go/pulumi" -) - -type envParser func(v string) interface{} - -func parseEnvBool(v string) interface{} { - b, err := strconv.ParseBool(v) - if err != nil { - return nil - } - return b -} - -func parseEnvInt(v string) interface{} { - i, err := strconv.ParseInt(v, 0, 0) - if err != nil { - return nil - } - return int(i) -} - -func parseEnvFloat(v string) interface{} { - f, err := strconv.ParseFloat(v, 64) - if err != nil { - return nil - } - return f -} - -func parseEnvStringArray(v string) interface{} { - var result pulumi.StringArray - for _, item := range strings.Split(v, ";") { - result = append(result, pulumi.String(item)) - } - return result -} - -func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { - for _, v := range vars { - if value := os.Getenv(v); value != "" { - if parser != nil { - return parser(value) - } - return value - } - } - return def -} - -// PkgVersion uses reflection to determine the version of the current package. -// If a version cannot be determined, v1 will be assumed. The second return -// value is always nil. -func PkgVersion() (semver.Version, error) { - type sentinal struct{} - pkgPath := reflect.TypeOf(sentinal{}).PkgPath() - re := regexp.MustCompile("^.*/pulumi-kong/sdk(/v\\d+)?") - if match := re.FindStringSubmatch(pkgPath); match != nil { - vStr := match[1] - if len(vStr) == 0 { // If the version capture group was empty, default to v1. - return semver.Version{Major: 1}, nil - } - return semver.MustParse(fmt.Sprintf("%s.0.0", vStr[2:])), nil - } - return semver.Version{Major: 1}, nil -} - -// isZero is a null safe check for if a value is it's types zero value. -func isZero(v interface{}) bool { - if v == nil { - return true - } - return reflect.ValueOf(v).IsZero() -} diff --git a/sdk/go/kong/route.go b/sdk/go/kong/route.go index c414017a..823e2eff 100644 --- a/sdk/go/kong/route.go +++ b/sdk/go/kong/route.go @@ -7,8 +7,10 @@ import ( "context" "reflect" - "github.com/pkg/errors" + "errors" + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) // ## # Route @@ -50,8 +52,8 @@ import ( // PreserveHost: pulumi.Bool(true), // RegexPriority: pulumi.Int(1), // ServiceId: pulumi.Any(kong_service.Service.Id), -// Headers: RouteHeaderArray{ -// &RouteHeaderArgs{ +// Headers: kong.RouteHeaderArray{ +// &kong.RouteHeaderArgs{ // Name: pulumi.String("x-test-1"), // Values: pulumi.StringArray{ // pulumi.String("a"), @@ -89,17 +91,17 @@ import ( // }, // StripPath: pulumi.Bool(true), // PreserveHost: pulumi.Bool(false), -// Sources: RouteSourceArray{ -// &RouteSourceArgs{ +// Sources: kong.RouteSourceArray{ +// &kong.RouteSourceArgs{ // Ip: pulumi.String("192.168.1.1"), // Port: pulumi.Int(80), // }, -// &RouteSourceArgs{ +// &kong.RouteSourceArgs{ // Ip: pulumi.String("192.168.1.2"), // }, // }, -// Destinations: RouteDestinationArray{ -// &RouteDestinationArgs{ +// Destinations: kong.RouteDestinationArray{ +// &kong.RouteDestinationArgs{ // Ip: pulumi.String("172.10.1.1"), // Port: pulumi.Int(81), // }, @@ -181,6 +183,7 @@ func NewRoute(ctx *pulumi.Context, if args.ServiceId == nil { return nil, errors.New("invalid value for required argument 'ServiceId'") } + opts = internal.PkgResourceDefaultOpts(opts) var resource Route err := ctx.RegisterResource("kong:index/route:Route", name, args, &resource, opts...) if err != nil { @@ -386,6 +389,12 @@ func (i *Route) ToRouteOutputWithContext(ctx context.Context) RouteOutput { return pulumi.ToOutputWithContext(ctx, i).(RouteOutput) } +func (i *Route) ToOutput(ctx context.Context) pulumix.Output[*Route] { + return pulumix.Output[*Route]{ + OutputState: i.ToRouteOutputWithContext(ctx).OutputState, + } +} + // RouteArrayInput is an input type that accepts RouteArray and RouteArrayOutput values. // You can construct a concrete instance of `RouteArrayInput` via: // @@ -411,6 +420,12 @@ func (i RouteArray) ToRouteArrayOutputWithContext(ctx context.Context) RouteArra return pulumi.ToOutputWithContext(ctx, i).(RouteArrayOutput) } +func (i RouteArray) ToOutput(ctx context.Context) pulumix.Output[[]*Route] { + return pulumix.Output[[]*Route]{ + OutputState: i.ToRouteArrayOutputWithContext(ctx).OutputState, + } +} + // RouteMapInput is an input type that accepts RouteMap and RouteMapOutput values. // You can construct a concrete instance of `RouteMapInput` via: // @@ -436,6 +451,12 @@ func (i RouteMap) ToRouteMapOutputWithContext(ctx context.Context) RouteMapOutpu return pulumi.ToOutputWithContext(ctx, i).(RouteMapOutput) } +func (i RouteMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*Route] { + return pulumix.Output[map[string]*Route]{ + OutputState: i.ToRouteMapOutputWithContext(ctx).OutputState, + } +} + type RouteOutput struct{ *pulumi.OutputState } func (RouteOutput) ElementType() reflect.Type { @@ -450,6 +471,102 @@ func (o RouteOutput) ToRouteOutputWithContext(ctx context.Context) RouteOutput { return o } +func (o RouteOutput) ToOutput(ctx context.Context) pulumix.Output[*Route] { + return pulumix.Output[*Route]{ + OutputState: o.OutputState, + } +} + +// A list of destination `ip` and `port` +func (o RouteOutput) Destinations() RouteDestinationArrayOutput { + return o.ApplyT(func(v *Route) RouteDestinationArrayOutput { return v.Destinations }).(RouteDestinationArrayOutput) +} + +// One or more blocks of `name` to set name of header and `values` which is a list of `string` for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute. +func (o RouteOutput) Headers() RouteHeaderArrayOutput { + return o.ApplyT(func(v *Route) RouteHeaderArrayOutput { return v.Headers }).(RouteHeaderArrayOutput) +} + +// A list of domain names that match this Route +func (o RouteOutput) Hosts() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Route) pulumi.StringArrayOutput { return v.Hosts }).(pulumi.StringArrayOutput) +} + +// The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to `301`, `302`, `307` or `308`. Accepted values are: `426`, `301`, `302`, `307`, `308`. Default: `426`. +func (o RouteOutput) HttpsRedirectStatusCode() pulumi.IntPtrOutput { + return o.ApplyT(func(v *Route) pulumi.IntPtrOutput { return v.HttpsRedirectStatusCode }).(pulumi.IntPtrOutput) +} + +// A list of HTTP methods that match this Route +func (o RouteOutput) Methods() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Route) pulumi.StringArrayOutput { return v.Methods }).(pulumi.StringArrayOutput) +} + +// The name of the route +func (o RouteOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v *Route) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) +} + +// Controls how the Service path, Route path and requested path are combined when sending a request to the upstream. +func (o RouteOutput) PathHandling() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Route) pulumi.StringPtrOutput { return v.PathHandling }).(pulumi.StringPtrOutput) +} + +// A list of paths that match this Route +func (o RouteOutput) Paths() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Route) pulumi.StringArrayOutput { return v.Paths }).(pulumi.StringArrayOutput) +} + +// When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host. +func (o RouteOutput) PreserveHost() pulumi.BoolPtrOutput { + return o.ApplyT(func(v *Route) pulumi.BoolPtrOutput { return v.PreserveHost }).(pulumi.BoolPtrOutput) +} + +// The list of protocols to use +func (o RouteOutput) Protocols() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Route) pulumi.StringArrayOutput { return v.Protocols }).(pulumi.StringArrayOutput) +} + +// A number used to choose which route resolves a given request when several routes match it using regexes simultaneously. +func (o RouteOutput) RegexPriority() pulumi.IntPtrOutput { + return o.ApplyT(func(v *Route) pulumi.IntPtrOutput { return v.RegexPriority }).(pulumi.IntPtrOutput) +} + +// Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true. +func (o RouteOutput) RequestBuffering() pulumi.BoolPtrOutput { + return o.ApplyT(func(v *Route) pulumi.BoolPtrOutput { return v.RequestBuffering }).(pulumi.BoolPtrOutput) +} + +// Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true. +func (o RouteOutput) ResponseBuffering() pulumi.BoolPtrOutput { + return o.ApplyT(func(v *Route) pulumi.BoolPtrOutput { return v.ResponseBuffering }).(pulumi.BoolPtrOutput) +} + +// Service ID to map to +func (o RouteOutput) ServiceId() pulumi.StringOutput { + return o.ApplyT(func(v *Route) pulumi.StringOutput { return v.ServiceId }).(pulumi.StringOutput) +} + +// A list of SNIs that match this Route when using stream routing. +func (o RouteOutput) Snis() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Route) pulumi.StringArrayOutput { return v.Snis }).(pulumi.StringArrayOutput) +} + +// A list of source `ip` and `port` +func (o RouteOutput) Sources() RouteSourceArrayOutput { + return o.ApplyT(func(v *Route) RouteSourceArrayOutput { return v.Sources }).(RouteSourceArrayOutput) +} + +// When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true. +func (o RouteOutput) StripPath() pulumi.BoolPtrOutput { + return o.ApplyT(func(v *Route) pulumi.BoolPtrOutput { return v.StripPath }).(pulumi.BoolPtrOutput) +} + +// A list of strings associated with the Route for grouping and filtering. +func (o RouteOutput) Tags() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Route) pulumi.StringArrayOutput { return v.Tags }).(pulumi.StringArrayOutput) +} + type RouteArrayOutput struct{ *pulumi.OutputState } func (RouteArrayOutput) ElementType() reflect.Type { @@ -464,6 +581,12 @@ func (o RouteArrayOutput) ToRouteArrayOutputWithContext(ctx context.Context) Rou return o } +func (o RouteArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*Route] { + return pulumix.Output[[]*Route]{ + OutputState: o.OutputState, + } +} + func (o RouteArrayOutput) Index(i pulumi.IntInput) RouteOutput { return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Route { return vs[0].([]*Route)[vs[1].(int)] @@ -484,6 +607,12 @@ func (o RouteMapOutput) ToRouteMapOutputWithContext(ctx context.Context) RouteMa return o } +func (o RouteMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*Route] { + return pulumix.Output[map[string]*Route]{ + OutputState: o.OutputState, + } +} + func (o RouteMapOutput) MapIndex(k pulumi.StringInput) RouteOutput { return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Route { return vs[0].(map[string]*Route)[vs[1].(string)] diff --git a/sdk/go/kong/service.go b/sdk/go/kong/service.go index fa4cba9f..9f5ee759 100644 --- a/sdk/go/kong/service.go +++ b/sdk/go/kong/service.go @@ -7,8 +7,10 @@ import ( "context" "reflect" - "github.com/pkg/errors" + "errors" + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) // ## # Service @@ -55,8 +57,6 @@ import ( // // import ( // -// "fmt" -// // "github.com/pulumi/pulumi-kong/sdk/v4/go/kong" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // @@ -65,8 +65,8 @@ import ( // func main() { // pulumi.Run(func(ctx *pulumi.Context) error { // certificate, err := kong.NewCertificate(ctx, "certificate", &kong.CertificateArgs{ -// Certificate: pulumi.String(fmt.Sprintf("%v%v%v", " -----BEGIN CERTIFICATE-----\n", " ......\n", " -----END CERTIFICATE-----\n")), -// PrivateKey: pulumi.String(fmt.Sprintf("%v%v%v", " -----BEGIN PRIVATE KEY-----\n", " .....\n", " -----END PRIVATE KEY-----\n")), +// Certificate: pulumi.String(" -----BEGIN CERTIFICATE-----\n ......\n -----END CERTIFICATE-----\n"), +// PrivateKey: pulumi.String(" -----BEGIN PRIVATE KEY-----\n .....\n -----END PRIVATE KEY-----\n"), // Snis: pulumi.StringArray{ // pulumi.String("foo.com"), // }, @@ -75,8 +75,8 @@ import ( // return err // } // ca, err := kong.NewCertificate(ctx, "ca", &kong.CertificateArgs{ -// Certificate: pulumi.String(fmt.Sprintf("%v%v%v", " -----BEGIN CERTIFICATE-----\n", " ......\n", " -----END CERTIFICATE-----\n")), -// PrivateKey: pulumi.String(fmt.Sprintf("%v%v%v", " -----BEGIN PRIVATE KEY-----\n", " .....\n", " -----END PRIVATE KEY-----\n")), +// Certificate: pulumi.String(" -----BEGIN CERTIFICATE-----\n ......\n -----END CERTIFICATE-----\n"), +// PrivateKey: pulumi.String(" -----BEGIN PRIVATE KEY-----\n .....\n -----END PRIVATE KEY-----\n"), // Snis: pulumi.StringArray{ // pulumi.String("ca.com"), // }, @@ -155,6 +155,7 @@ func NewService(ctx *pulumi.Context, if args.Protocol == nil { return nil, errors.New("invalid value for required argument 'Protocol'") } + opts = internal.PkgResourceDefaultOpts(opts) var resource Service err := ctx.RegisterResource("kong:index/service:Service", name, args, &resource, opts...) if err != nil { @@ -328,6 +329,12 @@ func (i *Service) ToServiceOutputWithContext(ctx context.Context) ServiceOutput return pulumi.ToOutputWithContext(ctx, i).(ServiceOutput) } +func (i *Service) ToOutput(ctx context.Context) pulumix.Output[*Service] { + return pulumix.Output[*Service]{ + OutputState: i.ToServiceOutputWithContext(ctx).OutputState, + } +} + // ServiceArrayInput is an input type that accepts ServiceArray and ServiceArrayOutput values. // You can construct a concrete instance of `ServiceArrayInput` via: // @@ -353,6 +360,12 @@ func (i ServiceArray) ToServiceArrayOutputWithContext(ctx context.Context) Servi return pulumi.ToOutputWithContext(ctx, i).(ServiceArrayOutput) } +func (i ServiceArray) ToOutput(ctx context.Context) pulumix.Output[[]*Service] { + return pulumix.Output[[]*Service]{ + OutputState: i.ToServiceArrayOutputWithContext(ctx).OutputState, + } +} + // ServiceMapInput is an input type that accepts ServiceMap and ServiceMapOutput values. // You can construct a concrete instance of `ServiceMapInput` via: // @@ -378,6 +391,12 @@ func (i ServiceMap) ToServiceMapOutputWithContext(ctx context.Context) ServiceMa return pulumi.ToOutputWithContext(ctx, i).(ServiceMapOutput) } +func (i ServiceMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*Service] { + return pulumix.Output[map[string]*Service]{ + OutputState: i.ToServiceMapOutputWithContext(ctx).OutputState, + } +} + type ServiceOutput struct{ *pulumi.OutputState } func (ServiceOutput) ElementType() reflect.Type { @@ -392,6 +411,82 @@ func (o ServiceOutput) ToServiceOutputWithContext(ctx context.Context) ServiceOu return o } +func (o ServiceOutput) ToOutput(ctx context.Context) pulumix.Output[*Service] { + return pulumix.Output[*Service]{ + OutputState: o.OutputState, + } +} + +// A of CA Certificate IDs (created from the certificate resource). that are used to build the trust store while verifying upstream server’s TLS certificate. +func (o ServiceOutput) CaCertificateIds() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Service) pulumi.StringArrayOutput { return v.CaCertificateIds }).(pulumi.StringArrayOutput) +} + +// ID of Certificate to be used as client certificate while TLS handshaking to the upstream server. Use ID from `Certificate` resource +func (o ServiceOutput) ClientCertificateId() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Service) pulumi.StringPtrOutput { return v.ClientCertificateId }).(pulumi.StringPtrOutput) +} + +// Connection timeout. Default(ms): 60000 +func (o ServiceOutput) ConnectTimeout() pulumi.IntPtrOutput { + return o.ApplyT(func(v *Service) pulumi.IntPtrOutput { return v.ConnectTimeout }).(pulumi.IntPtrOutput) +} + +// Host to map to +func (o ServiceOutput) Host() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Service) pulumi.StringPtrOutput { return v.Host }).(pulumi.StringPtrOutput) +} + +// Service name +func (o ServiceOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v *Service) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) +} + +// Path to map to +func (o ServiceOutput) Path() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Service) pulumi.StringPtrOutput { return v.Path }).(pulumi.StringPtrOutput) +} + +// Port to map to. Default: 80 +func (o ServiceOutput) Port() pulumi.IntPtrOutput { + return o.ApplyT(func(v *Service) pulumi.IntPtrOutput { return v.Port }).(pulumi.IntPtrOutput) +} + +// Protocol to use +func (o ServiceOutput) Protocol() pulumi.StringOutput { + return o.ApplyT(func(v *Service) pulumi.StringOutput { return v.Protocol }).(pulumi.StringOutput) +} + +// Read timeout. Default(ms): 60000 +func (o ServiceOutput) ReadTimeout() pulumi.IntPtrOutput { + return o.ApplyT(func(v *Service) pulumi.IntPtrOutput { return v.ReadTimeout }).(pulumi.IntPtrOutput) +} + +// Number of retries. Default: 5 +func (o ServiceOutput) Retries() pulumi.IntPtrOutput { + return o.ApplyT(func(v *Service) pulumi.IntPtrOutput { return v.Retries }).(pulumi.IntPtrOutput) +} + +// A list of strings associated with the Service for grouping and filtering. +func (o ServiceOutput) Tags() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Service) pulumi.StringArrayOutput { return v.Tags }).(pulumi.StringArrayOutput) +} + +// Whether to enable verification of upstream server TLS certificate. If not set then the nginx default is respected. +func (o ServiceOutput) TlsVerify() pulumi.BoolPtrOutput { + return o.ApplyT(func(v *Service) pulumi.BoolPtrOutput { return v.TlsVerify }).(pulumi.BoolPtrOutput) +} + +// Maximum depth of chain while verifying Upstream server’s TLS certificate. +func (o ServiceOutput) TlsVerifyDepth() pulumi.IntPtrOutput { + return o.ApplyT(func(v *Service) pulumi.IntPtrOutput { return v.TlsVerifyDepth }).(pulumi.IntPtrOutput) +} + +// Write timout. Default(ms): 60000 +func (o ServiceOutput) WriteTimeout() pulumi.IntPtrOutput { + return o.ApplyT(func(v *Service) pulumi.IntPtrOutput { return v.WriteTimeout }).(pulumi.IntPtrOutput) +} + type ServiceArrayOutput struct{ *pulumi.OutputState } func (ServiceArrayOutput) ElementType() reflect.Type { @@ -406,6 +501,12 @@ func (o ServiceArrayOutput) ToServiceArrayOutputWithContext(ctx context.Context) return o } +func (o ServiceArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*Service] { + return pulumix.Output[[]*Service]{ + OutputState: o.OutputState, + } +} + func (o ServiceArrayOutput) Index(i pulumi.IntInput) ServiceOutput { return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Service { return vs[0].([]*Service)[vs[1].(int)] @@ -426,6 +527,12 @@ func (o ServiceMapOutput) ToServiceMapOutputWithContext(ctx context.Context) Ser return o } +func (o ServiceMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*Service] { + return pulumix.Output[map[string]*Service]{ + OutputState: o.OutputState, + } +} + func (o ServiceMapOutput) MapIndex(k pulumi.StringInput) ServiceOutput { return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Service { return vs[0].(map[string]*Service)[vs[1].(string)] diff --git a/sdk/go/kong/target.go b/sdk/go/kong/target.go index 70ec8c43..e156093a 100644 --- a/sdk/go/kong/target.go +++ b/sdk/go/kong/target.go @@ -7,8 +7,10 @@ import ( "context" "reflect" - "github.com/pkg/errors" + "errors" + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) // ## Example Usage @@ -77,6 +79,7 @@ func NewTarget(ctx *pulumi.Context, if args.Weight == nil { return nil, errors.New("invalid value for required argument 'Weight'") } + opts = internal.PkgResourceDefaultOpts(opts) var resource Target err := ctx.RegisterResource("kong:index/target:Target", name, args, &resource, opts...) if err != nil { @@ -170,6 +173,12 @@ func (i *Target) ToTargetOutputWithContext(ctx context.Context) TargetOutput { return pulumi.ToOutputWithContext(ctx, i).(TargetOutput) } +func (i *Target) ToOutput(ctx context.Context) pulumix.Output[*Target] { + return pulumix.Output[*Target]{ + OutputState: i.ToTargetOutputWithContext(ctx).OutputState, + } +} + // TargetArrayInput is an input type that accepts TargetArray and TargetArrayOutput values. // You can construct a concrete instance of `TargetArrayInput` via: // @@ -195,6 +204,12 @@ func (i TargetArray) ToTargetArrayOutputWithContext(ctx context.Context) TargetA return pulumi.ToOutputWithContext(ctx, i).(TargetArrayOutput) } +func (i TargetArray) ToOutput(ctx context.Context) pulumix.Output[[]*Target] { + return pulumix.Output[[]*Target]{ + OutputState: i.ToTargetArrayOutputWithContext(ctx).OutputState, + } +} + // TargetMapInput is an input type that accepts TargetMap and TargetMapOutput values. // You can construct a concrete instance of `TargetMapInput` via: // @@ -220,6 +235,12 @@ func (i TargetMap) ToTargetMapOutputWithContext(ctx context.Context) TargetMapOu return pulumi.ToOutputWithContext(ctx, i).(TargetMapOutput) } +func (i TargetMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*Target] { + return pulumix.Output[map[string]*Target]{ + OutputState: i.ToTargetMapOutputWithContext(ctx).OutputState, + } +} + type TargetOutput struct{ *pulumi.OutputState } func (TargetOutput) ElementType() reflect.Type { @@ -234,6 +255,32 @@ func (o TargetOutput) ToTargetOutputWithContext(ctx context.Context) TargetOutpu return o } +func (o TargetOutput) ToOutput(ctx context.Context) pulumix.Output[*Target] { + return pulumix.Output[*Target]{ + OutputState: o.OutputState, + } +} + +// A list set of strings associated with the Plugin for grouping and filtering +func (o TargetOutput) Tags() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Target) pulumi.StringArrayOutput { return v.Tags }).(pulumi.StringArrayOutput) +} + +// is the target address (IP or hostname) and port. If omitted the port defaults to 8000. +func (o TargetOutput) Target() pulumi.StringOutput { + return o.ApplyT(func(v *Target) pulumi.StringOutput { return v.Target }).(pulumi.StringOutput) +} + +// is the id of the upstream to apply this target to. +func (o TargetOutput) UpstreamId() pulumi.StringOutput { + return o.ApplyT(func(v *Target) pulumi.StringOutput { return v.UpstreamId }).(pulumi.StringOutput) +} + +// is the weight this target gets within the upstream load balancer (0-1000, defaults to 100). +func (o TargetOutput) Weight() pulumi.IntOutput { + return o.ApplyT(func(v *Target) pulumi.IntOutput { return v.Weight }).(pulumi.IntOutput) +} + type TargetArrayOutput struct{ *pulumi.OutputState } func (TargetArrayOutput) ElementType() reflect.Type { @@ -248,6 +295,12 @@ func (o TargetArrayOutput) ToTargetArrayOutputWithContext(ctx context.Context) T return o } +func (o TargetArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*Target] { + return pulumix.Output[[]*Target]{ + OutputState: o.OutputState, + } +} + func (o TargetArrayOutput) Index(i pulumi.IntInput) TargetOutput { return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Target { return vs[0].([]*Target)[vs[1].(int)] @@ -268,6 +321,12 @@ func (o TargetMapOutput) ToTargetMapOutputWithContext(ctx context.Context) Targe return o } +func (o TargetMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*Target] { + return pulumix.Output[map[string]*Target]{ + OutputState: o.OutputState, + } +} + func (o TargetMapOutput) MapIndex(k pulumi.StringInput) TargetOutput { return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Target { return vs[0].(map[string]*Target)[vs[1].(string)] diff --git a/sdk/go/kong/upstream.go b/sdk/go/kong/upstream.go index 09332bcb..aa2265ea 100644 --- a/sdk/go/kong/upstream.go +++ b/sdk/go/kong/upstream.go @@ -7,7 +7,9 @@ import ( "context" "reflect" + "github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) // ## Example Usage @@ -17,8 +19,6 @@ import ( // // import ( // -// "fmt" -// // "github.com/pulumi/pulumi-kong/sdk/v4/go/kong" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // @@ -27,8 +27,8 @@ import ( // func main() { // pulumi.Run(func(ctx *pulumi.Context) error { // certificate, err := kong.NewCertificate(ctx, "certificate", &kong.CertificateArgs{ -// Certificate: pulumi.String(fmt.Sprintf("%v%v%v", " -----BEGIN CERTIFICATE-----\n", " ......\n", " -----END CERTIFICATE-----\n")), -// PrivateKey: pulumi.String(fmt.Sprintf("%v%v%v", " -----BEGIN PRIVATE KEY-----\n", " .....\n", " -----END PRIVATE KEY-----\n")), +// Certificate: pulumi.String(" -----BEGIN CERTIFICATE-----\n ......\n -----END CERTIFICATE-----\n"), +// PrivateKey: pulumi.String(" -----BEGIN PRIVATE KEY-----\n .....\n -----END PRIVATE KEY-----\n"), // Snis: pulumi.StringArray{ // pulumi.String("foo.com"), // }, @@ -50,15 +50,15 @@ import ( // pulumi.String("b"), // }, // ClientCertificateId: certificate.ID(), -// Healthchecks: &UpstreamHealthchecksArgs{ -// Active: &UpstreamHealthchecksActiveArgs{ +// Healthchecks: &kong.UpstreamHealthchecksArgs{ +// Active: &kong.UpstreamHealthchecksActiveArgs{ // Type: pulumi.String("https"), // HttpPath: pulumi.String("/status"), // Timeout: pulumi.Int(10), // Concurrency: pulumi.Int(20), // HttpsVerifyCertificate: pulumi.Bool(false), // HttpsSni: pulumi.String("some.domain.com"), -// Healthy: &UpstreamHealthchecksActiveHealthyArgs{ +// Healthy: &kong.UpstreamHealthchecksActiveHealthyArgs{ // Successes: pulumi.Int(1), // Interval: pulumi.Int(5), // HttpStatuses: pulumi.IntArray{ @@ -66,7 +66,7 @@ import ( // pulumi.Int(201), // }, // }, -// Unhealthy: &UpstreamHealthchecksActiveUnhealthyArgs{ +// Unhealthy: &kong.UpstreamHealthchecksActiveUnhealthyArgs{ // Timeouts: pulumi.Int(7), // Interval: pulumi.Int(3), // TcpFailures: pulumi.Int(1), @@ -77,9 +77,9 @@ import ( // }, // }, // }, -// Passive: &UpstreamHealthchecksPassiveArgs{ +// Passive: &kong.UpstreamHealthchecksPassiveArgs{ // Type: pulumi.String("https"), -// Healthy: &UpstreamHealthchecksPassiveHealthyArgs{ +// Healthy: &kong.UpstreamHealthchecksPassiveHealthyArgs{ // Successes: pulumi.Int(1), // HttpStatuses: pulumi.IntArray{ // pulumi.Int(200), @@ -87,7 +87,7 @@ import ( // pulumi.Int(202), // }, // }, -// Unhealthy: &UpstreamHealthchecksPassiveUnhealthyArgs{ +// Unhealthy: &kong.UpstreamHealthchecksPassiveUnhealthyArgs{ // Timeouts: pulumi.Int(3), // TcpFailures: pulumi.Int(5), // HttpFailures: pulumi.Int(6), @@ -174,6 +174,7 @@ func NewUpstream(ctx *pulumi.Context, args = &UpstreamArgs{} } + opts = internal.PkgResourceDefaultOpts(opts) var resource Upstream err := ctx.RegisterResource("kong:index/upstream:Upstream", name, args, &resource, opts...) if err != nil { @@ -411,6 +412,12 @@ func (i *Upstream) ToUpstreamOutputWithContext(ctx context.Context) UpstreamOutp return pulumi.ToOutputWithContext(ctx, i).(UpstreamOutput) } +func (i *Upstream) ToOutput(ctx context.Context) pulumix.Output[*Upstream] { + return pulumix.Output[*Upstream]{ + OutputState: i.ToUpstreamOutputWithContext(ctx).OutputState, + } +} + // UpstreamArrayInput is an input type that accepts UpstreamArray and UpstreamArrayOutput values. // You can construct a concrete instance of `UpstreamArrayInput` via: // @@ -436,6 +443,12 @@ func (i UpstreamArray) ToUpstreamArrayOutputWithContext(ctx context.Context) Ups return pulumi.ToOutputWithContext(ctx, i).(UpstreamArrayOutput) } +func (i UpstreamArray) ToOutput(ctx context.Context) pulumix.Output[[]*Upstream] { + return pulumix.Output[[]*Upstream]{ + OutputState: i.ToUpstreamArrayOutputWithContext(ctx).OutputState, + } +} + // UpstreamMapInput is an input type that accepts UpstreamMap and UpstreamMapOutput values. // You can construct a concrete instance of `UpstreamMapInput` via: // @@ -461,6 +474,12 @@ func (i UpstreamMap) ToUpstreamMapOutputWithContext(ctx context.Context) Upstrea return pulumi.ToOutputWithContext(ctx, i).(UpstreamMapOutput) } +func (i UpstreamMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*Upstream] { + return pulumix.Output[map[string]*Upstream]{ + OutputState: i.ToUpstreamMapOutputWithContext(ctx).OutputState, + } +} + type UpstreamOutput struct{ *pulumi.OutputState } func (UpstreamOutput) ElementType() reflect.Type { @@ -475,6 +494,92 @@ func (o UpstreamOutput) ToUpstreamOutputWithContext(ctx context.Context) Upstrea return o } +func (o UpstreamOutput) ToOutput(ctx context.Context) pulumix.Output[*Upstream] { + return pulumix.Output[*Upstream]{ + OutputState: o.OutputState, + } +} + +// The ID of the client certificate to use (from certificate resource) while TLS handshaking to the upstream server. +func (o UpstreamOutput) ClientCertificateId() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Upstream) pulumi.StringPtrOutput { return v.ClientCertificateId }).(pulumi.StringPtrOutput) +} + +// is a hashing input type if the primary `hashOn` does not return a hash (eg. header is missing, or no consumer identified). One of: `none`, `consumer`, `ip`, `header`, or `cookie`. Not available if `hashOn` is set to `cookie`. Defaults to `none`. +func (o UpstreamOutput) HashFallback() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Upstream) pulumi.StringPtrOutput { return v.HashFallback }).(pulumi.StringPtrOutput) +} + +// is a header name to take the value from as hash input. Only required when `hashFallback` is set to `header`. Default `nil`. +func (o UpstreamOutput) HashFallbackHeader() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Upstream) pulumi.StringPtrOutput { return v.HashFallbackHeader }).(pulumi.StringPtrOutput) +} + +// is a hashing input type: ` none `(resulting in a weighted*round*robin scheme with no hashing), `consumer`, `ip`, `header`, or `cookie`. Defaults to `none`. +func (o UpstreamOutput) HashOn() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Upstream) pulumi.StringPtrOutput { return v.HashOn }).(pulumi.StringPtrOutput) +} + +// is a cookie name to take the value from as hash input. Only required when `hashOn` or `hashFallback` is set to `cookie`. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response. Default `nil`. +func (o UpstreamOutput) HashOnCookie() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Upstream) pulumi.StringPtrOutput { return v.HashOnCookie }).(pulumi.StringPtrOutput) +} + +// is a cookie path to set in the response headers. Only required when `hashOn` or `hashFallback` is set to `cookie`. Defaults to `/`. +// * `healthchecks.active.type` - (Optional) is a active health check type. HTTP or HTTPS, or just attempt a TCP connection. Possible values are `tcp`, `http` or `https`. Defaults to `http`. +// * `healthchecks.active.timeout` - (Optional) is a socket timeout for active health checks (in seconds). Defaults to `1`. +// * `healthchecks.active.concurrency` - (Optional) is a number of targets to check concurrently in active health checks. Defaults to `10`. +// * `healthchecks.active.http_path` - (Optional) is a path to use in GET HTTP request to run as a probe on active health checks. Defaults to `/`. +// * `healthchecks.active.https_verify_certificate` - (Optional) check the validity of the SSL certificate of the remote host when performing active health checks using HTTPS. Defaults to `true`. +// * `healthchecks.active.https_sni` - (Optional) is the hostname to use as an SNI (Server Name Identification) when performing active health checks using HTTPS. This is particularly useful when Targets are configured using IPs, so that the target host’s certificate can be verified with the proper SNI. Default `nil`. +// * `healthchecks.active.healthy.interval` - (Optional) is an interval between active health checks for healthy targets (in seconds). A value of zero indicates that active probes for healthy targets should not be performed. Defaults to `0`. +// * `healthchecks.active.healthy.successes` - (Optional) is a number of successes in active probes (as defined by `healthchecks.active.healthy.http_statuses`) to consider a target healthy. Defaults to `0`. +// * `healthchecks.active.healthy.http_statuses` - (Optional) is an array of HTTP statuses to consider a success, indicating healthiness, when returned by a probe in active health checks. Defaults to `[200, 302]`. +// * `healthchecks.active.unhealthy.interval` - (Optional) is an interval between active health checks for unhealthy targets (in seconds). A value of zero indicates that active probes for unhealthy targets should not be performed. Defaults to `0`. +// * `healthchecks.active.unhealthy.tcp_failures` - (Optional) is a number of TCP failures in active probes to consider a target unhealthy. Defaults to `0`. +// * `healthchecks.active.unhealthy.http_failures` - (Optional) is a number of HTTP failures in active probes (as defined by `healthchecks.active.unhealthy.http_statuses`) to consider a target unhealthy. Defaults to `0`. +// * `healthchecks.active.unhealthy.timeouts` - (Optional) is a number of timeouts in active probes to consider a target unhealthy. Defaults to `0`. +// * `healthchecks.active.unhealthy.http_statuses` - (Optional) is an array of HTTP statuses to consider a failure, indicating unhealthiness, when returned by a probe in active health checks. Defaults to `[429, 404, 500, 501, 502, 503, 504, 505]`. +// * `healthchecks.passive.type` - (Optional) is a passive health check type. Interpreting HTTP/HTTPS statuses, or just check for TCP connection success. Possible values are `tcp`, `http` or `https` (in passive checks, `http` and `https` options are equivalent.). Defaults to `http`. +// * `healthchecks.passive.healthy.successes` - (Optional) is a Number of successes in proxied traffic (as defined by `healthchecks.passive.healthy.http_statuses`) to consider a target healthy, as observed by passive health checks. Defaults to `0`. +// * `healthchecks.passive.healthy.http_statuses` - (Optional) is an array of HTTP statuses which represent healthiness when produced by proxied traffic, as observed by passive health checks. Defaults to `[200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308]`. +// * `healthchecks.passive.unhealthy.tcp_failures` - (Optional) is a number of TCP failures in proxied traffic to consider a target unhealthy, as observed by passive health checks. Defaults to `0`. +// * `healthchecks.passive.unhealthy.http_failures` - (Optional) is a number of HTTP failures in proxied traffic (as defined by `healthchecks.passive.unhealthy.http_statuses`) to consider a target unhealthy, as observed by passive health checks. Defaults to `0`. +// * `healthchecks.passive.unhealthy.timeouts` - (Optional) is a number of timeouts in proxied traffic to consider a target unhealthy, as observed by passive health checks. Defaults to `0`. +// * `healthchecks.passive.unhealthy.http_statuses` - (Optional) is an array of HTTP statuses which represent unhealthiness when produced by proxied traffic, as observed by passive health checks. Defaults to `[429, 500, 503]`. +func (o UpstreamOutput) HashOnCookiePath() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Upstream) pulumi.StringPtrOutput { return v.HashOnCookiePath }).(pulumi.StringPtrOutput) +} + +// is a header name to take the value from as hash input. Only required when `hashOn` is set to `header`. Default `nil`. +func (o UpstreamOutput) HashOnHeader() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Upstream) pulumi.StringPtrOutput { return v.HashOnHeader }).(pulumi.StringPtrOutput) +} + +func (o UpstreamOutput) Healthchecks() UpstreamHealthchecksOutput { + return o.ApplyT(func(v *Upstream) UpstreamHealthchecksOutput { return v.Healthchecks }).(UpstreamHealthchecksOutput) +} + +// The hostname to be used as Host header when proxying requests through Kong. +func (o UpstreamOutput) HostHeader() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Upstream) pulumi.StringPtrOutput { return v.HostHeader }).(pulumi.StringPtrOutput) +} + +// is a hostname, which must be equal to the host of a Service. +func (o UpstreamOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v *Upstream) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) +} + +// is the number of slots in the load balancer algorithm (10*65536, defaults to 10000). +func (o UpstreamOutput) Slots() pulumi.IntPtrOutput { + return o.ApplyT(func(v *Upstream) pulumi.IntPtrOutput { return v.Slots }).(pulumi.IntPtrOutput) +} + +// A list of strings associated with the Upstream for grouping and filtering. +func (o UpstreamOutput) Tags() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Upstream) pulumi.StringArrayOutput { return v.Tags }).(pulumi.StringArrayOutput) +} + type UpstreamArrayOutput struct{ *pulumi.OutputState } func (UpstreamArrayOutput) ElementType() reflect.Type { @@ -489,6 +594,12 @@ func (o UpstreamArrayOutput) ToUpstreamArrayOutputWithContext(ctx context.Contex return o } +func (o UpstreamArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*Upstream] { + return pulumix.Output[[]*Upstream]{ + OutputState: o.OutputState, + } +} + func (o UpstreamArrayOutput) Index(i pulumi.IntInput) UpstreamOutput { return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Upstream { return vs[0].([]*Upstream)[vs[1].(int)] @@ -509,6 +620,12 @@ func (o UpstreamMapOutput) ToUpstreamMapOutputWithContext(ctx context.Context) U return o } +func (o UpstreamMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*Upstream] { + return pulumix.Output[map[string]*Upstream]{ + OutputState: o.OutputState, + } +} + func (o UpstreamMapOutput) MapIndex(k pulumi.StringInput) UpstreamOutput { return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Upstream { return vs[0].(map[string]*Upstream)[vs[1].(string)] diff --git a/sdk/java/src/main/java/com/pulumi/kong/Certificate.java b/sdk/java/src/main/java/com/pulumi/kong/Certificate.java index 8ec76565..34739962 100644 --- a/sdk/java/src/main/java/com/pulumi/kong/Certificate.java +++ b/sdk/java/src/main/java/com/pulumi/kong/Certificate.java @@ -21,6 +21,39 @@ * For more information on creating certificates in Kong [see their documentation](https://docs.konghq.com/gateway-oss/2.5.x/admin-api/#certificate-object) * * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Certificate; + * import com.pulumi.kong.CertificateArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var certificate = new Certificate("certificate", CertificateArgs.builder() + * .certificate("public key --- 123 ----") + * .privateKey("private key --- 456 ----") + * .snis( + * "foo.com", + * "bar.com") + * .tags("myTag") + * .build()); + * + * } + * } + * ``` * * ## Import * @@ -114,6 +147,9 @@ private Certificate(String name, Output id, @Nullable CertificateState s private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) + .additionalSecretOutputs(List.of( + "privateKey" + )) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } diff --git a/sdk/java/src/main/java/com/pulumi/kong/Consumer.java b/sdk/java/src/main/java/com/pulumi/kong/Consumer.java index 45fa2c99..65068ce0 100644 --- a/sdk/java/src/main/java/com/pulumi/kong/Consumer.java +++ b/sdk/java/src/main/java/com/pulumi/kong/Consumer.java @@ -21,6 +21,36 @@ * The consumer resource maps directly onto the json for creating a Consumer in Kong. For more information on the parameters [see the Kong Consumer create documentation](https://docs.konghq.com/gateway-oss/2.5.x/admin-api/#consumer-object). * * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Consumer; + * import com.pulumi.kong.ConsumerArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var consumer = new Consumer("consumer", ConsumerArgs.builder() + * .customId("123") + * .tags("mySuperTag") + * .username("User1") + * .build()); + * + * } + * } + * ``` * * ## Import * diff --git a/sdk/java/src/main/java/com/pulumi/kong/ConsumerAcl.java b/sdk/java/src/main/java/com/pulumi/kong/ConsumerAcl.java index 050956e8..bbf6638b 100644 --- a/sdk/java/src/main/java/com/pulumi/kong/ConsumerAcl.java +++ b/sdk/java/src/main/java/com/pulumi/kong/ConsumerAcl.java @@ -21,6 +21,56 @@ * Consumer ACL is a resource that allows you to configure the acl plugin for a consumer. * * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Consumer; + * import com.pulumi.kong.ConsumerArgs; + * import com.pulumi.kong.Plugin; + * import com.pulumi.kong.PluginArgs; + * import com.pulumi.kong.ConsumerAcl; + * import com.pulumi.kong.ConsumerAclArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var myConsumer = new Consumer("myConsumer", ConsumerArgs.builder() + * .customId("123") + * .username("User1") + * .build()); + * + * var aclPlugin = new Plugin("aclPlugin", PluginArgs.builder() + * .configJson(""" + * { + * "allow": ["group1", "group2"] + * } + * + * """) + * .build()); + * + * var consumerAcl = new ConsumerAcl("consumerAcl", ConsumerAclArgs.builder() + * .consumerId(myConsumer.id()) + * .group("group2") + * .tags( + * "myTag", + * "otherTag") + * .build()); + * + * } + * } + * ``` * */ @ResourceType(type="kong:index/consumerAcl:ConsumerAcl") diff --git a/sdk/java/src/main/java/com/pulumi/kong/ConsumerBasicAuth.java b/sdk/java/src/main/java/com/pulumi/kong/ConsumerBasicAuth.java index d021dd20..f1e29904 100644 --- a/sdk/java/src/main/java/com/pulumi/kong/ConsumerBasicAuth.java +++ b/sdk/java/src/main/java/com/pulumi/kong/ConsumerBasicAuth.java @@ -21,6 +21,49 @@ * Consumer basic auth is a resource that allows you to configure the basic auth plugin for a consumer. * * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Consumer; + * import com.pulumi.kong.ConsumerArgs; + * import com.pulumi.kong.Plugin; + * import com.pulumi.kong.ConsumerBasicAuth; + * import com.pulumi.kong.ConsumerBasicAuthArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var myConsumer = new Consumer("myConsumer", ConsumerArgs.builder() + * .customId("123") + * .username("User1") + * .build()); + * + * var basicAuthPlugin = new Plugin("basicAuthPlugin"); + * + * var consumerBasicAuth = new ConsumerBasicAuth("consumerBasicAuth", ConsumerBasicAuthArgs.builder() + * .consumerId(myConsumer.id()) + * .password("bar_updated") + * .tags( + * "myTag", + * "anotherTag") + * .username("foo_updated") + * .build()); + * + * } + * } + * ``` * */ @ResourceType(type="kong:index/consumerBasicAuth:ConsumerBasicAuth") diff --git a/sdk/java/src/main/java/com/pulumi/kong/ConsumerJwtAuth.java b/sdk/java/src/main/java/com/pulumi/kong/ConsumerJwtAuth.java index fca89752..48dc6dba 100644 --- a/sdk/java/src/main/java/com/pulumi/kong/ConsumerJwtAuth.java +++ b/sdk/java/src/main/java/com/pulumi/kong/ConsumerJwtAuth.java @@ -21,6 +21,56 @@ * Consumer jwt auth is a resource that allows you to configure the jwt auth plugin for a consumer. * * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Consumer; + * import com.pulumi.kong.ConsumerArgs; + * import com.pulumi.kong.Plugin; + * import com.pulumi.kong.PluginArgs; + * import com.pulumi.kong.ConsumerJwtAuth; + * import com.pulumi.kong.ConsumerJwtAuthArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var myConsumer = new Consumer("myConsumer", ConsumerArgs.builder() + * .customId("123") + * .username("User1") + * .build()); + * + * var jwtPlugin = new Plugin("jwtPlugin", PluginArgs.builder() + * .configJson(""" + * { + * "claims_to_verify": ["exp"] + * } + * + * """) + * .build()); + * + * var consumerJwtConfig = new ConsumerJwtAuth("consumerJwtConfig", ConsumerJwtAuthArgs.builder() + * .algorithm("HS256") + * .consumerId(myConsumer.id()) + * .key("my_key") + * .rsaPublicKey("foo") + * .secret("my_secret") + * .build()); + * + * } + * } + * ``` * */ @ResourceType(type="kong:index/consumerJwtAuth:ConsumerJwtAuth") diff --git a/sdk/java/src/main/java/com/pulumi/kong/ConsumerKeyAuth.java b/sdk/java/src/main/java/com/pulumi/kong/ConsumerKeyAuth.java index 2ba00f5e..2ff68c52 100644 --- a/sdk/java/src/main/java/com/pulumi/kong/ConsumerKeyAuth.java +++ b/sdk/java/src/main/java/com/pulumi/kong/ConsumerKeyAuth.java @@ -21,6 +21,48 @@ * Resource that allows you to configure the [Key Authentication](https://docs.konghq.com/hub/kong-inc/key-auth/) plugin for a consumer. * * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Consumer; + * import com.pulumi.kong.ConsumerArgs; + * import com.pulumi.kong.Plugin; + * import com.pulumi.kong.ConsumerKeyAuth; + * import com.pulumi.kong.ConsumerKeyAuthArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var myConsumer = new Consumer("myConsumer", ConsumerArgs.builder() + * .username("User1") + * .customId("123") + * .build()); + * + * var keyAuthPlugin = new Plugin("keyAuthPlugin"); + * + * var consumerKeyAuth = new ConsumerKeyAuth("consumerKeyAuth", ConsumerKeyAuthArgs.builder() + * .consumerId(myConsumer.id()) + * .key("secret") + * .tags( + * "myTag", + * "anotherTag") + * .build()); + * + * } + * } + * ``` * */ @ResourceType(type="kong:index/consumerKeyAuth:ConsumerKeyAuth") @@ -100,6 +142,9 @@ private ConsumerKeyAuth(String name, Output id, @Nullable ConsumerKeyAut private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) + .additionalSecretOutputs(List.of( + "key" + )) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } diff --git a/sdk/java/src/main/java/com/pulumi/kong/ConsumerOauth2.java b/sdk/java/src/main/java/com/pulumi/kong/ConsumerOauth2.java index 280a7484..a36809d7 100644 --- a/sdk/java/src/main/java/com/pulumi/kong/ConsumerOauth2.java +++ b/sdk/java/src/main/java/com/pulumi/kong/ConsumerOauth2.java @@ -22,6 +22,62 @@ * Resource that allows you to configure the OAuth2 plugin credentials for a consumer. * * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Consumer; + * import com.pulumi.kong.ConsumerArgs; + * import com.pulumi.kong.Plugin; + * import com.pulumi.kong.PluginArgs; + * import com.pulumi.kong.ConsumerOauth2; + * import com.pulumi.kong.ConsumerOauth2Args; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var myConsumer = new Consumer("myConsumer", ConsumerArgs.builder() + * .customId("123") + * .username("User1") + * .build()); + * + * var oauth2Plugin = new Plugin("oauth2Plugin", PluginArgs.builder() + * .configJson(""" + * { + * "global_credentials": true, + * "enable_password_grant": true, + * "token_expiration": 180, + * "refresh_token_ttl": 180, + * "provision_key": "testprovisionkey" + * } + * + * """) + * .build()); + * + * var consumerOauth2 = new ConsumerOauth2("consumerOauth2", ConsumerOauth2Args.builder() + * .clientId("client_id") + * .clientSecret("client_secret") + * .consumerId(myConsumer.id()) + * .redirectUris( + * "https://asdf.com/callback", + * "https://test.cl/callback") + * .tags("myTag") + * .build()); + * + * } + * } + * ``` * */ @ResourceType(type="kong:index/consumerOauth2:ConsumerOauth2") diff --git a/sdk/java/src/main/java/com/pulumi/kong/Plugin.java b/sdk/java/src/main/java/com/pulumi/kong/Plugin.java index f99175c6..78a7823a 100644 --- a/sdk/java/src/main/java/com/pulumi/kong/Plugin.java +++ b/sdk/java/src/main/java/com/pulumi/kong/Plugin.java @@ -23,6 +23,172 @@ * The `config_json` is passed through to the plugin to configure it as is. * * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Plugin; + * import com.pulumi.kong.PluginArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var rateLimit = new Plugin("rateLimit", PluginArgs.builder() + * .configJson(""" + * { + * "second": 5, + * "hour" : 1000 + * } + * + * """) + * .build()); + * + * } + * } + * ``` + * To apply a plugin to a consumer use the `consumer_id` property, for example: + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Consumer; + * import com.pulumi.kong.ConsumerArgs; + * import com.pulumi.kong.Plugin; + * import com.pulumi.kong.PluginArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var pluginConsumer = new Consumer("pluginConsumer", ConsumerArgs.builder() + * .customId("567") + * .username("PluginUser") + * .build()); + * + * var rateLimit = new Plugin("rateLimit", PluginArgs.builder() + * .configJson(""" + * { + * "second": 5, + * "hour" : 1000 + * } + * + * """) + * .consumerId(pluginConsumer.id()) + * .build()); + * + * } + * } + * ``` + * + * To apply a plugin to a service use the `service_id` property, for example: + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Service; + * import com.pulumi.kong.ServiceArgs; + * import com.pulumi.kong.Plugin; + * import com.pulumi.kong.PluginArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var service = new Service("service", ServiceArgs.builder() + * .host("test.org") + * .protocol("http") + * .build()); + * + * var rateLimit = new Plugin("rateLimit", PluginArgs.builder() + * .configJson(""" + * { + * "second": 10, + * "hour" : 2000 + * } + * + * """) + * .serviceId(service.id()) + * .build()); + * + * } + * } + * ``` + * + * To apply a plugin to a route use the `route_id` property, for example: + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Service; + * import com.pulumi.kong.ServiceArgs; + * import com.pulumi.kong.Plugin; + * import com.pulumi.kong.PluginArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var service = new Service("service", ServiceArgs.builder() + * .host("test.org") + * .protocol("http") + * .build()); + * + * var rateLimit = new Plugin("rateLimit", PluginArgs.builder() + * .configJson(""" + * { + * "second": 11, + * "hour" : 4000 + * } + * + * """) + * .enabled(true) + * .serviceId(service.id()) + * .build()); + * + * } + * } + * ``` * * ## Import * diff --git a/sdk/java/src/main/java/com/pulumi/kong/Route.java b/sdk/java/src/main/java/com/pulumi/kong/Route.java index ef9a941c..bba49595 100644 --- a/sdk/java/src/main/java/com/pulumi/kong/Route.java +++ b/sdk/java/src/main/java/com/pulumi/kong/Route.java @@ -28,6 +28,100 @@ * To create a tcp/tls route you set `sources` and `destinations` by repeating the corresponding element (`source` or `destination`) for each source or destination you want. * * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Route; + * import com.pulumi.kong.RouteArgs; + * import com.pulumi.kong.inputs.RouteHeaderArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var route = new Route("route", RouteArgs.builder() + * .protocols( + * "http", + * "https") + * .methods( + * "GET", + * "POST") + * .hosts("example2.com") + * .paths("/test") + * .stripPath(false) + * .preserveHost(true) + * .regexPriority(1) + * .serviceId(kong_service.service().id()) + * .headers(RouteHeaderArgs.builder() + * .name("x-test-1") + * .values( + * "a", + * "b") + * .build()) + * .build()); + * + * } + * } + * ``` + * + * To create a tcp/tls route you set `sources` and `destinations` by repeating the corresponding element (`source` or `destination`) for each source or destination you want, for example: + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Route; + * import com.pulumi.kong.RouteArgs; + * import com.pulumi.kong.inputs.RouteSourceArgs; + * import com.pulumi.kong.inputs.RouteDestinationArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var route = new Route("route", RouteArgs.builder() + * .protocols("tcp") + * .stripPath(true) + * .preserveHost(false) + * .sources( + * RouteSourceArgs.builder() + * .ip("192.168.1.1") + * .port(80) + * .build(), + * RouteSourceArgs.builder() + * .ip("192.168.1.2") + * .build()) + * .destinations(RouteDestinationArgs.builder() + * .ip("172.10.1.1") + * .port(81) + * .build()) + * .snis("foo.com") + * .serviceId(kong_service.service().id()) + * .build()); + * + * } + * } + * ``` * * ## Import * diff --git a/sdk/java/src/main/java/com/pulumi/kong/Service.java b/sdk/java/src/main/java/com/pulumi/kong/Service.java index 1b9f629f..5b9fcd86 100644 --- a/sdk/java/src/main/java/com/pulumi/kong/Service.java +++ b/sdk/java/src/main/java/com/pulumi/kong/Service.java @@ -23,6 +23,106 @@ * The service resource maps directly onto the json for the service endpoint in Kong. For more information on the parameters [see the Kong Service create documentation](https://docs.konghq.com/gateway-oss/2.5.x/admin-api/#service-object). * * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Service; + * import com.pulumi.kong.ServiceArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var service = new Service("service", ServiceArgs.builder() + * .connectTimeout(1000) + * .host("test.org") + * .path("/mypath") + * .port(8080) + * .protocol("http") + * .readTimeout(3000) + * .retries(5) + * .writeTimeout(2000) + * .build()); + * + * } + * } + * ``` + * + * To use a client certificate and ca certificates combine with certificate resource (note protocol must be `https`): + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Certificate; + * import com.pulumi.kong.CertificateArgs; + * import com.pulumi.kong.Service; + * import com.pulumi.kong.ServiceArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var certificate = new Certificate("certificate", CertificateArgs.builder() + * .certificate(""" + * -----BEGIN CERTIFICATE----- + * ...... + * -----END CERTIFICATE----- + * """) + * .privateKey(""" + * -----BEGIN PRIVATE KEY----- + * ..... + * -----END PRIVATE KEY----- + * """) + * .snis("foo.com") + * .build()); + * + * var ca = new Certificate("ca", CertificateArgs.builder() + * .certificate(""" + * -----BEGIN CERTIFICATE----- + * ...... + * -----END CERTIFICATE----- + * """) + * .privateKey(""" + * -----BEGIN PRIVATE KEY----- + * ..... + * -----END PRIVATE KEY----- + * """) + * .snis("ca.com") + * .build()); + * + * var service = new Service("service", ServiceArgs.builder() + * .protocol("https") + * .host("test.org") + * .tlsVerify(true) + * .tlsVerifyDepth(2) + * .clientCertificateId(certificate.id()) + * .caCertificateIds(ca.id()) + * .build()); + * + * } + * } + * ``` * * ## Import * diff --git a/sdk/java/src/main/java/com/pulumi/kong/Target.java b/sdk/java/src/main/java/com/pulumi/kong/Target.java index 1a4d09ab..0228e796 100644 --- a/sdk/java/src/main/java/com/pulumi/kong/Target.java +++ b/sdk/java/src/main/java/com/pulumi/kong/Target.java @@ -18,6 +18,36 @@ /** * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Target; + * import com.pulumi.kong.TargetArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var target = new Target("target", TargetArgs.builder() + * .target("sample_target:80") + * .upstreamId(kong_upstream.upstream().id()) + * .weight(10) + * .build()); + * + * } + * } + * ``` * * ## Import * diff --git a/sdk/java/src/main/java/com/pulumi/kong/Upstream.java b/sdk/java/src/main/java/com/pulumi/kong/Upstream.java index fade739c..8f8d16a3 100644 --- a/sdk/java/src/main/java/com/pulumi/kong/Upstream.java +++ b/sdk/java/src/main/java/com/pulumi/kong/Upstream.java @@ -19,6 +19,113 @@ /** * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.kong.Certificate; + * import com.pulumi.kong.CertificateArgs; + * import com.pulumi.kong.Upstream; + * import com.pulumi.kong.UpstreamArgs; + * import com.pulumi.kong.inputs.UpstreamHealthchecksArgs; + * import com.pulumi.kong.inputs.UpstreamHealthchecksActiveArgs; + * import com.pulumi.kong.inputs.UpstreamHealthchecksActiveHealthyArgs; + * import com.pulumi.kong.inputs.UpstreamHealthchecksActiveUnhealthyArgs; + * import com.pulumi.kong.inputs.UpstreamHealthchecksPassiveArgs; + * import com.pulumi.kong.inputs.UpstreamHealthchecksPassiveHealthyArgs; + * import com.pulumi.kong.inputs.UpstreamHealthchecksPassiveUnhealthyArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var certificate = new Certificate("certificate", CertificateArgs.builder() + * .certificate(""" + * -----BEGIN CERTIFICATE----- + * ...... + * -----END CERTIFICATE----- + * """) + * .privateKey(""" + * -----BEGIN PRIVATE KEY----- + * ..... + * -----END PRIVATE KEY----- + * """) + * .snis("foo.com") + * .build()); + * + * var upstream = new Upstream("upstream", UpstreamArgs.builder() + * .slots(10) + * .hashOn("header") + * .hashFallback("cookie") + * .hashOnHeader("HeaderName") + * .hashFallbackHeader("FallbackHeaderName") + * .hashOnCookie("CookieName") + * .hashOnCookiePath("/path") + * .hostHeader("x-host") + * .tags( + * "a", + * "b") + * .clientCertificateId(certificate.id()) + * .healthchecks(UpstreamHealthchecksArgs.builder() + * .active(UpstreamHealthchecksActiveArgs.builder() + * .type("https") + * .httpPath("/status") + * .timeout(10) + * .concurrency(20) + * .httpsVerifyCertificate(false) + * .httpsSni("some.domain.com") + * .healthy(UpstreamHealthchecksActiveHealthyArgs.builder() + * .successes(1) + * .interval(5) + * .httpStatuses( + * 200, + * 201) + * .build()) + * .unhealthy(UpstreamHealthchecksActiveUnhealthyArgs.builder() + * .timeouts(7) + * .interval(3) + * .tcpFailures(1) + * .httpFailures(2) + * .httpStatuses( + * 500, + * 501) + * .build()) + * .build()) + * .passive(UpstreamHealthchecksPassiveArgs.builder() + * .type("https") + * .healthy(UpstreamHealthchecksPassiveHealthyArgs.builder() + * .successes(1) + * .httpStatuses( + * 200, + * 201, + * 202) + * .build()) + * .unhealthy(UpstreamHealthchecksPassiveUnhealthyArgs.builder() + * .timeouts(3) + * .tcpFailures(5) + * .httpFailures(6) + * .httpStatuses( + * 500, + * 501, + * 502) + * .build()) + * .build()) + * .build()) + * .build()); + * + * } + * } + * ``` * * ## Import * diff --git a/sdk/nodejs/README.md b/sdk/nodejs/README.md index 65bfb754..2359b361 100644 --- a/sdk/nodejs/README.md +++ b/sdk/nodejs/README.md @@ -1,4 +1,4 @@ > This provider is a derived work of the [Terraform Provider](https://github.com/kevholditch/terraform-provider-kong) > distributed under [MIT](https://mit-license.org/). If you encounter a bug or missing feature, -> first check the [`pulumi/pulumi-kong` repo](https://github.com/pulumi/pulumi-kong/issues); however, if that doesn't turn up anything, -> please consult the source [`kevholditch/terraform-provider-kong` repo](https://github.com/kevholditch/terraform-provider-kong/issues). +> first check the [`pulumi-kong` repo](https://github.com/pulumi/pulumi-kong/issues); however, if that doesn't turn up anything, +> please consult the source [`terraform-provider-kong` repo](https://github.com/kevholditch/terraform-provider-kong/issues). diff --git a/sdk/nodejs/certificate.ts b/sdk/nodejs/certificate.ts index b607e66c..3f99c967 100644 --- a/sdk/nodejs/certificate.ts +++ b/sdk/nodejs/certificate.ts @@ -99,11 +99,13 @@ export class Certificate extends pulumi.CustomResource { throw new Error("Missing required property 'certificate'"); } resourceInputs["certificate"] = args ? args.certificate : undefined; - resourceInputs["privateKey"] = args ? args.privateKey : undefined; + resourceInputs["privateKey"] = args?.privateKey ? pulumi.secret(args.privateKey) : undefined; resourceInputs["snis"] = args ? args.snis : undefined; resourceInputs["tags"] = args ? args.tags : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); + const secretOpts = { additionalSecretOutputs: ["privateKey"] }; + opts = pulumi.mergeOptions(opts, secretOpts); super(Certificate.__pulumiType, name, resourceInputs, opts); } } diff --git a/sdk/nodejs/consumerAcl.ts b/sdk/nodejs/consumerAcl.ts index 3667be7c..c7382c9a 100644 --- a/sdk/nodejs/consumerAcl.ts +++ b/sdk/nodejs/consumerAcl.ts @@ -15,17 +15,16 @@ import * as utilities from "./utilities"; * import * as pulumi from "@pulumi/pulumi"; * import * as kong from "@pulumi/kong"; * - * const myConsumer = new kong.Consumer("my_consumer", { + * const myConsumer = new kong.Consumer("myConsumer", { * customId: "123", * username: "User1", * }); - * const aclPlugin = new kong.Plugin("acl_plugin", { - * configJson: ` { + * const aclPlugin = new kong.Plugin("aclPlugin", {configJson: ` { * "allow": ["group1", "group2"] * } - * `, - * }); - * const consumerAcl = new kong.ConsumerAcl("consumer_acl", { + * + * `}); + * const consumerAcl = new kong.ConsumerAcl("consumerAcl", { * consumerId: myConsumer.id, * group: "group2", * tags: [ diff --git a/sdk/nodejs/consumerBasicAuth.ts b/sdk/nodejs/consumerBasicAuth.ts index 6fc32e27..b3756c37 100644 --- a/sdk/nodejs/consumerBasicAuth.ts +++ b/sdk/nodejs/consumerBasicAuth.ts @@ -15,12 +15,12 @@ import * as utilities from "./utilities"; * import * as pulumi from "@pulumi/pulumi"; * import * as kong from "@pulumi/kong"; * - * const myConsumer = new kong.Consumer("my_consumer", { + * const myConsumer = new kong.Consumer("myConsumer", { * customId: "123", * username: "User1", * }); - * const basicAuthPlugin = new kong.Plugin("basic_auth_plugin", {}); - * const consumerBasicAuth = new kong.ConsumerBasicAuth("consumer_basic_auth", { + * const basicAuthPlugin = new kong.Plugin("basicAuthPlugin", {}); + * const consumerBasicAuth = new kong.ConsumerBasicAuth("consumerBasicAuth", { * consumerId: myConsumer.id, * password: "bar_updated", * tags: [ diff --git a/sdk/nodejs/consumerJwtAuth.ts b/sdk/nodejs/consumerJwtAuth.ts index a6b2dbf8..b4b8abd7 100644 --- a/sdk/nodejs/consumerJwtAuth.ts +++ b/sdk/nodejs/consumerJwtAuth.ts @@ -15,17 +15,16 @@ import * as utilities from "./utilities"; * import * as pulumi from "@pulumi/pulumi"; * import * as kong from "@pulumi/kong"; * - * const myConsumer = new kong.Consumer("my_consumer", { + * const myConsumer = new kong.Consumer("myConsumer", { * customId: "123", * username: "User1", * }); - * const jwtPlugin = new kong.Plugin("jwt_plugin", { - * configJson: ` { + * const jwtPlugin = new kong.Plugin("jwtPlugin", {configJson: ` { * "claims_to_verify": ["exp"] * } - * `, - * }); - * const consumerJwtConfig = new kong.ConsumerJwtAuth("consumer_jwt_config", { + * + * `}); + * const consumerJwtConfig = new kong.ConsumerJwtAuth("consumerJwtConfig", { * algorithm: "HS256", * consumerId: myConsumer.id, * key: "my_key", diff --git a/sdk/nodejs/consumerKeyAuth.ts b/sdk/nodejs/consumerKeyAuth.ts index eb1a83c0..0a5107cd 100644 --- a/sdk/nodejs/consumerKeyAuth.ts +++ b/sdk/nodejs/consumerKeyAuth.ts @@ -93,10 +93,12 @@ export class ConsumerKeyAuth extends pulumi.CustomResource { throw new Error("Missing required property 'consumerId'"); } resourceInputs["consumerId"] = args ? args.consumerId : undefined; - resourceInputs["key"] = args ? args.key : undefined; + resourceInputs["key"] = args?.key ? pulumi.secret(args.key) : undefined; resourceInputs["tags"] = args ? args.tags : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); + const secretOpts = { additionalSecretOutputs: ["key"] }; + opts = pulumi.mergeOptions(opts, secretOpts); super(ConsumerKeyAuth.__pulumiType, name, resourceInputs, opts); } } diff --git a/sdk/nodejs/consumerOauth2.ts b/sdk/nodejs/consumerOauth2.ts index b59555d9..4cecd0d2 100644 --- a/sdk/nodejs/consumerOauth2.ts +++ b/sdk/nodejs/consumerOauth2.ts @@ -15,21 +15,20 @@ import * as utilities from "./utilities"; * import * as pulumi from "@pulumi/pulumi"; * import * as kong from "@pulumi/kong"; * - * const myConsumer = new kong.Consumer("my_consumer", { + * const myConsumer = new kong.Consumer("myConsumer", { * customId: "123", * username: "User1", * }); - * const oauth2Plugin = new kong.Plugin("oauth2_plugin", { - * configJson: ` { + * const oauth2Plugin = new kong.Plugin("oauth2Plugin", {configJson: ` { * "global_credentials": true, * "enable_password_grant": true, * "token_expiration": 180, * "refresh_token_ttl": 180, * "provision_key": "testprovisionkey" * } - * `, - * }); - * const consumerOauth2 = new kong.ConsumerOauth2("consumer_oauth2", { + * + * `}); + * const consumerOauth2 = new kong.ConsumerOauth2("consumerOauth2", { * clientId: "client_id", * clientSecret: "client_secret", * consumerId: myConsumer.id, diff --git a/sdk/nodejs/index.ts b/sdk/nodejs/index.ts index 178fc7a4..0ee99b4f 100644 --- a/sdk/nodejs/index.ts +++ b/sdk/nodejs/index.ts @@ -5,19 +5,71 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; // Export members: -export * from "./certificate"; -export * from "./consumer"; -export * from "./consumerAcl"; -export * from "./consumerBasicAuth"; -export * from "./consumerJwtAuth"; -export * from "./consumerKeyAuth"; -export * from "./consumerOauth2"; -export * from "./plugin"; -export * from "./provider"; -export * from "./route"; -export * from "./service"; -export * from "./target"; -export * from "./upstream"; +export { CertificateArgs, CertificateState } from "./certificate"; +export type Certificate = import("./certificate").Certificate; +export const Certificate: typeof import("./certificate").Certificate = null as any; +utilities.lazyLoad(exports, ["Certificate"], () => require("./certificate")); + +export { ConsumerArgs, ConsumerState } from "./consumer"; +export type Consumer = import("./consumer").Consumer; +export const Consumer: typeof import("./consumer").Consumer = null as any; +utilities.lazyLoad(exports, ["Consumer"], () => require("./consumer")); + +export { ConsumerAclArgs, ConsumerAclState } from "./consumerAcl"; +export type ConsumerAcl = import("./consumerAcl").ConsumerAcl; +export const ConsumerAcl: typeof import("./consumerAcl").ConsumerAcl = null as any; +utilities.lazyLoad(exports, ["ConsumerAcl"], () => require("./consumerAcl")); + +export { ConsumerBasicAuthArgs, ConsumerBasicAuthState } from "./consumerBasicAuth"; +export type ConsumerBasicAuth = import("./consumerBasicAuth").ConsumerBasicAuth; +export const ConsumerBasicAuth: typeof import("./consumerBasicAuth").ConsumerBasicAuth = null as any; +utilities.lazyLoad(exports, ["ConsumerBasicAuth"], () => require("./consumerBasicAuth")); + +export { ConsumerJwtAuthArgs, ConsumerJwtAuthState } from "./consumerJwtAuth"; +export type ConsumerJwtAuth = import("./consumerJwtAuth").ConsumerJwtAuth; +export const ConsumerJwtAuth: typeof import("./consumerJwtAuth").ConsumerJwtAuth = null as any; +utilities.lazyLoad(exports, ["ConsumerJwtAuth"], () => require("./consumerJwtAuth")); + +export { ConsumerKeyAuthArgs, ConsumerKeyAuthState } from "./consumerKeyAuth"; +export type ConsumerKeyAuth = import("./consumerKeyAuth").ConsumerKeyAuth; +export const ConsumerKeyAuth: typeof import("./consumerKeyAuth").ConsumerKeyAuth = null as any; +utilities.lazyLoad(exports, ["ConsumerKeyAuth"], () => require("./consumerKeyAuth")); + +export { ConsumerOauth2Args, ConsumerOauth2State } from "./consumerOauth2"; +export type ConsumerOauth2 = import("./consumerOauth2").ConsumerOauth2; +export const ConsumerOauth2: typeof import("./consumerOauth2").ConsumerOauth2 = null as any; +utilities.lazyLoad(exports, ["ConsumerOauth2"], () => require("./consumerOauth2")); + +export { PluginArgs, PluginState } from "./plugin"; +export type Plugin = import("./plugin").Plugin; +export const Plugin: typeof import("./plugin").Plugin = null as any; +utilities.lazyLoad(exports, ["Plugin"], () => require("./plugin")); + +export { ProviderArgs } from "./provider"; +export type Provider = import("./provider").Provider; +export const Provider: typeof import("./provider").Provider = null as any; +utilities.lazyLoad(exports, ["Provider"], () => require("./provider")); + +export { RouteArgs, RouteState } from "./route"; +export type Route = import("./route").Route; +export const Route: typeof import("./route").Route = null as any; +utilities.lazyLoad(exports, ["Route"], () => require("./route")); + +export { ServiceArgs, ServiceState } from "./service"; +export type Service = import("./service").Service; +export const Service: typeof import("./service").Service = null as any; +utilities.lazyLoad(exports, ["Service"], () => require("./service")); + +export { TargetArgs, TargetState } from "./target"; +export type Target = import("./target").Target; +export const Target: typeof import("./target").Target = null as any; +utilities.lazyLoad(exports, ["Target"], () => require("./target")); + +export { UpstreamArgs, UpstreamState } from "./upstream"; +export type Upstream = import("./upstream").Upstream; +export const Upstream: typeof import("./upstream").Upstream = null as any; +utilities.lazyLoad(exports, ["Upstream"], () => require("./upstream")); + // Export sub-modules: import * as config from "./config"; @@ -28,20 +80,6 @@ export { types, }; -// Import resources to register: -import { Certificate } from "./certificate"; -import { Consumer } from "./consumer"; -import { ConsumerAcl } from "./consumerAcl"; -import { ConsumerBasicAuth } from "./consumerBasicAuth"; -import { ConsumerJwtAuth } from "./consumerJwtAuth"; -import { ConsumerKeyAuth } from "./consumerKeyAuth"; -import { ConsumerOauth2 } from "./consumerOauth2"; -import { Plugin } from "./plugin"; -import { Route } from "./route"; -import { Service } from "./service"; -import { Target } from "./target"; -import { Upstream } from "./upstream"; - const _module = { version: utilities.getVersion(), construct: (name: string, type: string, urn: string): pulumi.Resource => { @@ -87,9 +125,6 @@ pulumi.runtime.registerResourceModule("kong", "index/route", _module) pulumi.runtime.registerResourceModule("kong", "index/service", _module) pulumi.runtime.registerResourceModule("kong", "index/target", _module) pulumi.runtime.registerResourceModule("kong", "index/upstream", _module) - -import { Provider } from "./provider"; - pulumi.runtime.registerResourcePackage("kong", { version: utilities.getVersion(), constructProvider: (name: string, type: string, urn: string): pulumi.ProviderResource => { diff --git a/sdk/nodejs/package.json b/sdk/nodejs/package.json index e79cce1f..39d1ca48 100644 --- a/sdk/nodejs/package.json +++ b/sdk/nodejs/package.json @@ -10,8 +10,7 @@ "repository": "https://github.com/pulumi/pulumi-kong", "license": "Apache-2.0", "scripts": { - "build": "tsc", - "install": "node scripts/install-pulumi-plugin.js resource kong ${VERSION}" + "build": "tsc" }, "dependencies": { "@pulumi/pulumi": "^3.0.0" @@ -22,6 +21,7 @@ "typescript": "^4.3.5" }, "pulumi": { - "resource": true + "resource": true, + "name": "kong" } } diff --git a/sdk/nodejs/plugin.ts b/sdk/nodejs/plugin.ts index d09f9955..6640b355 100644 --- a/sdk/nodejs/plugin.ts +++ b/sdk/nodejs/plugin.ts @@ -16,13 +16,12 @@ import * as utilities from "./utilities"; * import * as pulumi from "@pulumi/pulumi"; * import * as kong from "@pulumi/kong"; * - * const rateLimit = new kong.Plugin("rate_limit", { - * configJson: ` { + * const rateLimit = new kong.Plugin("rateLimit", {configJson: ` { * "second": 5, * "hour" : 1000 * } - * `, - * }); + * + * `}); * ``` * To apply a plugin to a consumer use the `consumerId` property, for example: * @@ -30,15 +29,16 @@ import * as utilities from "./utilities"; * import * as pulumi from "@pulumi/pulumi"; * import * as kong from "@pulumi/kong"; * - * const pluginConsumer = new kong.Consumer("plugin_consumer", { + * const pluginConsumer = new kong.Consumer("pluginConsumer", { * customId: "567", * username: "PluginUser", * }); - * const rateLimit = new kong.Plugin("rate_limit", { + * const rateLimit = new kong.Plugin("rateLimit", { * configJson: ` { * "second": 5, * "hour" : 1000 * } + * * `, * consumerId: pluginConsumer.id, * }); @@ -54,11 +54,12 @@ import * as utilities from "./utilities"; * host: "test.org", * protocol: "http", * }); - * const rateLimit = new kong.Plugin("rate_limit", { + * const rateLimit = new kong.Plugin("rateLimit", { * configJson: ` { * "second": 10, * "hour" : 2000 * } + * * `, * serviceId: service.id, * }); @@ -74,11 +75,12 @@ import * as utilities from "./utilities"; * host: "test.org", * protocol: "http", * }); - * const rateLimit = new kong.Plugin("rate_limit", { + * const rateLimit = new kong.Plugin("rateLimit", { * configJson: ` { * "second": 11, * "hour" : 4000 * } + * * `, * enabled: true, * serviceId: service.id, diff --git a/sdk/nodejs/provider.ts b/sdk/nodejs/provider.ts index b788d6d8..f18ad799 100644 --- a/sdk/nodejs/provider.ts +++ b/sdk/nodejs/provider.ts @@ -22,7 +22,7 @@ export class Provider extends pulumi.ProviderResource { if (obj === undefined || obj === null) { return false; } - return obj['__pulumiType'] === Provider.__pulumiType; + return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType; } /** diff --git a/sdk/nodejs/route.ts b/sdk/nodejs/route.ts index 067f7929..0e6051d7 100644 --- a/sdk/nodejs/route.ts +++ b/sdk/nodejs/route.ts @@ -2,7 +2,8 @@ // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; -import { input as inputs, output as outputs } from "./types"; +import * as inputs from "./types/input"; +import * as outputs from "./types/output"; import * as utilities from "./utilities"; /** diff --git a/sdk/nodejs/scripts/install-pulumi-plugin.js b/sdk/nodejs/scripts/install-pulumi-plugin.js deleted file mode 100644 index fefc6e0e..00000000 --- a/sdk/nodejs/scripts/install-pulumi-plugin.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -var childProcess = require("child_process"); - -var args = process.argv.slice(2); - -if (args.indexOf("${VERSION}") !== -1) { - process.exit(0); -} - -var res = childProcess.spawnSync("pulumi", ["plugin", "install"].concat(args), { - stdio: ["ignore", "inherit", "inherit"] -}); - -if (res.error && res.error.code === "ENOENT") { - console.error("\nThere was an error installing the resource provider plugin. " + - "It looks like `pulumi` is not installed on your system. " + - "Please visit https://pulumi.com/ to install the Pulumi CLI.\n" + - "You may try manually installing the plugin by running " + - "`pulumi plugin install " + args.join(" ") + "`"); -} else if (res.error || res.status !== 0) { - console.error("\nThere was an error installing the resource provider plugin. " + - "You may try to manually installing the plugin by running " + - "`pulumi plugin install " + args.join(" ") + "`"); -} - -process.exit(0); diff --git a/sdk/nodejs/target.ts b/sdk/nodejs/target.ts index 3df3c495..e7b9c86e 100644 --- a/sdk/nodejs/target.ts +++ b/sdk/nodejs/target.ts @@ -13,7 +13,7 @@ import * as utilities from "./utilities"; * * const target = new kong.Target("target", { * target: "sample_target:80", - * upstreamId: kong_upstream_upstream.id, + * upstreamId: kong_upstream.upstream.id, * weight: 10, * }); * ``` diff --git a/sdk/nodejs/types/index.ts b/sdk/nodejs/types/index.ts index a6057c6f..c7b9909c 100644 --- a/sdk/nodejs/types/index.ts +++ b/sdk/nodejs/types/index.ts @@ -1,6 +1,8 @@ // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** +import * as utilities from "../utilities"; + // Export sub-modules: import * as input from "./input"; import * as output from "./output"; diff --git a/sdk/nodejs/types/input.ts b/sdk/nodejs/types/input.ts index c6b2f5ad..437e6bf7 100644 --- a/sdk/nodejs/types/input.ts +++ b/sdk/nodejs/types/input.ts @@ -2,7 +2,8 @@ // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; -import { input as inputs, output as outputs } from "../types"; +import * as inputs from "../types/input"; +import * as outputs from "../types/output"; export interface RouteDestination { ip?: pulumi.Input; diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index f00777a6..7d31dda2 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -2,7 +2,8 @@ // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; -import { input as inputs, output as outputs } from "../types"; +import * as inputs from "../types/input"; +import * as outputs from "../types/output"; export interface RouteDestination { ip?: string; diff --git a/sdk/nodejs/upstream.ts b/sdk/nodejs/upstream.ts index 70a9b74c..78383500 100644 --- a/sdk/nodejs/upstream.ts +++ b/sdk/nodejs/upstream.ts @@ -2,7 +2,8 @@ // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; -import { input as inputs, output as outputs } from "./types"; +import * as inputs from "./types/input"; +import * as outputs from "./types/output"; import * as utilities from "./utilities"; /** diff --git a/sdk/nodejs/utilities.ts b/sdk/nodejs/utilities.ts index 4c60e03f..2580a644 100644 --- a/sdk/nodejs/utilities.ts +++ b/sdk/nodejs/utilities.ts @@ -52,3 +52,15 @@ export function getVersion(): string { export function resourceOptsDefaults(): any { return { version: getVersion() }; } + +/** @internal */ +export function lazyLoad(exports: any, props: string[], loadModule: any) { + for (let property of props) { + Object.defineProperty(exports, property, { + enumerable: true, + get: function() { + return loadModule()[property]; + }, + }); + } +} diff --git a/sdk/python/pulumi_kong/README.md b/sdk/python/pulumi_kong/README.md index 2df88c70..0995f15d 100644 --- a/sdk/python/pulumi_kong/README.md +++ b/sdk/python/pulumi_kong/README.md @@ -1,4 +1,4 @@ > This provider is a derived work of the [Terraform Provider](https://github.com/kevholditch/terraform-provider-kong) > distributed under [MIT](https://mit-license.org/). If you encounter a bug or missing feature, -> first check the [`pulumi/pulumi-kong` repo](https://github.com/pulumi/pulumi-kong/issues); however, if that doesn't turn up anything, -> please consult the source [`kevholditch/terraform-provider-kong` repo](https://github.com/kevholditch/terraform-provider-kong/issues). \ No newline at end of file +> first check the [`pulumi-kong` repo](https://github.com/pulumi/pulumi-kong/issues); however, if that doesn't turn up anything, +> please consult the source [`terraform-provider-kong` repo](https://github.com/kevholditch/terraform-provider-kong/issues). \ No newline at end of file diff --git a/sdk/python/pulumi_kong/_inputs.py b/sdk/python/pulumi_kong/_inputs.py index dc3a778a..5758a9a1 100644 --- a/sdk/python/pulumi_kong/_inputs.py +++ b/sdk/python/pulumi_kong/_inputs.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime diff --git a/sdk/python/pulumi_kong/_utilities.py b/sdk/python/pulumi_kong/_utilities.py index cfdc7572..2d9a3c84 100644 --- a/sdk/python/pulumi_kong/_utilities.py +++ b/sdk/python/pulumi_kong/_utilities.py @@ -98,6 +98,17 @@ def _get_semver_version(): def get_version(): return _version_str +def get_resource_opts_defaults() -> pulumi.ResourceOptions: + return pulumi.ResourceOptions( + version=get_version(), + plugin_download_url=get_plugin_download_url(), + ) + +def get_invoke_opts_defaults() -> pulumi.InvokeOptions: + return pulumi.InvokeOptions( + version=get_version(), + plugin_download_url=get_plugin_download_url(), + ) def get_resource_args_opts(resource_args_type, resource_options_type, *args, **kwargs): """ @@ -234,3 +245,6 @@ def lifted_func(*args, opts=None, **kwargs): **resolved_args['kwargs'])) return (lambda _: lifted_func) + +def get_plugin_download_url(): + return None diff --git a/sdk/python/pulumi_kong/certificate.py b/sdk/python/pulumi_kong/certificate.py index 93f87485..652eeaa4 100644 --- a/sdk/python/pulumi_kong/certificate.py +++ b/sdk/python/pulumi_kong/certificate.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime @@ -245,12 +246,9 @@ def _internal_init(__self__, snis: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, __props__=None): - if opts is None: - opts = pulumi.ResourceOptions() + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.version is None: - opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') @@ -259,9 +257,11 @@ def _internal_init(__self__, if certificate is None and not opts.urn: raise TypeError("Missing required property 'certificate'") __props__.__dict__["certificate"] = certificate - __props__.__dict__["private_key"] = private_key + __props__.__dict__["private_key"] = None if private_key is None else pulumi.Output.secret(private_key) __props__.__dict__["snis"] = snis __props__.__dict__["tags"] = tags + secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["privateKey"]) + opts = pulumi.ResourceOptions.merge(opts, secret_opts) super(Certificate, __self__).__init__( 'kong:index/certificate:Certificate', resource_name, diff --git a/sdk/python/pulumi_kong/config/__init__.pyi b/sdk/python/pulumi_kong/config/__init__.pyi index f4f320f6..19d4adbd 100644 --- a/sdk/python/pulumi_kong/config/__init__.pyi +++ b/sdk/python/pulumi_kong/config/__init__.pyi @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime diff --git a/sdk/python/pulumi_kong/config/vars.py b/sdk/python/pulumi_kong/config/vars.py index 5971f954..21dbe341 100644 --- a/sdk/python/pulumi_kong/config/vars.py +++ b/sdk/python/pulumi_kong/config/vars.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime diff --git a/sdk/python/pulumi_kong/consumer.py b/sdk/python/pulumi_kong/consumer.py index e6f9ec18..03df9548 100644 --- a/sdk/python/pulumi_kong/consumer.py +++ b/sdk/python/pulumi_kong/consumer.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime @@ -212,12 +213,9 @@ def _internal_init(__self__, tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, username: Optional[pulumi.Input[str]] = None, __props__=None): - if opts is None: - opts = pulumi.ResourceOptions() + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.version is None: - opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_kong/consumer_acl.py b/sdk/python/pulumi_kong/consumer_acl.py index 0fa630df..fd1500f6 100644 --- a/sdk/python/pulumi_kong/consumer_acl.py +++ b/sdk/python/pulumi_kong/consumer_acl.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime @@ -216,12 +217,9 @@ def _internal_init(__self__, group: Optional[pulumi.Input[str]] = None, tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, __props__=None): - if opts is None: - opts = pulumi.ResourceOptions() + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.version is None: - opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_kong/consumer_basic_auth.py b/sdk/python/pulumi_kong/consumer_basic_auth.py index c307ab6c..69c77266 100644 --- a/sdk/python/pulumi_kong/consumer_basic_auth.py +++ b/sdk/python/pulumi_kong/consumer_basic_auth.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime @@ -244,12 +245,9 @@ def _internal_init(__self__, tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, username: Optional[pulumi.Input[str]] = None, __props__=None): - if opts is None: - opts = pulumi.ResourceOptions() + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.version is None: - opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_kong/consumer_jwt_auth.py b/sdk/python/pulumi_kong/consumer_jwt_auth.py index ecba64fc..8a928766 100644 --- a/sdk/python/pulumi_kong/consumer_jwt_auth.py +++ b/sdk/python/pulumi_kong/consumer_jwt_auth.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime @@ -319,12 +320,9 @@ def _internal_init(__self__, secret: Optional[pulumi.Input[str]] = None, tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, __props__=None): - if opts is None: - opts = pulumi.ResourceOptions() + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.version is None: - opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_kong/consumer_key_auth.py b/sdk/python/pulumi_kong/consumer_key_auth.py index 7a0c0469..1f803f86 100644 --- a/sdk/python/pulumi_kong/consumer_key_auth.py +++ b/sdk/python/pulumi_kong/consumer_key_auth.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime @@ -209,12 +210,9 @@ def _internal_init(__self__, key: Optional[pulumi.Input[str]] = None, tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, __props__=None): - if opts is None: - opts = pulumi.ResourceOptions() + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.version is None: - opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') @@ -223,8 +221,10 @@ def _internal_init(__self__, if consumer_id is None and not opts.urn: raise TypeError("Missing required property 'consumer_id'") __props__.__dict__["consumer_id"] = consumer_id - __props__.__dict__["key"] = key + __props__.__dict__["key"] = None if key is None else pulumi.Output.secret(key) __props__.__dict__["tags"] = tags + secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["key"]) + opts = pulumi.ResourceOptions.merge(opts, secret_opts) super(ConsumerKeyAuth, __self__).__init__( 'kong:index/consumerKeyAuth:ConsumerKeyAuth', resource_name, diff --git a/sdk/python/pulumi_kong/consumer_oauth2.py b/sdk/python/pulumi_kong/consumer_oauth2.py index 304c62ef..f375eb5a 100644 --- a/sdk/python/pulumi_kong/consumer_oauth2.py +++ b/sdk/python/pulumi_kong/consumer_oauth2.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime @@ -368,12 +369,9 @@ def _internal_init(__self__, redirect_uris: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, __props__=None): - if opts is None: - opts = pulumi.ResourceOptions() + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.version is None: - opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_kong/outputs.py b/sdk/python/pulumi_kong/outputs.py index dc92299c..41c778b7 100644 --- a/sdk/python/pulumi_kong/outputs.py +++ b/sdk/python/pulumi_kong/outputs.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime diff --git a/sdk/python/pulumi_kong/plugin.py b/sdk/python/pulumi_kong/plugin.py index aace2fcf..55482da1 100644 --- a/sdk/python/pulumi_kong/plugin.py +++ b/sdk/python/pulumi_kong/plugin.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime @@ -506,12 +507,9 @@ def _internal_init(__self__, strict_match: Optional[pulumi.Input[bool]] = None, tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, __props__=None): - if opts is None: - opts = pulumi.ResourceOptions() + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.version is None: - opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_kong/provider.py b/sdk/python/pulumi_kong/provider.py index 094e8150..3b920fca 100644 --- a/sdk/python/pulumi_kong/provider.py +++ b/sdk/python/pulumi_kong/provider.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime @@ -216,12 +217,9 @@ def _internal_init(__self__, strict_plugins_match: Optional[pulumi.Input[bool]] = None, tls_skip_verify: Optional[pulumi.Input[bool]] = None, __props__=None): - if opts is None: - opts = pulumi.ResourceOptions() + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.version is None: - opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_kong/route.py b/sdk/python/pulumi_kong/route.py index 1490cac0..31a7396a 100644 --- a/sdk/python/pulumi_kong/route.py +++ b/sdk/python/pulumi_kong/route.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime @@ -831,12 +832,9 @@ def _internal_init(__self__, strip_path: Optional[pulumi.Input[bool]] = None, tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, __props__=None): - if opts is None: - opts = pulumi.ResourceOptions() + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.version is None: - opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_kong/service.py b/sdk/python/pulumi_kong/service.py index f5314016..07f6c2c4 100644 --- a/sdk/python/pulumi_kong/service.py +++ b/sdk/python/pulumi_kong/service.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime @@ -676,12 +677,9 @@ def _internal_init(__self__, tls_verify_depth: Optional[pulumi.Input[int]] = None, write_timeout: Optional[pulumi.Input[int]] = None, __props__=None): - if opts is None: - opts = pulumi.ResourceOptions() + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.version is None: - opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_kong/target.py b/sdk/python/pulumi_kong/target.py index f7a45012..c64bb552 100644 --- a/sdk/python/pulumi_kong/target.py +++ b/sdk/python/pulumi_kong/target.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime @@ -236,12 +237,9 @@ def _internal_init(__self__, upstream_id: Optional[pulumi.Input[str]] = None, weight: Optional[pulumi.Input[int]] = None, __props__=None): - if opts is None: - opts = pulumi.ResourceOptions() + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.version is None: - opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_kong/upstream.py b/sdk/python/pulumi_kong/upstream.py index abe1d2cb..e3431cc3 100644 --- a/sdk/python/pulumi_kong/upstream.py +++ b/sdk/python/pulumi_kong/upstream.py @@ -2,6 +2,7 @@ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** +import copy import warnings import pulumi import pulumi.runtime @@ -755,12 +756,9 @@ def _internal_init(__self__, slots: Optional[pulumi.Input[int]] = None, tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, __props__=None): - if opts is None: - opts = pulumi.ResourceOptions() + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.version is None: - opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/setup.py b/sdk/python/setup.py index 3a443400..4c7aa7f5 100644 --- a/sdk/python/setup.py +++ b/sdk/python/setup.py @@ -9,26 +9,6 @@ VERSION = "0.0.0" -PLUGIN_VERSION = "0.0.0" - -class InstallPluginCommand(install): - def run(self): - install.run(self) - try: - check_call(['pulumi', 'plugin', 'install', 'resource', 'kong', PLUGIN_VERSION]) - except OSError as error: - if error.errno == errno.ENOENT: - print(f""" - There was an error installing the kong resource provider plugin. - It looks like `pulumi` is not installed on your system. - Please visit https://pulumi.com/ to install the Pulumi CLI. - You may try manually installing the plugin by running - `pulumi plugin install resource kong {PLUGIN_VERSION}` - """) - else: - raise - - def readme(): try: with open('README.md', encoding='utf-8') as f: @@ -38,13 +18,11 @@ def readme(): setup(name='pulumi_kong', + python_requires='>=3.7', version=VERSION, description="A Pulumi package for creating and managing Kong resources.", long_description=readme(), long_description_content_type='text/markdown', - cmdclass={ - 'install': InstallPluginCommand, - }, keywords='pulumi kong', url='https://pulumi.io', project_urls={