clean generated SDKs

This commit is contained in:
2025-04-24 15:36:51 -04:00
parent ee34514a18
commit b649164b63
60 changed files with 0 additions and 2695 deletions

View File

@@ -1,46 +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! ***
using System;
using System.Collections.Immutable;
namespace Pulumi.Xyz
{
public static class Config
{
[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "IDE1006", Justification =
"Double underscore prefix used to avoid conflicts with variable names.")]
private sealed class __Value<T>
{
private readonly Func<T> _getter;
private T _value = default!;
private bool _set;
public __Value(Func<T> getter)
{
_getter = getter;
}
public T Get() => _set ? _value : _getter();
public void Set(T value)
{
_value = value;
_set = true;
}
}
private static readonly global::Pulumi.Config __config = new global::Pulumi.Config("xyz");
private static readonly __Value<Pulumi.Xyz.Region.Region?> _region = new __Value<Pulumi.Xyz.Region.Region?>(() => __config.GetObject<Pulumi.Xyz.Region.Region>("region"));
/// <summary>
/// A region which should be used.
/// </summary>
public static Pulumi.Xyz.Region.Region? Region
{
get => _region.Get();
set => _region.Set(value);
}
}
}

View File

@@ -1 +0,0 @@
A Pulumi package for creating and managing xyz cloud resources.

View File

@@ -1,67 +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! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Xyz
{
public static class GetDataSource
{
public static Task<GetDataSourceResult> InvokeAsync(GetDataSourceArgs args, InvokeOptions? options = null)
=> global::Pulumi.Deployment.Instance.InvokeAsync<GetDataSourceResult>("xyz:index/getDataSource:getDataSource", args ?? new GetDataSourceArgs(), options.WithDefaults());
public static Output<GetDataSourceResult> Invoke(GetDataSourceInvokeArgs args, InvokeOptions? options = null)
=> global::Pulumi.Deployment.Instance.Invoke<GetDataSourceResult>("xyz:index/getDataSource:getDataSource", args ?? new GetDataSourceInvokeArgs(), options.WithDefaults());
public static Output<GetDataSourceResult> Invoke(GetDataSourceInvokeArgs args, InvokeOutputOptions options)
=> global::Pulumi.Deployment.Instance.Invoke<GetDataSourceResult>("xyz:index/getDataSource:getDataSource", args ?? new GetDataSourceInvokeArgs(), options.WithDefaults());
}
public sealed class GetDataSourceArgs : global::Pulumi.InvokeArgs
{
[Input("sampleAttribute", required: true)]
public string SampleAttribute { get; set; } = null!;
public GetDataSourceArgs()
{
}
public static new GetDataSourceArgs Empty => new GetDataSourceArgs();
}
public sealed class GetDataSourceInvokeArgs : global::Pulumi.InvokeArgs
{
[Input("sampleAttribute", required: true)]
public Input<string> SampleAttribute { get; set; } = null!;
public GetDataSourceInvokeArgs()
{
}
public static new GetDataSourceInvokeArgs Empty => new GetDataSourceInvokeArgs();
}
[OutputType]
public sealed class GetDataSourceResult
{
/// <summary>
/// The provider-assigned unique ID for this managed resource.
/// </summary>
public readonly string Id;
public readonly string SampleAttribute;
[OutputConstructor]
private GetDataSourceResult(
string id,
string sampleAttribute)
{
Id = id;
SampleAttribute = sampleAttribute;
}
}
}

59
sdk/dotnet/Provider.cs generated
View File

@@ -1,59 +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! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Xyz
{
/// <summary>
/// The provider type for the xyz package. By default, resources use package-wide configuration
/// settings, however an explicit `Provider` instance may be created and passed during resource
/// construction to achieve fine-grained programmatic control over provider settings. See the
/// [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
/// </summary>
[XyzResourceType("pulumi:providers:xyz")]
public partial class Provider : global::Pulumi.ProviderResource
{
/// <summary>
/// Create a Provider resource with the given unique name, arguments, and options.
/// </summary>
///
/// <param name="name">The unique name of the resource</param>
/// <param name="args">The arguments used to populate this resource's properties</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public Provider(string name, ProviderArgs? args = null, CustomResourceOptions? options = null)
: base("xyz", name, args ?? new ProviderArgs(), MakeResourceOptions(options, ""))
{
}
private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
{
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
merged.Id = id ?? merged.Id;
return merged;
}
}
public sealed class ProviderArgs : global::Pulumi.ResourceArgs
{
/// <summary>
/// A region which should be used.
/// </summary>
[Input("region", json: true)]
public Input<Pulumi.Xyz.Region.Region>? Region { get; set; }
public ProviderArgs()
{
}
public static new ProviderArgs Empty => new ProviderArgs();
}
}

View File

@@ -1,61 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Pulumi</Authors>
<Company>Pulumi</Company>
<Description>A Pulumi package for creating and managing xyz cloud resources.</Description>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://www.pulumi.com</PackageProjectUrl>
<RepositoryUrl>https://github.com/pulumi/pulumi-xyz</RepositoryUrl>
<PackageIcon>logo.png</PackageIcon>
<Version>1.0.0-alpha.0+dev</Version>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<PropertyGroup>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="version.txt" />
<None Include="version.txt" Pack="True" PackagePath="content" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="pulumi-plugin.json" />
<None Include="pulumi-plugin.json" Pack="True" PackagePath="content" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Pulumi" Version="3.*" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
</Project>

View File

1
sdk/dotnet/README.md generated
View File

@@ -1 +0,0 @@
A Pulumi package for creating and managing xyz cloud resources.

View File

@@ -1,37 +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! ***
using System;
using System.ComponentModel;
using Pulumi;
namespace Pulumi.Xyz.Region
{
[EnumType]
public readonly struct Region : IEquatable<Region>
{
private readonly string _value;
private Region(string value)
{
_value = value ?? throw new ArgumentNullException(nameof(value));
}
public static Region Here { get; } = new Region("HERE");
public static Region OverThere { get; } = new Region("OVER_THERE");
public static bool operator ==(Region left, Region right) => left.Equals(right);
public static bool operator !=(Region left, Region right) => !left.Equals(right);
public static explicit operator string(Region value) => value._value;
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object? obj) => obj is Region other && Equals(other);
public bool Equals(Region other) => string.Equals(_value, other._value, StringComparison.Ordinal);
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => _value?.GetHashCode() ?? 0;
public override string ToString() => _value;
}
}

View File

@@ -1 +0,0 @@
A Pulumi package for creating and managing xyz cloud resources.

92
sdk/dotnet/Resource.cs generated
View File

@@ -1,92 +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! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Xyz
{
[XyzResourceType("xyz:index/resource:Resource")]
public partial class Resource : global::Pulumi.CustomResource
{
/// <summary>
/// Sample attribute.
/// </summary>
[Output("sampleAttribute")]
public Output<string?> SampleAttribute { get; private set; } = null!;
/// <summary>
/// Create a Resource resource with the given unique name, arguments, and options.
/// </summary>
///
/// <param name="name">The unique name of the resource</param>
/// <param name="args">The arguments used to populate this resource's properties</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public Resource(string name, ResourceArgs? args = null, CustomResourceOptions? options = null)
: base("xyz:index/resource:Resource", name, args ?? new ResourceArgs(), MakeResourceOptions(options, ""))
{
}
private Resource(string name, Input<string> id, ResourceState? state = null, CustomResourceOptions? options = null)
: base("xyz:index/resource:Resource", name, state, MakeResourceOptions(options, id))
{
}
private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
{
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
merged.Id = id ?? merged.Id;
return merged;
}
/// <summary>
/// Get an existing Resource resource's state with the given name, ID, and optional extra
/// properties used to qualify the lookup.
/// </summary>
///
/// <param name="name">The unique name of the resulting resource.</param>
/// <param name="id">The unique provider ID of the resource to lookup.</param>
/// <param name="state">Any extra arguments used during the lookup.</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public static Resource Get(string name, Input<string> id, ResourceState? state = null, CustomResourceOptions? options = null)
{
return new Resource(name, id, state, options);
}
}
public sealed class ResourceArgs : global::Pulumi.ResourceArgs
{
/// <summary>
/// Sample attribute.
/// </summary>
[Input("sampleAttribute")]
public Input<string>? SampleAttribute { get; set; }
public ResourceArgs()
{
}
public static new ResourceArgs Empty => new ResourceArgs();
}
public sealed class ResourceState : global::Pulumi.ResourceArgs
{
/// <summary>
/// Sample attribute.
/// </summary>
[Input("sampleAttribute")]
public Input<string>? SampleAttribute { get; set; }
public ResourceState()
{
}
public static new ResourceState Empty => new ResourceState();
}
}

