Skip to content

Commit

Permalink
Upgrade terraform-provider-tailscale to v0.13.9 (#197)
Browse files Browse the repository at this point in the history
* make tfgen

* make build_sdks

* Add user agent schema to tf provider

* Run `make build`

---------

Co-authored-by: pulumi-bot <runner@fv-az574-124.esnmgxn14wlejbqjnvhsbsbtxa.dx.internal.cloudapp.net>
Co-authored-by: Ramon Quitales <ramon@pulumi.com>
  • Loading branch information
3 people authored Aug 24, 2023
1 parent 5ce2c4e commit 87abc2b
Show file tree
Hide file tree
Showing 53 changed files with 1,638 additions and 427 deletions.
104 changes: 66 additions & 38 deletions provider/cmd/pulumi-resource-tailscale/schema.json

Large diffs are not rendered by default.

186 changes: 97 additions & 89 deletions provider/go.mod

Large diffs are not rendered by default.

944 changes: 807 additions & 137 deletions provider/go.sum

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"path/filepath"
"unicode"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/pulumi/pulumi-tailscale/provider/pkg/version"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
shim "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim"
Expand Down Expand Up @@ -73,7 +74,7 @@ func preConfigureCallback(vars resource.PropertyMap, c shim.ResourceConfig) erro
// Provider returns additional overlaid schema and metadata associated with the provider..
func Provider() tfbridge.ProviderInfo {
// Instantiate the Terraform provider
p := shimv2.NewProvider(tailscale.Provider())
p := shimv2.NewProvider(tailscale.Provider(addUserAgent))

// Create a Pulumi provider mapping
prov := tfbridge.ProviderInfo{
Expand Down Expand Up @@ -145,3 +146,15 @@ func Provider() tfbridge.ProviderInfo {

return prov
}

// addUserAgent adds a `user_agent` configuration key to the provider with a
// default value based on provider version. This is adapted from the upstream provider.
// See: https://github.com/tailscale/terraform-provider-tailscale/commit/e2961ac83f24bc2cc279177abcf23e28570815c6
func addUserAgent(p *schema.Provider) {
p.Schema["user_agent"] = &schema.Schema{
Type: schema.TypeString,
Default: fmt.Sprintf("Pulumi/3.0 (https://www.pulumi.com) pulumi-tailscale/%s", version.Version),
Optional: true,
Description: "User-Agent header for API requests.",
}
}
1 change: 1 addition & 0 deletions sdk/dotnet/Acl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Pulumi.Tailscale
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using System.Text.Json;
/// using Pulumi;
/// using Tailscale = Pulumi.Tailscale;
Expand Down
23 changes: 17 additions & 6 deletions sdk/dotnet/Config/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public static string? BaseUrl

private static readonly __Value<string?> _oauthClientId = new __Value<string?>(() => __config.Get("oauthClientId"));
/// <summary>
/// The OAuth application's ID when using OAuth client credentials. Can be set via the OAUTH_CLIENT_ID environment variable.
/// Both 'oauth_client_id' and 'oauth_client_secret' must be set. Conflicts with 'api_key'.
/// The OAuth application's ID when using OAuth client credentials. Can be set via the TAILSCALE_OAUTH_CLIENT_ID environment
/// variable. Both 'oauth_client_id' and 'oauth_client_secret' must be set. Conflicts with 'api_key'.
/// </summary>
public static string? OauthClientId
{
Expand All @@ -67,8 +67,8 @@ public static string? OauthClientId

private static readonly __Value<string?> _oauthClientSecret = new __Value<string?>(() => __config.Get("oauthClientSecret"));
/// <summary>
/// The OAuth application's secret when using OAuth client credentials. Can be set via the OAUTH_CLIENT_SECRET environment
/// variable. Both 'oauth_client_id' and 'oauth_client_secret' must be set. Conflicts with 'api_key'.
/// The OAuth application's secret when using OAuth client credentials. Can be set via the TAILSCALE_OAUTH_CLIENT_SECRET
/// environment variable. Both 'oauth_client_id' and 'oauth_client_secret' must be set. Conflicts with 'api_key'.
/// </summary>
public static string? OauthClientSecret
{
Expand All @@ -79,7 +79,7 @@ public static string? OauthClientSecret
private static readonly __Value<ImmutableArray<string>> _scopes = new __Value<ImmutableArray<string>>(() => __config.GetObject<ImmutableArray<string>>("scopes"));
/// <summary>
/// The OAuth 2.0 scopes to request when for the access token generated using the supplied OAuth client credentials. See
/// https://tailscale.com/kb/1215/oauth-clients/#scopes for avialable scopes. Only valid when both 'oauth_client_id' and
/// https://tailscale.com/kb/1215/oauth-clients/#scopes for available scopes. Only valid when both 'oauth_client_id' and
/// 'oauth_client_secret' are set.
/// </summary>
public static ImmutableArray<string> Scopes
Expand All @@ -90,13 +90,24 @@ public static ImmutableArray<string> Scopes

private static readonly __Value<string?> _tailnet = new __Value<string?>(() => __config.Get("tailnet"));
/// <summary>
/// The Tailnet to perform actions in. Can be set via the TAILSCALE_TAILNET environment variable.
/// The organization name of the Tailnet in which to perform actions. Can be set via the TAILSCALE_TAILNET environment
/// variable. Default is the tailnet that owns API credentials passed to the provider.
/// </summary>
public static string? Tailnet
{
get => _tailnet.Get();
set => _tailnet.Set(value);
}

private static readonly __Value<string?> _userAgent = new __Value<string?>(() => __config.Get("userAgent"));
/// <summary>
/// User-Agent header for API requests.
/// </summary>
public static string? UserAgent
{
get => _userAgent.Get();
set => _userAgent.Set(value);
}

}
}
1 change: 1 addition & 0 deletions sdk/dotnet/DeviceAuthorization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Pulumi.Tailscale
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tailscale = Pulumi.Tailscale;
///
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/DeviceKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Pulumi.Tailscale
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tailscale = Pulumi.Tailscale;
///
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/DeviceSubnetRoutes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Pulumi.Tailscale
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tailscale = Pulumi.Tailscale;
///
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/DeviceTags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Pulumi.Tailscale
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tailscale = Pulumi.Tailscale;
///
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/DnsNameservers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Pulumi.Tailscale
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tailscale = Pulumi.Tailscale;
///
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/DnsPreferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Pulumi.Tailscale
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tailscale = Pulumi.Tailscale;
///
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/DnsSearchPaths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Pulumi.Tailscale
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tailscale = Pulumi.Tailscale;
///
Expand Down
2 changes: 2 additions & 0 deletions sdk/dotnet/Get4Via6.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static class Get4Via6
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tailscale = Pulumi.Tailscale;
///
Expand Down Expand Up @@ -48,6 +49,7 @@ public static Task<Get4Via6Result> InvokeAsync(Get4Via6Args args, InvokeOptions?
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tailscale = Pulumi.Tailscale;
///
Expand Down
2 changes: 2 additions & 0 deletions sdk/dotnet/GetDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static class GetDevice
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tailscale = Pulumi.Tailscale;
///
Expand Down Expand Up @@ -48,6 +49,7 @@ public static Task<GetDeviceResult> InvokeAsync(GetDeviceArgs args, InvokeOption
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tailscale = Pulumi.Tailscale;
///
Expand Down
2 changes: 2 additions & 0 deletions sdk/dotnet/GetDevices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static class GetDevices
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tailscale = Pulumi.Tailscale;
///
Expand Down Expand Up @@ -47,6 +48,7 @@ public static Task<GetDevicesResult> InvokeAsync(GetDevicesArgs? args = null, In
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tailscale = Pulumi.Tailscale;
///
Expand Down
36 changes: 25 additions & 11 deletions sdk/dotnet/Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,32 @@ public partial class Provider : global::Pulumi.ProviderResource
public Output<string?> BaseUrl { get; private set; } = null!;

/// <summary>
/// The OAuth application's ID when using OAuth client credentials. Can be set via the OAUTH_CLIENT_ID environment variable.
/// Both 'oauth_client_id' and 'oauth_client_secret' must be set. Conflicts with 'api_key'.
/// The OAuth application's ID when using OAuth client credentials. Can be set via the TAILSCALE_OAUTH_CLIENT_ID environment
/// variable. Both 'oauth_client_id' and 'oauth_client_secret' must be set. Conflicts with 'api_key'.
/// </summary>
[Output("oauthClientId")]
public Output<string?> OauthClientId { get; private set; } = null!;

/// <summary>
/// The OAuth application's secret when using OAuth client credentials. Can be set via the OAUTH_CLIENT_SECRET environment
/// variable. Both 'oauth_client_id' and 'oauth_client_secret' must be set. Conflicts with 'api_key'.
/// The OAuth application's secret when using OAuth client credentials. Can be set via the TAILSCALE_OAUTH_CLIENT_SECRET
/// environment variable. Both 'oauth_client_id' and 'oauth_client_secret' must be set. Conflicts with 'api_key'.
/// </summary>
[Output("oauthClientSecret")]
public Output<string?> OauthClientSecret { get; private set; } = null!;

/// <summary>
/// The Tailnet to perform actions in. Can be set via the TAILSCALE_TAILNET environment variable.
/// The organization name of the Tailnet in which to perform actions. Can be set via the TAILSCALE_TAILNET environment
/// variable. Default is the tailnet that owns API credentials passed to the provider.
/// </summary>
[Output("tailnet")]
public Output<string?> Tailnet { get; private set; } = null!;

/// <summary>
/// User-Agent header for API requests.
/// </summary>
[Output("userAgent")]
public Output<string?> UserAgent { get; private set; } = null!;


/// <summary>
/// Create a Provider resource with the given unique name, arguments, and options.
Expand Down Expand Up @@ -110,8 +117,8 @@ public Input<string>? ApiKey
public Input<string>? BaseUrl { get; set; }

/// <summary>
/// The OAuth application's ID when using OAuth client credentials. Can be set via the OAUTH_CLIENT_ID environment variable.
/// Both 'oauth_client_id' and 'oauth_client_secret' must be set. Conflicts with 'api_key'.
/// The OAuth application's ID when using OAuth client credentials. Can be set via the TAILSCALE_OAUTH_CLIENT_ID environment
/// variable. Both 'oauth_client_id' and 'oauth_client_secret' must be set. Conflicts with 'api_key'.
/// </summary>
[Input("oauthClientId")]
public Input<string>? OauthClientId { get; set; }
Expand All @@ -120,8 +127,8 @@ public Input<string>? ApiKey
private Input<string>? _oauthClientSecret;

/// <summary>
/// The OAuth application's secret when using OAuth client credentials. Can be set via the OAUTH_CLIENT_SECRET environment
/// variable. Both 'oauth_client_id' and 'oauth_client_secret' must be set. Conflicts with 'api_key'.
/// The OAuth application's secret when using OAuth client credentials. Can be set via the TAILSCALE_OAUTH_CLIENT_SECRET
/// environment variable. Both 'oauth_client_id' and 'oauth_client_secret' must be set. Conflicts with 'api_key'.
/// </summary>
public Input<string>? OauthClientSecret
{
Expand All @@ -138,7 +145,7 @@ public Input<string>? OauthClientSecret

/// <summary>
/// The OAuth 2.0 scopes to request when for the access token generated using the supplied OAuth client credentials. See
/// https://tailscale.com/kb/1215/oauth-clients/#scopes for avialable scopes. Only valid when both 'oauth_client_id' and
/// https://tailscale.com/kb/1215/oauth-clients/#scopes for available scopes. Only valid when both 'oauth_client_id' and
/// 'oauth_client_secret' are set.
/// </summary>
public InputList<string> Scopes
Expand All @@ -148,11 +155,18 @@ public InputList<string> Scopes
}

/// <summary>
/// The Tailnet to perform actions in. Can be set via the TAILSCALE_TAILNET environment variable.
/// The organization name of the Tailnet in which to perform actions. Can be set via the TAILSCALE_TAILNET environment
/// variable. Default is the tailnet that owns API credentials passed to the provider.
/// </summary>
[Input("tailnet")]
public Input<string>? Tailnet { get; set; }

/// <summary>
/// User-Agent header for API requests.
/// </summary>
[Input("userAgent")]
public Input<string>? UserAgent { get; set; }

public ProviderArgs()
{
}
Expand Down
3 changes: 1 addition & 2 deletions sdk/dotnet/Pulumi.Tailscale.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<UseSharedCompilation>false</UseSharedCompilation>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -39,7 +38,7 @@
<None Include="version.txt" Pack="True" PackagePath="content" />
</ItemGroup>

<ItemGroup>
<ItemGroup>
<EmbeddedResource Include="pulumi-plugin.json" />
<None Include="pulumi-plugin.json" Pack="True" PackagePath="content" />
</ItemGroup>
Expand Down
25 changes: 25 additions & 0 deletions sdk/dotnet/TailnetKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Pulumi.Tailscale
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tailscale = Pulumi.Tailscale;
///
Expand All @@ -35,12 +36,24 @@ namespace Pulumi.Tailscale
[TailscaleResourceType("tailscale:index/tailnetKey:TailnetKey")]
public partial class TailnetKey : global::Pulumi.CustomResource
{
/// <summary>
/// The creation timestamp of the key in RFC3339 format
/// </summary>
[Output("createdAt")]
public Output<string> CreatedAt { get; private set; } = null!;

/// <summary>
/// Indicates if the key is ephemeral.
/// </summary>
[Output("ephemeral")]
public Output<bool?> Ephemeral { get; private set; } = null!;

/// <summary>
/// The expiry timestamp of the key in RFC3339 format
/// </summary>
[Output("expiresAt")]
public Output<string> ExpiresAt { get; private set; } = null!;

/// <summary>
/// The expiry of the key in seconds
/// </summary>
Expand Down Expand Up @@ -165,12 +178,24 @@ public TailnetKeyArgs()

public sealed class TailnetKeyState : global::Pulumi.ResourceArgs
{
/// <summary>
/// The creation timestamp of the key in RFC3339 format
/// </summary>
[Input("createdAt")]
public Input<string>? CreatedAt { get; set; }

/// <summary>
/// Indicates if the key is ephemeral.
/// </summary>
[Input("ephemeral")]
public Input<bool>? Ephemeral { get; set; }

/// <summary>
/// The expiry timestamp of the key in RFC3339 format
/// </summary>
[Input("expiresAt")]
public Input<string>? ExpiresAt { get; set; }

/// <summary>
/// The expiry of the key in seconds
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions sdk/go/tailscale/acl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 87abc2b

Please sign in to comment.