View File

@@ -1,90 +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! ***
namespace Pulumi.Xyz
{
static class Utilities
{
public static string? GetEnv(params string[] names)
{
foreach (var n in names)
{
var value = global::System.Environment.GetEnvironmentVariable(n);
if (value != null)
{
return value;
}
}
return null;
}
static string[] trueValues = { "1", "t", "T", "true", "TRUE", "True" };
static string[] falseValues = { "0", "f", "F", "false", "FALSE", "False" };
public static bool? GetEnvBoolean(params string[] names)
{
var s = GetEnv(names);
if (s != null)
{
if (global::System.Array.IndexOf(trueValues, s) != -1)
{
return true;
}
if (global::System.Array.IndexOf(falseValues, s) != -1)
{
return false;
}
}
return null;
}
public static int? GetEnvInt32(params string[] names) => int.TryParse(GetEnv(names), out int v) ? (int?)v : null;
public static double? GetEnvDouble(params string[] names) => double.TryParse(GetEnv(names), out double v) ? (double?)v : null;
[global::System.Obsolete("Please use WithDefaults instead")]
public static global::Pulumi.InvokeOptions WithVersion(this global::Pulumi.InvokeOptions? options)
{
var dst = options ?? new global::Pulumi.InvokeOptions{};
dst.Version = options?.Version ?? Version;
return dst;
}
public static global::Pulumi.InvokeOptions WithDefaults(this global::Pulumi.InvokeOptions? src)
{
var dst = src ?? new global::Pulumi.InvokeOptions{};
dst.Version = src?.Version ?? Version;
return dst;
}
public static global::Pulumi.InvokeOutputOptions WithDefaults(this global::Pulumi.InvokeOutputOptions? src)
{
var dst = src ?? new global::Pulumi.InvokeOutputOptions{};
dst.Version = src?.Version ?? Version;
return dst;
}
private readonly static string version;
public static string Version => version;
static Utilities()
{
var assembly = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(Utilities)).Assembly;
using var stream = assembly.GetManifestResourceStream("Pulumi.Xyz.version.txt");
using var reader = new global::System.IO.StreamReader(stream ?? throw new global::System.NotSupportedException("Missing embedded version.txt file"));
version = reader.ReadToEnd().Trim();
var parts = version.Split("\n");
if (parts.Length == 2)
{
// The first part is the provider name.
version = parts[1].Trim();
}
}
}
internal sealed class XyzResourceTypeAttribute : global::Pulumi.ResourceTypeAttribute
{
public XyzResourceTypeAttribute(string type) : base(type, Utilities.Version)
{
}
}
}

3
sdk/dotnet/go.mod generated
View File

@@ -1,3 +0,0 @@
module fake_dotnet_module // Exclude this directory from Go tools
go 1.17

BIN
sdk/dotnet/logo.png generated

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

View File

@@ -1,5 +0,0 @@
{
"resource": true,
"name": "xyz",
"version": "1.0.0-alpha.0+dev"
}

0
sdk/go/Pulumi.yaml generated
View File

View File

@@ -1,17 +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 config
import (
"github.com/pulumi/pulumi-xyz/sdk/go/xyz/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
var _ = internal.GetEnvOrDefault
// A region which should be used.
func GetRegion(ctx *pulumi.Context) string {
return config.Get(ctx, "xyz:region")
}

2
sdk/go/xyz/doc.go generated
View File

@@ -1,2 +0,0 @@
// A Pulumi package for creating and managing xyz cloud resources.
package xyz

View File

@@ -1,80 +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 xyz
import (
"context"
"reflect"
"github.com/pulumi/pulumi-xyz/sdk/go/xyz/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func GetDataSource(ctx *pulumi.Context, args *GetDataSourceArgs, opts ...pulumi.InvokeOption) (*GetDataSourceResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetDataSourceResult
err := ctx.Invoke("xyz:index/getDataSource:getDataSource", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getDataSource.
type GetDataSourceArgs struct {
SampleAttribute string `pulumi:"sampleAttribute"`
}
// A collection of values returned by getDataSource.
type GetDataSourceResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
SampleAttribute string `pulumi:"sampleAttribute"`
}
func GetDataSourceOutput(ctx *pulumi.Context, args GetDataSourceOutputArgs, opts ...pulumi.InvokeOption) GetDataSourceResultOutput {
return pulumi.ToOutputWithContext(ctx.Context(), args).
ApplyT(func(v interface{}) (GetDataSourceResultOutput, error) {
args := v.(GetDataSourceArgs)
options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)}
return ctx.InvokeOutput("xyz:index/getDataSource:getDataSource", args, GetDataSourceResultOutput{}, options).(GetDataSourceResultOutput), nil
}).(GetDataSourceResultOutput)
}
// A collection of arguments for invoking getDataSource.
type GetDataSourceOutputArgs struct {
SampleAttribute pulumi.StringInput `pulumi:"sampleAttribute"`
}
func (GetDataSourceOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetDataSourceArgs)(nil)).Elem()
}
// A collection of values returned by getDataSource.
type GetDataSourceResultOutput struct{ *pulumi.OutputState }
func (GetDataSourceResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetDataSourceResult)(nil)).Elem()
}
func (o GetDataSourceResultOutput) ToGetDataSourceResultOutput() GetDataSourceResultOutput {
return o
}
func (o GetDataSourceResultOutput) ToGetDataSourceResultOutputWithContext(ctx context.Context) GetDataSourceResultOutput {
return o
}
// The provider-assigned unique ID for this managed resource.
func (o GetDataSourceResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetDataSourceResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o GetDataSourceResultOutput) SampleAttribute() pulumi.StringOutput {
return o.ApplyT(func(v GetDataSourceResult) string { return v.SampleAttribute }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetDataSourceResultOutput{})
}

66
sdk/go/xyz/init.go generated
View File

@@ -1,66 +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 xyz
import (
"fmt"
"github.com/blang/semver"
"github.com/pulumi/pulumi-xyz/sdk/go/xyz/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type module struct {
version semver.Version
}
func (m *module) Version() semver.Version {
return m.version
}
func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) {
switch typ {
case "xyz:index/resource:Resource":
r = &Resource{}
default:
return nil, fmt.Errorf("unknown resource type: %s", typ)
}
err = ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn))
return
}
type pkg struct {
version semver.Version
}
func (p *pkg) Version() semver.Version {
return p.version
}
func (p *pkg) ConstructProvider(ctx *pulumi.Context, name, typ, urn string) (pulumi.ProviderResource, error) {
if typ != "pulumi:providers:xyz" {
return nil, fmt.Errorf("unknown provider type: %s", typ)
}
r := &Provider{}
err := ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn))
return r, err
}
func init() {
version, err := internal.PkgVersion()
if err != nil {
version = semver.Version{Major: 1}
}
pulumi.RegisterResourceModule(
"xyz",
"index/resource",
&module{version},
)
pulumi.RegisterResourcePackage(
"xyz",
&pkg{version},
)
}

View File

@@ -1,184 +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 internal
import (
"fmt"
"os"
"reflect"
"regexp"
"strconv"
"strings"
"github.com/blang/semver"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/internals"
)
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, ok := os.LookupEnv(v); ok {
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) {
// 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-xyz/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()
}
func CallPlain(
ctx *pulumi.Context,
tok string,
args pulumi.Input,
output pulumi.Output,
self pulumi.Resource,
property string,
resultPtr reflect.Value,
errorPtr *error,
opts ...pulumi.InvokeOption,
) {
res, err := callPlainInner(ctx, tok, args, output, self, opts...)
if err != nil {
*errorPtr = err
return
}
v := reflect.ValueOf(res)
// extract res.property field if asked to do so
if property != "" {
v = v.FieldByName("Res")
}
// return by setting the result pointer; this style of returns shortens the generated code without generics
resultPtr.Elem().Set(v)
}
func callPlainInner(
ctx *pulumi.Context,
tok string,
args pulumi.Input,
output pulumi.Output,
self pulumi.Resource,
opts ...pulumi.InvokeOption,
) (any, error) {
o, err := ctx.Call(tok, args, output, self, opts...)
if err != nil {
return nil, err
}
outputData, err := internals.UnsafeAwaitOutput(ctx.Context(), o)
if err != nil {
return nil, err
}
// Ingoring deps silently. They are typically non-empty, r.f() calls include r as a dependency.
known := outputData.Known
value := outputData.Value
secret := outputData.Secret
problem := ""
if !known {
problem = "an unknown value"
} else if secret {
problem = "a secret value"
}
if problem != "" {
return nil, fmt.Errorf("Plain resource method %q incorrectly returned %s. "+
"This is an error in the provider, please report this to the provider developer.",
tok, problem)
}
return value, nil
}
// PkgResourceDefaultOpts provides package level defaults to pulumi.OptionResource.
func PkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption {
defaults := []pulumi.ResourceOption{}
version := semver.MustParse("1.0.0-alpha.0+dev")
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 := semver.MustParse("1.0.0-alpha.0+dev")
if !version.Equals(semver.Version{}) {
defaults = append(defaults, pulumi.Version(version.String()))
}
return append(defaults, opts...)
}

View File

@@ -1,11 +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 internal
import (
"github.com/blang/semver"
)
var SdkVersion semver.Version = semver.Version{}
var pluginDownloadURL string = ""

90
sdk/go/xyz/provider.go generated
View File

@@ -1,90 +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 xyz
import (
"context"
"reflect"
"github.com/pulumi/pulumi-xyz/sdk/go/xyz/internal"
"github.com/pulumi/pulumi-xyz/sdk/go/xyz/region"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The provider type for the xyz package. By default, resources use package-wide configuration
// settings, however an explicit `Provider` instance may be created and passed during resource
// construction to achieve fine-grained programmatic control over provider settings. See the
// [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
type Provider struct {
pulumi.ProviderResourceState
}
// NewProvider registers a new resource with the given unique name, arguments, and options.
func NewProvider(ctx *pulumi.Context,
name string, args *ProviderArgs, opts ...pulumi.ResourceOption) (*Provider, error) {
if args == nil {
args = &ProviderArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Provider
err := ctx.RegisterResource("pulumi:providers:xyz", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
type providerArgs struct {
// A region which should be used.
Region *region.Region `pulumi:"region"`
}
// The set of arguments for constructing a Provider resource.
type ProviderArgs struct {
// A region which should be used.
Region region.RegionPtrInput
}
func (ProviderArgs) ElementType() reflect.Type {
return reflect.TypeOf((*providerArgs)(nil)).Elem()
}
type ProviderInput interface {
pulumi.Input
ToProviderOutput() ProviderOutput
ToProviderOutputWithContext(ctx context.Context) ProviderOutput
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
return i.ToProviderOutputWithContext(context.Background())
}
func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProviderOutput)
}
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {
return o
}
func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) ProviderOutput {
return o
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ProviderInput)(nil)).Elem(), &Provider{})
pulumi.RegisterOutputType(ProviderOutput{})
}

View File

@@ -1,5 +0,0 @@
{
"resource": true,
"name": "xyz",
"version": "1.0.0-alpha.0+dev"
}

View File

@@ -1,183 +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 region
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Region string
const (
RegionHere = Region("HERE")
RegionOverThere = Region("OVER_THERE")
)
func (Region) ElementType() reflect.Type {
return reflect.TypeOf((*Region)(nil)).Elem()
}
func (e Region) ToRegionOutput() RegionOutput {
return pulumi.ToOutput(e).(RegionOutput)
}
func (e Region) ToRegionOutputWithContext(ctx context.Context) RegionOutput {
return pulumi.ToOutputWithContext(ctx, e).(RegionOutput)
}
func (e Region) ToRegionPtrOutput() RegionPtrOutput {
return e.ToRegionPtrOutputWithContext(context.Background())
}
func (e Region) ToRegionPtrOutputWithContext(ctx context.Context) RegionPtrOutput {
return Region(e).ToRegionOutputWithContext(ctx).ToRegionPtrOutputWithContext(ctx)
}
func (e Region) ToStringOutput() pulumi.StringOutput {
return pulumi.ToOutput(pulumi.String(e)).(pulumi.StringOutput)
}
func (e Region) ToStringOutputWithContext(ctx context.Context) pulumi.StringOutput {
return pulumi.ToOutputWithContext(ctx, pulumi.String(e)).(pulumi.StringOutput)
}
func (e Region) ToStringPtrOutput() pulumi.StringPtrOutput {
return pulumi.String(e).ToStringPtrOutputWithContext(context.Background())
}
func (e Region) ToStringPtrOutputWithContext(ctx context.Context) pulumi.StringPtrOutput {
return pulumi.String(e).ToStringOutputWithContext(ctx).ToStringPtrOutputWithContext(ctx)
}
type RegionOutput struct{ *pulumi.OutputState }
func (RegionOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Region)(nil)).Elem()
}
func (o RegionOutput) ToRegionOutput() RegionOutput {
return o
}
func (o RegionOutput) ToRegionOutputWithContext(ctx context.Context) RegionOutput {
return o
}
func (o RegionOutput) ToRegionPtrOutput() RegionPtrOutput {
return o.ToRegionPtrOutputWithContext(context.Background())
}
func (o RegionOutput) ToRegionPtrOutputWithContext(ctx context.Context) RegionPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v Region) *Region {
return &v
}).(RegionPtrOutput)
}
func (o RegionOutput) ToStringOutput() pulumi.StringOutput {
return o.ToStringOutputWithContext(context.Background())
}
func (o RegionOutput) ToStringOutputWithContext(ctx context.Context) pulumi.StringOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, e Region) string {
return string(e)
}).(pulumi.StringOutput)
}
func (o RegionOutput) ToStringPtrOutput() pulumi.StringPtrOutput {
return o.ToStringPtrOutputWithContext(context.Background())
}
func (o RegionOutput) ToStringPtrOutputWithContext(ctx context.Context) pulumi.StringPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, e Region) *string {
v := string(e)
return &v
}).(pulumi.StringPtrOutput)
}
type RegionPtrOutput struct{ *pulumi.OutputState }
func (RegionPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Region)(nil)).Elem()
}
func (o RegionPtrOutput) ToRegionPtrOutput() RegionPtrOutput {
return o
}
func (o RegionPtrOutput) ToRegionPtrOutputWithContext(ctx context.Context) RegionPtrOutput {
return o
}
func (o RegionPtrOutput) Elem() RegionOutput {
return o.ApplyT(func(v *Region) Region {
if v != nil {
return *v
}
var ret Region
return ret
}).(RegionOutput)
}
func (o RegionPtrOutput) ToStringPtrOutput() pulumi.StringPtrOutput {
return o.ToStringPtrOutputWithContext(context.Background())
}
func (o RegionPtrOutput) ToStringPtrOutputWithContext(ctx context.Context) pulumi.StringPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, e *Region) *string {
if e == nil {
return nil
}
v := string(*e)
return &v
}).(pulumi.StringPtrOutput)
}
// RegionInput is an input type that accepts values of the Region enum
// A concrete instance of `RegionInput` can be one of the following:
//
// RegionHere
// RegionOverThere
type RegionInput interface {
pulumi.Input
ToRegionOutput() RegionOutput
ToRegionOutputWithContext(context.Context) RegionOutput
}
var regionPtrType = reflect.TypeOf((**Region)(nil)).Elem()
type RegionPtrInput interface {
pulumi.Input
ToRegionPtrOutput() RegionPtrOutput
ToRegionPtrOutputWithContext(context.Context) RegionPtrOutput
}
type regionPtr string
func RegionPtr(v string) RegionPtrInput {
return (*regionPtr)(&v)
}
func (*regionPtr) ElementType() reflect.Type {
return regionPtrType
}
func (in *regionPtr) ToRegionPtrOutput() RegionPtrOutput {
return pulumi.ToOutput(in).(RegionPtrOutput)
}
func (in *regionPtr) ToRegionPtrOutputWithContext(ctx context.Context) RegionPtrOutput {
return pulumi.ToOutputWithContext(ctx, in).(RegionPtrOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RegionInput)(nil)).Elem(), Region("HERE"))
pulumi.RegisterInputType(reflect.TypeOf((*RegionPtrInput)(nil)).Elem(), Region("HERE"))
pulumi.RegisterOutputType(RegionOutput{})
pulumi.RegisterOutputType(RegionPtrOutput{})
}

214
sdk/go/xyz/resource.go generated
View File

@@ -1,214 +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 xyz
import (
"context"
"reflect"
"github.com/pulumi/pulumi-xyz/sdk/go/xyz/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Resource struct {
pulumi.CustomResourceState
// Sample attribute.
SampleAttribute pulumi.StringPtrOutput `pulumi:"sampleAttribute"`
}
// NewResource registers a new resource with the given unique name, arguments, and options.
func NewResource(ctx *pulumi.Context,
name string, args *ResourceArgs, opts ...pulumi.ResourceOption) (*Resource, error) {
if args == nil {
args = &ResourceArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Resource
err := ctx.RegisterResource("xyz:index/resource:Resource", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetResource gets an existing Resource 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 GetResource(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ResourceState, opts ...pulumi.ResourceOption) (*Resource, error) {
var resource Resource
err := ctx.ReadResource("xyz:index/resource:Resource", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Resource resources.
type resourceState struct {
// Sample attribute.
SampleAttribute *string `pulumi:"sampleAttribute"`
}
type ResourceState struct {
// Sample attribute.
SampleAttribute pulumi.StringPtrInput
}
func (ResourceState) ElementType() reflect.Type {
return reflect.TypeOf((*resourceState)(nil)).Elem()
}
type resourceArgs struct {
// Sample attribute.
SampleAttribute *string `pulumi:"sampleAttribute"`
}
// The set of arguments for constructing a Resource resource.
type ResourceArgs struct {
// Sample attribute.
SampleAttribute pulumi.StringPtrInput
}
func (ResourceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*resourceArgs)(nil)).Elem()
}
type ResourceInput interface {
pulumi.Input
ToResourceOutput() ResourceOutput
ToResourceOutputWithContext(ctx context.Context) ResourceOutput
}
func (*Resource) ElementType() reflect.Type {
return reflect.TypeOf((**Resource)(nil)).Elem()
}
func (i *Resource) ToResourceOutput() ResourceOutput {
return i.ToResourceOutputWithContext(context.Background())
}
func (i *Resource) ToResourceOutputWithContext(ctx context.Context) ResourceOutput {
return pulumi.ToOutputWithContext(ctx, i).(ResourceOutput)
}
// ResourceArrayInput is an input type that accepts ResourceArray and ResourceArrayOutput values.
// You can construct a concrete instance of `ResourceArrayInput` via:
//
// ResourceArray{ ResourceArgs{...} }
type ResourceArrayInput interface {
pulumi.Input
ToResourceArrayOutput() ResourceArrayOutput
ToResourceArrayOutputWithContext(context.Context) ResourceArrayOutput
}
type ResourceArray []ResourceInput
func (ResourceArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Resource)(nil)).Elem()
}
func (i ResourceArray) ToResourceArrayOutput() ResourceArrayOutput {
return i.ToResourceArrayOutputWithContext(context.Background())
}
func (i ResourceArray) ToResourceArrayOutputWithContext(ctx context.Context) ResourceArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ResourceArrayOutput)
}
// ResourceMapInput is an input type that accepts ResourceMap and ResourceMapOutput values.
// You can construct a concrete instance of `ResourceMapInput` via:
//
// ResourceMap{ "key": ResourceArgs{...} }
type ResourceMapInput interface {
pulumi.Input
ToResourceMapOutput() ResourceMapOutput
ToResourceMapOutputWithContext(context.Context) ResourceMapOutput
}
type ResourceMap map[string]ResourceInput
func (ResourceMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Resource)(nil)).Elem()
}
func (i ResourceMap) ToResourceMapOutput() ResourceMapOutput {
return i.ToResourceMapOutputWithContext(context.Background())
}
func (i ResourceMap) ToResourceMapOutputWithContext(ctx context.Context) ResourceMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ResourceMapOutput)
}
type ResourceOutput struct{ *pulumi.OutputState }
func (ResourceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Resource)(nil)).Elem()
}
func (o ResourceOutput) ToResourceOutput() ResourceOutput {
return o
}
func (o ResourceOutput) ToResourceOutputWithContext(ctx context.Context) ResourceOutput {
return o
}
// Sample attribute.
func (o ResourceOutput) SampleAttribute() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Resource) pulumi.StringPtrOutput { return v.SampleAttribute }).(pulumi.StringPtrOutput)
}
type ResourceArrayOutput struct{ *pulumi.OutputState }
func (ResourceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Resource)(nil)).Elem()
}
func (o ResourceArrayOutput) ToResourceArrayOutput() ResourceArrayOutput {
return o
}
func (o ResourceArrayOutput) ToResourceArrayOutputWithContext(ctx context.Context) ResourceArrayOutput {
return o
}
func (o ResourceArrayOutput) Index(i pulumi.IntInput) ResourceOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Resource {
return vs[0].([]*Resource)[vs[1].(int)]
}).(ResourceOutput)
}
type ResourceMapOutput struct{ *pulumi.OutputState }
func (ResourceMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Resource)(nil)).Elem()
}
func (o ResourceMapOutput) ToResourceMapOutput() ResourceMapOutput {
return o
}
func (o ResourceMapOutput) ToResourceMapOutputWithContext(ctx context.Context) ResourceMapOutput {
return o
}
func (o ResourceMapOutput) MapIndex(k pulumi.StringInput) ResourceOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Resource {
return vs[0].(map[string]*Resource)[vs[1].(string)]
}).(ResourceOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ResourceInput)(nil)).Elem(), &Resource{})
pulumi.RegisterInputType(reflect.TypeOf((*ResourceArrayInput)(nil)).Elem(), ResourceArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ResourceMapInput)(nil)).Elem(), ResourceMap{})
pulumi.RegisterOutputType(ResourceOutput{})
pulumi.RegisterOutputType(ResourceArrayOutput{})
pulumi.RegisterOutputType(ResourceMapOutput{})
}

View File

4
sdk/nodejs/README.md generated
View File

@@ -1,4 +0,0 @@
> This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-xyz)
> distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,
> first check the [`pulumi-xyz` repo](https://github.com/pulumi/pulumi-xyz/issues); however, if that doesn't turn up anything,
> please consult the source [`terraform-provider-xyz` repo](https://github.com/terraform-providers/terraform-provider-xyz/issues).

View File

@@ -1,5 +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! ***
// Export members:
export * from "./vars";

View File

@@ -1,23 +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! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
import * as enums from "../types/enums";
import * as utilities from "../utilities";
declare var exports: any;
const __config = new pulumi.Config("xyz");
/**
* A region which should be used.
*/
export declare const region: enums.region.Region | undefined;
Object.defineProperty(exports, "region", {
get() {
return __config.getObject<enums.region.Region>("region");
},
enumerable: true,
});

View File

@@ -1,43 +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! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "./utilities";
export function getDataSource(args: GetDataSourceArgs, opts?: pulumi.InvokeOptions): Promise<GetDataSourceResult> {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("xyz:index/getDataSource:getDataSource", {
"sampleAttribute": args.sampleAttribute,
}, opts);
}
/**
* A collection of arguments for invoking getDataSource.
*/
export interface GetDataSourceArgs {
sampleAttribute: string;
}
/**
* A collection of values returned by getDataSource.
*/
export interface GetDataSourceResult {
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly sampleAttribute: string;
}
export function getDataSourceOutput(args: GetDataSourceOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetDataSourceResult> {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("xyz:index/getDataSource:getDataSource", {
"sampleAttribute": args.sampleAttribute,
}, opts);
}
/**
* A collection of arguments for invoking getDataSource.
*/
export interface GetDataSourceOutputArgs {
sampleAttribute: pulumi.Input<string>;
}

3
sdk/nodejs/go.mod generated
View File

@@ -1,3 +0,0 @@
module fake_nodejs_module // Exclude this directory from Go tools
go 1.17

55
sdk/nodejs/index.ts generated
View File

@@ -1,55 +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! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "./utilities";
// Export members:
export { GetDataSourceArgs, GetDataSourceResult, GetDataSourceOutputArgs } from "./getDataSource";
export const getDataSource: typeof import("./getDataSource").getDataSource = null as any;
export const getDataSourceOutput: typeof import("./getDataSource").getDataSourceOutput = null as any;
utilities.lazyLoad(exports, ["getDataSource","getDataSourceOutput"], () => require("./getDataSource"));
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 { ResourceArgs, ResourceState } from "./resource";
export type Resource = import("./resource").Resource;
export const Resource: typeof import("./resource").Resource = null as any;
utilities.lazyLoad(exports, ["Resource"], () => require("./resource"));
// Export sub-modules:
import * as config from "./config";
import * as region from "./region";
import * as types from "./types";
export {
config,
region,
types,
};
const _module = {
version: utilities.getVersion(),
construct: (name: string, type: string, urn: string): pulumi.Resource => {
switch (type) {
case "xyz:index/resource:Resource":
return new Resource(name, <any>undefined, { urn })
default:
throw new Error(`unknown resource type ${type}`);
}
},
};
pulumi.runtime.registerResourceModule("xyz", "index/resource", _module)
pulumi.runtime.registerResourcePackage("xyz", {
version: utilities.getVersion(),
constructProvider: (name: string, type: string, urn: string): pulumi.ProviderResource => {
if (type !== "pulumi:providers:xyz") {
throw new Error(`unknown provider type ${type}`);
}
return new Provider(name, <any>undefined, { urn });
},
});

View File

@@ -1,27 +0,0 @@
{
"name": "@pulumi/xyz",
"version": "1.0.0-alpha.0+dev",
"description": "A Pulumi package for creating and managing xyz cloud resources.",
"keywords": [
"xyz",
"category/cloud"
],
"homepage": "https://www.pulumi.com",
"repository": "https://github.com/pulumi/pulumi-xyz",
"license": "Apache-2.0",
"scripts": {
"build": "tsc"
},
"dependencies": {
"@pulumi/pulumi": "^3.142.0"
},
"devDependencies": {
"@types/node": "^18",
"typescript": "^4.3.5"
},
"pulumi": {
"resource": true,
"name": "xyz",
"version": "1.0.0-alpha.0+dev"
}
}

58
sdk/nodejs/provider.ts generated
View File

@@ -1,58 +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! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
import * as enums from "./types/enums";
import * as utilities from "./utilities";
/**
* The provider type for the xyz package. By default, resources use package-wide configuration
* settings, however an explicit `Provider` instance may be created and passed during resource
* construction to achieve fine-grained programmatic control over provider settings. See the
* [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
*/
export class Provider extends pulumi.ProviderResource {
/** @internal */
public static readonly __pulumiType = 'xyz';
/**
* Returns true if the given object is an instance of Provider. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is Provider {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}
/**
* Create a Provider resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
{
resourceInputs["region"] = args ? args.region : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Provider.__pulumiType, name, resourceInputs, opts);
}
}
/**
* The set of arguments for constructing a Provider resource.
*/
export interface ProviderArgs {
/**
* A region which should be used.
*/
region?: pulumi.Input<enums.region.Region>;
}

View File

@@ -1,6 +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! ***
// Export enums:
export * from "../types/enums/region";

81
sdk/nodejs/resource.ts generated
View File

@@ -1,81 +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! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "./utilities";
export class Resource extends pulumi.CustomResource {
/**
* Get an existing Resource resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ResourceState, opts?: pulumi.CustomResourceOptions): Resource {
return new Resource(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'xyz:index/resource:Resource';
/**
* Returns true if the given object is an instance of Resource. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is Resource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Resource.__pulumiType;
}
/**
* Sample attribute.
*/
public readonly sampleAttribute!: pulumi.Output<string | undefined>;
/**
* Create a Resource resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: ResourceArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: ResourceArgs | ResourceState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as ResourceState | undefined;
resourceInputs["sampleAttribute"] = state ? state.sampleAttribute : undefined;
} else {
const args = argsOrState as ResourceArgs | undefined;
resourceInputs["sampleAttribute"] = args ? args.sampleAttribute : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Resource.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering Resource resources.
*/
export interface ResourceState {
/**
* Sample attribute.
*/
sampleAttribute?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Resource resource.
*/
export interface ResourceArgs {
/**
* Sample attribute.
*/
sampleAttribute?: pulumi.Input<string>;
}

View File

@@ -1,30 +0,0 @@
{
"compilerOptions": {
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"declaration": true,
"sourceMap": true,
"stripInternal": true,
"experimentalDecorators": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"strict": true
},
"files": [
"config/index.ts",
"config/vars.ts",
"getDataSource.ts",
"index.ts",
"provider.ts",
"region/index.ts",
"resource.ts",
"types/enums/index.ts",
"types/enums/region/index.ts",
"types/index.ts",
"types/input.ts",
"types/output.ts",
"utilities.ts"
]
}

View File

@@ -1,9 +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! ***
// Export sub-modules:
import * as region from "./region";
export {
region,
};

View File

@@ -1,10 +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! ***
export const Region = {
Here: "HERE",
OverThere: "OVER_THERE",
} as const;
export type Region = (typeof Region)[keyof typeof Region];

View File

@@ -1,13 +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! ***
// Export sub-modules:
import * as enums from "./enums";
import * as input from "./input";
import * as output from "./output";
export {
enums,
input,
output,
};

View File

@@ -1,8 +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! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
import * as enums from "../types/enums";

View File

@@ -1,8 +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! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
import * as enums from "../types/enums";

View File

@@ -1,95 +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! ***
import * as runtime from "@pulumi/pulumi/runtime";
import * as pulumi from "@pulumi/pulumi";
export function getEnv(...vars: string[]): string | undefined {
for (const v of vars) {
const value = process.env[v];
if (value) {
return value;
}
}
return undefined;
}
export function getEnvBoolean(...vars: string[]): boolean | undefined {
const s = getEnv(...vars);
if (s !== undefined) {
// NOTE: these values are taken from https://golang.org/src/strconv/atob.go?s=351:391#L1, which is what
// Terraform uses internally when parsing boolean values.
if (["1", "t", "T", "true", "TRUE", "True"].find(v => v === s) !== undefined) {
return true;
}
if (["0", "f", "F", "false", "FALSE", "False"].find(v => v === s) !== undefined) {
return false;
}
}
return undefined;
}
export function getEnvNumber(...vars: string[]): number | undefined {
const s = getEnv(...vars);
if (s !== undefined) {
const f = parseFloat(s);
if (!isNaN(f)) {
return f;
}
}
return undefined;
}
export function getVersion(): string {
let version = require('./package.json').version;
// Node allows for the version to be prefixed by a "v", while semver doesn't.
// If there is a v, strip it off.
if (version.indexOf('v') === 0) {
version = version.slice(1);
}
return version;
}
/** @internal */
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];
},
});
}
}
export async function callAsync<T>(
tok: string,
props: pulumi.Inputs,
res?: pulumi.Resource,
opts?: {property?: string},
): Promise<T> {
const o: any = runtime.call<T>(tok, props, res);
const value = await o.promise(true /*withUnknowns*/);
const isKnown = await o.isKnown;
const isSecret = await o.isSecret;
const problem: string|undefined =
!isKnown ? "an unknown value"
: isSecret ? "a secret value"
: undefined;
// Ingoring o.resources silently. They are typically non-empty, r.f() calls include r as a dependency.
if (problem) {
throw new Error(`Plain resource method "${tok}" incorrectly returned ${problem}. ` +
"This is an error in the provider, please report this to the provider developer.");
}
// Extract a single property if requested.
if (opts && opts.property) {
return value[opts.property];
}
return value;
}

View File

63
sdk/python/README.md generated
View File

@@ -1,63 +0,0 @@
# Terraform Bridge Provider Boilerplate
This repository is the template for authoring a Pulumi package from an existing Terraform provider as part of the guide for [authoring and publishing Pulumi packages](https://www.pulumi.com/docs/iac/packages-and-automation/pulumi-packages/authoring/).
This repository is initially set up as a fictitious provider named "xyz" to demonstrate a resource, a data source and configuration derived from the [github.com/pulumi/terraform-provider-xyz provider](https://github.com/pulumi/terraform-provider-xyz).
Read the [setup instructions](SETUP.md) for step-by-step instructions on how to bridge a new provider and refer to our complete docs [guide for authoring and publishing a Pulumi Package](https://www.pulumi.com/docs/iac/packages-and-automation/pulumi-packages/authoring/).
# Xyz Resource Provider
The Xyz Resource Provider lets you manage [Xyz](http://example.com) resources.
## Installing
This package is available for several languages/platforms:
### Node.js (JavaScript/TypeScript)
To use from JavaScript or TypeScript in Node.js, install using either `npm`:
```bash
npm install @pulumi/xyz
```
or `yarn`:
```bash
yarn add @pulumi/xyz
```
### Python
To use from Python, install using `pip`:
```bash
pip install pulumi_xyz
```
### Go
To use from Go, use `go get` to grab the latest version of the library:
```bash
go get github.com/pulumi/pulumi-xyz/sdk/go/...
```
### .NET
To use from .NET, install using `dotnet add package`:
```bash
dotnet add package Pulumi.Xyz
```
## Configuration
The following configuration points are available for the `xyz` provider:
- `xyz:region` (environment: `XYZ_REGION`) - the region in which to deploy resources
## Reference
For detailed reference documentation, please visit [the Pulumi registry](https://www.pulumi.com/registry/packages/xyz/api-docs/).

3
sdk/python/go.mod generated
View File

@@ -1,3 +0,0 @@
module fake_python_module // Exclude this directory from Go tools
go 1.17

View File

@@ -1,4 +0,0 @@
> This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-xyz)
> distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,
> first check the [`pulumi-xyz` repo](https://github.com/pulumi/pulumi-xyz/issues); however, if that doesn't turn up anything,
> please consult the source [`terraform-provider-xyz` repo](https://github.com/terraform-providers/terraform-provider-xyz/issues).

View File

@@ -1,46 +0,0 @@
# coding=utf-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 builtins
from . import _utilities
import typing
# Export this package's modules as members:
from .get_data_source import *
from .provider import *
from .resource import *
# Make subpackages available:
if typing.TYPE_CHECKING:
import pulumi_xyz.config as __config
config = __config
import pulumi_xyz.region as __region
region = __region
else:
config = _utilities.lazy_import('pulumi_xyz.config')
region = _utilities.lazy_import('pulumi_xyz.region')
_utilities.register(
resource_modules="""
[
{
"pkg": "xyz",
"mod": "index/resource",
"fqn": "pulumi_xyz",
"classes": {
"xyz:index/resource:Resource": "Resource"
}
}
]
""",
resource_packages="""
[
{
"pkg": "xyz",
"token": "pulumi:providers:xyz",
"fqn": "pulumi_xyz",
"class": "Provider"
}
]
"""
)

View File

@@ -1,331 +0,0 @@
# coding=utf-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 asyncio
import functools
import importlib.metadata
import importlib.util
import inspect
import json
import os
import sys
import typing
import warnings
import base64
import pulumi
import pulumi.runtime
from pulumi.runtime.sync_await import _sync_await
from pulumi.runtime.proto import resource_pb2
from semver import VersionInfo as SemverVersion
from parver import Version as PEP440Version
C = typing.TypeVar("C", bound=typing.Callable)
def get_env(*args):
for v in args:
value = os.getenv(v)
if value is not None:
return value
return None
def get_env_bool(*args):
str = get_env(*args)
if str is not None:
# NOTE: these values are taken from https://golang.org/src/strconv/atob.go?s=351:391#L1, which is what
# Terraform uses internally when parsing boolean values.
if str in ["1", "t", "T", "true", "TRUE", "True"]:
return True
if str in ["0", "f", "F", "false", "FALSE", "False"]:
return False
return None
def get_env_int(*args):
str = get_env(*args)
if str is not None:
try:
return int(str)
except:
return None
return None
def get_env_float(*args):
str = get_env(*args)
if str is not None:
try:
return float(str)
except:
return None
return None
def _get_semver_version():
# __name__ is set to the fully-qualified name of the current module, In our case, it will be
# <some module>._utilities. <some module> is the module we want to query the version for.
root_package, *rest = __name__.split('.')
# pkg_resources uses setuptools to inspect the set of installed packages. We use it here to ask
# for the currently installed version of the root package (i.e. us) and get its version.
# Unfortunately, PEP440 and semver differ slightly in incompatible ways. The Pulumi engine expects
# to receive a valid semver string when receiving requests from the language host, so it's our
# responsibility as the library to convert our own PEP440 version into a valid semver string.
pep440_version_string = importlib.metadata.version(root_package)
pep440_version = PEP440Version.parse(pep440_version_string)
(major, minor, patch) = pep440_version.release
prerelease = None
if pep440_version.pre_tag == 'a':
prerelease = f"alpha.{pep440_version.pre}"
elif pep440_version.pre_tag == 'b':
prerelease = f"beta.{pep440_version.pre}"
elif pep440_version.pre_tag == 'rc':
prerelease = f"rc.{pep440_version.pre}"
elif pep440_version.dev is not None:
# PEP440 has explicit support for dev builds, while semver encodes them as "prerelease" versions. To bridge
# between the two, we convert our dev build version into a prerelease tag. This matches what all of our other
# packages do when constructing their own semver string.
prerelease = f"dev.{pep440_version.dev}"
elif pep440_version.local is not None:
# PEP440 only allows a small set of prerelease tags, so when converting an arbitrary prerelease,
# PypiVersion in /pkg/codegen/python/utilities.go converts it to a local version. Therefore, we need to
# do the reverse conversion here and set the local version as the prerelease tag.
prerelease = pep440_version.local
return SemverVersion(major=major, minor=minor, patch=patch, prerelease=prerelease)
# Determine the version once and cache the value, which measurably improves program performance.
_version = _get_semver_version()
_version_str = str(_version)
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):
"""
Return the resource args and options given the *args and **kwargs of a resource's
__init__ method.
"""
resource_args, opts = None, None
# If the first item is the resource args type, save it and remove it from the args list.
if args and isinstance(args[0], resource_args_type):
resource_args, args = args[0], args[1:]
# Now look at the first item in the args list again.
# If the first item is the resource options class, save it.
if args and isinstance(args[0], resource_options_type):
opts = args[0]
# If resource_args is None, see if "args" is in kwargs, and, if so, if it's typed as the
# the resource args type.
if resource_args is None:
a = kwargs.get("args")
if isinstance(a, resource_args_type):
resource_args = a
# If opts is None, look it up in kwargs.
if opts is None:
opts = kwargs.get("opts")
return resource_args, opts
# Temporary: just use pulumi._utils.lazy_import once everyone upgrades.
def lazy_import(fullname):
import pulumi._utils as u
f = getattr(u, 'lazy_import', None)
if f is None:
f = _lazy_import_temp
return f(fullname)
# Copied from pulumi._utils.lazy_import, see comments there.
def _lazy_import_temp(fullname):
m = sys.modules.get(fullname, None)
if m is not None:
return m
spec = importlib.util.find_spec(fullname)
m = sys.modules.get(fullname, None)
if m is not None:
return m
loader = importlib.util.LazyLoader(spec.loader)
spec.loader = loader
module = importlib.util.module_from_spec(spec)
m = sys.modules.get(fullname, None)
if m is not None:
return m
sys.modules[fullname] = module
loader.exec_module(module)
return module
class Package(pulumi.runtime.ResourcePackage):
def __init__(self, pkg_info):
super().__init__()
self.pkg_info = pkg_info
def version(self):
return _version
def construct_provider(self, name: str, typ: str, urn: str) -> pulumi.ProviderResource:
if typ != self.pkg_info['token']:
raise Exception(f"unknown provider type {typ}")
Provider = getattr(lazy_import(self.pkg_info['fqn']), self.pkg_info['class'])
return Provider(name, pulumi.ResourceOptions(urn=urn))
class Module(pulumi.runtime.ResourceModule):
def __init__(self, mod_info):
super().__init__()
self.mod_info = mod_info
def version(self):
return _version
def construct(self, name: str, typ: str, urn: str) -> pulumi.Resource:
class_name = self.mod_info['classes'].get(typ, None)
if class_name is None:
raise Exception(f"unknown resource type {typ}")
TheClass = getattr(lazy_import(self.mod_info['fqn']), class_name)
return TheClass(name, pulumi.ResourceOptions(urn=urn))
def register(resource_modules, resource_packages):
resource_modules = json.loads(resource_modules)
resource_packages = json.loads(resource_packages)
for pkg_info in resource_packages:
pulumi.runtime.register_resource_package(pkg_info['pkg'], Package(pkg_info))
for mod_info in resource_modules:
pulumi.runtime.register_resource_module(
mod_info['pkg'],
mod_info['mod'],
Module(mod_info))
_F = typing.TypeVar('_F', bound=typing.Callable[..., typing.Any])
def lift_output_func(func: typing.Any) -> typing.Callable[[_F], _F]:
"""Decorator internally used on {fn}_output lifted function versions
to implement them automatically from the un-lifted function."""
func_sig = inspect.signature(func)
def lifted_func(*args, opts=None, **kwargs):
bound_args = func_sig.bind(*args, **kwargs)
# Convert tuple to list, see pulumi/pulumi#8172
args_list = list(bound_args.args)
return pulumi.Output.from_input({
'args': args_list,
'kwargs': bound_args.kwargs
}).apply(lambda resolved_args: func(*resolved_args['args'],
opts=opts,
**resolved_args['kwargs']))
return (lambda _: lifted_func)
def call_plain(
tok: str,
props: pulumi.Inputs,
res: typing.Optional[pulumi.Resource] = None,
typ: typing.Optional[type] = None,
) -> typing.Any:
"""
Wraps pulumi.runtime.plain to force the output and return it plainly.
"""
output = pulumi.runtime.call(tok, props, res, typ)
# Ingoring deps silently. They are typically non-empty, r.f() calls include r as a dependency.
result, known, secret, _ = _sync_await(asyncio.create_task(_await_output(output)))
problem = None
if not known:
problem = ' an unknown value'
elif secret:
problem = ' a secret value'
if problem:
raise AssertionError(
f"Plain resource method '{tok}' incorrectly returned {problem}. "
+ "This is an error in the provider, please report this to the provider developer."
)
return result
async def _await_output(o: pulumi.Output[typing.Any]) -> typing.Tuple[object, bool, bool, set]:
return (
await o._future,
await o._is_known,
await o._is_secret,
await o._resources,
)
# This is included to provide an upgrade path for users who are using a version
# of the Pulumi SDK (<3.121.0) that does not include the `deprecated` decorator.
def deprecated(message: str) -> typing.Callable[[C], C]:
"""
Decorator to indicate a function is deprecated.
As well as inserting appropriate statements to indicate that the function is
deprecated, this decorator also tags the function with a special attribute
so that Pulumi code can detect that it is deprecated and react appropriately
in certain situations.
message is the deprecation message that should be printed if the function is called.
"""
def decorator(fn: C) -> C:
if not callable(fn):
raise TypeError("Expected fn to be callable")
@functools.wraps(fn)
def deprecated_fn(*args, **kwargs):
warnings.warn(message)
pulumi.warn(f"{fn.__name__} is deprecated: {message}")
return fn(*args, **kwargs)
deprecated_fn.__dict__["_pulumi_deprecated_callable"] = fn
return typing.cast(C, deprecated_fn)
return decorator
def get_plugin_download_url():
return None
def get_version():
return _version_str

View File

@@ -1,9 +0,0 @@
# coding=utf-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 builtins
import sys
from .vars import _ExportableConfig
sys.modules[__name__].__class__ = _ExportableConfig

View File

@@ -1,23 +0,0 @@
# coding=utf-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 builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
from typing import NotRequired, TypedDict, TypeAlias
else:
from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from .. import region
region: Optional[str]
"""
A region which should be used.
"""

View File

@@ -1,31 +0,0 @@
# coding=utf-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 builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
from typing import NotRequired, TypedDict, TypeAlias
else:
from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from .. import region
import types
__config__ = pulumi.Config('xyz')
class _ExportableConfig(types.ModuleType):
@property
def region(self) -> Optional[str]:
"""
A region which should be used.
"""
return __config__.get('region')

View File

@@ -1,86 +0,0 @@
# coding=utf-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 builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
from typing import NotRequired, TypedDict, TypeAlias
else:
from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities
__all__ = [
'GetDataSourceResult',
'AwaitableGetDataSourceResult',
'get_data_source',
'get_data_source_output',
]
@pulumi.output_type
class GetDataSourceResult:
"""
A collection of values returned by getDataSource.
"""
def __init__(__self__, id=None, sample_attribute=None):
if id and not isinstance(id, str):
raise TypeError("Expected argument 'id' to be a str")
pulumi.set(__self__, "id", id)
if sample_attribute and not isinstance(sample_attribute, str):
raise TypeError("Expected argument 'sample_attribute' to be a str")
pulumi.set(__self__, "sample_attribute", sample_attribute)
@property
@pulumi.getter
def id(self) -> builtins.str:
"""
The provider-assigned unique ID for this managed resource.
"""
return pulumi.get(self, "id")
@property
@pulumi.getter(name="sampleAttribute")
def sample_attribute(self) -> builtins.str:
return pulumi.get(self, "sample_attribute")
class AwaitableGetDataSourceResult(GetDataSourceResult):
# pylint: disable=using-constant-test
def __await__(self):
if False:
yield self
return GetDataSourceResult(
id=self.id,
sample_attribute=self.sample_attribute)
def get_data_source(sample_attribute: Optional[builtins.str] = None,
opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDataSourceResult:
"""
Use this data source to access information about an existing resource.
"""
__args__ = dict()
__args__['sampleAttribute'] = sample_attribute
opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
__ret__ = pulumi.runtime.invoke('xyz:index/getDataSource:getDataSource', __args__, opts=opts, typ=GetDataSourceResult).value
return AwaitableGetDataSourceResult(
id=pulumi.get(__ret__, 'id'),
sample_attribute=pulumi.get(__ret__, 'sample_attribute'))
def get_data_source_output(sample_attribute: Optional[pulumi.Input[builtins.str]] = None,
opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetDataSourceResult]:
"""
Use this data source to access information about an existing resource.
"""
__args__ = dict()
__args__['sampleAttribute'] = sample_attribute
opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
__ret__ = pulumi.runtime.invoke_output('xyz:index/getDataSource:getDataSource', __args__, opts=opts, typ=GetDataSourceResult)
return __ret__.apply(lambda __response__: GetDataSourceResult(
id=pulumi.get(__response__, 'id'),
sample_attribute=pulumi.get(__response__, 'sample_attribute')))

View File

@@ -1,105 +0,0 @@
# coding=utf-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 builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
from typing import NotRequired, TypedDict, TypeAlias
else:
from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities
from . import region
__all__ = ['ProviderArgs', 'Provider']
@pulumi.input_type
class ProviderArgs:
def __init__(__self__, *,
region: Optional[pulumi.Input['region.Region']] = None):
"""
The set of arguments for constructing a Provider resource.
:param pulumi.Input['region.Region'] region: A region which should be used.
"""
if region is not None:
pulumi.set(__self__, "region", region)
@property
@pulumi.getter
def region(self) -> Optional[pulumi.Input['region.Region']]:
"""
A region which should be used.
"""
return pulumi.get(self, "region")
@region.setter
def region(self, value: Optional[pulumi.Input['region.Region']]):
pulumi.set(self, "region", value)
class Provider(pulumi.ProviderResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
region: Optional[pulumi.Input['region.Region']] = None,
__props__=None):
"""
The provider type for the xyz package. By default, resources use package-wide configuration
settings, however an explicit `Provider` instance may be created and passed during resource
construction to achieve fine-grained programmatic control over provider settings. See the
[documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input['region.Region'] region: A region which should be used.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: Optional[ProviderArgs] = None,
opts: Optional[pulumi.ResourceOptions] = None):
"""
The provider type for the xyz package. By default, resources use package-wide configuration
settings, however an explicit `Provider` instance may be created and passed during resource
construction to achieve fine-grained programmatic control over provider settings. See the
[documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
:param str resource_name: The name of the resource.
:param ProviderArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(ProviderArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
region: Optional[pulumi.Input['region.Region']] = None,
__props__=None):
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.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')
__props__ = ProviderArgs.__new__(ProviderArgs)
__props__.__dict__["region"] = pulumi.Output.from_input(region).apply(pulumi.runtime.to_json) if region is not None else None
super(Provider, __self__).__init__(
'xyz',
resource_name,
__props__,
opts)

View File

@@ -1,5 +0,0 @@
{
"resource": true,
"name": "xyz",
"version": "1.0.0-alpha.0+dev"
}

View File

View File

@@ -1,9 +0,0 @@
# coding=utf-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 builtins
from .. import _utilities
import typing
# Export this package's modules as members:
from ._enums import *

View File

@@ -1,16 +0,0 @@
# coding=utf-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 builtins
import builtins
from enum import Enum
__all__ = [
'Region',
]
class Region(builtins.str, Enum):
HERE = "HERE"
OVER_THERE = "OVER_THERE"

View File

@@ -1,149 +0,0 @@
# coding=utf-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 builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
from typing import NotRequired, TypedDict, TypeAlias
else:
from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities
__all__ = ['ResourceArgs', 'Resource']
@pulumi.input_type
class ResourceArgs:
def __init__(__self__, *,
sample_attribute: Optional[pulumi.Input[builtins.str]] = None):
"""
The set of arguments for constructing a Resource resource.
:param pulumi.Input[builtins.str] sample_attribute: Sample attribute.
"""
if sample_attribute is not None:
pulumi.set(__self__, "sample_attribute", sample_attribute)
@property
@pulumi.getter(name="sampleAttribute")
def sample_attribute(self) -> Optional[pulumi.Input[builtins.str]]:
"""
Sample attribute.
"""
return pulumi.get(self, "sample_attribute")
@sample_attribute.setter
def sample_attribute(self, value: Optional[pulumi.Input[builtins.str]]):
pulumi.set(self, "sample_attribute", value)
@pulumi.input_type
class _ResourceState:
def __init__(__self__, *,
sample_attribute: Optional[pulumi.Input[builtins.str]] = None):
"""
Input properties used for looking up and filtering Resource resources.
:param pulumi.Input[builtins.str] sample_attribute: Sample attribute.
"""
if sample_attribute is not None:
pulumi.set(__self__, "sample_attribute", sample_attribute)
@property
@pulumi.getter(name="sampleAttribute")
def sample_attribute(self) -> Optional[pulumi.Input[builtins.str]]:
"""
Sample attribute.
"""
return pulumi.get(self, "sample_attribute")
@sample_attribute.setter
def sample_attribute(self, value: Optional[pulumi.Input[builtins.str]]):
pulumi.set(self, "sample_attribute", value)
class Resource(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
sample_attribute: Optional[pulumi.Input[builtins.str]] = None,
__props__=None):
"""
Create a Resource resource with the given unique name, props, and options.
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[builtins.str] sample_attribute: Sample attribute.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: Optional[ResourceArgs] = None,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Create a Resource resource with the given unique name, props, and options.
:param str resource_name: The name of the resource.
:param ResourceArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(ResourceArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
sample_attribute: Optional[pulumi.Input[builtins.str]] = None,
__props__=None):
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.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')
__props__ = ResourceArgs.__new__(ResourceArgs)
__props__.__dict__["sample_attribute"] = sample_attribute
super(Resource, __self__).__init__(
'xyz:index/resource:Resource',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
sample_attribute: Optional[pulumi.Input[builtins.str]] = None) -> 'Resource':
"""
Get an existing Resource resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[builtins.str] sample_attribute: Sample attribute.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _ResourceState.__new__(_ResourceState)
__props__.__dict__["sample_attribute"] = sample_attribute
return Resource(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter(name="sampleAttribute")
def sample_attribute(self) -> pulumi.Output[Optional[builtins.str]]:
"""
Sample attribute.
"""
return pulumi.get(self, "sample_attribute")

View File

@@ -1,22 +0,0 @@
[project]
name = "pulumi_xyz"
description = "A Pulumi package for creating and managing xyz cloud resources."
dependencies = ["parver>=0.2.1", "pulumi>=3.142.0,<4.0.0", "semver>=2.8.1", "typing-extensions>=4.11; python_version < \"3.11\""]
keywords = ["xyz", "category/cloud"]
readme = "README.md"
requires-python = ">=3.9"
version = "1.0.0a0+dev"
[project.license]
text = "Apache-2.0"
[project.urls]
Homepage = "https://www.pulumi.com"
Repository = "https://github.com/pulumi/pulumi-xyz"
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[tool]
[tool.setuptools]
[tool.setuptools.package-data]
pulumi_xyz = ["py.typed", "pulumi-plugin.json"]