Merge remote-tracking branch 'origin/master' into ctpp
This commit is contained in:
commit
b692140160
|
@ -28,8 +28,8 @@ RUN groupadd --gid $USER_GID $USER_NAME \
|
|||
|
||||
RUN mkdir -p /go/bin \
|
||||
&& chown -R $USER_NAME: /go \
|
||||
&& mkdir -p /opt/pulumi/bin \
|
||||
&& chown -R $USER_NAME: /opt/pulumi
|
||||
&& mkdir -p $HOME/.pulumi/bin \
|
||||
&& chown -R $USER_NAME: $HOME/.pulumi
|
||||
|
||||
USER $USER_NAME
|
||||
|
||||
|
@ -38,7 +38,7 @@ USER $USER_NAME
|
|||
ENV XDG_CONFIG_HOME=/home/$USER_NAME/.config
|
||||
ENV XDG_CACHE_HOME=/home/$USER_NAME/.cache
|
||||
|
||||
RUN echo "export PATH=/opt/pulumi:/opt/pulumi/bin:$GOPATH/bin:/usr/local/go/bin:$PATH" >> ~/.bashrc \
|
||||
RUN echo "export PATH=$HOME/.pulumi:$HOME/.pulumi/bin:$GOPATH/bin:/usr/local/go/bin:$PATH" >> ~/.bashrc \
|
||||
&& echo "alias l='ls -aF'" >> ~/.bash_aliases \
|
||||
&& echo "alias ll='ls -ahlF'" >> ~/.bash_aliases \
|
||||
&& echo "alias ls='ls --color=auto --group-directories-first'" >> ~/.bash_aliases
|
||||
|
|
7
.github/workflows/run-docs-generation.yml
vendored
7
.github/workflows/run-docs-generation.yml
vendored
|
@ -101,6 +101,13 @@ jobs:
|
|||
|
||||
./scripts/gen_resource_docs.sh aws true
|
||||
./scripts/gen_resource_docs.sh kubernetes true
|
||||
|
||||
# Undo the changes to the go.mod and go.sum files since we don't want the PR
|
||||
# to contain local overrides or the PR build in docs repo would fail.
|
||||
pushd tools/resourcedocsgen
|
||||
git checkout .
|
||||
popd
|
||||
|
||||
popd
|
||||
|
||||
echo "::set-output name=branchName::${BRANCH_NAME}"
|
||||
|
|
|
@ -5,7 +5,7 @@ image:
|
|||
tasks:
|
||||
- before: >
|
||||
mkdir -p /workspace/opt-pulumi &&
|
||||
sudo ln -s /workspace/opt-pulumi /opt/pulumi
|
||||
sudo ln -s /workspace/opt-pulumi $HOME/.pulumi
|
||||
init: >
|
||||
make ensure &&
|
||||
make install
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
FROM gitpod/workspace-full
|
||||
USER gitpod
|
||||
|
||||
ENV PATH="/opt/pulumi:/opt/pulumi/bin:$PATH"
|
||||
ENV PATH="$HOME/.pulumi:$HOME/.pulumi/bin:$PATH"
|
||||
|
||||
# Install .NET Core 3.1 SDK binaries on Ubuntu 20.04
|
||||
# Source: https://dev.to/carlos487/installing-dotnet-core-in-ubuntu-20-04-6jh
|
||||
|
|
47
CHANGELOG.md
47
CHANGELOG.md
|
@ -1,6 +1,53 @@
|
|||
CHANGELOG
|
||||
=========
|
||||
|
||||
## 3.18.0 (2021-11-17)
|
||||
|
||||
### Improvements
|
||||
- [ci] - Adds CI detector for Buildkite
|
||||
[#7933](https://github.com/pulumi/pulumi/pull/7933)
|
||||
|
||||
- [cli] - Add `--exclude-protected` flag to `pulumi destroy`.
|
||||
[#8359](https://github.com/pulumi/pulumi/pull/8359)
|
||||
|
||||
- [cli] Add the ability to use `pulumi org set [name]` to set a default org
|
||||
to use when creating a stacks in the Pulumi Service backend or self-hosted Service.
|
||||
[#8352](https://github.com/pulumi/pulumi/pull/8352)
|
||||
|
||||
- [schema] Add IsOverlay option to disable codegen for particular types.
|
||||
[#8338](https://github.com/pulumi/pulumi/pull/8338)
|
||||
[#8425](https://github.com/pulumi/pulumi/pull/8425)
|
||||
|
||||
- [sdk/dotnet] - Marshal output values.
|
||||
[#8316](https://github.com/pulumi/pulumi/pull/8316)
|
||||
|
||||
- [sdk/python] - Unmarshal output values in component provider.
|
||||
[#8212](https://github.com/pulumi/pulumi/pull/8212)
|
||||
|
||||
- [sdk/nodejs] - Unmarshal output values in component provider.
|
||||
[#8205](https://github.com/pulumi/pulumi/pull/8205)
|
||||
|
||||
- [sdk/nodejs] - Allow returning failures from Call in the provider without setting result outputs.
|
||||
[#8424](https://github.com/pulumi/pulumi/pull/8424)
|
||||
|
||||
- [sdk/go] - Allow specifying Call failures from the provider.
|
||||
[#8424](https://github.com/pulumi/pulumi/pull/8424)
|
||||
|
||||
- [codegen/nodejs] - Program generator now uses `fnOutput` forms where
|
||||
appropriate, simplifying auto-generated examples.
|
||||
[#8434](https://github.com/pulumi/pulumi/pull/8434)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- [engine] - Compute dependents correctly during targeted deletes.
|
||||
[#8360](https://github.com/pulumi/pulumi/pull/8360)
|
||||
|
||||
- [cli/engine] - Update command respects `--target-dependents`.
|
||||
[#8395](https://github.com/pulumi/pulumi/pull/8395)
|
||||
|
||||
- [docs] - Fix broken lists in dotnet docs.
|
||||
[docs#6558](https://github.com/pulumi/docs/issues/6558)
|
||||
|
||||
## 3.17.1 (2021-11-09)
|
||||
|
||||
### Improvements
|
||||
|
|
|
@ -1,40 +1,28 @@
|
|||
### Improvements
|
||||
- Adds CI detector for Buildkite
|
||||
[#7933](https://github.com/pulumi/pulumi/pull/7933)
|
||||
|
||||
- [cli] - Add `--exclude-protected` flag to `pulumi destroy`.
|
||||
[#8359](https://github.com/pulumi/pulumi/pull/8359)
|
||||
- [cli] - When running `pulumi new https://github.com/name/repo`, check
|
||||
for branch `main` if branch `master` doesn't exist.
|
||||
[#8463](https://github.com/pulumi/pulumi/pull/8463)
|
||||
|
||||
- [cli] Adding the ability to use `pulumi org set [name]` to set a default org
|
||||
to use when creating a stacks in the Pulumi Service backend or self-hosted Service
|
||||
[#8352](https://github.com/pulumi/pulumi/pull/8352)
|
||||
- [codegen/python] - Program generator now uses `fn_output` forms where
|
||||
appropriate, simplifying auto-generated examples.
|
||||
[#8433](https://github.com/pulumi/pulumi/pull/8433)
|
||||
|
||||
- [schema] Add IsOverlay option to disable codegen for particular types
|
||||
[#8338](https://github.com/pulumi/pulumi/pull/8338)
|
||||
[#8425](https://github.com/pulumi/pulumi/pull/8425)
|
||||
- [codegen/go] - Program generator now uses fnOutput forms where
|
||||
appropriate, simplifying auto-generated examples.
|
||||
[#8431](https://github.com/pulumi/pulumi/pull/8431)
|
||||
|
||||
- [sdk/dotnet] - Marshal output values.
|
||||
[#8316](https://github.com/pulumi/pulumi/pull/8316)
|
||||
|
||||
- [sdk/python] - Unmarshal output values in component provider.
|
||||
[#8212](https://github.com/pulumi/pulumi/pull/8212)
|
||||
|
||||
- [sdk/nodejs] - Unmarshal output values in component provider.
|
||||
[#8205](https://github.com/pulumi/pulumi/pull/8205)
|
||||
|
||||
- [sdk/nodejs] - Allow returning failures from Call in the provider without setting result outputs.
|
||||
[#8424](https://github.com/pulumi/pulumi/pull/8424)
|
||||
|
||||
- [sdk/go] - Allow specifying Call failures from the provider.
|
||||
[#8424](https://github.com/pulumi/pulumi/pull/8424)
|
||||
- [codegen/dotnet] - Program generator now uses `Invoke` forms where
|
||||
appropriate, simplifying auto-generated examples.
|
||||
[#8432](https://github.com/pulumi/pulumi/pull/8432)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- [engine] - Compute dependents correctly during targeted deletes.
|
||||
[#8360](https://github.com/pulumi/pulumi/pull/8360)
|
||||
- [codegen/typescript] - Respect default values in Pulumi object types.
|
||||
[#8400](https://github.com/pulumi/pulumi/pull/8400)
|
||||
|
||||
- [cli/engine] - Update command respects `--target-dependents`
|
||||
[#8395](https://github.com/pulumi/pulumi/pull/8395)
|
||||
- [sdk/python] - Correctly handle version checking python virtual environments.
|
||||
[#8465](https://github.com/pulumi/pulumi/pull/8465)
|
||||
|
||||
- [docs] - Fix broken lists in dotnet docs
|
||||
[docs#6558](https://github.com/pulumi/docs/issues/6558)
|
||||
- [cli] - Catch expected errors in stacks with filestate backends.
|
||||
[#8455](https://github.com/pulumi/pulumi/pull/8455)
|
||||
|
|
|
@ -38,12 +38,10 @@ If you have a web browser, you can get a fully pre-configured Pulumi development
|
|||
|
||||
We use `make` as our build system, so you'll want to install that as well, if you don't have it already. We have extremely limited support for doing development on Windows (the bare minimum for us to get Windows validation of `pulumi`) so if you're on windows, we recommend that you use the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10). We'd like to [make this better](https://github.com/pulumi/pulumi/issues/208) so feel free to pitch in if you can.
|
||||
|
||||
For historical reasons (which we'd [like to address](https://github.com/pulumi/pulumi/issues/1515)) our build system requires that the folder `/opt/pulumi` exists and is writable by the current user. If you'd like, you can override this location by setting `PULUMI_ROOT` in your environment. The build is known to fail if this doesn't exist, so you'll need to create it first.
|
||||
We build Pulumi in `$PULUMI_ROOT`, which defaults to `$HOME/.pulumi`. If you would like to build Pulumi in another location, you do so by setting `$PULUMI_ROOT`.
|
||||
|
||||
```bash
|
||||
mkdir /opt/pulumi
|
||||
sudo chown <your_user_name>: /opt/pulumi
|
||||
export PATH=/opt/pulumi:/opt/pulumi/bin:$PATH
|
||||
export PATH=$HOME/.pulumi/bin:$PATH
|
||||
```
|
||||
|
||||
You'll also need to make sure your maximum open file descriptor limit is set to 5000 at a minimum.
|
||||
|
|
|
@ -96,9 +96,9 @@ SHELL := /bin/bash
|
|||
STEP_MESSAGE = @echo -e "\033[0;32m$(shell echo '$@' | tr a-z A-Z | tr '_' ' '):\033[0m"
|
||||
|
||||
# Our install targets place items item into $PULUMI_ROOT, if it's
|
||||
# unset, default to /opt/pulumi.
|
||||
# unset, default to `$HOME/.pulumi`.
|
||||
ifeq ($(PULUMI_ROOT),)
|
||||
PULUMI_ROOT:=/opt/pulumi
|
||||
PULUMI_ROOT:=$(shell realpath "$$HOME/.pulumi")
|
||||
endif
|
||||
|
||||
# Use Python 3 explicitly vs expecting that `python` will resolve to a python 3
|
||||
|
@ -168,6 +168,7 @@ test_fast::
|
|||
|
||||
install::
|
||||
$(call STEP_MESSAGE)
|
||||
# Implicitly creates PULUMI_ROOT.
|
||||
@mkdir -p $(PULUMI_BIN)
|
||||
@mkdir -p $(PULUMI_NODE_MODULES)
|
||||
@mkdir -p $(PULUMI_NUGET)
|
||||
|
|
|
@ -323,7 +323,7 @@ func (b *localBackend) GetStack(ctx context.Context, stackRef backend.StackRefer
|
|||
snapshot, path, err := b.getStack(stackName)
|
||||
|
||||
switch {
|
||||
case gcerrors.Code(drillError(err)) == gcerrors.NotFound:
|
||||
case gcerrors.Code(err) == gcerrors.NotFound:
|
||||
return nil, nil
|
||||
case err != nil:
|
||||
return nil, err
|
||||
|
@ -883,12 +883,3 @@ func (b *localBackend) UpdateStackTags(ctx context.Context,
|
|||
// The local backend does not currently persist tags.
|
||||
return errors.New("stack tags not supported in --local mode")
|
||||
}
|
||||
|
||||
// Returns the original error in the chain. If `err` is nil, nil is returned.
|
||||
func drillError(err error) error {
|
||||
e := err
|
||||
for errors.Unwrap(e) != nil {
|
||||
e = errors.Unwrap(e)
|
||||
}
|
||||
return e
|
||||
}
|
||||
|
|
|
@ -187,3 +187,20 @@ func TestListStacksWithMultiplePassphrases(t *testing.T) {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
func TestDrillError(t *testing.T) {
|
||||
// Login to a temp dir filestate backend
|
||||
tmpDir, err := ioutil.TempDir("", "filestatebackend")
|
||||
assert.NoError(t, err)
|
||||
b, err := New(cmdutil.Diag(), "file://"+filepath.ToSlash(tmpDir))
|
||||
assert.NoError(t, err)
|
||||
ctx := context.Background()
|
||||
|
||||
// Get a non-existent stack and expect a nil error because it won't be found.
|
||||
stackRef, err := b.ParseStackReference("dev")
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error %v when parsing stack reference", err)
|
||||
}
|
||||
_, err = b.GetStack(ctx, stackRef)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
|
|
@ -323,7 +323,7 @@ func (b *localBackend) getHistory(name tokens.QName, pageSize int, page int) ([]
|
|||
allFiles, err := listBucket(b.bucket, dir)
|
||||
if err != nil {
|
||||
// History doesn't exist until a stack has been updated.
|
||||
if gcerrors.Code(drillError(err)) == gcerrors.NotFound {
|
||||
if gcerrors.Code(err) == gcerrors.NotFound {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, err
|
||||
|
@ -391,7 +391,7 @@ func (b *localBackend) renameHistory(oldName tokens.QName, newName tokens.QName)
|
|||
allFiles, err := listBucket(b.bucket, oldHistory)
|
||||
if err != nil {
|
||||
// if there's nothing there, we don't really need to do a rename.
|
||||
if gcerrors.Code(drillError(err)) == gcerrors.NotFound {
|
||||
if gcerrors.Code(err) == gcerrors.NotFound {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
|
|
|
@ -902,8 +902,14 @@ func (mod *modContext) genNestedTypes(member interface{}, resourceType bool) []d
|
|||
// and if it appears in an input object and/or output object.
|
||||
mod.getTypes(member, tokens)
|
||||
|
||||
var typs []docNestedType
|
||||
var sortedTokens []string
|
||||
for token := range tokens {
|
||||
sortedTokens = append(sortedTokens, token)
|
||||
}
|
||||
sort.Strings(sortedTokens)
|
||||
|
||||
var typs []docNestedType
|
||||
for _, token := range sortedTokens {
|
||||
for _, t := range mod.pkg.Types {
|
||||
switch typ := t.(type) {
|
||||
case *schema.ObjectType:
|
||||
|
@ -1957,8 +1963,14 @@ func (dctx *docGenContext) generatePackage(tool string, pkg *schema.Package) (ma
|
|||
|
||||
glog.V(3).Infoln("generating package docs now...")
|
||||
files := fs{}
|
||||
for _, mod := range dctx.modules() {
|
||||
if err := mod.gen(files); err != nil {
|
||||
modules := []string{}
|
||||
modMap := dctx.modules()
|
||||
for k := range modMap {
|
||||
modules = append(modules, k)
|
||||
}
|
||||
sort.Strings(modules)
|
||||
for _, mod := range modules {
|
||||
if err := modMap[mod].gen(files); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016-2020, Pulumi Corporation.
|
||||
// Copyright 2016-2021, Pulumi Corporation.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
|
@ -46,6 +46,9 @@ type generator struct {
|
|||
asyncInit bool
|
||||
configCreated bool
|
||||
diagnostics hcl.Diagnostics
|
||||
// Helper map to emit custom type name suffixes that match
|
||||
// those emitted by codegen.
|
||||
usedInFunctionOutputVersionInputs map[schema.Type]bool
|
||||
}
|
||||
|
||||
const pulumiPackage = "pulumi"
|
||||
|
@ -343,14 +346,32 @@ func (g *generator) functionName(tokenArg model.Expression) (string, string) {
|
|||
return rootNamespace, fmt.Sprintf("%s%s.%s", rootNamespace, namespace, Title(member))
|
||||
}
|
||||
|
||||
func (g *generator) toSchemaType(destType model.Type) (schema.Type, bool) {
|
||||
schemaType, ok := pcl.GetSchemaForType(destType.(model.Type))
|
||||
if !ok {
|
||||
return nil, false
|
||||
}
|
||||
return codegen.UnwrapType(schemaType), true
|
||||
}
|
||||
|
||||
// argumentTypeName computes the C# argument class name for the given expression and model type.
|
||||
func (g *generator) argumentTypeName(expr model.Expression, destType model.Type) string {
|
||||
schemaType, ok := pcl.GetSchemaForType(destType.(model.Type))
|
||||
schemaType, ok := g.toSchemaType(destType)
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
suffix := "Args"
|
||||
if g.usedInFunctionOutputVersionInputs[schemaType] {
|
||||
suffix = "InputArgs"
|
||||
}
|
||||
return g.argumentTypeNameWithSuffix(expr, destType, suffix)
|
||||
}
|
||||
|
||||
schemaType = codegen.UnwrapType(schemaType)
|
||||
func (g *generator) argumentTypeNameWithSuffix(expr model.Expression, destType model.Type, suffix string) string {
|
||||
schemaType, ok := g.toSchemaType(destType)
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
|
||||
objType, ok := schemaType.(*schema.ObjectType)
|
||||
if !ok {
|
||||
|
@ -382,7 +403,7 @@ func (g *generator) argumentTypeName(expr model.Expression, destType model.Type)
|
|||
} else if qualifier != "" {
|
||||
namespace = namespace + "." + qualifier
|
||||
}
|
||||
member = member + "Args"
|
||||
member = member + suffix
|
||||
|
||||
return fmt.Sprintf("%s%s.%s", rootNamespace, namespace, Title(member))
|
||||
}
|
||||
|
|
|
@ -255,6 +255,28 @@ func (g *generator) genFunctionUsings(x *model.FunctionCallExpression) []string
|
|||
return []string{fmt.Sprintf("%s = Pulumi.%[1]s", pkg)}
|
||||
}
|
||||
|
||||
func (g *generator) markTypeAsUsedInFunctionOutputVersionInputs(t model.Type) {
|
||||
if g.usedInFunctionOutputVersionInputs == nil {
|
||||
g.usedInFunctionOutputVersionInputs = make(map[schema.Type]bool)
|
||||
}
|
||||
schemaType, ok := g.toSchemaType(t)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
g.usedInFunctionOutputVersionInputs[schemaType] = true
|
||||
}
|
||||
|
||||
func (g *generator) visitToMarkTypesUsedInFunctionOutputVersionInputs(expr model.Expression) {
|
||||
visitor := func(expr model.Expression) (model.Expression, hcl.Diagnostics) {
|
||||
isCons, _, t := pcl.RecognizeTypedObjectCons(expr)
|
||||
if isCons {
|
||||
g.markTypeAsUsedInFunctionOutputVersionInputs(t)
|
||||
}
|
||||
return expr, nil
|
||||
}
|
||||
model.VisitExpression(expr, nil, visitor) // nolint:errcheck
|
||||
}
|
||||
|
||||
func (g *generator) GenFunctionCallExpression(w io.Writer, expr *model.FunctionCallExpression) {
|
||||
switch expr.Name {
|
||||
case pcl.IntrinsicConvert:
|
||||
|
@ -294,10 +316,19 @@ func (g *generator) GenFunctionCallExpression(w io.Writer, expr *model.FunctionC
|
|||
case pcl.Invoke:
|
||||
_, name := g.functionName(expr.Args[0])
|
||||
|
||||
g.Fprintf(w, "%s.InvokeAsync(", name)
|
||||
if len(expr.Args) >= 2 {
|
||||
g.Fgenf(w, "%.v", expr.Args[1])
|
||||
isOut, outArgs, outArgsTy := pcl.RecognizeOutputVersionedInvoke(expr)
|
||||
if isOut {
|
||||
g.visitToMarkTypesUsedInFunctionOutputVersionInputs(outArgs)
|
||||
g.Fprintf(w, "%s.Invoke(", name)
|
||||
typeName := g.argumentTypeNameWithSuffix(expr, outArgsTy, "InvokeArgs")
|
||||
g.genObjectConsExpressionWithTypeName(w, outArgs, typeName)
|
||||
} else {
|
||||
g.Fprintf(w, "%s.InvokeAsync(", name)
|
||||
if len(expr.Args) >= 2 {
|
||||
g.Fgenf(w, "%.v", expr.Args[1])
|
||||
}
|
||||
}
|
||||
|
||||
if len(expr.Args) == 3 {
|
||||
g.Fgenf(w, ", %.v", expr.Args[2])
|
||||
}
|
||||
|
@ -446,7 +477,18 @@ func (g *generator) genObjectConsExpression(w io.Writer, expr *model.ObjectConsE
|
|||
return
|
||||
}
|
||||
|
||||
typeName := g.argumentTypeName(expr, destType)
|
||||
destTypeName := g.argumentTypeName(expr, destType)
|
||||
g.genObjectConsExpressionWithTypeName(w, expr, destTypeName)
|
||||
}
|
||||
|
||||
func (g *generator) genObjectConsExpressionWithTypeName(
|
||||
w io.Writer, expr *model.ObjectConsExpression, destTypeName string) {
|
||||
|
||||
if len(expr.Items) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
typeName := destTypeName
|
||||
if typeName != "" {
|
||||
g.Fgenf(w, "new %s", typeName)
|
||||
g.Fgenf(w, "\n%s{\n", g.Indent)
|
||||
|
|
|
@ -571,6 +571,10 @@ func (pkg *pkgContext) resolveObjectType(t *schema.ObjectType) string {
|
|||
}
|
||||
return name
|
||||
}
|
||||
return pkg.contextForExternalReferenceType(t).typeString(t)
|
||||
}
|
||||
|
||||
func (pkg *pkgContext) contextForExternalReferenceType(t *schema.ObjectType) *pkgContext {
|
||||
extPkg := t.Package
|
||||
var goInfo GoPackageInfo
|
||||
|
||||
|
@ -584,7 +588,7 @@ func (pkg *pkgContext) resolveObjectType(t *schema.ObjectType) string {
|
|||
pkgImportAliases: goInfo.PackageImportAliases,
|
||||
modToPkg: goInfo.ModuleToPackage,
|
||||
}
|
||||
return extPkgCtx.typeString(t)
|
||||
return extPkgCtx
|
||||
}
|
||||
|
||||
func (pkg *pkgContext) outputType(t schema.Type) string {
|
||||
|
|
|
@ -244,9 +244,7 @@ func (g *generator) collectImports(
|
|||
}
|
||||
pulumiImports.Add(g.getPulumiImport(pkg, vPath, mod))
|
||||
} else if call.Name == pcl.IntrinsicConvert {
|
||||
if schemaType, ok := pcl.GetSchemaForType(call.Type()); ok {
|
||||
g.collectTypeImports(program, schemaType, pulumiImports)
|
||||
}
|
||||
g.collectConvertImports(program, call, pulumiImports)
|
||||
}
|
||||
|
||||
// Checking to see if this function call deserves its own dedicated helper method in the preamble
|
||||
|
@ -277,6 +275,30 @@ func (g *generator) collectImports(
|
|||
return stdImports, pulumiImports, preambleHelperMethods
|
||||
}
|
||||
|
||||
func (g *generator) collectConvertImports(
|
||||
program *pcl.Program,
|
||||
call *model.FunctionCallExpression,
|
||||
pulumiImports codegen.StringSet) {
|
||||
if schemaType, ok := pcl.GetSchemaForType(call.Type()); ok {
|
||||
// Sometimes code for a `__convert` call does not
|
||||
// really use the import of the result type. In such
|
||||
// cases it is important not to generate a
|
||||
// non-compiling unused import. Detect some of these
|
||||
// cases here.
|
||||
//
|
||||
// Fully solving this is deferred for later:
|
||||
// TODO[pulumi/pulumi#8324].
|
||||
if expr, ok := call.Args[0].(*model.TemplateExpression); ok {
|
||||
if lit, ok := expr.Parts[0].(*model.LiteralValueExpression); ok &&
|
||||
model.StringType.AssignableFrom(lit.Type()) &&
|
||||
call.Type().AssignableFrom(lit.Type()) {
|
||||
return
|
||||
}
|
||||
}
|
||||
g.collectTypeImports(program, schemaType, pulumiImports)
|
||||
}
|
||||
}
|
||||
|
||||
func (g *generator) getVersionPath(program *pcl.Program, pkg string) (string, error) {
|
||||
for _, p := range program.Packages() {
|
||||
if p.Name == pkg {
|
||||
|
@ -614,11 +636,17 @@ func (g *generator) genLocalVariable(w io.Writer, v *pcl.LocalVariable) {
|
|||
case *model.FunctionCallExpression:
|
||||
switch expr.Name {
|
||||
case pcl.Invoke:
|
||||
g.Fgenf(w, "%s, err %s %.3v;\n", name, assignment, expr)
|
||||
g.isErrAssigned = true
|
||||
g.Fgenf(w, "if err != nil {\n")
|
||||
g.Fgenf(w, "return err\n")
|
||||
g.Fgenf(w, "}\n")
|
||||
// OutputVersionedInvoke does not return an error
|
||||
noError, _, _ := pcl.RecognizeOutputVersionedInvoke(expr)
|
||||
if noError {
|
||||
g.Fgenf(w, "%s %s %.3v;\n", name, assignment, expr)
|
||||
} else {
|
||||
g.Fgenf(w, "%s, err %s %.3v;\n", name, assignment, expr)
|
||||
g.isErrAssigned = true
|
||||
g.Fgenf(w, "if err != nil {\n")
|
||||
g.Fgenf(w, "return err\n")
|
||||
g.Fgenf(w, "}\n")
|
||||
}
|
||||
case "join", "toBase64", "mimeType", "fileAsset":
|
||||
g.Fgenf(w, "%s := %.3v;\n", name, expr)
|
||||
}
|
||||
|
|
|
@ -195,7 +195,18 @@ func (g *generator) GenFunctionCallExpression(w io.Writer, expr *model.FunctionC
|
|||
if module == "" {
|
||||
module = pkg
|
||||
}
|
||||
name := fmt.Sprintf("%s.%s", module, fn)
|
||||
isOut, outArgs, outArgsType := pcl.RecognizeOutputVersionedInvoke(expr)
|
||||
if isOut {
|
||||
outTypeName, err := outputVersionFunctionArgTypeName(outArgsType)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("Error when generating an output-versioned Invoke: %w", err))
|
||||
}
|
||||
g.Fgenf(w, "%s.%sOutput(ctx, ", module, fn)
|
||||
g.genObjectConsExpressionWithTypeName(w, outArgs, outArgsType, outTypeName)
|
||||
} else {
|
||||
g.Fgenf(w, "%s.%s(ctx, ", module, fn)
|
||||
g.Fgenf(w, "%.v", expr.Args[1])
|
||||
}
|
||||
|
||||
optionsBag := ""
|
||||
var buf bytes.Buffer
|
||||
|
@ -205,9 +216,6 @@ func (g *generator) GenFunctionCallExpression(w io.Writer, expr *model.FunctionC
|
|||
g.Fgenf(&buf, ", nil")
|
||||
}
|
||||
optionsBag = buf.String()
|
||||
|
||||
g.Fgenf(w, "%s(ctx, ", name)
|
||||
g.Fgenf(w, "%.v", expr.Args[1])
|
||||
g.Fgenf(w, "%v)", optionsBag)
|
||||
case "join":
|
||||
g.Fgenf(w, "strings.Join(%v, %v)", expr.Args[1], expr.Args[0])
|
||||
|
@ -246,6 +254,32 @@ func (g *generator) GenFunctionCallExpression(w io.Writer, expr *model.FunctionC
|
|||
}
|
||||
}
|
||||
|
||||
// Currently args type for output-versioned invokes are named
|
||||
// `FOutputArgs`, but this is not yet understood by `tokenToType`. Use
|
||||
// this function to compensate.
|
||||
func outputVersionFunctionArgTypeName(t model.Type) (string, error) {
|
||||
schemaType, ok := pcl.GetSchemaForType(t)
|
||||
if !ok {
|
||||
return "", fmt.Errorf("No schema.Type type found for the given model.Type")
|
||||
}
|
||||
|
||||
objType, ok := schemaType.(*schema.ObjectType)
|
||||
if !ok {
|
||||
return "", fmt.Errorf("Expected a schema.ObjectType, got %s", schemaType.String())
|
||||
}
|
||||
|
||||
pkg := &pkgContext{pkg: &schema.Package{Name: "main"}}
|
||||
|
||||
var ty string
|
||||
if pkg.isExternalReference(objType) {
|
||||
ty = pkg.contextForExternalReferenceType(objType).tokenToType(objType.Token)
|
||||
} else {
|
||||
ty = pkg.tokenToType(objType.Token)
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%sOutputArgs", strings.TrimSuffix(ty, "Args")), nil
|
||||
}
|
||||
|
||||
func (g *generator) GenIndexExpression(w io.Writer, expr *model.IndexExpression) {
|
||||
g.Fgenf(w, "%.20v[%.v]", expr.Collection, expr.Key)
|
||||
}
|
||||
|
@ -316,15 +350,10 @@ func (g *generator) genObjectConsExpression(
|
|||
w io.Writer,
|
||||
expr *model.ObjectConsExpression,
|
||||
destType model.Type,
|
||||
isInput bool,
|
||||
) {
|
||||
if len(expr.Items) == 0 {
|
||||
g.Fgenf(w, "nil")
|
||||
return
|
||||
}
|
||||
isInput bool) {
|
||||
|
||||
var temps []interface{}
|
||||
isInput = isInput || isInputty(destType)
|
||||
|
||||
typeName := g.argumentTypeName(expr, destType, isInput)
|
||||
if schemaType, ok := pcl.GetSchemaForType(destType); ok {
|
||||
if obj, ok := codegen.UnwrapType(schemaType).(*schema.ObjectType); ok {
|
||||
|
@ -334,6 +363,21 @@ func (g *generator) genObjectConsExpression(
|
|||
}
|
||||
}
|
||||
|
||||
g.genObjectConsExpressionWithTypeName(w, expr, destType, typeName)
|
||||
}
|
||||
|
||||
func (g *generator) genObjectConsExpressionWithTypeName(
|
||||
w io.Writer,
|
||||
expr *model.ObjectConsExpression,
|
||||
destType model.Type,
|
||||
typeName string) {
|
||||
|
||||
if len(expr.Items) == 0 {
|
||||
g.Fgenf(w, "nil")
|
||||
return
|
||||
}
|
||||
|
||||
var temps []interface{}
|
||||
// TODO: @pgavlin --- ineffectual assignment, was there some work in flight here?
|
||||
// if strings.HasSuffix(typeName, "Args") {
|
||||
// isInput = true
|
||||
|
@ -360,7 +404,7 @@ func (g *generator) genObjectConsExpression(
|
|||
}
|
||||
g.genTemps(w, temps)
|
||||
|
||||
if isMap || !strings.HasSuffix(typeName, "Args") {
|
||||
if isMap || !strings.HasSuffix(typeName, "Args") || strings.HasSuffix(typeName, "OutputArgs") {
|
||||
g.Fgenf(w, "%s", typeName)
|
||||
} else {
|
||||
g.Fgenf(w, "&%s", typeName)
|
||||
|
@ -814,9 +858,15 @@ func (g *generator) genApply(w io.Writer, expr *model.FunctionCallExpression) {
|
|||
isInput := false
|
||||
retType := g.argumentTypeName(nil, then.Signature.ReturnType, isInput)
|
||||
// TODO account for outputs in other namespaces like aws
|
||||
typeAssertion := fmt.Sprintf(".(%sOutput)", retType)
|
||||
if !strings.HasPrefix(retType, "pulumi.") {
|
||||
typeAssertion = fmt.Sprintf(".(pulumi.%sOutput)", Title(retType))
|
||||
// TODO[pulumi/pulumi#8453] incomplete pattern code below.
|
||||
var typeAssertion string
|
||||
if retType == "[]string" {
|
||||
typeAssertion = ".(pulumi.StringArrayOutput)"
|
||||
} else {
|
||||
typeAssertion = fmt.Sprintf(".(%sOutput)", retType)
|
||||
if !strings.HasPrefix(retType, "pulumi.") {
|
||||
typeAssertion = fmt.Sprintf(".(pulumi.%sOutput)", Title(retType))
|
||||
}
|
||||
}
|
||||
|
||||
if len(applyArgs) == 1 {
|
||||
|
|
|
@ -44,7 +44,9 @@ func (os *optionalSpiller) spillExpressionHelper(
|
|||
case *model.FunctionCallExpression:
|
||||
if x.Name == "invoke" {
|
||||
// recurse into invoke args
|
||||
isInvoke = true
|
||||
isOutputInvoke, _, _ := pcl.RecognizeOutputVersionedInvoke(x)
|
||||
// ignore output-versioned invokes as they do not need converting
|
||||
isInvoke = !isOutputInvoke
|
||||
_, diags := os.spillExpressionHelper(x.Args[1], x.Args[1].Type(), isInvoke)
|
||||
return x, diags
|
||||
}
|
||||
|
|
|
@ -1034,7 +1034,13 @@ func (x *FunctionCallExpression) Typecheck(typecheckOperands bool) hcl.Diagnosti
|
|||
typecheckDiags := typecheckArgs(rng, x.Signature, x.Args...)
|
||||
diagnostics = append(diagnostics, typecheckDiags...)
|
||||
|
||||
x.Signature.ReturnType = liftOperationType(x.Signature.ReturnType, x.Args...)
|
||||
// Unless the function is already automatically using an
|
||||
// Output-returning version, modify the signature to account
|
||||
// for automatic lifting to Promise or Output.
|
||||
_, isOutput := x.Signature.ReturnType.(*OutputType)
|
||||
if !isOutput {
|
||||
x.Signature.ReturnType = liftOperationType(x.Signature.ReturnType, x.Args...)
|
||||
}
|
||||
return diagnostics
|
||||
}
|
||||
|
||||
|
|
|
@ -363,7 +363,7 @@ func RunCommandWithOptions(
|
|||
type SchemaVersion = string
|
||||
|
||||
const (
|
||||
AwsSchema SchemaVersion = "4.21.1"
|
||||
AwsSchema SchemaVersion = "4.26.0"
|
||||
AzureNativeSchema SchemaVersion = "1.29.0"
|
||||
AzureSchema SchemaVersion = "4.18.0"
|
||||
KubernetesSchema SchemaVersion = "3.7.2"
|
||||
|
|
|
@ -49,6 +49,8 @@ var programTests = []programTest{
|
|||
{
|
||||
Name: "aws-fargate",
|
||||
Description: "AWS Fargate",
|
||||
|
||||
// TODO[pulumi/pulumi#8440]
|
||||
SkipCompile: codegen.NewStringSet("go"),
|
||||
},
|
||||
{
|
||||
|
@ -123,6 +125,10 @@ var programTests = []programTest{
|
|||
// TODO[pulumi/pulumi#8078]
|
||||
// TODO[pulumi/pulumi#8079]
|
||||
},
|
||||
{
|
||||
Name: "output-funcs-aws",
|
||||
Description: "Output Versioned Functions",
|
||||
},
|
||||
}
|
||||
|
||||
// Checks that a generated program is correct
|
||||
|
|
|
@ -191,6 +191,12 @@ var sdkTests = []sdkTest{
|
|||
Skip: codegen.NewStringSet("python/test", "nodejs/test"),
|
||||
SkipCompileCheck: codegen.NewStringSet(nodejs),
|
||||
},
|
||||
{
|
||||
Directory: "env-helper",
|
||||
Description: "Ensure that eviromental helpers are generated (repro #8132)",
|
||||
Skip: codegen.NewStringSet("python/test", "nodejs/test"),
|
||||
SkipCompileCheck: codegen.NewStringSet(dotnet),
|
||||
},
|
||||
}
|
||||
|
||||
var genSDKOnly bool
|
||||
|
|
|
@ -3,7 +3,6 @@ package main
|
|||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws"
|
||||
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
|
||||
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ecs"
|
||||
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/elasticloadbalancingv2"
|
||||
|
|
6286
pkg/codegen/internal/test/testdata/aws.json
vendored
6286
pkg/codegen/internal/test/testdata/aws.json
vendored
File diff suppressed because one or more lines are too long
|
@ -28,14 +28,14 @@ export class Provider extends pulumi.ProviderResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
{
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, inputs, opts);
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,14 +28,14 @@ export class Provider extends pulumi.ProviderResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
{
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, inputs, opts);
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,17 +42,17 @@ export class ModuleResource extends pulumi.CustomResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ModuleResourceArgs, opts?: pulumi.CustomResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (!opts.id) {
|
||||
inputs["thing"] = args ? args.thing : undefined;
|
||||
resourceInputs["thing"] = args ? args.thing : undefined;
|
||||
} else {
|
||||
inputs["thing"] = undefined /*out*/;
|
||||
resourceInputs["thing"] = undefined /*out*/;
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(ModuleResource.__pulumiType, name, inputs, opts);
|
||||
super(ModuleResource.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,14 +28,14 @@ export class Provider extends pulumi.ProviderResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
{
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, inputs, opts);
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,20 +41,20 @@ export class Nursery extends pulumi.CustomResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args: NurseryArgs, opts?: pulumi.CustomResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (!opts.id) {
|
||||
if ((!args || args.varieties === undefined) && !opts.urn) {
|
||||
throw new Error("Missing required property 'varieties'");
|
||||
}
|
||||
inputs["sizes"] = args ? args.sizes : undefined;
|
||||
inputs["varieties"] = args ? args.varieties : undefined;
|
||||
resourceInputs["sizes"] = args ? args.sizes : undefined;
|
||||
resourceInputs["varieties"] = args ? args.varieties : undefined;
|
||||
} else {
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Nursery.__pulumiType, name, inputs, opts);
|
||||
super(Nursery.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,11 +48,11 @@ export class RubberTree extends pulumi.CustomResource {
|
|||
*/
|
||||
constructor(name: string, args: RubberTreeArgs, opts?: pulumi.CustomResourceOptions)
|
||||
constructor(name: string, argsOrState?: RubberTreeArgs | RubberTreeState, opts?: pulumi.CustomResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (opts.id) {
|
||||
const state = argsOrState as RubberTreeState | undefined;
|
||||
inputs["farm"] = state ? state.farm : undefined;
|
||||
resourceInputs["farm"] = state ? state.farm : undefined;
|
||||
} else {
|
||||
const args = argsOrState as RubberTreeArgs | undefined;
|
||||
if ((!args || args.diameter === undefined) && !opts.urn) {
|
||||
|
@ -61,16 +61,16 @@ export class RubberTree extends pulumi.CustomResource {
|
|||
if ((!args || args.type === undefined) && !opts.urn) {
|
||||
throw new Error("Missing required property 'type'");
|
||||
}
|
||||
inputs["container"] = args ? args.container : undefined;
|
||||
inputs["diameter"] = (args ? args.diameter : undefined) ?? 6;
|
||||
inputs["farm"] = (args ? args.farm : undefined) ?? "(unknown)";
|
||||
inputs["size"] = (args ? args.size : undefined) ?? "medium";
|
||||
inputs["type"] = (args ? args.type : undefined) ?? "Burgundy";
|
||||
resourceInputs["container"] = args ? (args.container ? pulumi.output(args.container).apply(inputs.containerArgsProvideDefaults) : undefined) : undefined;
|
||||
resourceInputs["diameter"] = (args ? args.diameter : undefined) ?? 6;
|
||||
resourceInputs["farm"] = (args ? args.farm : undefined) ?? "(unknown)";
|
||||
resourceInputs["size"] = (args ? args.size : undefined) ?? "medium";
|
||||
resourceInputs["type"] = (args ? args.type : undefined) ?? "Burgundy";
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(RubberTree.__pulumiType, name, inputs, opts);
|
||||
super(RubberTree.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,9 +4,20 @@
|
|||
import * as pulumi from "@pulumi/pulumi";
|
||||
import { input as inputs, output as outputs, enums } from "../types";
|
||||
|
||||
import * as utilities from "../utilities";
|
||||
|
||||
export interface ContainerArgs {
|
||||
brightness?: pulumi.Input<enums.ContainerBrightness>;
|
||||
color?: pulumi.Input<enums.ContainerColor | string>;
|
||||
material?: pulumi.Input<string>;
|
||||
size: pulumi.Input<enums.ContainerSize>;
|
||||
}
|
||||
/**
|
||||
* containerArgsProvideDefaults sets the appropriate defaults for ContainerArgs
|
||||
*/
|
||||
export function containerArgsProvideDefaults(val: ContainerArgs): ContainerArgs {
|
||||
return {
|
||||
...val,
|
||||
brightness: (val.brightness) ?? 1,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4,10 +4,21 @@
|
|||
import * as pulumi from "@pulumi/pulumi";
|
||||
import { input as inputs, output as outputs, enums } from "../types";
|
||||
|
||||
import * as utilities from "../utilities";
|
||||
|
||||
export interface Container {
|
||||
brightness?: enums.ContainerBrightness;
|
||||
color?: enums.ContainerColor | string;
|
||||
material?: string;
|
||||
size: enums.ContainerSize;
|
||||
}
|
||||
/**
|
||||
* containerProvideDefaults sets the appropriate defaults for Container
|
||||
*/
|
||||
export function containerProvideDefaults(val: Container): Container {
|
||||
return {
|
||||
...val,
|
||||
brightness: (val.brightness) ?? 1,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
41
pkg/codegen/internal/test/testdata/env-helper/docs/_index.md
vendored
Normal file
41
pkg/codegen/internal/test/testdata/env-helper/docs/_index.md
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
title: "example"
|
||||
title_tag: "example Package"
|
||||
meta_desc: ""
|
||||
layout: api
|
||||
no_edit_this_page: true
|
||||
---
|
||||
|
||||
<!-- WARNING: this file was generated by test. -->
|
||||
<!-- Do not edit by hand unless you're certain you know what you are doing! -->
|
||||
|
||||
|
||||
|
||||
<h2 id="modules">Modules</h2>
|
||||
<ul class="api">
|
||||
<li><a href="mod1/" title="mod1"><span class="api-symbol api-symbol--module"></span>mod1</a></li>
|
||||
<li><a href="mod2/" title="mod2"><span class="api-symbol api-symbol--module"></span>mod2</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="resources">Resources</h2>
|
||||
<ul class="api">
|
||||
<li><a href="foo" title="Foo"><span class="api-symbol api-symbol--resource"></span>Foo</a></li>
|
||||
<li><a href="moduletest" title="ModuleTest"><span class="api-symbol api-symbol--resource"></span>ModuleTest</a></li>
|
||||
<li><a href="provider" title="Provider"><span class="api-symbol api-symbol--resource"></span>Provider</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="functions">Functions</h2>
|
||||
<ul class="api">
|
||||
<li><a href="funcwithalloptionalinputs" title="FuncWithAllOptionalInputs"><span class="api-symbol api-symbol--function"></span>FuncWithAllOptionalInputs</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="package-details">Package Details</h2>
|
||||
<dl class="package-details">
|
||||
<dt>Repository</dt>
|
||||
<dd><a href=""></a></dd>
|
||||
<dt>License</dt>
|
||||
<dd></dd>
|
||||
<dt>Version</dt>
|
||||
<dd>0.0.1</dd>
|
||||
</dl>
|
||||
|
11
pkg/codegen/internal/test/testdata/env-helper/docs/codegen-manifest.json
vendored
Normal file
11
pkg/codegen/internal/test/testdata/env-helper/docs/codegen-manifest.json
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"emittedFiles": [
|
||||
"_index.md",
|
||||
"foo/_index.md",
|
||||
"funcwithalloptionalinputs/_index.md",
|
||||
"mod1/_index.md",
|
||||
"mod2/_index.md",
|
||||
"moduletest/_index.md",
|
||||
"provider/_index.md"
|
||||
]
|
||||
}
|
849
pkg/codegen/internal/test/testdata/env-helper/docs/foo/_index.md
vendored
Normal file
849
pkg/codegen/internal/test/testdata/env-helper/docs/foo/_index.md
vendored
Normal file
|
@ -0,0 +1,849 @@
|
|||
|
||||
---
|
||||
title: "Foo"
|
||||
title_tag: "example.Foo"
|
||||
meta_desc: "Documentation for the example.Foo resource with examples, input properties, output properties, lookup functions, and supporting types."
|
||||
layout: api
|
||||
no_edit_this_page: true
|
||||
---
|
||||
|
||||
|
||||
|
||||
<!-- WARNING: this file was generated by test. -->
|
||||
<!-- Do not edit by hand unless you're certain you know what you are doing! -->
|
||||
|
||||
test new feature with resoruces
|
||||
|
||||
|
||||
|
||||
|
||||
## Create a Foo Resource {#create}
|
||||
{{< chooser language "typescript,python,go,csharp" / >}}
|
||||
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-typescript" data-lang="typescript"><span class="k">new </span><span class="nx">Foo</span><span class="p">(</span><span class="nx">name</span><span class="p">:</span> <span class="nx">string</span><span class="p">,</span> <span class="nx">args</span><span class="p">:</span> <span class="nx"><a href="#inputs">FooArgs</a></span><span class="p">,</span> <span class="nx">opts</span><span class="p">?:</span> <span class="nx"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#CustomResourceOptions">CustomResourceOptions</a></span><span class="p">);</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-python" data-lang="python"><span class=nd>@overload</span>
|
||||
<span class="k">def </span><span class="nx">Foo</span><span class="p">(</span><span class="nx">resource_name</span><span class="p">:</span> <span class="nx">str</span><span class="p">,</span>
|
||||
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">Optional[ResourceOptions]</a></span> = None<span class="p">,</span>
|
||||
<span class="nx">argument</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
|
||||
<span class="nx">backup_kube_client_settings</span><span class="p">:</span> <span class="nx">Optional[KubeClientSettingsArgs]</span> = None<span class="p">,</span>
|
||||
<span class="nx">kube_client_settings</span><span class="p">:</span> <span class="nx">Optional[KubeClientSettingsArgs]</span> = None<span class="p">,</span>
|
||||
<span class="nx">settings</span><span class="p">:</span> <span class="nx">Optional[LayeredTypeArgs]</span> = None<span class="p">)</span>
|
||||
<span class=nd>@overload</span>
|
||||
<span class="k">def </span><span class="nx">Foo</span><span class="p">(</span><span class="nx">resource_name</span><span class="p">:</span> <span class="nx">str</span><span class="p">,</span>
|
||||
<span class="nx">args</span><span class="p">:</span> <span class="nx"><a href="#inputs">FooArgs</a></span><span class="p">,</span>
|
||||
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">Optional[ResourceOptions]</a></span> = None<span class="p">)</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-go" data-lang="go"><span class="k">func </span><span class="nx">NewFoo</span><span class="p">(</span><span class="nx">ctx</span><span class="p"> *</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span><span class="p">,</span> <span class="nx">name</span><span class="p"> </span><span class="nx">string</span><span class="p">,</span> <span class="nx">args</span><span class="p"> </span><span class="nx"><a href="#inputs">FooArgs</a></span><span class="p">,</span> <span class="nx">opts</span><span class="p"> ...</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#ResourceOption">ResourceOption</a></span><span class="p">) (*<span class="nx">Foo</span>, error)</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-csharp" data-lang="csharp"><span class="k">public </span><span class="nx">Foo</span><span class="p">(</span><span class="nx">string</span><span class="p"> </span><span class="nx">name<span class="p">,</span> <span class="nx"><a href="#inputs">FooArgs</a></span><span class="p"> </span><span class="nx">args<span class="p">,</span> <span class="nx"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.CustomResourceOptions.html">CustomResourceOptions</a></span><span class="p">? </span><span class="nx">opts = null<span class="p">)</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-required" title="Required">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">FooArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#CustomResourceOptions">CustomResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>resource_name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-required" title="Required">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">FooArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">ResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>ctx</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span>
|
||||
</dt>
|
||||
<dd>Context object for the current deployment.</dd><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-required" title="Required">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">FooArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#ResourceOption">ResourceOption</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-required" title="Required">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">FooArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.CustomResourceOptions.html">CustomResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
## Foo Resource Properties {#properties}
|
||||
|
||||
To learn more about resource properties and how to use them, see [Inputs and Outputs]({{< relref "/docs/intro/concepts/inputs-outputs" >}}) in the Architecture and Concepts docs.
|
||||
|
||||
### Inputs
|
||||
|
||||
The Foo resource accepts the following [input]({{< relref "/docs/intro/concepts/inputs-outputs" >}}) properties:
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="backupkubeclientsettings_csharp">
|
||||
<a href="#backupkubeclientsettings_csharp" style="color: inherit; text-decoration: inherit;">Backup<wbr>Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="argument_csharp">
|
||||
<a href="#argument_csharp" style="color: inherit; text-decoration: inherit;">Argument</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="kubeclientsettings_csharp">
|
||||
<a href="#kubeclientsettings_csharp" style="color: inherit; text-decoration: inherit;">Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="settings_csharp">
|
||||
<a href="#settings_csharp" style="color: inherit; text-decoration: inherit;">Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}describing things{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="backupkubeclientsettings_go">
|
||||
<a href="#backupkubeclientsettings_go" style="color: inherit; text-decoration: inherit;">Backup<wbr>Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="argument_go">
|
||||
<a href="#argument_go" style="color: inherit; text-decoration: inherit;">Argument</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="kubeclientsettings_go">
|
||||
<a href="#kubeclientsettings_go" style="color: inherit; text-decoration: inherit;">Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="settings_go">
|
||||
<a href="#settings_go" style="color: inherit; text-decoration: inherit;">Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}describing things{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="backupkubeclientsettings_nodejs">
|
||||
<a href="#backupkubeclientsettings_nodejs" style="color: inherit; text-decoration: inherit;">backup<wbr>Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="argument_nodejs">
|
||||
<a href="#argument_nodejs" style="color: inherit; text-decoration: inherit;">argument</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="kubeclientsettings_nodejs">
|
||||
<a href="#kubeclientsettings_nodejs" style="color: inherit; text-decoration: inherit;">kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="settings_nodejs">
|
||||
<a href="#settings_nodejs" style="color: inherit; text-decoration: inherit;">settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}describing things{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="backup_kube_client_settings_python">
|
||||
<a href="#backup_kube_client_settings_python" style="color: inherit; text-decoration: inherit;">backup_<wbr>kube_<wbr>client_<wbr>settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="argument_python">
|
||||
<a href="#argument_python" style="color: inherit; text-decoration: inherit;">argument</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="kube_client_settings_python">
|
||||
<a href="#kube_client_settings_python" style="color: inherit; text-decoration: inherit;">kube_<wbr>client_<wbr>settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="settings_python">
|
||||
<a href="#settings_python" style="color: inherit; text-decoration: inherit;">settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}describing things{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
### Outputs
|
||||
|
||||
All [input](#inputs) properties are implicitly available as output properties. Additionally, the Foo resource produces the following output properties:
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_csharp">
|
||||
<a href="#id_csharp" style="color: inherit; text-decoration: inherit;">Id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd><dt class="property-"
|
||||
title="">
|
||||
<span id="defaultkubeclientsettings_csharp">
|
||||
<a href="#defaultkubeclientsettings_csharp" style="color: inherit; text-decoration: inherit;">Default<wbr>Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}A test for plain types{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_go">
|
||||
<a href="#id_go" style="color: inherit; text-decoration: inherit;">Id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd><dt class="property-"
|
||||
title="">
|
||||
<span id="defaultkubeclientsettings_go">
|
||||
<a href="#defaultkubeclientsettings_go" style="color: inherit; text-decoration: inherit;">Default<wbr>Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}A test for plain types{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_nodejs">
|
||||
<a href="#id_nodejs" style="color: inherit; text-decoration: inherit;">id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd><dt class="property-"
|
||||
title="">
|
||||
<span id="defaultkubeclientsettings_nodejs">
|
||||
<a href="#defaultkubeclientsettings_nodejs" style="color: inherit; text-decoration: inherit;">default<wbr>Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}A test for plain types{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_python">
|
||||
<a href="#id_python" style="color: inherit; text-decoration: inherit;">id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd><dt class="property-"
|
||||
title="">
|
||||
<span id="default_kube_client_settings_python">
|
||||
<a href="#default_kube_client_settings_python" style="color: inherit; text-decoration: inherit;">default_<wbr>kube_<wbr>client_<wbr>settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}A test for plain types{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Supporting Types
|
||||
|
||||
|
||||
|
||||
<h4 id="helmreleasesettings">Helm<wbr>Release<wbr>Settings</h4>
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_csharp">
|
||||
<a href="#requiredarg_csharp" style="color: inherit; text-decoration: inherit;">Required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_csharp">
|
||||
<a href="#driver_csharp" style="color: inherit; text-decoration: inherit;">Driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_csharp">
|
||||
<a href="#pluginspath_csharp" style="color: inherit; text-decoration: inherit;">Plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_go">
|
||||
<a href="#requiredarg_go" style="color: inherit; text-decoration: inherit;">Required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_go">
|
||||
<a href="#driver_go" style="color: inherit; text-decoration: inherit;">Driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_go">
|
||||
<a href="#pluginspath_go" style="color: inherit; text-decoration: inherit;">Plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_nodejs">
|
||||
<a href="#requiredarg_nodejs" style="color: inherit; text-decoration: inherit;">required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_nodejs">
|
||||
<a href="#driver_nodejs" style="color: inherit; text-decoration: inherit;">driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_nodejs">
|
||||
<a href="#pluginspath_nodejs" style="color: inherit; text-decoration: inherit;">plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="required_arg_python">
|
||||
<a href="#required_arg_python" style="color: inherit; text-decoration: inherit;">required_<wbr>arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_python">
|
||||
<a href="#driver_python" style="color: inherit; text-decoration: inherit;">driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="plugins_path_python">
|
||||
<a href="#plugins_path_python" style="color: inherit; text-decoration: inherit;">plugins_<wbr>path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
<h4 id="kubeclientsettings">Kube<wbr>Client<wbr>Settings</h4>
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="burst_csharp">
|
||||
<a href="#burst_csharp" style="color: inherit; text-decoration: inherit;">Burst</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">int</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum burst for throttle. Default value is 10.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="qps_csharp">
|
||||
<a href="#qps_csharp" style="color: inherit; text-decoration: inherit;">Qps</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">double</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum queries per second (QPS) to the API server from this client. Default value is 5.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="rectest_csharp">
|
||||
<a href="#rectest_csharp" style="color: inherit; text-decoration: inherit;">Rec<wbr>Test</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="burst_go">
|
||||
<a href="#burst_go" style="color: inherit; text-decoration: inherit;">Burst</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">int</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum burst for throttle. Default value is 10.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="qps_go">
|
||||
<a href="#qps_go" style="color: inherit; text-decoration: inherit;">Qps</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">float64</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum queries per second (QPS) to the API server from this client. Default value is 5.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="rectest_go">
|
||||
<a href="#rectest_go" style="color: inherit; text-decoration: inherit;">Rec<wbr>Test</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="burst_nodejs">
|
||||
<a href="#burst_nodejs" style="color: inherit; text-decoration: inherit;">burst</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">number</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum burst for throttle. Default value is 10.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="qps_nodejs">
|
||||
<a href="#qps_nodejs" style="color: inherit; text-decoration: inherit;">qps</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">number</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum queries per second (QPS) to the API server from this client. Default value is 5.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="rectest_nodejs">
|
||||
<a href="#rectest_nodejs" style="color: inherit; text-decoration: inherit;">rec<wbr>Test</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="burst_python">
|
||||
<a href="#burst_python" style="color: inherit; text-decoration: inherit;">burst</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">int</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum burst for throttle. Default value is 10.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="qps_python">
|
||||
<a href="#qps_python" style="color: inherit; text-decoration: inherit;">qps</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">float</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum queries per second (QPS) to the API server from this client. Default value is 5.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="rec_test_python">
|
||||
<a href="#rec_test_python" style="color: inherit; text-decoration: inherit;">rec_<wbr>test</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
<h4 id="layeredtype">Layered<wbr>Type</h4>
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="other_csharp">
|
||||
<a href="#other_csharp" style="color: inherit; text-decoration: inherit;">Other</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="thinker_csharp">
|
||||
<a href="#thinker_csharp" style="color: inherit; text-decoration: inherit;">Thinker</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}To ask and answer{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="answer_csharp">
|
||||
<a href="#answer_csharp" style="color: inherit; text-decoration: inherit;">Answer</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">double</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The answer to the question{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="plainother_csharp">
|
||||
<a href="#plainother_csharp" style="color: inherit; text-decoration: inherit;">Plain<wbr>Other</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Test how plain types interact{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="question_csharp">
|
||||
<a href="#question_csharp" style="color: inherit; text-decoration: inherit;">Question</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The question already answered{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="recursive_csharp">
|
||||
<a href="#recursive_csharp" style="color: inherit; text-decoration: inherit;">Recursive</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="other_go">
|
||||
<a href="#other_go" style="color: inherit; text-decoration: inherit;">Other</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="thinker_go">
|
||||
<a href="#thinker_go" style="color: inherit; text-decoration: inherit;">Thinker</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}To ask and answer{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="answer_go">
|
||||
<a href="#answer_go" style="color: inherit; text-decoration: inherit;">Answer</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">float64</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The answer to the question{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="plainother_go">
|
||||
<a href="#plainother_go" style="color: inherit; text-decoration: inherit;">Plain<wbr>Other</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Test how plain types interact{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="question_go">
|
||||
<a href="#question_go" style="color: inherit; text-decoration: inherit;">Question</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The question already answered{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="recursive_go">
|
||||
<a href="#recursive_go" style="color: inherit; text-decoration: inherit;">Recursive</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="other_nodejs">
|
||||
<a href="#other_nodejs" style="color: inherit; text-decoration: inherit;">other</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="thinker_nodejs">
|
||||
<a href="#thinker_nodejs" style="color: inherit; text-decoration: inherit;">thinker</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}To ask and answer{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="answer_nodejs">
|
||||
<a href="#answer_nodejs" style="color: inherit; text-decoration: inherit;">answer</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">number</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The answer to the question{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="plainother_nodejs">
|
||||
<a href="#plainother_nodejs" style="color: inherit; text-decoration: inherit;">plain<wbr>Other</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Test how plain types interact{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="question_nodejs">
|
||||
<a href="#question_nodejs" style="color: inherit; text-decoration: inherit;">question</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The question already answered{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="recursive_nodejs">
|
||||
<a href="#recursive_nodejs" style="color: inherit; text-decoration: inherit;">recursive</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="other_python">
|
||||
<a href="#other_python" style="color: inherit; text-decoration: inherit;">other</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="thinker_python">
|
||||
<a href="#thinker_python" style="color: inherit; text-decoration: inherit;">thinker</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}To ask and answer{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="answer_python">
|
||||
<a href="#answer_python" style="color: inherit; text-decoration: inherit;">answer</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">float</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The answer to the question{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="plain_other_python">
|
||||
<a href="#plain_other_python" style="color: inherit; text-decoration: inherit;">plain_<wbr>other</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Test how plain types interact{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="question_python">
|
||||
<a href="#question_python" style="color: inherit; text-decoration: inherit;">question</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The question already answered{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="recursive_python">
|
||||
<a href="#recursive_python" style="color: inherit; text-decoration: inherit;">recursive</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
<h2 id="package-details">Package Details</h2>
|
||||
<dl class="package-details">
|
||||
<dt>Repository</dt>
|
||||
<dd><a href=""></a></dd>
|
||||
<dt>License</dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
348
pkg/codegen/internal/test/testdata/env-helper/docs/funcwithalloptionalinputs/_index.md
vendored
Normal file
348
pkg/codegen/internal/test/testdata/env-helper/docs/funcwithalloptionalinputs/_index.md
vendored
Normal file
|
@ -0,0 +1,348 @@
|
|||
|
||||
---
|
||||
title: "funcWithAllOptionalInputs"
|
||||
title_tag: "example.funcWithAllOptionalInputs"
|
||||
meta_desc: "Documentation for the example.funcWithAllOptionalInputs function with examples, input properties, output properties, and supporting types."
|
||||
layout: api
|
||||
no_edit_this_page: true
|
||||
---
|
||||
|
||||
|
||||
|
||||
<!-- WARNING: this file was generated by test. -->
|
||||
<!-- Do not edit by hand unless you're certain you know what you are doing! -->
|
||||
|
||||
Check codegen of functions with all optional inputs.
|
||||
|
||||
|
||||
|
||||
|
||||
## Using funcWithAllOptionalInputs {#using}
|
||||
|
||||
Two invocation forms are available. The direct form accepts plain
|
||||
arguments and either blocks until the result value is available, or
|
||||
returns a Promise-wrapped result. The output form accepts
|
||||
Input-wrapped arguments and returns an Output-wrapped result.
|
||||
|
||||
{{< chooser language "typescript,python,go,csharp" / >}}
|
||||
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<div class="highlight"
|
||||
><pre class="chroma"><code class="language-typescript" data-lang="typescript"
|
||||
><span class="k">function </span>funcWithAllOptionalInputs<span class="p">(</span><span class="nx">args</span><span class="p">:</span> <span class="nx">FuncWithAllOptionalInputsArgs</span><span class="p">,</span> <span class="nx">opts</span><span class="p">?:</span> <span class="nx"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#InvokeOptions">InvokeOptions</a></span><span class="p">): Promise<<span class="nx"><a href="#result">FuncWithAllOptionalInputsResult</a></span>></span
|
||||
><span class="k">
|
||||
function </span>funcWithAllOptionalInputsOutput<span class="p">(</span><span class="nx">args</span><span class="p">:</span> <span class="nx">FuncWithAllOptionalInputsOutputArgs</span><span class="p">,</span> <span class="nx">opts</span><span class="p">?:</span> <span class="nx"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#InvokeOptions">InvokeOptions</a></span><span class="p">): Output<<span class="nx"><a href="#result">FuncWithAllOptionalInputsResult</a></span>></span
|
||||
></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
{{% choosable language python %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-python" data-lang="python"
|
||||
><span class="k">def </span>func_with_all_optional_inputs<span class="p">(</span><span class="nx">a</span><span class="p">:</span> <span class="nx">Optional[HelmReleaseSettings]</span> = None<span class="p">,</span>
|
||||
<span class="nx">b</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
|
||||
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.InvokeOptions">Optional[InvokeOptions]</a></span> = None<span class="p">) -></span> <span>FuncWithAllOptionalInputsResult</span
|
||||
><span class="k">
|
||||
def </span>func_with_all_optional_inputs_output<span class="p">(</span><span class="nx">a</span><span class="p">:</span> <span class="nx">Optional[pulumi.Input[HelmReleaseSettingsArgs]]</span> = None<span class="p">,</span>
|
||||
<span class="nx">b</span><span class="p">:</span> <span class="nx">Optional[pulumi.Input[str]]</span> = None<span class="p">,</span>
|
||||
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.InvokeOptions">Optional[InvokeOptions]</a></span> = None<span class="p">) -></span> <span>Output[FuncWithAllOptionalInputsResult]</span
|
||||
></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
{{% choosable language go %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-go" data-lang="go"
|
||||
><span class="k">func </span>FuncWithAllOptionalInputs<span class="p">(</span><span class="nx">ctx</span><span class="p"> *</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span><span class="p">,</span> <span class="nx">args</span><span class="p"> *</span><span class="nx">FuncWithAllOptionalInputsArgs</span><span class="p">,</span> <span class="nx">opts</span><span class="p"> ...</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#InvokeOption">InvokeOption</a></span><span class="p">) (*<span class="nx"><a href="#result">FuncWithAllOptionalInputsResult</a></span>, error)</span
|
||||
><span class="k">
|
||||
func </span>FuncWithAllOptionalInputsOutput<span class="p">(</span><span class="nx">ctx</span><span class="p"> *</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span><span class="p">,</span> <span class="nx">args</span><span class="p"> *</span><span class="nx">FuncWithAllOptionalInputsOutputArgs</span><span class="p">,</span> <span class="nx">opts</span><span class="p"> ...</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#InvokeOption">InvokeOption</a></span><span class="p">) FuncWithAllOptionalInputsResultOutput</span
|
||||
></code></pre></div>
|
||||
|
||||
> Note: This function is named `FuncWithAllOptionalInputs` in the Go SDK.
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-csharp" data-lang="csharp"><span class="k">public static class </span><span class="nx">FuncWithAllOptionalInputs </span><span class="p">
|
||||
{</span><span class="k">
|
||||
public static </span>Task<<span class="nx"><a href="#result">FuncWithAllOptionalInputsResult</a></span>> <span class="p">InvokeAsync(</span><span class="nx">FuncWithAllOptionalInputsArgs</span><span class="p"> </span><span class="nx">args<span class="p">,</span> <span class="nx"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.InvokeOptions.html">InvokeOptions</a></span><span class="p">? </span><span class="nx">opts = null<span class="p">)</span><span class="k">
|
||||
public static </span>Output<<span class="nx"><a href="#result">FuncWithAllOptionalInputsResult</a></span>> <span class="p">Invoke(</span><span class="nx">FuncWithAllOptionalInputsInvokeArgs</span><span class="p"> </span><span class="nx">args<span class="p">,</span> <span class="nx"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.InvokeOptions.html">InvokeOptions</a></span><span class="p">? </span><span class="nx">opts = null<span class="p">)</span><span class="p">
|
||||
}</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
|
||||
The following arguments are supported:
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="a_csharp">
|
||||
<a href="#a_csharp" style="color: inherit; text-decoration: inherit;">A</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property A{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="b_csharp">
|
||||
<a href="#b_csharp" style="color: inherit; text-decoration: inherit;">B</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property B{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="a_go">
|
||||
<a href="#a_go" style="color: inherit; text-decoration: inherit;">A</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property A{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="b_go">
|
||||
<a href="#b_go" style="color: inherit; text-decoration: inherit;">B</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property B{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="a_nodejs">
|
||||
<a href="#a_nodejs" style="color: inherit; text-decoration: inherit;">a</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property A{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="b_nodejs">
|
||||
<a href="#b_nodejs" style="color: inherit; text-decoration: inherit;">b</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property B{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="a_python">
|
||||
<a href="#a_python" style="color: inherit; text-decoration: inherit;">a</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property A{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="b_python">
|
||||
<a href="#b_python" style="color: inherit; text-decoration: inherit;">b</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property B{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
|
||||
|
||||
## funcWithAllOptionalInputs Result {#result}
|
||||
|
||||
The following output properties are available:
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="r_csharp">
|
||||
<a href="#r_csharp" style="color: inherit; text-decoration: inherit;">R</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="r_go">
|
||||
<a href="#r_go" style="color: inherit; text-decoration: inherit;">R</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="r_nodejs">
|
||||
<a href="#r_nodejs" style="color: inherit; text-decoration: inherit;">r</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="r_python">
|
||||
<a href="#r_python" style="color: inherit; text-decoration: inherit;">r</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
|
||||
|
||||
## Supporting Types
|
||||
|
||||
|
||||
<h4 id="helmreleasesettings">Helm<wbr>Release<wbr>Settings</h4>
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_csharp">
|
||||
<a href="#requiredarg_csharp" style="color: inherit; text-decoration: inherit;">Required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_csharp">
|
||||
<a href="#driver_csharp" style="color: inherit; text-decoration: inherit;">Driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_csharp">
|
||||
<a href="#pluginspath_csharp" style="color: inherit; text-decoration: inherit;">Plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_go">
|
||||
<a href="#requiredarg_go" style="color: inherit; text-decoration: inherit;">Required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_go">
|
||||
<a href="#driver_go" style="color: inherit; text-decoration: inherit;">Driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_go">
|
||||
<a href="#pluginspath_go" style="color: inherit; text-decoration: inherit;">Plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_nodejs">
|
||||
<a href="#requiredarg_nodejs" style="color: inherit; text-decoration: inherit;">required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_nodejs">
|
||||
<a href="#driver_nodejs" style="color: inherit; text-decoration: inherit;">driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_nodejs">
|
||||
<a href="#pluginspath_nodejs" style="color: inherit; text-decoration: inherit;">plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="required_arg_python">
|
||||
<a href="#required_arg_python" style="color: inherit; text-decoration: inherit;">required_<wbr>arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_python">
|
||||
<a href="#driver_python" style="color: inherit; text-decoration: inherit;">driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="plugins_path_python">
|
||||
<a href="#plugins_path_python" style="color: inherit; text-decoration: inherit;">plugins_<wbr>path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="package-details">Package Details</h2>
|
||||
<dl class="package-details">
|
||||
<dt>Repository</dt>
|
||||
<dd><a href=""></a></dd>
|
||||
<dt>License</dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
23
pkg/codegen/internal/test/testdata/env-helper/docs/mod1/_index.md
vendored
Normal file
23
pkg/codegen/internal/test/testdata/env-helper/docs/mod1/_index.md
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
title: "mod1"
|
||||
title_tag: "example.mod1"
|
||||
meta_desc: "Explore the resources and functions of the example.mod1 module."
|
||||
layout: api
|
||||
no_edit_this_page: true
|
||||
---
|
||||
|
||||
<!-- WARNING: this file was generated by test. -->
|
||||
<!-- Do not edit by hand unless you're certain you know what you are doing! -->
|
||||
|
||||
Explore the resources and functions of the example.mod1 module.
|
||||
|
||||
<h2 id="package-details">Package Details</h2>
|
||||
<dl class="package-details">
|
||||
<dt>Repository</dt>
|
||||
<dd><a href=""></a></dd>
|
||||
<dt>License</dt>
|
||||
<dd></dd>
|
||||
<dt>Version</dt>
|
||||
<dd>0.0.1</dd>
|
||||
</dl>
|
||||
|
23
pkg/codegen/internal/test/testdata/env-helper/docs/mod2/_index.md
vendored
Normal file
23
pkg/codegen/internal/test/testdata/env-helper/docs/mod2/_index.md
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
title: "mod2"
|
||||
title_tag: "example.mod2"
|
||||
meta_desc: "Explore the resources and functions of the example.mod2 module."
|
||||
layout: api
|
||||
no_edit_this_page: true
|
||||
---
|
||||
|
||||
<!-- WARNING: this file was generated by test. -->
|
||||
<!-- Do not edit by hand unless you're certain you know what you are doing! -->
|
||||
|
||||
Explore the resources and functions of the example.mod2 module.
|
||||
|
||||
<h2 id="package-details">Package Details</h2>
|
||||
<dl class="package-details">
|
||||
<dt>Repository</dt>
|
||||
<dd><a href=""></a></dd>
|
||||
<dt>License</dt>
|
||||
<dd></dd>
|
||||
<dt>Version</dt>
|
||||
<dd>0.0.1</dd>
|
||||
</dl>
|
||||
|
557
pkg/codegen/internal/test/testdata/env-helper/docs/moduletest/_index.md
vendored
Normal file
557
pkg/codegen/internal/test/testdata/env-helper/docs/moduletest/_index.md
vendored
Normal file
|
@ -0,0 +1,557 @@
|
|||
|
||||
---
|
||||
title: "ModuleTest"
|
||||
title_tag: "example.ModuleTest"
|
||||
meta_desc: "Documentation for the example.ModuleTest resource with examples, input properties, output properties, lookup functions, and supporting types."
|
||||
layout: api
|
||||
no_edit_this_page: true
|
||||
---
|
||||
|
||||
|
||||
|
||||
<!-- WARNING: this file was generated by test. -->
|
||||
<!-- Do not edit by hand unless you're certain you know what you are doing! -->
|
||||
|
||||
|
||||
|
||||
|
||||
## Create a ModuleTest Resource {#create}
|
||||
{{< chooser language "typescript,python,go,csharp" / >}}
|
||||
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-typescript" data-lang="typescript"><span class="k">new </span><span class="nx">ModuleTest</span><span class="p">(</span><span class="nx">name</span><span class="p">:</span> <span class="nx">string</span><span class="p">,</span> <span class="nx">args</span><span class="p">?:</span> <span class="nx"><a href="#inputs">ModuleTestArgs</a></span><span class="p">,</span> <span class="nx">opts</span><span class="p">?:</span> <span class="nx"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#CustomResourceOptions">CustomResourceOptions</a></span><span class="p">);</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-python" data-lang="python"><span class=nd>@overload</span>
|
||||
<span class="k">def </span><span class="nx">ModuleTest</span><span class="p">(</span><span class="nx">resource_name</span><span class="p">:</span> <span class="nx">str</span><span class="p">,</span>
|
||||
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">Optional[ResourceOptions]</a></span> = None<span class="p">,</span>
|
||||
<span class="nx">mod1</span><span class="p">:</span> <span class="nx">Optional[_mod1.TypArgs]</span> = None<span class="p">,</span>
|
||||
<span class="nx">val</span><span class="p">:</span> <span class="nx">Optional[TypArgs]</span> = None<span class="p">)</span>
|
||||
<span class=nd>@overload</span>
|
||||
<span class="k">def </span><span class="nx">ModuleTest</span><span class="p">(</span><span class="nx">resource_name</span><span class="p">:</span> <span class="nx">str</span><span class="p">,</span>
|
||||
<span class="nx">args</span><span class="p">:</span> <span class="nx"><a href="#inputs">Optional[ModuleTestArgs]</a></span> = None<span class="p">,</span>
|
||||
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">Optional[ResourceOptions]</a></span> = None<span class="p">)</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-go" data-lang="go"><span class="k">func </span><span class="nx">NewModuleTest</span><span class="p">(</span><span class="nx">ctx</span><span class="p"> *</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span><span class="p">,</span> <span class="nx">name</span><span class="p"> </span><span class="nx">string</span><span class="p">,</span> <span class="nx">args</span><span class="p"> *</span><span class="nx"><a href="#inputs">ModuleTestArgs</a></span><span class="p">,</span> <span class="nx">opts</span><span class="p"> ...</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#ResourceOption">ResourceOption</a></span><span class="p">) (*<span class="nx">ModuleTest</span>, error)</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-csharp" data-lang="csharp"><span class="k">public </span><span class="nx">ModuleTest</span><span class="p">(</span><span class="nx">string</span><span class="p"> </span><span class="nx">name<span class="p">,</span> <span class="nx"><a href="#inputs">ModuleTestArgs</a></span><span class="p">? </span><span class="nx">args = null<span class="p">,</span> <span class="nx"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.CustomResourceOptions.html">CustomResourceOptions</a></span><span class="p">? </span><span class="nx">opts = null<span class="p">)</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ModuleTestArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#CustomResourceOptions">CustomResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>resource_name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ModuleTestArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">ResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>ctx</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span>
|
||||
</dt>
|
||||
<dd>Context object for the current deployment.</dd><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ModuleTestArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#ResourceOption">ResourceOption</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ModuleTestArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.CustomResourceOptions.html">CustomResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
## ModuleTest Resource Properties {#properties}
|
||||
|
||||
To learn more about resource properties and how to use them, see [Inputs and Outputs]({{< relref "/docs/intro/concepts/inputs-outputs" >}}) in the Architecture and Concepts docs.
|
||||
|
||||
### Inputs
|
||||
|
||||
The ModuleTest resource accepts the following [input]({{< relref "/docs/intro/concepts/inputs-outputs" >}}) properties:
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_csharp">
|
||||
<a href="#mod1_csharp" style="color: inherit; text-decoration: inherit;">Mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Pulumi.<wbr>Example.<wbr>Mod1.<wbr>Inputs.<wbr>Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_csharp">
|
||||
<a href="#val_csharp" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_go">
|
||||
<a href="#mod1_go" style="color: inherit; text-decoration: inherit;">Mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_go">
|
||||
<a href="#val_go" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_nodejs">
|
||||
<a href="#mod1_nodejs" style="color: inherit; text-decoration: inherit;">mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">mod1Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_nodejs">
|
||||
<a href="#val_nodejs" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_python">
|
||||
<a href="#mod1_python" style="color: inherit; text-decoration: inherit;">mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_python">
|
||||
<a href="#val_python" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
### Outputs
|
||||
|
||||
All [input](#inputs) properties are implicitly available as output properties. Additionally, the ModuleTest resource produces the following output properties:
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_csharp">
|
||||
<a href="#id_csharp" style="color: inherit; text-decoration: inherit;">Id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_go">
|
||||
<a href="#id_go" style="color: inherit; text-decoration: inherit;">Id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_nodejs">
|
||||
<a href="#id_nodejs" style="color: inherit; text-decoration: inherit;">id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_python">
|
||||
<a href="#id_python" style="color: inherit; text-decoration: inherit;">id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Supporting Types
|
||||
|
||||
|
||||
|
||||
<h4 id="typ">Typ</h4>
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_csharp">
|
||||
<a href="#mod1_csharp" style="color: inherit; text-decoration: inherit;">Mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Pulumi.<wbr>Example.<wbr>Mod1.<wbr>Inputs.<wbr>Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod2_csharp">
|
||||
<a href="#mod2_csharp" style="color: inherit; text-decoration: inherit;">Mod2</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Pulumi.<wbr>Example.<wbr>Mod2.<wbr>Inputs.<wbr>Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_csharp">
|
||||
<a href="#val_csharp" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_go">
|
||||
<a href="#mod1_go" style="color: inherit; text-decoration: inherit;">Mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod2_go">
|
||||
<a href="#mod2_go" style="color: inherit; text-decoration: inherit;">Mod2</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_go">
|
||||
<a href="#val_go" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_nodejs">
|
||||
<a href="#mod1_nodejs" style="color: inherit; text-decoration: inherit;">mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">mod1Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod2_nodejs">
|
||||
<a href="#mod2_nodejs" style="color: inherit; text-decoration: inherit;">mod2</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">mod2Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_nodejs">
|
||||
<a href="#val_nodejs" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_python">
|
||||
<a href="#mod1_python" style="color: inherit; text-decoration: inherit;">mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod2_python">
|
||||
<a href="#mod2_python" style="color: inherit; text-decoration: inherit;">mod2</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_python">
|
||||
<a href="#val_python" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
<h4 id="typ">Typ</h4>
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_csharp">
|
||||
<a href="#val_csharp" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_go">
|
||||
<a href="#val_go" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_nodejs">
|
||||
<a href="#val_nodejs" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_python">
|
||||
<a href="#val_python" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
<h4 id="typ">Typ</h4>
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_csharp">
|
||||
<a href="#mod1_csharp" style="color: inherit; text-decoration: inherit;">Mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Pulumi.<wbr>Example.<wbr>Mod1.<wbr>Inputs.<wbr>Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_csharp">
|
||||
<a href="#val_csharp" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_go">
|
||||
<a href="#mod1_go" style="color: inherit; text-decoration: inherit;">Mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_go">
|
||||
<a href="#val_go" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_nodejs">
|
||||
<a href="#mod1_nodejs" style="color: inherit; text-decoration: inherit;">mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">mod1Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_nodejs">
|
||||
<a href="#val_nodejs" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_python">
|
||||
<a href="#mod1_python" style="color: inherit; text-decoration: inherit;">mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_python">
|
||||
<a href="#val_python" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
<h2 id="package-details">Package Details</h2>
|
||||
<dl class="package-details">
|
||||
<dt>Repository</dt>
|
||||
<dd><a href=""></a></dd>
|
||||
<dt>License</dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
394
pkg/codegen/internal/test/testdata/env-helper/docs/provider/_index.md
vendored
Normal file
394
pkg/codegen/internal/test/testdata/env-helper/docs/provider/_index.md
vendored
Normal file
|
@ -0,0 +1,394 @@
|
|||
|
||||
---
|
||||
title: "Provider"
|
||||
title_tag: "example.Provider"
|
||||
meta_desc: "Documentation for the example.Provider resource with examples, input properties, output properties, lookup functions, and supporting types."
|
||||
layout: api
|
||||
no_edit_this_page: true
|
||||
---
|
||||
|
||||
|
||||
|
||||
<!-- WARNING: this file was generated by test. -->
|
||||
<!-- Do not edit by hand unless you're certain you know what you are doing! -->
|
||||
|
||||
The provider type for the kubernetes package.
|
||||
|
||||
|
||||
|
||||
|
||||
## Create a Provider Resource {#create}
|
||||
{{< chooser language "typescript,python,go,csharp" / >}}
|
||||
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-typescript" data-lang="typescript"><span class="k">new </span><span class="nx">Provider</span><span class="p">(</span><span class="nx">name</span><span class="p">:</span> <span class="nx">string</span><span class="p">,</span> <span class="nx">args</span><span class="p">?:</span> <span class="nx"><a href="#inputs">ProviderArgs</a></span><span class="p">,</span> <span class="nx">opts</span><span class="p">?:</span> <span class="nx"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#CustomResourceOptions">CustomResourceOptions</a></span><span class="p">);</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-python" data-lang="python"><span class=nd>@overload</span>
|
||||
<span class="k">def </span><span class="nx">Provider</span><span class="p">(</span><span class="nx">resource_name</span><span class="p">:</span> <span class="nx">str</span><span class="p">,</span>
|
||||
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">Optional[ResourceOptions]</a></span> = None<span class="p">,</span>
|
||||
<span class="nx">helm_release_settings</span><span class="p">:</span> <span class="nx">Optional[HelmReleaseSettingsArgs]</span> = None<span class="p">)</span>
|
||||
<span class=nd>@overload</span>
|
||||
<span class="k">def </span><span class="nx">Provider</span><span class="p">(</span><span class="nx">resource_name</span><span class="p">:</span> <span class="nx">str</span><span class="p">,</span>
|
||||
<span class="nx">args</span><span class="p">:</span> <span class="nx"><a href="#inputs">Optional[ProviderArgs]</a></span> = None<span class="p">,</span>
|
||||
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">Optional[ResourceOptions]</a></span> = None<span class="p">)</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-go" data-lang="go"><span class="k">func </span><span class="nx">NewProvider</span><span class="p">(</span><span class="nx">ctx</span><span class="p"> *</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span><span class="p">,</span> <span class="nx">name</span><span class="p"> </span><span class="nx">string</span><span class="p">,</span> <span class="nx">args</span><span class="p"> *</span><span class="nx"><a href="#inputs">ProviderArgs</a></span><span class="p">,</span> <span class="nx">opts</span><span class="p"> ...</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#ResourceOption">ResourceOption</a></span><span class="p">) (*<span class="nx">Provider</span>, error)</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-csharp" data-lang="csharp"><span class="k">public </span><span class="nx">Provider</span><span class="p">(</span><span class="nx">string</span><span class="p"> </span><span class="nx">name<span class="p">,</span> <span class="nx"><a href="#inputs">ProviderArgs</a></span><span class="p">? </span><span class="nx">args = null<span class="p">,</span> <span class="nx"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.CustomResourceOptions.html">CustomResourceOptions</a></span><span class="p">? </span><span class="nx">opts = null<span class="p">)</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ProviderArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#CustomResourceOptions">CustomResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>resource_name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ProviderArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">ResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>ctx</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span>
|
||||
</dt>
|
||||
<dd>Context object for the current deployment.</dd><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ProviderArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#ResourceOption">ResourceOption</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ProviderArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.CustomResourceOptions.html">CustomResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
## Provider Resource Properties {#properties}
|
||||
|
||||
To learn more about resource properties and how to use them, see [Inputs and Outputs]({{< relref "/docs/intro/concepts/inputs-outputs" >}}) in the Architecture and Concepts docs.
|
||||
|
||||
### Inputs
|
||||
|
||||
The Provider resource accepts the following [input]({{< relref "/docs/intro/concepts/inputs-outputs" >}}) properties:
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="helmreleasesettings_csharp">
|
||||
<a href="#helmreleasesettings_csharp" style="color: inherit; text-decoration: inherit;">Helm<wbr>Release<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}BETA FEATURE - Options to configure the Helm Release resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="helmreleasesettings_go">
|
||||
<a href="#helmreleasesettings_go" style="color: inherit; text-decoration: inherit;">Helm<wbr>Release<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}BETA FEATURE - Options to configure the Helm Release resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="helmreleasesettings_nodejs">
|
||||
<a href="#helmreleasesettings_nodejs" style="color: inherit; text-decoration: inherit;">helm<wbr>Release<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}BETA FEATURE - Options to configure the Helm Release resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="helm_release_settings_python">
|
||||
<a href="#helm_release_settings_python" style="color: inherit; text-decoration: inherit;">helm_<wbr>release_<wbr>settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}BETA FEATURE - Options to configure the Helm Release resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
### Outputs
|
||||
|
||||
All [input](#inputs) properties are implicitly available as output properties. Additionally, the Provider resource produces the following output properties:
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_csharp">
|
||||
<a href="#id_csharp" style="color: inherit; text-decoration: inherit;">Id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_go">
|
||||
<a href="#id_go" style="color: inherit; text-decoration: inherit;">Id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_nodejs">
|
||||
<a href="#id_nodejs" style="color: inherit; text-decoration: inherit;">id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_python">
|
||||
<a href="#id_python" style="color: inherit; text-decoration: inherit;">id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Supporting Types
|
||||
|
||||
|
||||
|
||||
<h4 id="helmreleasesettings">Helm<wbr>Release<wbr>Settings</h4>
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_csharp">
|
||||
<a href="#requiredarg_csharp" style="color: inherit; text-decoration: inherit;">Required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_csharp">
|
||||
<a href="#driver_csharp" style="color: inherit; text-decoration: inherit;">Driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_csharp">
|
||||
<a href="#pluginspath_csharp" style="color: inherit; text-decoration: inherit;">Plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_go">
|
||||
<a href="#requiredarg_go" style="color: inherit; text-decoration: inherit;">Required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_go">
|
||||
<a href="#driver_go" style="color: inherit; text-decoration: inherit;">Driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_go">
|
||||
<a href="#pluginspath_go" style="color: inherit; text-decoration: inherit;">Plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_nodejs">
|
||||
<a href="#requiredarg_nodejs" style="color: inherit; text-decoration: inherit;">required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_nodejs">
|
||||
<a href="#driver_nodejs" style="color: inherit; text-decoration: inherit;">driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_nodejs">
|
||||
<a href="#pluginspath_nodejs" style="color: inherit; text-decoration: inherit;">plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="required_arg_python">
|
||||
<a href="#required_arg_python" style="color: inherit; text-decoration: inherit;">required_<wbr>arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_python">
|
||||
<a href="#driver_python" style="color: inherit; text-decoration: inherit;">driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="plugins_path_python">
|
||||
<a href="#plugins_path_python" style="color: inherit; text-decoration: inherit;">plugins_<wbr>path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
<h2 id="package-details">Package Details</h2>
|
||||
<dl class="package-details">
|
||||
<dt>Repository</dt>
|
||||
<dd><a href=""></a></dd>
|
||||
<dt>License</dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
94
pkg/codegen/internal/test/testdata/env-helper/dotnet/Foo.cs
vendored
Normal file
94
pkg/codegen/internal/test/testdata/env-helper/dotnet/Foo.cs
vendored
Normal file
|
@ -0,0 +1,94 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** 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.Example
|
||||
{
|
||||
/// <summary>
|
||||
/// test new feature with resoruces
|
||||
/// </summary>
|
||||
[ExampleResourceType("example:index:Foo")]
|
||||
public partial class Foo : Pulumi.CustomResource
|
||||
{
|
||||
/// <summary>
|
||||
/// A test for plain types
|
||||
/// </summary>
|
||||
[Output("defaultKubeClientSettings")]
|
||||
public Output<Outputs.KubeClientSettings?> DefaultKubeClientSettings { get; private set; } = null!;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a Foo 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 Foo(string name, FooArgs args, CustomResourceOptions? options = null)
|
||||
: base("example:index:Foo", name, args ?? new FooArgs(), MakeResourceOptions(options, ""))
|
||||
{
|
||||
}
|
||||
|
||||
private Foo(string name, Input<string> id, CustomResourceOptions? options = null)
|
||||
: base("example:index:Foo", name, null, 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 Foo 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="options">A bag of options that control this resource's behavior</param>
|
||||
public static Foo Get(string name, Input<string> id, CustomResourceOptions? options = null)
|
||||
{
|
||||
return new Foo(name, id, options);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class FooArgs : Pulumi.ResourceArgs
|
||||
{
|
||||
[Input("argument")]
|
||||
public string? Argument { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Options for tuning the Kubernetes client used by a Provider.
|
||||
/// </summary>
|
||||
[Input("backupKubeClientSettings", required: true)]
|
||||
public Input<Inputs.KubeClientSettingsArgs> BackupKubeClientSettings { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Options for tuning the Kubernetes client used by a Provider.
|
||||
/// </summary>
|
||||
[Input("kubeClientSettings")]
|
||||
public Input<Inputs.KubeClientSettingsArgs>? KubeClientSettings { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// describing things
|
||||
/// </summary>
|
||||
[Input("settings")]
|
||||
public Input<Inputs.LayeredTypeArgs>? Settings { get; set; }
|
||||
|
||||
public FooArgs()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
81
pkg/codegen/internal/test/testdata/env-helper/dotnet/FuncWithAllOptionalInputs.cs
vendored
Normal file
81
pkg/codegen/internal/test/testdata/env-helper/dotnet/FuncWithAllOptionalInputs.cs
vendored
Normal file
|
@ -0,0 +1,81 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** 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;
|
||||
using Pulumi.Utilities;
|
||||
|
||||
namespace Pulumi.Mypkg
|
||||
{
|
||||
public static class FuncWithAllOptionalInputs
|
||||
{
|
||||
/// <summary>
|
||||
/// Check codegen of functions with all optional inputs.
|
||||
/// </summary>
|
||||
public static Task<FuncWithAllOptionalInputsResult> InvokeAsync(FuncWithAllOptionalInputsArgs? args = null, InvokeOptions? options = null)
|
||||
=> Pulumi.Deployment.Instance.InvokeAsync<FuncWithAllOptionalInputsResult>("mypkg::funcWithAllOptionalInputs", args ?? new FuncWithAllOptionalInputsArgs(), options.WithVersion());
|
||||
|
||||
/// <summary>
|
||||
/// Check codegen of functions with all optional inputs.
|
||||
/// </summary>
|
||||
public static Output<FuncWithAllOptionalInputsResult> Invoke(FuncWithAllOptionalInputsInvokeArgs? args = null, InvokeOptions? options = null)
|
||||
=> Pulumi.Deployment.Instance.Invoke<FuncWithAllOptionalInputsResult>("mypkg::funcWithAllOptionalInputs", args ?? new FuncWithAllOptionalInputsInvokeArgs(), options.WithVersion());
|
||||
}
|
||||
|
||||
|
||||
public sealed class FuncWithAllOptionalInputsArgs : Pulumi.InvokeArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Property A
|
||||
/// </summary>
|
||||
[Input("a")]
|
||||
public Inputs.HelmReleaseSettings? A { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Property B
|
||||
/// </summary>
|
||||
[Input("b")]
|
||||
public string? B { get; set; }
|
||||
|
||||
public FuncWithAllOptionalInputsArgs()
|
||||
{
|
||||
B = "defValue";
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class FuncWithAllOptionalInputsInvokeArgs : Pulumi.InvokeArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Property A
|
||||
/// </summary>
|
||||
[Input("a")]
|
||||
public Input<Inputs.HelmReleaseSettingsArgs>? A { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Property B
|
||||
/// </summary>
|
||||
[Input("b")]
|
||||
public Input<string>? B { get; set; }
|
||||
|
||||
public FuncWithAllOptionalInputsInvokeArgs()
|
||||
{
|
||||
B = "defValue";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[OutputType]
|
||||
public sealed class FuncWithAllOptionalInputsResult
|
||||
{
|
||||
public readonly string R;
|
||||
|
||||
[OutputConstructor]
|
||||
private FuncWithAllOptionalInputsResult(string r)
|
||||
{
|
||||
R = r;
|
||||
}
|
||||
}
|
||||
}
|
42
pkg/codegen/internal/test/testdata/env-helper/dotnet/Inputs/HelmReleaseSettings.cs
vendored
Normal file
42
pkg/codegen/internal/test/testdata/env-helper/dotnet/Inputs/HelmReleaseSettings.cs
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** 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.Example.Inputs
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// BETA FEATURE - Options to configure the Helm Release resource.
|
||||
/// </summary>
|
||||
public sealed class HelmReleaseSettings : Pulumi.InvokeArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The backend storage driver for Helm. Values are: configmap, secret, memory, sql.
|
||||
/// </summary>
|
||||
[Input("driver")]
|
||||
public string? Driver { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The path to the helm plugins directory.
|
||||
/// </summary>
|
||||
[Input("pluginsPath")]
|
||||
public string? PluginsPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// to test required args
|
||||
/// </summary>
|
||||
[Input("requiredArg", required: true)]
|
||||
public string RequiredArg { get; set; } = null!;
|
||||
|
||||
public HelmReleaseSettings()
|
||||
{
|
||||
Driver = Utilities.GetEnv("PULUMI_K8S_HELM_DRIVER") ?? "secret";
|
||||
PluginsPath = Utilities.GetEnv("PULUMI_K8S_HELM_PLUGINS_PATH");
|
||||
}
|
||||
}
|
||||
}
|
42
pkg/codegen/internal/test/testdata/env-helper/dotnet/Inputs/HelmReleaseSettingsArgs.cs
vendored
Normal file
42
pkg/codegen/internal/test/testdata/env-helper/dotnet/Inputs/HelmReleaseSettingsArgs.cs
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** 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.Example.Inputs
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// BETA FEATURE - Options to configure the Helm Release resource.
|
||||
/// </summary>
|
||||
public sealed class HelmReleaseSettingsArgs : Pulumi.ResourceArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The backend storage driver for Helm. Values are: configmap, secret, memory, sql.
|
||||
/// </summary>
|
||||
[Input("driver")]
|
||||
public Input<string>? Driver { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The path to the helm plugins directory.
|
||||
/// </summary>
|
||||
[Input("pluginsPath")]
|
||||
public Input<string>? PluginsPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// to test required args
|
||||
/// </summary>
|
||||
[Input("requiredArg", required: true)]
|
||||
public Input<string> RequiredArg { get; set; } = null!;
|
||||
|
||||
public HelmReleaseSettingsArgs()
|
||||
{
|
||||
Driver = Utilities.GetEnv("PULUMI_K8S_HELM_DRIVER") ?? "secret";
|
||||
PluginsPath = Utilities.GetEnv("PULUMI_K8S_HELM_PLUGINS_PATH");
|
||||
}
|
||||
}
|
||||
}
|
39
pkg/codegen/internal/test/testdata/env-helper/dotnet/Inputs/KubeClientSettingsArgs.cs
vendored
Normal file
39
pkg/codegen/internal/test/testdata/env-helper/dotnet/Inputs/KubeClientSettingsArgs.cs
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** 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.Example.Inputs
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Options for tuning the Kubernetes client used by a Provider.
|
||||
/// </summary>
|
||||
public sealed class KubeClientSettingsArgs : Pulumi.ResourceArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Maximum burst for throttle. Default value is 10.
|
||||
/// </summary>
|
||||
[Input("burst")]
|
||||
public Input<int>? Burst { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Maximum queries per second (QPS) to the API server from this client. Default value is 5.
|
||||
/// </summary>
|
||||
[Input("qps")]
|
||||
public Input<double>? Qps { get; set; }
|
||||
|
||||
[Input("recTest")]
|
||||
public Input<Inputs.KubeClientSettingsArgs>? RecTest { get; set; }
|
||||
|
||||
public KubeClientSettingsArgs()
|
||||
{
|
||||
Burst = Utilities.GetEnvInt32("PULUMI_K8S_CLIENT_BURST");
|
||||
Qps = Utilities.GetEnvDouble("PULUMI_K8S_CLIENT_QPS");
|
||||
}
|
||||
}
|
||||
}
|
55
pkg/codegen/internal/test/testdata/env-helper/dotnet/Inputs/LayeredTypeArgs.cs
vendored
Normal file
55
pkg/codegen/internal/test/testdata/env-helper/dotnet/Inputs/LayeredTypeArgs.cs
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** 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.Example.Inputs
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Make sure that defaults propagate through types
|
||||
/// </summary>
|
||||
public sealed class LayeredTypeArgs : Pulumi.ResourceArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The answer to the question
|
||||
/// </summary>
|
||||
[Input("answer")]
|
||||
public Input<double>? Answer { get; set; }
|
||||
|
||||
[Input("other", required: true)]
|
||||
public Input<Inputs.HelmReleaseSettingsArgs> Other { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Test how plain types interact
|
||||
/// </summary>
|
||||
[Input("plainOther")]
|
||||
public Inputs.HelmReleaseSettingsArgs? PlainOther { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The question already answered
|
||||
/// </summary>
|
||||
[Input("question")]
|
||||
public Input<string>? Question { get; set; }
|
||||
|
||||
[Input("recursive")]
|
||||
public Input<Inputs.LayeredTypeArgs>? Recursive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// To ask and answer
|
||||
/// </summary>
|
||||
[Input("thinker", required: true)]
|
||||
public Input<string> Thinker { get; set; } = null!;
|
||||
|
||||
public LayeredTypeArgs()
|
||||
{
|
||||
Answer = 42;
|
||||
Question = Utilities.GetEnv("PULUMI_THE_QUESTION") ?? "<unknown>";
|
||||
Thinker = "not a good interaction";
|
||||
}
|
||||
}
|
||||
}
|
32
pkg/codegen/internal/test/testdata/env-helper/dotnet/Inputs/TypArgs.cs
vendored
Normal file
32
pkg/codegen/internal/test/testdata/env-helper/dotnet/Inputs/TypArgs.cs
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** 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.Example.Inputs
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// A test for namespaces (mod main)
|
||||
/// </summary>
|
||||
public sealed class TypArgs : Pulumi.ResourceArgs
|
||||
{
|
||||
[Input("mod1")]
|
||||
public Input<Pulumi.Example.Mod1.Inputs.TypArgs>? Mod1 { get; set; }
|
||||
|
||||
[Input("mod2")]
|
||||
public Input<Pulumi.Example.Mod2.Inputs.TypArgs>? Mod2 { get; set; }
|
||||
|
||||
[Input("val")]
|
||||
public Input<string>? Val { get; set; }
|
||||
|
||||
public TypArgs()
|
||||
{
|
||||
Val = "mod main";
|
||||
}
|
||||
}
|
||||
}
|
26
pkg/codegen/internal/test/testdata/env-helper/dotnet/Mod1/Inputs/TypArgs.cs
vendored
Normal file
26
pkg/codegen/internal/test/testdata/env-helper/dotnet/Mod1/Inputs/TypArgs.cs
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** 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.Example.Mod1.Inputs
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// A test for namespaces (mod 1)
|
||||
/// </summary>
|
||||
public sealed class TypArgs : Pulumi.ResourceArgs
|
||||
{
|
||||
[Input("val")]
|
||||
public Input<string>? Val { get; set; }
|
||||
|
||||
public TypArgs()
|
||||
{
|
||||
Val = "mod1";
|
||||
}
|
||||
}
|
||||
}
|
0
pkg/codegen/internal/test/testdata/env-helper/dotnet/Mod1/README.md
vendored
Normal file
0
pkg/codegen/internal/test/testdata/env-helper/dotnet/Mod1/README.md
vendored
Normal file
29
pkg/codegen/internal/test/testdata/env-helper/dotnet/Mod2/Inputs/TypArgs.cs
vendored
Normal file
29
pkg/codegen/internal/test/testdata/env-helper/dotnet/Mod2/Inputs/TypArgs.cs
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** 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.Example.Mod2.Inputs
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// A test for namespaces (mod 2)
|
||||
/// </summary>
|
||||
public sealed class TypArgs : Pulumi.ResourceArgs
|
||||
{
|
||||
[Input("mod1")]
|
||||
public Input<Pulumi.Example.Mod1.Inputs.TypArgs>? Mod1 { get; set; }
|
||||
|
||||
[Input("val")]
|
||||
public Input<string>? Val { get; set; }
|
||||
|
||||
public TypArgs()
|
||||
{
|
||||
Val = "mod2";
|
||||
}
|
||||
}
|
||||
}
|
0
pkg/codegen/internal/test/testdata/env-helper/dotnet/Mod2/README.md
vendored
Normal file
0
pkg/codegen/internal/test/testdata/env-helper/dotnet/Mod2/README.md
vendored
Normal file
69
pkg/codegen/internal/test/testdata/env-helper/dotnet/ModuleTest.cs
vendored
Normal file
69
pkg/codegen/internal/test/testdata/env-helper/dotnet/ModuleTest.cs
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** 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.Example
|
||||
{
|
||||
[ExampleResourceType("example:index:moduleTest")]
|
||||
public partial class ModuleTest : Pulumi.CustomResource
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a ModuleTest 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 ModuleTest(string name, ModuleTestArgs? args = null, CustomResourceOptions? options = null)
|
||||
: base("example:index:moduleTest", name, args ?? new ModuleTestArgs(), MakeResourceOptions(options, ""))
|
||||
{
|
||||
}
|
||||
|
||||
private ModuleTest(string name, Input<string> id, CustomResourceOptions? options = null)
|
||||
: base("example:index:moduleTest", name, null, 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 ModuleTest 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="options">A bag of options that control this resource's behavior</param>
|
||||
public static ModuleTest Get(string name, Input<string> id, CustomResourceOptions? options = null)
|
||||
{
|
||||
return new ModuleTest(name, id, options);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ModuleTestArgs : Pulumi.ResourceArgs
|
||||
{
|
||||
[Input("mod1")]
|
||||
public Input<Pulumi.Example.Mod1.Inputs.TypArgs>? Mod1 { get; set; }
|
||||
|
||||
[Input("val")]
|
||||
public Input<Inputs.TypArgs>? Val { get; set; }
|
||||
|
||||
public ModuleTestArgs()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
42
pkg/codegen/internal/test/testdata/env-helper/dotnet/Outputs/KubeClientSettings.cs
vendored
Normal file
42
pkg/codegen/internal/test/testdata/env-helper/dotnet/Outputs/KubeClientSettings.cs
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** 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.Example.Outputs
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Options for tuning the Kubernetes client used by a Provider.
|
||||
/// </summary>
|
||||
[OutputType]
|
||||
public sealed class KubeClientSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Maximum burst for throttle. Default value is 10.
|
||||
/// </summary>
|
||||
public readonly int? Burst;
|
||||
/// <summary>
|
||||
/// Maximum queries per second (QPS) to the API server from this client. Default value is 5.
|
||||
/// </summary>
|
||||
public readonly double? Qps;
|
||||
public readonly Outputs.KubeClientSettings? RecTest;
|
||||
|
||||
[OutputConstructor]
|
||||
private KubeClientSettings(
|
||||
int? burst,
|
||||
|
||||
double? qps,
|
||||
|
||||
Outputs.KubeClientSettings? recTest)
|
||||
{
|
||||
Burst = burst;
|
||||
Qps = qps;
|
||||
RecTest = recTest;
|
||||
}
|
||||
}
|
||||
}
|
55
pkg/codegen/internal/test/testdata/env-helper/dotnet/Provider.cs
vendored
Normal file
55
pkg/codegen/internal/test/testdata/env-helper/dotnet/Provider.cs
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** 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.Example
|
||||
{
|
||||
/// <summary>
|
||||
/// The provider type for the kubernetes package.
|
||||
/// </summary>
|
||||
[ExampleResourceType("pulumi:providers:example")]
|
||||
public partial class Provider : 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("example", 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 : Pulumi.ResourceArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// BETA FEATURE - Options to configure the Helm Release resource.
|
||||
/// </summary>
|
||||
[Input("helmReleaseSettings", json: true)]
|
||||
public Input<Inputs.HelmReleaseSettingsArgs>? HelmReleaseSettings { get; set; }
|
||||
|
||||
public ProviderArgs()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
56
pkg/codegen/internal/test/testdata/env-helper/dotnet/Pulumi.Example.csproj
vendored
Normal file
56
pkg/codegen/internal/test/testdata/env-helper/dotnet/Pulumi.Example.csproj
vendored
Normal file
|
@ -0,0 +1,56 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>Pulumi Corp.</Authors>
|
||||
<Company>Pulumi Corp.</Company>
|
||||
<Description></Description>
|
||||
<PackageLicenseExpression></PackageLicenseExpression>
|
||||
<PackageProjectUrl></PackageProjectUrl>
|
||||
<RepositoryUrl></RepositoryUrl>
|
||||
<PackageIcon>logo.png</PackageIcon>
|
||||
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseSharedCompilation>false</UseSharedCompilation>
|
||||
</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>
|
||||
<PackageReference Include="Pulumi" Version="3.12" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="logo.png">
|
||||
<Pack>True</Pack>
|
||||
<PackagePath></PackagePath>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
0
pkg/codegen/internal/test/testdata/env-helper/dotnet/README.md
vendored
Normal file
0
pkg/codegen/internal/test/testdata/env-helper/dotnet/README.md
vendored
Normal file
87
pkg/codegen/internal/test/testdata/env-helper/dotnet/Utilities.cs
vendored
Normal file
87
pkg/codegen/internal/test/testdata/env-helper/dotnet/Utilities.cs
vendored
Normal file
|
@ -0,0 +1,87 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using Pulumi;
|
||||
|
||||
namespace Pulumi.Example
|
||||
{
|
||||
static class Utilities
|
||||
{
|
||||
public static string? GetEnv(params string[] names)
|
||||
{
|
||||
foreach (var n in names)
|
||||
{
|
||||
var value = 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 (Array.IndexOf(trueValues, s) != -1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (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;
|
||||
|
||||
public static InvokeOptions WithVersion(this InvokeOptions? options)
|
||||
{
|
||||
if (options?.Version != null)
|
||||
{
|
||||
return options;
|
||||
}
|
||||
return new InvokeOptions
|
||||
{
|
||||
Parent = options?.Parent,
|
||||
Provider = options?.Provider,
|
||||
Version = Version,
|
||||
};
|
||||
}
|
||||
|
||||
private readonly static string version;
|
||||
public static string Version => version;
|
||||
|
||||
static Utilities()
|
||||
{
|
||||
var assembly = typeof(Utilities).GetTypeInfo().Assembly;
|
||||
using var stream = assembly.GetManifestResourceStream("Pulumi.Example.version.txt");
|
||||
using var reader = new StreamReader(stream ?? throw new 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 ExampleResourceTypeAttribute : Pulumi.ResourceTypeAttribute
|
||||
{
|
||||
public ExampleResourceTypeAttribute(string type) : base(type, Utilities.Version)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
22
pkg/codegen/internal/test/testdata/env-helper/dotnet/codegen-manifest.json
vendored
Normal file
22
pkg/codegen/internal/test/testdata/env-helper/dotnet/codegen-manifest.json
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"emittedFiles": [
|
||||
"Foo.cs",
|
||||
"FuncWithAllOptionalInputs.cs",
|
||||
"Inputs/HelmReleaseSettings.cs",
|
||||
"Inputs/HelmReleaseSettingsArgs.cs",
|
||||
"Inputs/KubeClientSettingsArgs.cs",
|
||||
"Inputs/LayeredTypeArgs.cs",
|
||||
"Inputs/TypArgs.cs",
|
||||
"Mod1/Inputs/TypArgs.cs",
|
||||
"Mod1/README.md",
|
||||
"Mod2/Inputs/TypArgs.cs",
|
||||
"Mod2/README.md",
|
||||
"ModuleTest.cs",
|
||||
"Outputs/KubeClientSettings.cs",
|
||||
"Provider.cs",
|
||||
"Pulumi.Example.csproj",
|
||||
"README.md",
|
||||
"Utilities.cs",
|
||||
"logo.png"
|
||||
]
|
||||
}
|
BIN
pkg/codegen/internal/test/testdata/env-helper/dotnet/logo.png
vendored
Normal file
BIN
pkg/codegen/internal/test/testdata/env-helper/dotnet/logo.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.7 KiB |
14
pkg/codegen/internal/test/testdata/env-helper/go/codegen-manifest.json
vendored
Normal file
14
pkg/codegen/internal/test/testdata/env-helper/go/codegen-manifest.json
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"emittedFiles": [
|
||||
"example/doc.go",
|
||||
"example/foo.go",
|
||||
"example/funcWithAllOptionalInputs.go",
|
||||
"example/init.go",
|
||||
"example/mod1/pulumiTypes.go",
|
||||
"example/mod2/pulumiTypes.go",
|
||||
"example/moduleTest.go",
|
||||
"example/provider.go",
|
||||
"example/pulumiTypes.go",
|
||||
"example/pulumiUtilities.go"
|
||||
]
|
||||
}
|
3
pkg/codegen/internal/test/testdata/env-helper/go/example/doc.go
vendored
Normal file
3
pkg/codegen/internal/test/testdata/env-helper/go/example/doc.go
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
// Package example exports types, functions, subpackages for provisioning example resources.
|
||||
//
|
||||
package example
|
124
pkg/codegen/internal/test/testdata/env-helper/go/example/foo.go
vendored
Normal file
124
pkg/codegen/internal/test/testdata/env-helper/go/example/foo.go
vendored
Normal file
|
@ -0,0 +1,124 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
package example
|
||||
|
||||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
)
|
||||
|
||||
// test new feature with resoruces
|
||||
type Foo struct {
|
||||
pulumi.CustomResourceState
|
||||
|
||||
// A test for plain types
|
||||
DefaultKubeClientSettings KubeClientSettingsPtrOutput `pulumi:"defaultKubeClientSettings"`
|
||||
}
|
||||
|
||||
// NewFoo registers a new resource with the given unique name, arguments, and options.
|
||||
func NewFoo(ctx *pulumi.Context,
|
||||
name string, args *FooArgs, opts ...pulumi.ResourceOption) (*Foo, error) {
|
||||
if args == nil {
|
||||
return nil, errors.New("missing one or more required arguments")
|
||||
}
|
||||
|
||||
if args.BackupKubeClientSettings == nil {
|
||||
return nil, errors.New("invalid value for required argument 'BackupKubeClientSettings'")
|
||||
}
|
||||
var resource Foo
|
||||
err := ctx.RegisterResource("example:index:Foo", name, args, &resource, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resource, nil
|
||||
}
|
||||
|
||||
// GetFoo gets an existing Foo 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 GetFoo(ctx *pulumi.Context,
|
||||
name string, id pulumi.IDInput, state *FooState, opts ...pulumi.ResourceOption) (*Foo, error) {
|
||||
var resource Foo
|
||||
err := ctx.ReadResource("example:index:Foo", name, id, state, &resource, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resource, nil
|
||||
}
|
||||
|
||||
// Input properties used for looking up and filtering Foo resources.
|
||||
type fooState struct {
|
||||
}
|
||||
|
||||
type FooState struct {
|
||||
}
|
||||
|
||||
func (FooState) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*fooState)(nil)).Elem()
|
||||
}
|
||||
|
||||
type fooArgs struct {
|
||||
Argument *string `pulumi:"argument"`
|
||||
// Options for tuning the Kubernetes client used by a Provider.
|
||||
BackupKubeClientSettings KubeClientSettings `pulumi:"backupKubeClientSettings"`
|
||||
// Options for tuning the Kubernetes client used by a Provider.
|
||||
KubeClientSettings *KubeClientSettings `pulumi:"kubeClientSettings"`
|
||||
// describing things
|
||||
Settings *LayeredType `pulumi:"settings"`
|
||||
}
|
||||
|
||||
// The set of arguments for constructing a Foo resource.
|
||||
type FooArgs struct {
|
||||
Argument *string
|
||||
// Options for tuning the Kubernetes client used by a Provider.
|
||||
BackupKubeClientSettings KubeClientSettingsInput
|
||||
// Options for tuning the Kubernetes client used by a Provider.
|
||||
KubeClientSettings KubeClientSettingsPtrInput
|
||||
// describing things
|
||||
Settings LayeredTypePtrInput
|
||||
}
|
||||
|
||||
func (FooArgs) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*fooArgs)(nil)).Elem()
|
||||
}
|
||||
|
||||
type FooInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToFooOutput() FooOutput
|
||||
ToFooOutputWithContext(ctx context.Context) FooOutput
|
||||
}
|
||||
|
||||
func (*Foo) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*Foo)(nil))
|
||||
}
|
||||
|
||||
func (i *Foo) ToFooOutput() FooOutput {
|
||||
return i.ToFooOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i *Foo) ToFooOutputWithContext(ctx context.Context) FooOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(FooOutput)
|
||||
}
|
||||
|
||||
type FooOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (FooOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*Foo)(nil))
|
||||
}
|
||||
|
||||
func (o FooOutput) ToFooOutput() FooOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o FooOutput) ToFooOutputWithContext(ctx context.Context) FooOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func init() {
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*FooInput)(nil)).Elem(), &Foo{})
|
||||
pulumi.RegisterOutputType(FooOutput{})
|
||||
}
|
74
pkg/codegen/internal/test/testdata/env-helper/go/example/funcWithAllOptionalInputs.go
vendored
Normal file
74
pkg/codegen/internal/test/testdata/env-helper/go/example/funcWithAllOptionalInputs.go
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
package example
|
||||
|
||||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
)
|
||||
|
||||
// Check codegen of functions with all optional inputs.
|
||||
func FuncWithAllOptionalInputs(ctx *pulumi.Context, args *FuncWithAllOptionalInputsArgs, opts ...pulumi.InvokeOption) (*FuncWithAllOptionalInputsResult, error) {
|
||||
var rv FuncWithAllOptionalInputsResult
|
||||
err := ctx.Invoke("mypkg::funcWithAllOptionalInputs", args, &rv, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &rv, nil
|
||||
}
|
||||
|
||||
type FuncWithAllOptionalInputsArgs struct {
|
||||
// Property A
|
||||
A *HelmReleaseSettings `pulumi:"a"`
|
||||
// Property B
|
||||
B *string `pulumi:"b"`
|
||||
}
|
||||
|
||||
type FuncWithAllOptionalInputsResult struct {
|
||||
R string `pulumi:"r"`
|
||||
}
|
||||
|
||||
func FuncWithAllOptionalInputsOutput(ctx *pulumi.Context, args FuncWithAllOptionalInputsOutputArgs, opts ...pulumi.InvokeOption) FuncWithAllOptionalInputsResultOutput {
|
||||
return pulumi.ToOutputWithContext(context.Background(), args).
|
||||
ApplyT(func(v interface{}) (FuncWithAllOptionalInputsResult, error) {
|
||||
args := v.(FuncWithAllOptionalInputsArgs)
|
||||
r, err := FuncWithAllOptionalInputs(ctx, &args, opts...)
|
||||
return *r, err
|
||||
}).(FuncWithAllOptionalInputsResultOutput)
|
||||
}
|
||||
|
||||
type FuncWithAllOptionalInputsOutputArgs struct {
|
||||
// Property A
|
||||
A HelmReleaseSettingsPtrInput `pulumi:"a"`
|
||||
// Property B
|
||||
B pulumi.StringPtrInput `pulumi:"b"`
|
||||
}
|
||||
|
||||
func (FuncWithAllOptionalInputsOutputArgs) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*FuncWithAllOptionalInputsArgs)(nil)).Elem()
|
||||
}
|
||||
|
||||
type FuncWithAllOptionalInputsResultOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (FuncWithAllOptionalInputsResultOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*FuncWithAllOptionalInputsResult)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o FuncWithAllOptionalInputsResultOutput) ToFuncWithAllOptionalInputsResultOutput() FuncWithAllOptionalInputsResultOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o FuncWithAllOptionalInputsResultOutput) ToFuncWithAllOptionalInputsResultOutputWithContext(ctx context.Context) FuncWithAllOptionalInputsResultOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o FuncWithAllOptionalInputsResultOutput) R() pulumi.StringOutput {
|
||||
return o.ApplyT(func(v FuncWithAllOptionalInputsResult) string { return v.R }).(pulumi.StringOutput)
|
||||
}
|
||||
|
||||
func init() {
|
||||
pulumi.RegisterOutputType(FuncWithAllOptionalInputsResultOutput{})
|
||||
}
|
67
pkg/codegen/internal/test/testdata/env-helper/go/example/init.go
vendored
Normal file
67
pkg/codegen/internal/test/testdata/env-helper/go/example/init.go
vendored
Normal file
|
@ -0,0 +1,67 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/blang/semver"
|
||||
"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 "example:index:Foo":
|
||||
r = &Foo{}
|
||||
case "example:index:moduleTest":
|
||||
r = &ModuleTest{}
|
||||
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:example" {
|
||||
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 := PkgVersion()
|
||||
if err != nil {
|
||||
fmt.Printf("failed to determine package version. defaulting to v1: %v\n", err)
|
||||
}
|
||||
pulumi.RegisterResourceModule(
|
||||
"example",
|
||||
"index",
|
||||
&module{version},
|
||||
)
|
||||
pulumi.RegisterResourcePackage(
|
||||
"example",
|
||||
&pkg{version},
|
||||
)
|
||||
}
|
154
pkg/codegen/internal/test/testdata/env-helper/go/example/mod1/pulumiTypes.go
vendored
Normal file
154
pkg/codegen/internal/test/testdata/env-helper/go/example/mod1/pulumiTypes.go
vendored
Normal file
|
@ -0,0 +1,154 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
package mod1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
)
|
||||
|
||||
// A test for namespaces (mod 1)
|
||||
type Typ struct {
|
||||
Val *string `pulumi:"val"`
|
||||
}
|
||||
|
||||
// TypInput is an input type that accepts TypArgs and TypOutput values.
|
||||
// You can construct a concrete instance of `TypInput` via:
|
||||
//
|
||||
// TypArgs{...}
|
||||
type TypInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToTypOutput() TypOutput
|
||||
ToTypOutputWithContext(context.Context) TypOutput
|
||||
}
|
||||
|
||||
// A test for namespaces (mod 1)
|
||||
type TypArgs struct {
|
||||
Val pulumi.StringPtrInput `pulumi:"val"`
|
||||
}
|
||||
|
||||
func (TypArgs) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*Typ)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (i TypArgs) ToTypOutput() TypOutput {
|
||||
return i.ToTypOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i TypArgs) ToTypOutputWithContext(ctx context.Context) TypOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(TypOutput)
|
||||
}
|
||||
|
||||
func (i TypArgs) ToTypPtrOutput() TypPtrOutput {
|
||||
return i.ToTypPtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i TypArgs) ToTypPtrOutputWithContext(ctx context.Context) TypPtrOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(TypOutput).ToTypPtrOutputWithContext(ctx)
|
||||
}
|
||||
|
||||
// TypPtrInput is an input type that accepts TypArgs, TypPtr and TypPtrOutput values.
|
||||
// You can construct a concrete instance of `TypPtrInput` via:
|
||||
//
|
||||
// TypArgs{...}
|
||||
//
|
||||
// or:
|
||||
//
|
||||
// nil
|
||||
type TypPtrInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToTypPtrOutput() TypPtrOutput
|
||||
ToTypPtrOutputWithContext(context.Context) TypPtrOutput
|
||||
}
|
||||
|
||||
type typPtrType TypArgs
|
||||
|
||||
func TypPtr(v *TypArgs) TypPtrInput {
|
||||
return (*typPtrType)(v)
|
||||
}
|
||||
|
||||
func (*typPtrType) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**Typ)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (i *typPtrType) ToTypPtrOutput() TypPtrOutput {
|
||||
return i.ToTypPtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i *typPtrType) ToTypPtrOutputWithContext(ctx context.Context) TypPtrOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(TypPtrOutput)
|
||||
}
|
||||
|
||||
// A test for namespaces (mod 1)
|
||||
type TypOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (TypOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*Typ)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o TypOutput) ToTypOutput() TypOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o TypOutput) ToTypOutputWithContext(ctx context.Context) TypOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o TypOutput) ToTypPtrOutput() TypPtrOutput {
|
||||
return o.ToTypPtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (o TypOutput) ToTypPtrOutputWithContext(ctx context.Context) TypPtrOutput {
|
||||
return o.ApplyTWithContext(ctx, func(_ context.Context, v Typ) *Typ {
|
||||
return &v
|
||||
}).(TypPtrOutput)
|
||||
}
|
||||
|
||||
func (o TypOutput) Val() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v Typ) *string { return v.Val }).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
type TypPtrOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (TypPtrOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**Typ)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o TypPtrOutput) ToTypPtrOutput() TypPtrOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o TypPtrOutput) ToTypPtrOutputWithContext(ctx context.Context) TypPtrOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o TypPtrOutput) Elem() TypOutput {
|
||||
return o.ApplyT(func(v *Typ) Typ {
|
||||
if v != nil {
|
||||
return *v
|
||||
}
|
||||
var ret Typ
|
||||
return ret
|
||||
}).(TypOutput)
|
||||
}
|
||||
|
||||
func (o TypPtrOutput) Val() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v *Typ) *string {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.Val
|
||||
}).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
func init() {
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*TypInput)(nil)).Elem(), TypArgs{})
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*TypPtrInput)(nil)).Elem(), TypArgs{})
|
||||
pulumi.RegisterOutputType(TypOutput{})
|
||||
pulumi.RegisterOutputType(TypPtrOutput{})
|
||||
}
|
170
pkg/codegen/internal/test/testdata/env-helper/go/example/mod2/pulumiTypes.go
vendored
Normal file
170
pkg/codegen/internal/test/testdata/env-helper/go/example/mod2/pulumiTypes.go
vendored
Normal file
|
@ -0,0 +1,170 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
package mod2
|
||||
|
||||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
|
||||
"env-helper/example/mod1"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
)
|
||||
|
||||
// A test for namespaces (mod 2)
|
||||
type Typ struct {
|
||||
Mod1 *mod1.Typ `pulumi:"mod1"`
|
||||
Val *string `pulumi:"val"`
|
||||
}
|
||||
|
||||
// TypInput is an input type that accepts TypArgs and TypOutput values.
|
||||
// You can construct a concrete instance of `TypInput` via:
|
||||
//
|
||||
// TypArgs{...}
|
||||
type TypInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToTypOutput() TypOutput
|
||||
ToTypOutputWithContext(context.Context) TypOutput
|
||||
}
|
||||
|
||||
// A test for namespaces (mod 2)
|
||||
type TypArgs struct {
|
||||
Mod1 mod1.TypPtrInput `pulumi:"mod1"`
|
||||
Val pulumi.StringPtrInput `pulumi:"val"`
|
||||
}
|
||||
|
||||
func (TypArgs) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*Typ)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (i TypArgs) ToTypOutput() TypOutput {
|
||||
return i.ToTypOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i TypArgs) ToTypOutputWithContext(ctx context.Context) TypOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(TypOutput)
|
||||
}
|
||||
|
||||
func (i TypArgs) ToTypPtrOutput() TypPtrOutput {
|
||||
return i.ToTypPtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i TypArgs) ToTypPtrOutputWithContext(ctx context.Context) TypPtrOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(TypOutput).ToTypPtrOutputWithContext(ctx)
|
||||
}
|
||||
|
||||
// TypPtrInput is an input type that accepts TypArgs, TypPtr and TypPtrOutput values.
|
||||
// You can construct a concrete instance of `TypPtrInput` via:
|
||||
//
|
||||
// TypArgs{...}
|
||||
//
|
||||
// or:
|
||||
//
|
||||
// nil
|
||||
type TypPtrInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToTypPtrOutput() TypPtrOutput
|
||||
ToTypPtrOutputWithContext(context.Context) TypPtrOutput
|
||||
}
|
||||
|
||||
type typPtrType TypArgs
|
||||
|
||||
func TypPtr(v *TypArgs) TypPtrInput {
|
||||
return (*typPtrType)(v)
|
||||
}
|
||||
|
||||
func (*typPtrType) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**Typ)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (i *typPtrType) ToTypPtrOutput() TypPtrOutput {
|
||||
return i.ToTypPtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i *typPtrType) ToTypPtrOutputWithContext(ctx context.Context) TypPtrOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(TypPtrOutput)
|
||||
}
|
||||
|
||||
// A test for namespaces (mod 2)
|
||||
type TypOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (TypOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*Typ)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o TypOutput) ToTypOutput() TypOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o TypOutput) ToTypOutputWithContext(ctx context.Context) TypOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o TypOutput) ToTypPtrOutput() TypPtrOutput {
|
||||
return o.ToTypPtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (o TypOutput) ToTypPtrOutputWithContext(ctx context.Context) TypPtrOutput {
|
||||
return o.ApplyTWithContext(ctx, func(_ context.Context, v Typ) *Typ {
|
||||
return &v
|
||||
}).(TypPtrOutput)
|
||||
}
|
||||
|
||||
func (o TypOutput) Mod1() mod1.TypPtrOutput {
|
||||
return o.ApplyT(func(v Typ) *mod1.Typ { return v.Mod1 }).(mod1.TypPtrOutput)
|
||||
}
|
||||
|
||||
func (o TypOutput) Val() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v Typ) *string { return v.Val }).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
type TypPtrOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (TypPtrOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**Typ)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o TypPtrOutput) ToTypPtrOutput() TypPtrOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o TypPtrOutput) ToTypPtrOutputWithContext(ctx context.Context) TypPtrOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o TypPtrOutput) Elem() TypOutput {
|
||||
return o.ApplyT(func(v *Typ) Typ {
|
||||
if v != nil {
|
||||
return *v
|
||||
}
|
||||
var ret Typ
|
||||
return ret
|
||||
}).(TypOutput)
|
||||
}
|
||||
|
||||
func (o TypPtrOutput) Mod1() mod1.TypPtrOutput {
|
||||
return o.ApplyT(func(v *Typ) *mod1.Typ {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.Mod1
|
||||
}).(mod1.TypPtrOutput)
|
||||
}
|
||||
|
||||
func (o TypPtrOutput) Val() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v *Typ) *string {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.Val
|
||||
}).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
func init() {
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*TypInput)(nil)).Elem(), TypArgs{})
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*TypPtrInput)(nil)).Elem(), TypArgs{})
|
||||
pulumi.RegisterOutputType(TypOutput{})
|
||||
pulumi.RegisterOutputType(TypPtrOutput{})
|
||||
}
|
107
pkg/codegen/internal/test/testdata/env-helper/go/example/moduleTest.go
vendored
Normal file
107
pkg/codegen/internal/test/testdata/env-helper/go/example/moduleTest.go
vendored
Normal file
|
@ -0,0 +1,107 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
package example
|
||||
|
||||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
|
||||
"env-helper/example/mod1"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
)
|
||||
|
||||
type ModuleTest struct {
|
||||
pulumi.CustomResourceState
|
||||
}
|
||||
|
||||
// NewModuleTest registers a new resource with the given unique name, arguments, and options.
|
||||
func NewModuleTest(ctx *pulumi.Context,
|
||||
name string, args *ModuleTestArgs, opts ...pulumi.ResourceOption) (*ModuleTest, error) {
|
||||
if args == nil {
|
||||
args = &ModuleTestArgs{}
|
||||
}
|
||||
|
||||
var resource ModuleTest
|
||||
err := ctx.RegisterResource("example:index:moduleTest", name, args, &resource, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resource, nil
|
||||
}
|
||||
|
||||
// GetModuleTest gets an existing ModuleTest 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 GetModuleTest(ctx *pulumi.Context,
|
||||
name string, id pulumi.IDInput, state *ModuleTestState, opts ...pulumi.ResourceOption) (*ModuleTest, error) {
|
||||
var resource ModuleTest
|
||||
err := ctx.ReadResource("example:index:moduleTest", name, id, state, &resource, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resource, nil
|
||||
}
|
||||
|
||||
// Input properties used for looking up and filtering ModuleTest resources.
|
||||
type moduleTestState struct {
|
||||
}
|
||||
|
||||
type ModuleTestState struct {
|
||||
}
|
||||
|
||||
func (ModuleTestState) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*moduleTestState)(nil)).Elem()
|
||||
}
|
||||
|
||||
type moduleTestArgs struct {
|
||||
Mod1 *mod1.Typ `pulumi:"mod1"`
|
||||
Val *Typ `pulumi:"val"`
|
||||
}
|
||||
|
||||
// The set of arguments for constructing a ModuleTest resource.
|
||||
type ModuleTestArgs struct {
|
||||
Mod1 mod1.TypPtrInput
|
||||
Val TypPtrInput
|
||||
}
|
||||
|
||||
func (ModuleTestArgs) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*moduleTestArgs)(nil)).Elem()
|
||||
}
|
||||
|
||||
type ModuleTestInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToModuleTestOutput() ModuleTestOutput
|
||||
ToModuleTestOutputWithContext(ctx context.Context) ModuleTestOutput
|
||||
}
|
||||
|
||||
func (*ModuleTest) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*ModuleTest)(nil))
|
||||
}
|
||||
|
||||
func (i *ModuleTest) ToModuleTestOutput() ModuleTestOutput {
|
||||
return i.ToModuleTestOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i *ModuleTest) ToModuleTestOutputWithContext(ctx context.Context) ModuleTestOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(ModuleTestOutput)
|
||||
}
|
||||
|
||||
type ModuleTestOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (ModuleTestOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*ModuleTest)(nil))
|
||||
}
|
||||
|
||||
func (o ModuleTestOutput) ToModuleTestOutput() ModuleTestOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o ModuleTestOutput) ToModuleTestOutputWithContext(ctx context.Context) ModuleTestOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func init() {
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*ModuleTestInput)(nil)).Elem(), &ModuleTest{})
|
||||
pulumi.RegisterOutputType(ModuleTestOutput{})
|
||||
}
|
84
pkg/codegen/internal/test/testdata/env-helper/go/example/provider.go
vendored
Normal file
84
pkg/codegen/internal/test/testdata/env-helper/go/example/provider.go
vendored
Normal file
|
@ -0,0 +1,84 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
package example
|
||||
|
||||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
)
|
||||
|
||||
// The provider type for the kubernetes package.
|
||||
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{}
|
||||
}
|
||||
|
||||
var resource Provider
|
||||
err := ctx.RegisterResource("pulumi:providers:example", name, args, &resource, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resource, nil
|
||||
}
|
||||
|
||||
type providerArgs struct {
|
||||
// BETA FEATURE - Options to configure the Helm Release resource.
|
||||
HelmReleaseSettings *HelmReleaseSettings `pulumi:"helmReleaseSettings"`
|
||||
}
|
||||
|
||||
// The set of arguments for constructing a Provider resource.
|
||||
type ProviderArgs struct {
|
||||
// BETA FEATURE - Options to configure the Helm Release resource.
|
||||
HelmReleaseSettings HelmReleaseSettingsPtrInput
|
||||
}
|
||||
|
||||
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))
|
||||
}
|
||||
|
||||
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))
|
||||
}
|
||||
|
||||
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{})
|
||||
}
|
777
pkg/codegen/internal/test/testdata/env-helper/go/example/pulumiTypes.go
vendored
Normal file
777
pkg/codegen/internal/test/testdata/env-helper/go/example/pulumiTypes.go
vendored
Normal file
|
@ -0,0 +1,777 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
package example
|
||||
|
||||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
|
||||
"env-helper/example/mod1"
|
||||
"env-helper/example/mod2"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
)
|
||||
|
||||
// BETA FEATURE - Options to configure the Helm Release resource.
|
||||
type HelmReleaseSettings struct {
|
||||
// The backend storage driver for Helm. Values are: configmap, secret, memory, sql.
|
||||
Driver *string `pulumi:"driver"`
|
||||
// The path to the helm plugins directory.
|
||||
PluginsPath *string `pulumi:"pluginsPath"`
|
||||
// to test required args
|
||||
RequiredArg string `pulumi:"requiredArg"`
|
||||
}
|
||||
|
||||
// HelmReleaseSettingsInput is an input type that accepts HelmReleaseSettingsArgs and HelmReleaseSettingsOutput values.
|
||||
// You can construct a concrete instance of `HelmReleaseSettingsInput` via:
|
||||
//
|
||||
// HelmReleaseSettingsArgs{...}
|
||||
type HelmReleaseSettingsInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToHelmReleaseSettingsOutput() HelmReleaseSettingsOutput
|
||||
ToHelmReleaseSettingsOutputWithContext(context.Context) HelmReleaseSettingsOutput
|
||||
}
|
||||
|
||||
// BETA FEATURE - Options to configure the Helm Release resource.
|
||||
type HelmReleaseSettingsArgs struct {
|
||||
// The backend storage driver for Helm. Values are: configmap, secret, memory, sql.
|
||||
Driver pulumi.StringPtrInput `pulumi:"driver"`
|
||||
// The path to the helm plugins directory.
|
||||
PluginsPath pulumi.StringPtrInput `pulumi:"pluginsPath"`
|
||||
// to test required args
|
||||
RequiredArg pulumi.StringInput `pulumi:"requiredArg"`
|
||||
}
|
||||
|
||||
func (HelmReleaseSettingsArgs) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*HelmReleaseSettings)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (i HelmReleaseSettingsArgs) ToHelmReleaseSettingsOutput() HelmReleaseSettingsOutput {
|
||||
return i.ToHelmReleaseSettingsOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i HelmReleaseSettingsArgs) ToHelmReleaseSettingsOutputWithContext(ctx context.Context) HelmReleaseSettingsOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(HelmReleaseSettingsOutput)
|
||||
}
|
||||
|
||||
func (i HelmReleaseSettingsArgs) ToHelmReleaseSettingsPtrOutput() HelmReleaseSettingsPtrOutput {
|
||||
return i.ToHelmReleaseSettingsPtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i HelmReleaseSettingsArgs) ToHelmReleaseSettingsPtrOutputWithContext(ctx context.Context) HelmReleaseSettingsPtrOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(HelmReleaseSettingsOutput).ToHelmReleaseSettingsPtrOutputWithContext(ctx)
|
||||
}
|
||||
|
||||
// HelmReleaseSettingsPtrInput is an input type that accepts HelmReleaseSettingsArgs, HelmReleaseSettingsPtr and HelmReleaseSettingsPtrOutput values.
|
||||
// You can construct a concrete instance of `HelmReleaseSettingsPtrInput` via:
|
||||
//
|
||||
// HelmReleaseSettingsArgs{...}
|
||||
//
|
||||
// or:
|
||||
//
|
||||
// nil
|
||||
type HelmReleaseSettingsPtrInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToHelmReleaseSettingsPtrOutput() HelmReleaseSettingsPtrOutput
|
||||
ToHelmReleaseSettingsPtrOutputWithContext(context.Context) HelmReleaseSettingsPtrOutput
|
||||
}
|
||||
|
||||
type helmReleaseSettingsPtrType HelmReleaseSettingsArgs
|
||||
|
||||
func HelmReleaseSettingsPtr(v *HelmReleaseSettingsArgs) HelmReleaseSettingsPtrInput {
|
||||
return (*helmReleaseSettingsPtrType)(v)
|
||||
}
|
||||
|
||||
func (*helmReleaseSettingsPtrType) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**HelmReleaseSettings)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (i *helmReleaseSettingsPtrType) ToHelmReleaseSettingsPtrOutput() HelmReleaseSettingsPtrOutput {
|
||||
return i.ToHelmReleaseSettingsPtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i *helmReleaseSettingsPtrType) ToHelmReleaseSettingsPtrOutputWithContext(ctx context.Context) HelmReleaseSettingsPtrOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(HelmReleaseSettingsPtrOutput)
|
||||
}
|
||||
|
||||
// BETA FEATURE - Options to configure the Helm Release resource.
|
||||
type HelmReleaseSettingsOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (HelmReleaseSettingsOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*HelmReleaseSettings)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o HelmReleaseSettingsOutput) ToHelmReleaseSettingsOutput() HelmReleaseSettingsOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o HelmReleaseSettingsOutput) ToHelmReleaseSettingsOutputWithContext(ctx context.Context) HelmReleaseSettingsOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o HelmReleaseSettingsOutput) ToHelmReleaseSettingsPtrOutput() HelmReleaseSettingsPtrOutput {
|
||||
return o.ToHelmReleaseSettingsPtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (o HelmReleaseSettingsOutput) ToHelmReleaseSettingsPtrOutputWithContext(ctx context.Context) HelmReleaseSettingsPtrOutput {
|
||||
return o.ApplyTWithContext(ctx, func(_ context.Context, v HelmReleaseSettings) *HelmReleaseSettings {
|
||||
return &v
|
||||
}).(HelmReleaseSettingsPtrOutput)
|
||||
}
|
||||
|
||||
// The backend storage driver for Helm. Values are: configmap, secret, memory, sql.
|
||||
func (o HelmReleaseSettingsOutput) Driver() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v HelmReleaseSettings) *string { return v.Driver }).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
// The path to the helm plugins directory.
|
||||
func (o HelmReleaseSettingsOutput) PluginsPath() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v HelmReleaseSettings) *string { return v.PluginsPath }).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
// to test required args
|
||||
func (o HelmReleaseSettingsOutput) RequiredArg() pulumi.StringOutput {
|
||||
return o.ApplyT(func(v HelmReleaseSettings) string { return v.RequiredArg }).(pulumi.StringOutput)
|
||||
}
|
||||
|
||||
type HelmReleaseSettingsPtrOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (HelmReleaseSettingsPtrOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**HelmReleaseSettings)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o HelmReleaseSettingsPtrOutput) ToHelmReleaseSettingsPtrOutput() HelmReleaseSettingsPtrOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o HelmReleaseSettingsPtrOutput) ToHelmReleaseSettingsPtrOutputWithContext(ctx context.Context) HelmReleaseSettingsPtrOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o HelmReleaseSettingsPtrOutput) Elem() HelmReleaseSettingsOutput {
|
||||
return o.ApplyT(func(v *HelmReleaseSettings) HelmReleaseSettings {
|
||||
if v != nil {
|
||||
return *v
|
||||
}
|
||||
var ret HelmReleaseSettings
|
||||
return ret
|
||||
}).(HelmReleaseSettingsOutput)
|
||||
}
|
||||
|
||||
// The backend storage driver for Helm. Values are: configmap, secret, memory, sql.
|
||||
func (o HelmReleaseSettingsPtrOutput) Driver() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v *HelmReleaseSettings) *string {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.Driver
|
||||
}).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
// The path to the helm plugins directory.
|
||||
func (o HelmReleaseSettingsPtrOutput) PluginsPath() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v *HelmReleaseSettings) *string {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.PluginsPath
|
||||
}).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
// to test required args
|
||||
func (o HelmReleaseSettingsPtrOutput) RequiredArg() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v *HelmReleaseSettings) *string {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return &v.RequiredArg
|
||||
}).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
// Options for tuning the Kubernetes client used by a Provider.
|
||||
type KubeClientSettings struct {
|
||||
// Maximum burst for throttle. Default value is 10.
|
||||
Burst *int `pulumi:"burst"`
|
||||
// Maximum queries per second (QPS) to the API server from this client. Default value is 5.
|
||||
Qps *float64 `pulumi:"qps"`
|
||||
RecTest *KubeClientSettings `pulumi:"recTest"`
|
||||
}
|
||||
|
||||
// KubeClientSettingsInput is an input type that accepts KubeClientSettingsArgs and KubeClientSettingsOutput values.
|
||||
// You can construct a concrete instance of `KubeClientSettingsInput` via:
|
||||
//
|
||||
// KubeClientSettingsArgs{...}
|
||||
type KubeClientSettingsInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToKubeClientSettingsOutput() KubeClientSettingsOutput
|
||||
ToKubeClientSettingsOutputWithContext(context.Context) KubeClientSettingsOutput
|
||||
}
|
||||
|
||||
// Options for tuning the Kubernetes client used by a Provider.
|
||||
type KubeClientSettingsArgs struct {
|
||||
// Maximum burst for throttle. Default value is 10.
|
||||
Burst pulumi.IntPtrInput `pulumi:"burst"`
|
||||
// Maximum queries per second (QPS) to the API server from this client. Default value is 5.
|
||||
Qps pulumi.Float64PtrInput `pulumi:"qps"`
|
||||
RecTest KubeClientSettingsPtrInput `pulumi:"recTest"`
|
||||
}
|
||||
|
||||
func (KubeClientSettingsArgs) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*KubeClientSettings)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (i KubeClientSettingsArgs) ToKubeClientSettingsOutput() KubeClientSettingsOutput {
|
||||
return i.ToKubeClientSettingsOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i KubeClientSettingsArgs) ToKubeClientSettingsOutputWithContext(ctx context.Context) KubeClientSettingsOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(KubeClientSettingsOutput)
|
||||
}
|
||||
|
||||
func (i KubeClientSettingsArgs) ToKubeClientSettingsPtrOutput() KubeClientSettingsPtrOutput {
|
||||
return i.ToKubeClientSettingsPtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i KubeClientSettingsArgs) ToKubeClientSettingsPtrOutputWithContext(ctx context.Context) KubeClientSettingsPtrOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(KubeClientSettingsOutput).ToKubeClientSettingsPtrOutputWithContext(ctx)
|
||||
}
|
||||
|
||||
// KubeClientSettingsPtrInput is an input type that accepts KubeClientSettingsArgs, KubeClientSettingsPtr and KubeClientSettingsPtrOutput values.
|
||||
// You can construct a concrete instance of `KubeClientSettingsPtrInput` via:
|
||||
//
|
||||
// KubeClientSettingsArgs{...}
|
||||
//
|
||||
// or:
|
||||
//
|
||||
// nil
|
||||
type KubeClientSettingsPtrInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToKubeClientSettingsPtrOutput() KubeClientSettingsPtrOutput
|
||||
ToKubeClientSettingsPtrOutputWithContext(context.Context) KubeClientSettingsPtrOutput
|
||||
}
|
||||
|
||||
type kubeClientSettingsPtrType KubeClientSettingsArgs
|
||||
|
||||
func KubeClientSettingsPtr(v *KubeClientSettingsArgs) KubeClientSettingsPtrInput {
|
||||
return (*kubeClientSettingsPtrType)(v)
|
||||
}
|
||||
|
||||
func (*kubeClientSettingsPtrType) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**KubeClientSettings)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (i *kubeClientSettingsPtrType) ToKubeClientSettingsPtrOutput() KubeClientSettingsPtrOutput {
|
||||
return i.ToKubeClientSettingsPtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i *kubeClientSettingsPtrType) ToKubeClientSettingsPtrOutputWithContext(ctx context.Context) KubeClientSettingsPtrOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(KubeClientSettingsPtrOutput)
|
||||
}
|
||||
|
||||
// Options for tuning the Kubernetes client used by a Provider.
|
||||
type KubeClientSettingsOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (KubeClientSettingsOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*KubeClientSettings)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o KubeClientSettingsOutput) ToKubeClientSettingsOutput() KubeClientSettingsOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o KubeClientSettingsOutput) ToKubeClientSettingsOutputWithContext(ctx context.Context) KubeClientSettingsOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o KubeClientSettingsOutput) ToKubeClientSettingsPtrOutput() KubeClientSettingsPtrOutput {
|
||||
return o.ToKubeClientSettingsPtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (o KubeClientSettingsOutput) ToKubeClientSettingsPtrOutputWithContext(ctx context.Context) KubeClientSettingsPtrOutput {
|
||||
return o.ApplyTWithContext(ctx, func(_ context.Context, v KubeClientSettings) *KubeClientSettings {
|
||||
return &v
|
||||
}).(KubeClientSettingsPtrOutput)
|
||||
}
|
||||
|
||||
// Maximum burst for throttle. Default value is 10.
|
||||
func (o KubeClientSettingsOutput) Burst() pulumi.IntPtrOutput {
|
||||
return o.ApplyT(func(v KubeClientSettings) *int { return v.Burst }).(pulumi.IntPtrOutput)
|
||||
}
|
||||
|
||||
// Maximum queries per second (QPS) to the API server from this client. Default value is 5.
|
||||
func (o KubeClientSettingsOutput) Qps() pulumi.Float64PtrOutput {
|
||||
return o.ApplyT(func(v KubeClientSettings) *float64 { return v.Qps }).(pulumi.Float64PtrOutput)
|
||||
}
|
||||
|
||||
func (o KubeClientSettingsOutput) RecTest() KubeClientSettingsPtrOutput {
|
||||
return o.ApplyT(func(v KubeClientSettings) *KubeClientSettings { return v.RecTest }).(KubeClientSettingsPtrOutput)
|
||||
}
|
||||
|
||||
type KubeClientSettingsPtrOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (KubeClientSettingsPtrOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**KubeClientSettings)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o KubeClientSettingsPtrOutput) ToKubeClientSettingsPtrOutput() KubeClientSettingsPtrOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o KubeClientSettingsPtrOutput) ToKubeClientSettingsPtrOutputWithContext(ctx context.Context) KubeClientSettingsPtrOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o KubeClientSettingsPtrOutput) Elem() KubeClientSettingsOutput {
|
||||
return o.ApplyT(func(v *KubeClientSettings) KubeClientSettings {
|
||||
if v != nil {
|
||||
return *v
|
||||
}
|
||||
var ret KubeClientSettings
|
||||
return ret
|
||||
}).(KubeClientSettingsOutput)
|
||||
}
|
||||
|
||||
// Maximum burst for throttle. Default value is 10.
|
||||
func (o KubeClientSettingsPtrOutput) Burst() pulumi.IntPtrOutput {
|
||||
return o.ApplyT(func(v *KubeClientSettings) *int {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.Burst
|
||||
}).(pulumi.IntPtrOutput)
|
||||
}
|
||||
|
||||
// Maximum queries per second (QPS) to the API server from this client. Default value is 5.
|
||||
func (o KubeClientSettingsPtrOutput) Qps() pulumi.Float64PtrOutput {
|
||||
return o.ApplyT(func(v *KubeClientSettings) *float64 {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.Qps
|
||||
}).(pulumi.Float64PtrOutput)
|
||||
}
|
||||
|
||||
func (o KubeClientSettingsPtrOutput) RecTest() KubeClientSettingsPtrOutput {
|
||||
return o.ApplyT(func(v *KubeClientSettings) *KubeClientSettings {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.RecTest
|
||||
}).(KubeClientSettingsPtrOutput)
|
||||
}
|
||||
|
||||
// Make sure that defaults propagate through types
|
||||
type LayeredType struct {
|
||||
// The answer to the question
|
||||
Answer *float64 `pulumi:"answer"`
|
||||
Other HelmReleaseSettings `pulumi:"other"`
|
||||
// Test how plain types interact
|
||||
PlainOther *HelmReleaseSettings `pulumi:"plainOther"`
|
||||
// The question already answered
|
||||
Question *string `pulumi:"question"`
|
||||
Recursive *LayeredType `pulumi:"recursive"`
|
||||
// To ask and answer
|
||||
Thinker string `pulumi:"thinker"`
|
||||
}
|
||||
|
||||
// LayeredTypeInput is an input type that accepts LayeredTypeArgs and LayeredTypeOutput values.
|
||||
// You can construct a concrete instance of `LayeredTypeInput` via:
|
||||
//
|
||||
// LayeredTypeArgs{...}
|
||||
type LayeredTypeInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToLayeredTypeOutput() LayeredTypeOutput
|
||||
ToLayeredTypeOutputWithContext(context.Context) LayeredTypeOutput
|
||||
}
|
||||
|
||||
// Make sure that defaults propagate through types
|
||||
type LayeredTypeArgs struct {
|
||||
// The answer to the question
|
||||
Answer pulumi.Float64PtrInput `pulumi:"answer"`
|
||||
Other HelmReleaseSettingsInput `pulumi:"other"`
|
||||
// Test how plain types interact
|
||||
PlainOther *HelmReleaseSettingsArgs `pulumi:"plainOther"`
|
||||
// The question already answered
|
||||
Question pulumi.StringPtrInput `pulumi:"question"`
|
||||
Recursive LayeredTypePtrInput `pulumi:"recursive"`
|
||||
// To ask and answer
|
||||
Thinker pulumi.StringInput `pulumi:"thinker"`
|
||||
}
|
||||
|
||||
func (LayeredTypeArgs) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*LayeredType)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (i LayeredTypeArgs) ToLayeredTypeOutput() LayeredTypeOutput {
|
||||
return i.ToLayeredTypeOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i LayeredTypeArgs) ToLayeredTypeOutputWithContext(ctx context.Context) LayeredTypeOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(LayeredTypeOutput)
|
||||
}
|
||||
|
||||
func (i LayeredTypeArgs) ToLayeredTypePtrOutput() LayeredTypePtrOutput {
|
||||
return i.ToLayeredTypePtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i LayeredTypeArgs) ToLayeredTypePtrOutputWithContext(ctx context.Context) LayeredTypePtrOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(LayeredTypeOutput).ToLayeredTypePtrOutputWithContext(ctx)
|
||||
}
|
||||
|
||||
// LayeredTypePtrInput is an input type that accepts LayeredTypeArgs, LayeredTypePtr and LayeredTypePtrOutput values.
|
||||
// You can construct a concrete instance of `LayeredTypePtrInput` via:
|
||||
//
|
||||
// LayeredTypeArgs{...}
|
||||
//
|
||||
// or:
|
||||
//
|
||||
// nil
|
||||
type LayeredTypePtrInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToLayeredTypePtrOutput() LayeredTypePtrOutput
|
||||
ToLayeredTypePtrOutputWithContext(context.Context) LayeredTypePtrOutput
|
||||
}
|
||||
|
||||
type layeredTypePtrType LayeredTypeArgs
|
||||
|
||||
func LayeredTypePtr(v *LayeredTypeArgs) LayeredTypePtrInput {
|
||||
return (*layeredTypePtrType)(v)
|
||||
}
|
||||
|
||||
func (*layeredTypePtrType) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**LayeredType)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (i *layeredTypePtrType) ToLayeredTypePtrOutput() LayeredTypePtrOutput {
|
||||
return i.ToLayeredTypePtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i *layeredTypePtrType) ToLayeredTypePtrOutputWithContext(ctx context.Context) LayeredTypePtrOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(LayeredTypePtrOutput)
|
||||
}
|
||||
|
||||
// Make sure that defaults propagate through types
|
||||
type LayeredTypeOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (LayeredTypeOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*LayeredType)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o LayeredTypeOutput) ToLayeredTypeOutput() LayeredTypeOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o LayeredTypeOutput) ToLayeredTypeOutputWithContext(ctx context.Context) LayeredTypeOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o LayeredTypeOutput) ToLayeredTypePtrOutput() LayeredTypePtrOutput {
|
||||
return o.ToLayeredTypePtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (o LayeredTypeOutput) ToLayeredTypePtrOutputWithContext(ctx context.Context) LayeredTypePtrOutput {
|
||||
return o.ApplyTWithContext(ctx, func(_ context.Context, v LayeredType) *LayeredType {
|
||||
return &v
|
||||
}).(LayeredTypePtrOutput)
|
||||
}
|
||||
|
||||
// The answer to the question
|
||||
func (o LayeredTypeOutput) Answer() pulumi.Float64PtrOutput {
|
||||
return o.ApplyT(func(v LayeredType) *float64 { return v.Answer }).(pulumi.Float64PtrOutput)
|
||||
}
|
||||
|
||||
func (o LayeredTypeOutput) Other() HelmReleaseSettingsOutput {
|
||||
return o.ApplyT(func(v LayeredType) HelmReleaseSettings { return v.Other }).(HelmReleaseSettingsOutput)
|
||||
}
|
||||
|
||||
// Test how plain types interact
|
||||
func (o LayeredTypeOutput) PlainOther() HelmReleaseSettingsPtrOutput {
|
||||
return o.ApplyT(func(v LayeredType) *HelmReleaseSettings { return v.PlainOther }).(HelmReleaseSettingsPtrOutput)
|
||||
}
|
||||
|
||||
// The question already answered
|
||||
func (o LayeredTypeOutput) Question() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v LayeredType) *string { return v.Question }).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
func (o LayeredTypeOutput) Recursive() LayeredTypePtrOutput {
|
||||
return o.ApplyT(func(v LayeredType) *LayeredType { return v.Recursive }).(LayeredTypePtrOutput)
|
||||
}
|
||||
|
||||
// To ask and answer
|
||||
func (o LayeredTypeOutput) Thinker() pulumi.StringOutput {
|
||||
return o.ApplyT(func(v LayeredType) string { return v.Thinker }).(pulumi.StringOutput)
|
||||
}
|
||||
|
||||
type LayeredTypePtrOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (LayeredTypePtrOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**LayeredType)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o LayeredTypePtrOutput) ToLayeredTypePtrOutput() LayeredTypePtrOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o LayeredTypePtrOutput) ToLayeredTypePtrOutputWithContext(ctx context.Context) LayeredTypePtrOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o LayeredTypePtrOutput) Elem() LayeredTypeOutput {
|
||||
return o.ApplyT(func(v *LayeredType) LayeredType {
|
||||
if v != nil {
|
||||
return *v
|
||||
}
|
||||
var ret LayeredType
|
||||
return ret
|
||||
}).(LayeredTypeOutput)
|
||||
}
|
||||
|
||||
// The answer to the question
|
||||
func (o LayeredTypePtrOutput) Answer() pulumi.Float64PtrOutput {
|
||||
return o.ApplyT(func(v *LayeredType) *float64 {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.Answer
|
||||
}).(pulumi.Float64PtrOutput)
|
||||
}
|
||||
|
||||
func (o LayeredTypePtrOutput) Other() HelmReleaseSettingsPtrOutput {
|
||||
return o.ApplyT(func(v *LayeredType) *HelmReleaseSettings {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return &v.Other
|
||||
}).(HelmReleaseSettingsPtrOutput)
|
||||
}
|
||||
|
||||
// Test how plain types interact
|
||||
func (o LayeredTypePtrOutput) PlainOther() HelmReleaseSettingsPtrOutput {
|
||||
return o.ApplyT(func(v *LayeredType) *HelmReleaseSettings {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.PlainOther
|
||||
}).(HelmReleaseSettingsPtrOutput)
|
||||
}
|
||||
|
||||
// The question already answered
|
||||
func (o LayeredTypePtrOutput) Question() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v *LayeredType) *string {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.Question
|
||||
}).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
func (o LayeredTypePtrOutput) Recursive() LayeredTypePtrOutput {
|
||||
return o.ApplyT(func(v *LayeredType) *LayeredType {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.Recursive
|
||||
}).(LayeredTypePtrOutput)
|
||||
}
|
||||
|
||||
// To ask and answer
|
||||
func (o LayeredTypePtrOutput) Thinker() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v *LayeredType) *string {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return &v.Thinker
|
||||
}).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
// A test for namespaces (mod main)
|
||||
type Typ struct {
|
||||
Mod1 *mod1.Typ `pulumi:"mod1"`
|
||||
Mod2 *mod2.Typ `pulumi:"mod2"`
|
||||
Val *string `pulumi:"val"`
|
||||
}
|
||||
|
||||
// TypInput is an input type that accepts TypArgs and TypOutput values.
|
||||
// You can construct a concrete instance of `TypInput` via:
|
||||
//
|
||||
// TypArgs{...}
|
||||
type TypInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToTypOutput() TypOutput
|
||||
ToTypOutputWithContext(context.Context) TypOutput
|
||||
}
|
||||
|
||||
// A test for namespaces (mod main)
|
||||
type TypArgs struct {
|
||||
Mod1 mod1.TypPtrInput `pulumi:"mod1"`
|
||||
Mod2 mod2.TypPtrInput `pulumi:"mod2"`
|
||||
Val pulumi.StringPtrInput `pulumi:"val"`
|
||||
}
|
||||
|
||||
func (TypArgs) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*Typ)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (i TypArgs) ToTypOutput() TypOutput {
|
||||
return i.ToTypOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i TypArgs) ToTypOutputWithContext(ctx context.Context) TypOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(TypOutput)
|
||||
}
|
||||
|
||||
func (i TypArgs) ToTypPtrOutput() TypPtrOutput {
|
||||
return i.ToTypPtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i TypArgs) ToTypPtrOutputWithContext(ctx context.Context) TypPtrOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(TypOutput).ToTypPtrOutputWithContext(ctx)
|
||||
}
|
||||
|
||||
// TypPtrInput is an input type that accepts TypArgs, TypPtr and TypPtrOutput values.
|
||||
// You can construct a concrete instance of `TypPtrInput` via:
|
||||
//
|
||||
// TypArgs{...}
|
||||
//
|
||||
// or:
|
||||
//
|
||||
// nil
|
||||
type TypPtrInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToTypPtrOutput() TypPtrOutput
|
||||
ToTypPtrOutputWithContext(context.Context) TypPtrOutput
|
||||
}
|
||||
|
||||
type typPtrType TypArgs
|
||||
|
||||
func TypPtr(v *TypArgs) TypPtrInput {
|
||||
return (*typPtrType)(v)
|
||||
}
|
||||
|
||||
func (*typPtrType) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**Typ)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (i *typPtrType) ToTypPtrOutput() TypPtrOutput {
|
||||
return i.ToTypPtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i *typPtrType) ToTypPtrOutputWithContext(ctx context.Context) TypPtrOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(TypPtrOutput)
|
||||
}
|
||||
|
||||
// A test for namespaces (mod main)
|
||||
type TypOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (TypOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*Typ)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o TypOutput) ToTypOutput() TypOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o TypOutput) ToTypOutputWithContext(ctx context.Context) TypOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o TypOutput) ToTypPtrOutput() TypPtrOutput {
|
||||
return o.ToTypPtrOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (o TypOutput) ToTypPtrOutputWithContext(ctx context.Context) TypPtrOutput {
|
||||
return o.ApplyTWithContext(ctx, func(_ context.Context, v Typ) *Typ {
|
||||
return &v
|
||||
}).(TypPtrOutput)
|
||||
}
|
||||
|
||||
func (o TypOutput) Mod1() mod1.TypPtrOutput {
|
||||
return o.ApplyT(func(v Typ) *mod1.Typ { return v.Mod1 }).(mod1.TypPtrOutput)
|
||||
}
|
||||
|
||||
func (o TypOutput) Mod2() mod2.TypPtrOutput {
|
||||
return o.ApplyT(func(v Typ) *mod2.Typ { return v.Mod2 }).(mod2.TypPtrOutput)
|
||||
}
|
||||
|
||||
func (o TypOutput) Val() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v Typ) *string { return v.Val }).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
type TypPtrOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (TypPtrOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**Typ)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o TypPtrOutput) ToTypPtrOutput() TypPtrOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o TypPtrOutput) ToTypPtrOutputWithContext(ctx context.Context) TypPtrOutput {
|
||||
return o
|
||||
}
|
||||
|
||||
func (o TypPtrOutput) Elem() TypOutput {
|
||||
return o.ApplyT(func(v *Typ) Typ {
|
||||
if v != nil {
|
||||
return *v
|
||||
}
|
||||
var ret Typ
|
||||
return ret
|
||||
}).(TypOutput)
|
||||
}
|
||||
|
||||
func (o TypPtrOutput) Mod1() mod1.TypPtrOutput {
|
||||
return o.ApplyT(func(v *Typ) *mod1.Typ {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.Mod1
|
||||
}).(mod1.TypPtrOutput)
|
||||
}
|
||||
|
||||
func (o TypPtrOutput) Mod2() mod2.TypPtrOutput {
|
||||
return o.ApplyT(func(v *Typ) *mod2.Typ {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.Mod2
|
||||
}).(mod2.TypPtrOutput)
|
||||
}
|
||||
|
||||
func (o TypPtrOutput) Val() pulumi.StringPtrOutput {
|
||||
return o.ApplyT(func(v *Typ) *string {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.Val
|
||||
}).(pulumi.StringPtrOutput)
|
||||
}
|
||||
|
||||
func init() {
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*HelmReleaseSettingsInput)(nil)).Elem(), HelmReleaseSettingsArgs{})
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*HelmReleaseSettingsPtrInput)(nil)).Elem(), HelmReleaseSettingsArgs{})
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*KubeClientSettingsInput)(nil)).Elem(), KubeClientSettingsArgs{})
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*KubeClientSettingsPtrInput)(nil)).Elem(), KubeClientSettingsArgs{})
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*LayeredTypeInput)(nil)).Elem(), LayeredTypeArgs{})
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*LayeredTypePtrInput)(nil)).Elem(), LayeredTypeArgs{})
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*TypInput)(nil)).Elem(), TypArgs{})
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*TypPtrInput)(nil)).Elem(), TypArgs{})
|
||||
pulumi.RegisterOutputType(HelmReleaseSettingsOutput{})
|
||||
pulumi.RegisterOutputType(HelmReleaseSettingsPtrOutput{})
|
||||
pulumi.RegisterOutputType(KubeClientSettingsOutput{})
|
||||
pulumi.RegisterOutputType(KubeClientSettingsPtrOutput{})
|
||||
pulumi.RegisterOutputType(LayeredTypeOutput{})
|
||||
pulumi.RegisterOutputType(LayeredTypePtrOutput{})
|
||||
pulumi.RegisterOutputType(TypOutput{})
|
||||
pulumi.RegisterOutputType(TypPtrOutput{})
|
||||
}
|
77
pkg/codegen/internal/test/testdata/env-helper/go/example/pulumiUtilities.go
vendored
Normal file
77
pkg/codegen/internal/test/testdata/env-helper/go/example/pulumiUtilities.go
vendored
Normal file
|
@ -0,0 +1,77 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/blang/semver"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
)
|
||||
|
||||
type envParser func(v string) interface{}
|
||||
|
||||
func parseEnvBool(v string) interface{} {
|
||||
b, err := strconv.ParseBool(v)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func parseEnvInt(v string) interface{} {
|
||||
i, err := strconv.ParseInt(v, 0, 0)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return int(i)
|
||||
}
|
||||
|
||||
func parseEnvFloat(v string) interface{} {
|
||||
f, err := strconv.ParseFloat(v, 64)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return f
|
||||
}
|
||||
|
||||
func parseEnvStringArray(v string) interface{} {
|
||||
var result pulumi.StringArray
|
||||
for _, item := range strings.Split(v, ";") {
|
||||
result = append(result, pulumi.String(item))
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} {
|
||||
for _, v := range vars {
|
||||
if value := os.Getenv(v); value != "" {
|
||||
if parser != nil {
|
||||
return parser(value)
|
||||
}
|
||||
return value
|
||||
}
|
||||
}
|
||||
return def
|
||||
}
|
||||
|
||||
// PkgVersion uses reflection to determine the version of the current package.
|
||||
func PkgVersion() (semver.Version, error) {
|
||||
type sentinal struct{}
|
||||
pkgPath := reflect.TypeOf(sentinal{}).PkgPath()
|
||||
re := regexp.MustCompile("^.*/pulumi-example/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{}, fmt.Errorf("failed to determine the package version from %s", pkgPath)
|
||||
}
|
0
pkg/codegen/internal/test/testdata/env-helper/nodejs/README.md
vendored
Normal file
0
pkg/codegen/internal/test/testdata/env-helper/nodejs/README.md
vendored
Normal file
16
pkg/codegen/internal/test/testdata/env-helper/nodejs/codegen-manifest.json
vendored
Normal file
16
pkg/codegen/internal/test/testdata/env-helper/nodejs/codegen-manifest.json
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"emittedFiles": [
|
||||
"README.md",
|
||||
"foo.ts",
|
||||
"funcWithAllOptionalInputs.ts",
|
||||
"index.ts",
|
||||
"moduleTest.ts",
|
||||
"package.json",
|
||||
"provider.ts",
|
||||
"tsconfig.json",
|
||||
"types/index.ts",
|
||||
"types/input.ts",
|
||||
"types/output.ts",
|
||||
"utilities.ts"
|
||||
]
|
||||
}
|
89
pkg/codegen/internal/test/testdata/env-helper/nodejs/foo.ts
vendored
Normal file
89
pkg/codegen/internal/test/testdata/env-helper/nodejs/foo.ts
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import * as pulumi from "@pulumi/pulumi";
|
||||
import { input as inputs, output as outputs } from "./types";
|
||||
import * as utilities from "./utilities";
|
||||
|
||||
/**
|
||||
* test new feature with resoruces
|
||||
*/
|
||||
export class Foo extends pulumi.CustomResource {
|
||||
/**
|
||||
* Get an existing Foo 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 opts Optional settings to control the behavior of the CustomResource.
|
||||
*/
|
||||
public static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): Foo {
|
||||
return new Foo(name, undefined as any, { ...opts, id: id });
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
public static readonly __pulumiType = 'example:index:Foo';
|
||||
|
||||
/**
|
||||
* Returns true if the given object is an instance of Foo. 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 Foo {
|
||||
if (obj === undefined || obj === null) {
|
||||
return false;
|
||||
}
|
||||
return obj['__pulumiType'] === Foo.__pulumiType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A test for plain types
|
||||
*/
|
||||
public /*out*/ readonly defaultKubeClientSettings!: pulumi.Output<outputs.KubeClientSettings | undefined>;
|
||||
|
||||
/**
|
||||
* Create a Foo 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: FooArgs, opts?: pulumi.CustomResourceOptions) {
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (!opts.id) {
|
||||
if ((!args || args.backupKubeClientSettings === undefined) && !opts.urn) {
|
||||
throw new Error("Missing required property 'backupKubeClientSettings'");
|
||||
}
|
||||
resourceInputs["argument"] = args ? args.argument : undefined;
|
||||
resourceInputs["backupKubeClientSettings"] = args ? (args.backupKubeClientSettings ? pulumi.output(args.backupKubeClientSettings).apply(inputs.kubeClientSettingsArgsProvideDefaults) : undefined) : undefined;
|
||||
resourceInputs["kubeClientSettings"] = args ? (args.kubeClientSettings ? pulumi.output(args.kubeClientSettings).apply(inputs.kubeClientSettingsArgsProvideDefaults) : undefined) : undefined;
|
||||
resourceInputs["settings"] = args ? (args.settings ? pulumi.output(args.settings).apply(inputs.layeredTypeArgsProvideDefaults) : undefined) : undefined;
|
||||
resourceInputs["defaultKubeClientSettings"] = undefined /*out*/;
|
||||
} else {
|
||||
resourceInputs["defaultKubeClientSettings"] = undefined /*out*/;
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Foo.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The set of arguments for constructing a Foo resource.
|
||||
*/
|
||||
export interface FooArgs {
|
||||
argument?: string;
|
||||
/**
|
||||
* Options for tuning the Kubernetes client used by a Provider.
|
||||
*/
|
||||
backupKubeClientSettings: pulumi.Input<inputs.KubeClientSettingsArgs>;
|
||||
/**
|
||||
* Options for tuning the Kubernetes client used by a Provider.
|
||||
*/
|
||||
kubeClientSettings?: pulumi.Input<inputs.KubeClientSettingsArgs>;
|
||||
/**
|
||||
* describing things
|
||||
*/
|
||||
settings?: pulumi.Input<inputs.LayeredTypeArgs>;
|
||||
}
|
54
pkg/codegen/internal/test/testdata/env-helper/nodejs/funcWithAllOptionalInputs.ts
vendored
Normal file
54
pkg/codegen/internal/test/testdata/env-helper/nodejs/funcWithAllOptionalInputs.ts
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import * as pulumi from "@pulumi/pulumi";
|
||||
import { input as inputs, output as outputs } from "./types";
|
||||
import * as utilities from "./utilities";
|
||||
|
||||
/**
|
||||
* Check codegen of functions with all optional inputs.
|
||||
*/
|
||||
export function funcWithAllOptionalInputs(args?: FuncWithAllOptionalInputsArgs, opts?: pulumi.InvokeOptions): Promise<FuncWithAllOptionalInputsResult> {
|
||||
args = args || {};
|
||||
if (!opts) {
|
||||
opts = {}
|
||||
}
|
||||
|
||||
if (!opts.version) {
|
||||
opts.version = utilities.getVersion();
|
||||
}
|
||||
return pulumi.runtime.invoke("mypkg::funcWithAllOptionalInputs", {
|
||||
"a": args.a ? inputs.helmReleaseSettingsProvideDefaults(args.a) : undefined,
|
||||
"b": args.b,
|
||||
}, opts);
|
||||
}
|
||||
|
||||
export interface FuncWithAllOptionalInputsArgs {
|
||||
/**
|
||||
* Property A
|
||||
*/
|
||||
a?: inputs.HelmReleaseSettings;
|
||||
/**
|
||||
* Property B
|
||||
*/
|
||||
b?: string;
|
||||
}
|
||||
|
||||
export interface FuncWithAllOptionalInputsResult {
|
||||
readonly r: string;
|
||||
}
|
||||
|
||||
export function funcWithAllOptionalInputsOutput(args?: FuncWithAllOptionalInputsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output<FuncWithAllOptionalInputsResult> {
|
||||
return pulumi.output(args).apply(a => funcWithAllOptionalInputs(a, opts))
|
||||
}
|
||||
|
||||
export interface FuncWithAllOptionalInputsOutputArgs {
|
||||
/**
|
||||
* Property A
|
||||
*/
|
||||
a?: pulumi.Input<inputs.HelmReleaseSettingsArgs>;
|
||||
/**
|
||||
* Property B
|
||||
*/
|
||||
b?: pulumi.Input<string>;
|
||||
}
|
49
pkg/codegen/internal/test/testdata/env-helper/nodejs/index.ts
vendored
Normal file
49
pkg/codegen/internal/test/testdata/env-helper/nodejs/index.ts
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** 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 * from "./foo";
|
||||
export * from "./funcWithAllOptionalInputs";
|
||||
export * from "./moduleTest";
|
||||
export * from "./provider";
|
||||
|
||||
// Export sub-modules:
|
||||
import * as types from "./types";
|
||||
|
||||
export {
|
||||
types,
|
||||
};
|
||||
|
||||
// Import resources to register:
|
||||
import { Foo } from "./foo";
|
||||
import { ModuleTest } from "./moduleTest";
|
||||
|
||||
const _module = {
|
||||
version: utilities.getVersion(),
|
||||
construct: (name: string, type: string, urn: string): pulumi.Resource => {
|
||||
switch (type) {
|
||||
case "example:index:Foo":
|
||||
return new Foo(name, <any>undefined, { urn })
|
||||
case "example:index:moduleTest":
|
||||
return new ModuleTest(name, <any>undefined, { urn })
|
||||
default:
|
||||
throw new Error(`unknown resource type ${type}`);
|
||||
}
|
||||
},
|
||||
};
|
||||
pulumi.runtime.registerResourceModule("example", "index", _module)
|
||||
|
||||
import { Provider } from "./provider";
|
||||
|
||||
pulumi.runtime.registerResourcePackage("example", {
|
||||
version: utilities.getVersion(),
|
||||
constructProvider: (name: string, type: string, urn: string): pulumi.ProviderResource => {
|
||||
if (type !== "pulumi:providers:example") {
|
||||
throw new Error(`unknown provider type ${type}`);
|
||||
}
|
||||
return new Provider(name, <any>undefined, { urn });
|
||||
},
|
||||
});
|
64
pkg/codegen/internal/test/testdata/env-helper/nodejs/moduleTest.ts
vendored
Normal file
64
pkg/codegen/internal/test/testdata/env-helper/nodejs/moduleTest.ts
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import * as pulumi from "@pulumi/pulumi";
|
||||
import { input as inputs, output as outputs } from "./types";
|
||||
import * as utilities from "./utilities";
|
||||
|
||||
export class ModuleTest extends pulumi.CustomResource {
|
||||
/**
|
||||
* Get an existing ModuleTest 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 opts Optional settings to control the behavior of the CustomResource.
|
||||
*/
|
||||
public static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): ModuleTest {
|
||||
return new ModuleTest(name, undefined as any, { ...opts, id: id });
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
public static readonly __pulumiType = 'example:index:moduleTest';
|
||||
|
||||
/**
|
||||
* Returns true if the given object is an instance of ModuleTest. 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 ModuleTest {
|
||||
if (obj === undefined || obj === null) {
|
||||
return false;
|
||||
}
|
||||
return obj['__pulumiType'] === ModuleTest.__pulumiType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a ModuleTest 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?: ModuleTestArgs, opts?: pulumi.CustomResourceOptions) {
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (!opts.id) {
|
||||
resourceInputs["mod1"] = args ? (args.mod1 ? pulumi.output(args.mod1).apply(inputs.mod1.typArgsProvideDefaults) : undefined) : undefined;
|
||||
resourceInputs["val"] = args ? (args.val ? pulumi.output(args.val).apply(inputs.typArgsProvideDefaults) : undefined) : undefined;
|
||||
} else {
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(ModuleTest.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The set of arguments for constructing a ModuleTest resource.
|
||||
*/
|
||||
export interface ModuleTestArgs {
|
||||
mod1?: pulumi.Input<inputs.mod1.TypArgs>;
|
||||
val?: pulumi.Input<inputs.TypArgs>;
|
||||
}
|
16
pkg/codegen/internal/test/testdata/env-helper/nodejs/package.json
vendored
Normal file
16
pkg/codegen/internal/test/testdata/env-helper/nodejs/package.json
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "@pulumi/example",
|
||||
"version": "${VERSION}",
|
||||
"scripts": {
|
||||
"build": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pulumi/pulumi": "^3.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^3.7.0"
|
||||
},
|
||||
"pulumi": {
|
||||
"resource": true
|
||||
}
|
||||
}
|
55
pkg/codegen/internal/test/testdata/env-helper/nodejs/provider.ts
vendored
Normal file
55
pkg/codegen/internal/test/testdata/env-helper/nodejs/provider.ts
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import * as pulumi from "@pulumi/pulumi";
|
||||
import { input as inputs, output as outputs } from "./types";
|
||||
import * as utilities from "./utilities";
|
||||
|
||||
/**
|
||||
* The provider type for the kubernetes package.
|
||||
*/
|
||||
export class Provider extends pulumi.ProviderResource {
|
||||
/** @internal */
|
||||
public static readonly __pulumiType = 'example';
|
||||
|
||||
/**
|
||||
* 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'] === 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["helmReleaseSettings"] = pulumi.output(args ? (args.helmReleaseSettings ? pulumi.output(args.helmReleaseSettings).apply(inputs.helmReleaseSettingsArgsProvideDefaults) : undefined) : undefined).apply(JSON.stringify);
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The set of arguments for constructing a Provider resource.
|
||||
*/
|
||||
export interface ProviderArgs {
|
||||
/**
|
||||
* BETA FEATURE - Options to configure the Helm Release resource.
|
||||
*/
|
||||
helmReleaseSettings?: pulumi.Input<inputs.HelmReleaseSettingsArgs>;
|
||||
}
|
26
pkg/codegen/internal/test/testdata/env-helper/nodejs/tsconfig.json
vendored
Normal file
26
pkg/codegen/internal/test/testdata/env-helper/nodejs/tsconfig.json
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "bin",
|
||||
"target": "es2016",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"declaration": true,
|
||||
"sourceMap": true,
|
||||
"stripInternal": true,
|
||||
"experimentalDecorators": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true
|
||||
},
|
||||
"files": [
|
||||
"foo.ts",
|
||||
"funcWithAllOptionalInputs.ts",
|
||||
"index.ts",
|
||||
"moduleTest.ts",
|
||||
"provider.ts",
|
||||
"types/index.ts",
|
||||
"types/input.ts",
|
||||
"types/output.ts",
|
||||
"utilities.ts"
|
||||
]
|
||||
}
|
11
pkg/codegen/internal/test/testdata/env-helper/nodejs/types/index.ts
vendored
Normal file
11
pkg/codegen/internal/test/testdata/env-helper/nodejs/types/index.ts
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
// Export sub-modules:
|
||||
import * as input from "./input";
|
||||
import * as output from "./output";
|
||||
|
||||
export {
|
||||
input,
|
||||
output,
|
||||
};
|
184
pkg/codegen/internal/test/testdata/env-helper/nodejs/types/input.ts
vendored
Normal file
184
pkg/codegen/internal/test/testdata/env-helper/nodejs/types/input.ts
vendored
Normal file
|
@ -0,0 +1,184 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import * as pulumi from "@pulumi/pulumi";
|
||||
import { input as inputs, output as outputs } from "../types";
|
||||
|
||||
import * as utilities from "../utilities";
|
||||
|
||||
/**
|
||||
* BETA FEATURE - Options to configure the Helm Release resource.
|
||||
*/
|
||||
export interface HelmReleaseSettings {
|
||||
/**
|
||||
* The backend storage driver for Helm. Values are: configmap, secret, memory, sql.
|
||||
*/
|
||||
driver?: string;
|
||||
/**
|
||||
* The path to the helm plugins directory.
|
||||
*/
|
||||
pluginsPath?: string;
|
||||
/**
|
||||
* to test required args
|
||||
*/
|
||||
requiredArg: string;
|
||||
}
|
||||
/**
|
||||
* helmReleaseSettingsProvideDefaults sets the appropriate defaults for HelmReleaseSettings
|
||||
*/
|
||||
export function helmReleaseSettingsProvideDefaults(val: HelmReleaseSettings): HelmReleaseSettings {
|
||||
return {
|
||||
...val,
|
||||
driver: (val.driver) ?? (utilities.getEnv("PULUMI_K8S_HELM_DRIVER") || "secret"),
|
||||
pluginsPath: (val.pluginsPath) ?? utilities.getEnv("PULUMI_K8S_HELM_PLUGINS_PATH"),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* BETA FEATURE - Options to configure the Helm Release resource.
|
||||
*/
|
||||
export interface HelmReleaseSettingsArgs {
|
||||
/**
|
||||
* The backend storage driver for Helm. Values are: configmap, secret, memory, sql.
|
||||
*/
|
||||
driver?: pulumi.Input<string>;
|
||||
/**
|
||||
* The path to the helm plugins directory.
|
||||
*/
|
||||
pluginsPath?: pulumi.Input<string>;
|
||||
/**
|
||||
* to test required args
|
||||
*/
|
||||
requiredArg: pulumi.Input<string>;
|
||||
}
|
||||
/**
|
||||
* helmReleaseSettingsArgsProvideDefaults sets the appropriate defaults for HelmReleaseSettingsArgs
|
||||
*/
|
||||
export function helmReleaseSettingsArgsProvideDefaults(val: HelmReleaseSettingsArgs): HelmReleaseSettingsArgs {
|
||||
return {
|
||||
...val,
|
||||
driver: (val.driver) ?? (utilities.getEnv("PULUMI_K8S_HELM_DRIVER") || "secret"),
|
||||
pluginsPath: (val.pluginsPath) ?? utilities.getEnv("PULUMI_K8S_HELM_PLUGINS_PATH"),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for tuning the Kubernetes client used by a Provider.
|
||||
*/
|
||||
export interface KubeClientSettingsArgs {
|
||||
/**
|
||||
* Maximum burst for throttle. Default value is 10.
|
||||
*/
|
||||
burst?: pulumi.Input<number>;
|
||||
/**
|
||||
* Maximum queries per second (QPS) to the API server from this client. Default value is 5.
|
||||
*/
|
||||
qps?: pulumi.Input<number>;
|
||||
recTest?: pulumi.Input<inputs.KubeClientSettingsArgs>;
|
||||
}
|
||||
/**
|
||||
* kubeClientSettingsArgsProvideDefaults sets the appropriate defaults for KubeClientSettingsArgs
|
||||
*/
|
||||
export function kubeClientSettingsArgsProvideDefaults(val: KubeClientSettingsArgs): KubeClientSettingsArgs {
|
||||
return {
|
||||
...val,
|
||||
burst: (val.burst) ?? utilities.getEnvNumber("PULUMI_K8S_CLIENT_BURST"),
|
||||
qps: (val.qps) ?? utilities.getEnvNumber("PULUMI_K8S_CLIENT_QPS"),
|
||||
recTest: (val.recTest ? pulumi.output(val.recTest).apply(inputs.kubeClientSettingsArgsProvideDefaults) : undefined),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Make sure that defaults propagate through types
|
||||
*/
|
||||
export interface LayeredTypeArgs {
|
||||
/**
|
||||
* The answer to the question
|
||||
*/
|
||||
answer?: pulumi.Input<number>;
|
||||
other: pulumi.Input<inputs.HelmReleaseSettingsArgs>;
|
||||
/**
|
||||
* Test how plain types interact
|
||||
*/
|
||||
plainOther?: inputs.HelmReleaseSettingsArgs;
|
||||
/**
|
||||
* The question already answered
|
||||
*/
|
||||
question?: pulumi.Input<string>;
|
||||
recursive?: pulumi.Input<inputs.LayeredTypeArgs>;
|
||||
/**
|
||||
* To ask and answer
|
||||
*/
|
||||
thinker: pulumi.Input<string>;
|
||||
}
|
||||
/**
|
||||
* layeredTypeArgsProvideDefaults sets the appropriate defaults for LayeredTypeArgs
|
||||
*/
|
||||
export function layeredTypeArgsProvideDefaults(val: LayeredTypeArgs): LayeredTypeArgs {
|
||||
return {
|
||||
...val,
|
||||
answer: (val.answer) ?? 42,
|
||||
other: pulumi.output(val.other).apply(inputs.helmReleaseSettingsArgsProvideDefaults),
|
||||
plainOther: (val.plainOther ? inputs.helmReleaseSettingsArgsProvideDefaults(val.plainOther) : undefined),
|
||||
question: (val.question) ?? (utilities.getEnv("PULUMI_THE_QUESTION") || "<unknown>"),
|
||||
recursive: (val.recursive ? pulumi.output(val.recursive).apply(inputs.layeredTypeArgsProvideDefaults) : undefined),
|
||||
thinker: (val.thinker) ?? "not a good interaction",
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* A test for namespaces (mod main)
|
||||
*/
|
||||
export interface TypArgs {
|
||||
mod1?: pulumi.Input<inputs.mod1.TypArgs>;
|
||||
mod2?: pulumi.Input<inputs.mod2.TypArgs>;
|
||||
val?: pulumi.Input<string>;
|
||||
}
|
||||
/**
|
||||
* typArgsProvideDefaults sets the appropriate defaults for TypArgs
|
||||
*/
|
||||
export function typArgsProvideDefaults(val: TypArgs): TypArgs {
|
||||
return {
|
||||
...val,
|
||||
mod1: (val.mod1 ? pulumi.output(val.mod1).apply(inputs.mod1.typArgsProvideDefaults) : undefined),
|
||||
mod2: (val.mod2 ? pulumi.output(val.mod2).apply(inputs.mod2.typArgsProvideDefaults) : undefined),
|
||||
val: (val.val) ?? "mod main",
|
||||
};
|
||||
}
|
||||
export namespace mod1 {
|
||||
/**
|
||||
* A test for namespaces (mod 1)
|
||||
*/
|
||||
export interface TypArgs {
|
||||
val?: pulumi.Input<string>;
|
||||
}
|
||||
/**
|
||||
* typArgsProvideDefaults sets the appropriate defaults for TypArgs
|
||||
*/
|
||||
export function typArgsProvideDefaults(val: TypArgs): TypArgs {
|
||||
return {
|
||||
...val,
|
||||
val: (val.val) ?? "mod1",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export namespace mod2 {
|
||||
/**
|
||||
* A test for namespaces (mod 2)
|
||||
*/
|
||||
export interface TypArgs {
|
||||
mod1?: pulumi.Input<inputs.mod1.TypArgs>;
|
||||
val?: pulumi.Input<string>;
|
||||
}
|
||||
/**
|
||||
* typArgsProvideDefaults sets the appropriate defaults for TypArgs
|
||||
*/
|
||||
export function typArgsProvideDefaults(val: TypArgs): TypArgs {
|
||||
return {
|
||||
...val,
|
||||
mod1: (val.mod1 ? pulumi.output(val.mod1).apply(inputs.mod1.typArgsProvideDefaults) : undefined),
|
||||
val: (val.val) ?? "mod2",
|
||||
};
|
||||
}
|
||||
}
|
39
pkg/codegen/internal/test/testdata/env-helper/nodejs/types/output.ts
vendored
Normal file
39
pkg/codegen/internal/test/testdata/env-helper/nodejs/types/output.ts
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import * as pulumi from "@pulumi/pulumi";
|
||||
import { input as inputs, output as outputs } from "../types";
|
||||
|
||||
import * as utilities from "../utilities";
|
||||
|
||||
/**
|
||||
* Options for tuning the Kubernetes client used by a Provider.
|
||||
*/
|
||||
export interface KubeClientSettings {
|
||||
/**
|
||||
* Maximum burst for throttle. Default value is 10.
|
||||
*/
|
||||
burst?: number;
|
||||
/**
|
||||
* Maximum queries per second (QPS) to the API server from this client. Default value is 5.
|
||||
*/
|
||||
qps?: number;
|
||||
recTest?: outputs.KubeClientSettings;
|
||||
}
|
||||
/**
|
||||
* kubeClientSettingsProvideDefaults sets the appropriate defaults for KubeClientSettings
|
||||
*/
|
||||
export function kubeClientSettingsProvideDefaults(val: KubeClientSettings): KubeClientSettings {
|
||||
return {
|
||||
...val,
|
||||
burst: (val.burst) ?? utilities.getEnvNumber("PULUMI_K8S_CLIENT_BURST"),
|
||||
qps: (val.qps) ?? utilities.getEnvNumber("PULUMI_K8S_CLIENT_QPS"),
|
||||
recTest: (val.recTest ? outputs.kubeClientSettingsProvideDefaults(val.recTest) : undefined),
|
||||
};
|
||||
}
|
||||
|
||||
export namespace mod1 {
|
||||
}
|
||||
|
||||
export namespace mod2 {
|
||||
}
|
49
pkg/codegen/internal/test/testdata/env-helper/nodejs/utilities.ts
vendored
Normal file
49
pkg/codegen/internal/test/testdata/env-helper/nodejs/utilities.ts
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
// *** WARNING: this file was generated by test. ***
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
|
||||
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;
|
||||
}
|
19
pkg/codegen/internal/test/testdata/env-helper/python/codegen-manifest.json
vendored
Normal file
19
pkg/codegen/internal/test/testdata/env-helper/python/codegen-manifest.json
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"emittedFiles": [
|
||||
"pulumi_example/README.md",
|
||||
"pulumi_example/__init__.py",
|
||||
"pulumi_example/_inputs.py",
|
||||
"pulumi_example/_utilities.py",
|
||||
"pulumi_example/foo.py",
|
||||
"pulumi_example/func_with_all_optional_inputs.py",
|
||||
"pulumi_example/mod1/__init__.py",
|
||||
"pulumi_example/mod1/_inputs.py",
|
||||
"pulumi_example/mod2/__init__.py",
|
||||
"pulumi_example/mod2/_inputs.py",
|
||||
"pulumi_example/module_test.py",
|
||||
"pulumi_example/outputs.py",
|
||||
"pulumi_example/provider.py",
|
||||
"pulumi_example/py.typed",
|
||||
"setup.py"
|
||||
]
|
||||
}
|
0
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/README.md
vendored
Normal file
0
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/README.md
vendored
Normal file
49
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/__init__.py
vendored
Normal file
49
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/__init__.py
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
# coding=utf-8
|
||||
# *** WARNING: this file was generated by test. ***
|
||||
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
from . import _utilities
|
||||
import typing
|
||||
# Export this package's modules as members:
|
||||
from .foo import *
|
||||
from .func_with_all_optional_inputs import *
|
||||
from .module_test import *
|
||||
from .provider import *
|
||||
from ._inputs import *
|
||||
from . import outputs
|
||||
|
||||
# Make subpackages available:
|
||||
if typing.TYPE_CHECKING:
|
||||
import pulumi_example.mod1 as __mod1
|
||||
mod1 = __mod1
|
||||
import pulumi_example.mod2 as __mod2
|
||||
mod2 = __mod2
|
||||
else:
|
||||
mod1 = _utilities.lazy_import('pulumi_example.mod1')
|
||||
mod2 = _utilities.lazy_import('pulumi_example.mod2')
|
||||
|
||||
_utilities.register(
|
||||
resource_modules="""
|
||||
[
|
||||
{
|
||||
"pkg": "example",
|
||||
"mod": "index",
|
||||
"fqn": "pulumi_example",
|
||||
"classes": {
|
||||
"example:index:Foo": "Foo",
|
||||
"example:index:moduleTest": "ModuleTest"
|
||||
}
|
||||
}
|
||||
]
|
||||
""",
|
||||
resource_packages="""
|
||||
[
|
||||
{
|
||||
"pkg": "example",
|
||||
"token": "pulumi:providers:example",
|
||||
"fqn": "pulumi_example",
|
||||
"class": "Provider"
|
||||
}
|
||||
]
|
||||
"""
|
||||
)
|
340
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/_inputs.py
vendored
Normal file
340
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/_inputs.py
vendored
Normal file
|
@ -0,0 +1,340 @@
|
|||
# coding=utf-8
|
||||
# *** WARNING: this file was generated by test. ***
|
||||
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import warnings
|
||||
import pulumi
|
||||
import pulumi.runtime
|
||||
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
||||
from . import _utilities
|
||||
from . import mod1 as _mod1
|
||||
from . import mod2 as _mod2
|
||||
|
||||
__all__ = [
|
||||
'HelmReleaseSettings',
|
||||
'HelmReleaseSettingsArgs',
|
||||
'KubeClientSettingsArgs',
|
||||
'LayeredTypeArgs',
|
||||
'TypArgs',
|
||||
]
|
||||
|
||||
@pulumi.input_type
|
||||
class HelmReleaseSettings:
|
||||
def __init__(__self__, *,
|
||||
required_arg: str,
|
||||
driver: Optional[str] = None,
|
||||
plugins_path: Optional[str] = None):
|
||||
"""
|
||||
BETA FEATURE - Options to configure the Helm Release resource.
|
||||
:param str required_arg: to test required args
|
||||
:param str driver: The backend storage driver for Helm. Values are: configmap, secret, memory, sql.
|
||||
:param str plugins_path: The path to the helm plugins directory.
|
||||
"""
|
||||
pulumi.set(__self__, "required_arg", required_arg)
|
||||
if driver is None:
|
||||
driver = (_utilities.get_env('PULUMI_K8S_HELM_DRIVER') or 'secret')
|
||||
if driver is not None:
|
||||
pulumi.set(__self__, "driver", driver)
|
||||
if plugins_path is None:
|
||||
plugins_path = _utilities.get_env('PULUMI_K8S_HELM_PLUGINS_PATH')
|
||||
if plugins_path is not None:
|
||||
pulumi.set(__self__, "plugins_path", plugins_path)
|
||||
|
||||
@property
|
||||
@pulumi.getter(name="requiredArg")
|
||||
def required_arg(self) -> str:
|
||||
"""
|
||||
to test required args
|
||||
"""
|
||||
return pulumi.get(self, "required_arg")
|
||||
|
||||
@required_arg.setter
|
||||
def required_arg(self, value: str):
|
||||
pulumi.set(self, "required_arg", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def driver(self) -> Optional[str]:
|
||||
"""
|
||||
The backend storage driver for Helm. Values are: configmap, secret, memory, sql.
|
||||
"""
|
||||
return pulumi.get(self, "driver")
|
||||
|
||||
@driver.setter
|
||||
def driver(self, value: Optional[str]):
|
||||
pulumi.set(self, "driver", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter(name="pluginsPath")
|
||||
def plugins_path(self) -> Optional[str]:
|
||||
"""
|
||||
The path to the helm plugins directory.
|
||||
"""
|
||||
return pulumi.get(self, "plugins_path")
|
||||
|
||||
@plugins_path.setter
|
||||
def plugins_path(self, value: Optional[str]):
|
||||
pulumi.set(self, "plugins_path", value)
|
||||
|
||||
|
||||
@pulumi.input_type
|
||||
class HelmReleaseSettingsArgs:
|
||||
def __init__(__self__, *,
|
||||
required_arg: pulumi.Input[str],
|
||||
driver: Optional[pulumi.Input[str]] = None,
|
||||
plugins_path: Optional[pulumi.Input[str]] = None):
|
||||
"""
|
||||
BETA FEATURE - Options to configure the Helm Release resource.
|
||||
:param pulumi.Input[str] required_arg: to test required args
|
||||
:param pulumi.Input[str] driver: The backend storage driver for Helm. Values are: configmap, secret, memory, sql.
|
||||
:param pulumi.Input[str] plugins_path: The path to the helm plugins directory.
|
||||
"""
|
||||
pulumi.set(__self__, "required_arg", required_arg)
|
||||
if driver is None:
|
||||
driver = (_utilities.get_env('PULUMI_K8S_HELM_DRIVER') or 'secret')
|
||||
if driver is not None:
|
||||
pulumi.set(__self__, "driver", driver)
|
||||
if plugins_path is None:
|
||||
plugins_path = _utilities.get_env('PULUMI_K8S_HELM_PLUGINS_PATH')
|
||||
if plugins_path is not None:
|
||||
pulumi.set(__self__, "plugins_path", plugins_path)
|
||||
|
||||
@property
|
||||
@pulumi.getter(name="requiredArg")
|
||||
def required_arg(self) -> pulumi.Input[str]:
|
||||
"""
|
||||
to test required args
|
||||
"""
|
||||
return pulumi.get(self, "required_arg")
|
||||
|
||||
@required_arg.setter
|
||||
def required_arg(self, value: pulumi.Input[str]):
|
||||
pulumi.set(self, "required_arg", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def driver(self) -> Optional[pulumi.Input[str]]:
|
||||
"""
|
||||
The backend storage driver for Helm. Values are: configmap, secret, memory, sql.
|
||||
"""
|
||||
return pulumi.get(self, "driver")
|
||||
|
||||
@driver.setter
|
||||
def driver(self, value: Optional[pulumi.Input[str]]):
|
||||
pulumi.set(self, "driver", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter(name="pluginsPath")
|
||||
def plugins_path(self) -> Optional[pulumi.Input[str]]:
|
||||
"""
|
||||
The path to the helm plugins directory.
|
||||
"""
|
||||
return pulumi.get(self, "plugins_path")
|
||||
|
||||
@plugins_path.setter
|
||||
def plugins_path(self, value: Optional[pulumi.Input[str]]):
|
||||
pulumi.set(self, "plugins_path", value)
|
||||
|
||||
|
||||
@pulumi.input_type
|
||||
class KubeClientSettingsArgs:
|
||||
def __init__(__self__, *,
|
||||
burst: Optional[pulumi.Input[int]] = None,
|
||||
qps: Optional[pulumi.Input[float]] = None,
|
||||
rec_test: Optional[pulumi.Input['KubeClientSettingsArgs']] = None):
|
||||
"""
|
||||
Options for tuning the Kubernetes client used by a Provider.
|
||||
:param pulumi.Input[int] burst: Maximum burst for throttle. Default value is 10.
|
||||
:param pulumi.Input[float] qps: Maximum queries per second (QPS) to the API server from this client. Default value is 5.
|
||||
"""
|
||||
if burst is None:
|
||||
burst = _utilities.get_env_int('PULUMI_K8S_CLIENT_BURST')
|
||||
if burst is not None:
|
||||
pulumi.set(__self__, "burst", burst)
|
||||
if qps is None:
|
||||
qps = _utilities.get_env_float('PULUMI_K8S_CLIENT_QPS')
|
||||
if qps is not None:
|
||||
pulumi.set(__self__, "qps", qps)
|
||||
if rec_test is not None:
|
||||
pulumi.set(__self__, "rec_test", rec_test)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def burst(self) -> Optional[pulumi.Input[int]]:
|
||||
"""
|
||||
Maximum burst for throttle. Default value is 10.
|
||||
"""
|
||||
return pulumi.get(self, "burst")
|
||||
|
||||
@burst.setter
|
||||
def burst(self, value: Optional[pulumi.Input[int]]):
|
||||
pulumi.set(self, "burst", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def qps(self) -> Optional[pulumi.Input[float]]:
|
||||
"""
|
||||
Maximum queries per second (QPS) to the API server from this client. Default value is 5.
|
||||
"""
|
||||
return pulumi.get(self, "qps")
|
||||
|
||||
@qps.setter
|
||||
def qps(self, value: Optional[pulumi.Input[float]]):
|
||||
pulumi.set(self, "qps", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter(name="recTest")
|
||||
def rec_test(self) -> Optional[pulumi.Input['KubeClientSettingsArgs']]:
|
||||
return pulumi.get(self, "rec_test")
|
||||
|
||||
@rec_test.setter
|
||||
def rec_test(self, value: Optional[pulumi.Input['KubeClientSettingsArgs']]):
|
||||
pulumi.set(self, "rec_test", value)
|
||||
|
||||
|
||||
@pulumi.input_type
|
||||
class LayeredTypeArgs:
|
||||
def __init__(__self__, *,
|
||||
other: pulumi.Input['HelmReleaseSettingsArgs'],
|
||||
thinker: pulumi.Input[str],
|
||||
answer: Optional[pulumi.Input[float]] = None,
|
||||
plain_other: Optional['HelmReleaseSettingsArgs'] = None,
|
||||
question: Optional[pulumi.Input[str]] = None,
|
||||
recursive: Optional[pulumi.Input['LayeredTypeArgs']] = None):
|
||||
"""
|
||||
Make sure that defaults propagate through types
|
||||
:param pulumi.Input[str] thinker: To ask and answer
|
||||
:param pulumi.Input[float] answer: The answer to the question
|
||||
:param 'HelmReleaseSettingsArgs' plain_other: Test how plain types interact
|
||||
:param pulumi.Input[str] question: The question already answered
|
||||
"""
|
||||
pulumi.set(__self__, "other", other)
|
||||
if thinker is None:
|
||||
thinker = 'not a good interaction'
|
||||
pulumi.set(__self__, "thinker", thinker)
|
||||
if answer is None:
|
||||
answer = 42
|
||||
if answer is not None:
|
||||
pulumi.set(__self__, "answer", answer)
|
||||
if plain_other is not None:
|
||||
pulumi.set(__self__, "plain_other", plain_other)
|
||||
if question is None:
|
||||
question = (_utilities.get_env('PULUMI_THE_QUESTION') or '<unknown>')
|
||||
if question is not None:
|
||||
pulumi.set(__self__, "question", question)
|
||||
if recursive is not None:
|
||||
pulumi.set(__self__, "recursive", recursive)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def other(self) -> pulumi.Input['HelmReleaseSettingsArgs']:
|
||||
return pulumi.get(self, "other")
|
||||
|
||||
@other.setter
|
||||
def other(self, value: pulumi.Input['HelmReleaseSettingsArgs']):
|
||||
pulumi.set(self, "other", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def thinker(self) -> pulumi.Input[str]:
|
||||
"""
|
||||
To ask and answer
|
||||
"""
|
||||
return pulumi.get(self, "thinker")
|
||||
|
||||
@thinker.setter
|
||||
def thinker(self, value: pulumi.Input[str]):
|
||||
pulumi.set(self, "thinker", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def answer(self) -> Optional[pulumi.Input[float]]:
|
||||
"""
|
||||
The answer to the question
|
||||
"""
|
||||
return pulumi.get(self, "answer")
|
||||
|
||||
@answer.setter
|
||||
def answer(self, value: Optional[pulumi.Input[float]]):
|
||||
pulumi.set(self, "answer", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter(name="plainOther")
|
||||
def plain_other(self) -> Optional['HelmReleaseSettingsArgs']:
|
||||
"""
|
||||
Test how plain types interact
|
||||
"""
|
||||
return pulumi.get(self, "plain_other")
|
||||
|
||||
@plain_other.setter
|
||||
def plain_other(self, value: Optional['HelmReleaseSettingsArgs']):
|
||||
pulumi.set(self, "plain_other", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def question(self) -> Optional[pulumi.Input[str]]:
|
||||
"""
|
||||
The question already answered
|
||||
"""
|
||||
return pulumi.get(self, "question")
|
||||
|
||||
@question.setter
|
||||
def question(self, value: Optional[pulumi.Input[str]]):
|
||||
pulumi.set(self, "question", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def recursive(self) -> Optional[pulumi.Input['LayeredTypeArgs']]:
|
||||
return pulumi.get(self, "recursive")
|
||||
|
||||
@recursive.setter
|
||||
def recursive(self, value: Optional[pulumi.Input['LayeredTypeArgs']]):
|
||||
pulumi.set(self, "recursive", value)
|
||||
|
||||
|
||||
@pulumi.input_type
|
||||
class TypArgs:
|
||||
def __init__(__self__, *,
|
||||
mod1: Optional[pulumi.Input['_mod1.TypArgs']] = None,
|
||||
mod2: Optional[pulumi.Input['_mod2.TypArgs']] = None,
|
||||
val: Optional[pulumi.Input[str]] = None):
|
||||
"""
|
||||
A test for namespaces (mod main)
|
||||
"""
|
||||
if mod1 is not None:
|
||||
pulumi.set(__self__, "mod1", mod1)
|
||||
if mod2 is not None:
|
||||
pulumi.set(__self__, "mod2", mod2)
|
||||
if val is None:
|
||||
val = 'mod main'
|
||||
if val is not None:
|
||||
pulumi.set(__self__, "val", val)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def mod1(self) -> Optional[pulumi.Input['_mod1.TypArgs']]:
|
||||
return pulumi.get(self, "mod1")
|
||||
|
||||
@mod1.setter
|
||||
def mod1(self, value: Optional[pulumi.Input['_mod1.TypArgs']]):
|
||||
pulumi.set(self, "mod1", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def mod2(self) -> Optional[pulumi.Input['_mod2.TypArgs']]:
|
||||
return pulumi.get(self, "mod2")
|
||||
|
||||
@mod2.setter
|
||||
def mod2(self, value: Optional[pulumi.Input['_mod2.TypArgs']]):
|
||||
pulumi.set(self, "mod2", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def val(self) -> Optional[pulumi.Input[str]]:
|
||||
return pulumi.get(self, "val")
|
||||
|
||||
@val.setter
|
||||
def val(self, value: Optional[pulumi.Input[str]]):
|
||||
pulumi.set(self, "val", value)
|
||||
|
||||
|
236
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/_utilities.py
vendored
Normal file
236
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/_utilities.py
vendored
Normal file
|
@ -0,0 +1,236 @@
|
|||
# coding=utf-8
|
||||
# *** WARNING: this file was generated by test. ***
|
||||
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
|
||||
import importlib.util
|
||||
import inspect
|
||||
import json
|
||||
import os
|
||||
import pkg_resources
|
||||
import sys
|
||||
import typing
|
||||
|
||||
import pulumi
|
||||
import pulumi.runtime
|
||||
|
||||
from semver import VersionInfo as SemverVersion
|
||||
from parver import Version as PEP440Version
|
||||
|
||||
|
||||
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 = pkg_resources.require(root_package)[0].version
|
||||
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:
|
||||
prerelease = f"dev.{pep440_version.dev}"
|
||||
|
||||
# The only significant difference between PEP440 and semver as it pertains to us is that PEP440 has explicit support
|
||||
# for dev builds, while semver encodes them as "prerelease" versions. In order 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.
|
||||
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_version():
|
||||
return _version_str
|
||||
|
||||
|
||||
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)
|
180
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/foo.py
vendored
Normal file
180
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/foo.py
vendored
Normal file
|
@ -0,0 +1,180 @@
|
|||
# coding=utf-8
|
||||
# *** WARNING: this file was generated by test. ***
|
||||
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import warnings
|
||||
import pulumi
|
||||
import pulumi.runtime
|
||||
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
||||
from . import _utilities
|
||||
from . import outputs
|
||||
from ._inputs import *
|
||||
|
||||
__all__ = ['FooArgs', 'Foo']
|
||||
|
||||
@pulumi.input_type
|
||||
class FooArgs:
|
||||
def __init__(__self__, *,
|
||||
backup_kube_client_settings: pulumi.Input['KubeClientSettingsArgs'],
|
||||
argument: Optional[str] = None,
|
||||
kube_client_settings: Optional[pulumi.Input['KubeClientSettingsArgs']] = None,
|
||||
settings: Optional[pulumi.Input['LayeredTypeArgs']] = None):
|
||||
"""
|
||||
The set of arguments for constructing a Foo resource.
|
||||
:param pulumi.Input['KubeClientSettingsArgs'] backup_kube_client_settings: Options for tuning the Kubernetes client used by a Provider.
|
||||
:param pulumi.Input['KubeClientSettingsArgs'] kube_client_settings: Options for tuning the Kubernetes client used by a Provider.
|
||||
:param pulumi.Input['LayeredTypeArgs'] settings: describing things
|
||||
"""
|
||||
pulumi.set(__self__, "backup_kube_client_settings", backup_kube_client_settings)
|
||||
if argument is not None:
|
||||
pulumi.set(__self__, "argument", argument)
|
||||
if kube_client_settings is not None:
|
||||
pulumi.set(__self__, "kube_client_settings", kube_client_settings)
|
||||
if settings is not None:
|
||||
pulumi.set(__self__, "settings", settings)
|
||||
|
||||
@property
|
||||
@pulumi.getter(name="backupKubeClientSettings")
|
||||
def backup_kube_client_settings(self) -> pulumi.Input['KubeClientSettingsArgs']:
|
||||
"""
|
||||
Options for tuning the Kubernetes client used by a Provider.
|
||||
"""
|
||||
return pulumi.get(self, "backup_kube_client_settings")
|
||||
|
||||
@backup_kube_client_settings.setter
|
||||
def backup_kube_client_settings(self, value: pulumi.Input['KubeClientSettingsArgs']):
|
||||
pulumi.set(self, "backup_kube_client_settings", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def argument(self) -> Optional[str]:
|
||||
return pulumi.get(self, "argument")
|
||||
|
||||
@argument.setter
|
||||
def argument(self, value: Optional[str]):
|
||||
pulumi.set(self, "argument", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter(name="kubeClientSettings")
|
||||
def kube_client_settings(self) -> Optional[pulumi.Input['KubeClientSettingsArgs']]:
|
||||
"""
|
||||
Options for tuning the Kubernetes client used by a Provider.
|
||||
"""
|
||||
return pulumi.get(self, "kube_client_settings")
|
||||
|
||||
@kube_client_settings.setter
|
||||
def kube_client_settings(self, value: Optional[pulumi.Input['KubeClientSettingsArgs']]):
|
||||
pulumi.set(self, "kube_client_settings", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def settings(self) -> Optional[pulumi.Input['LayeredTypeArgs']]:
|
||||
"""
|
||||
describing things
|
||||
"""
|
||||
return pulumi.get(self, "settings")
|
||||
|
||||
@settings.setter
|
||||
def settings(self, value: Optional[pulumi.Input['LayeredTypeArgs']]):
|
||||
pulumi.set(self, "settings", value)
|
||||
|
||||
|
||||
class Foo(pulumi.CustomResource):
|
||||
@overload
|
||||
def __init__(__self__,
|
||||
resource_name: str,
|
||||
opts: Optional[pulumi.ResourceOptions] = None,
|
||||
argument: Optional[str] = None,
|
||||
backup_kube_client_settings: Optional[pulumi.Input[pulumi.InputType['KubeClientSettingsArgs']]] = None,
|
||||
kube_client_settings: Optional[pulumi.Input[pulumi.InputType['KubeClientSettingsArgs']]] = None,
|
||||
settings: Optional[pulumi.Input[pulumi.InputType['LayeredTypeArgs']]] = None,
|
||||
__props__=None):
|
||||
"""
|
||||
test new feature with resoruces
|
||||
|
||||
:param str resource_name: The name of the resource.
|
||||
:param pulumi.ResourceOptions opts: Options for the resource.
|
||||
:param pulumi.Input[pulumi.InputType['KubeClientSettingsArgs']] backup_kube_client_settings: Options for tuning the Kubernetes client used by a Provider.
|
||||
:param pulumi.Input[pulumi.InputType['KubeClientSettingsArgs']] kube_client_settings: Options for tuning the Kubernetes client used by a Provider.
|
||||
:param pulumi.Input[pulumi.InputType['LayeredTypeArgs']] settings: describing things
|
||||
"""
|
||||
...
|
||||
@overload
|
||||
def __init__(__self__,
|
||||
resource_name: str,
|
||||
args: FooArgs,
|
||||
opts: Optional[pulumi.ResourceOptions] = None):
|
||||
"""
|
||||
test new feature with resoruces
|
||||
|
||||
:param str resource_name: The name of the resource.
|
||||
:param FooArgs 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(FooArgs, 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,
|
||||
argument: Optional[str] = None,
|
||||
backup_kube_client_settings: Optional[pulumi.Input[pulumi.InputType['KubeClientSettingsArgs']]] = None,
|
||||
kube_client_settings: Optional[pulumi.Input[pulumi.InputType['KubeClientSettingsArgs']]] = None,
|
||||
settings: Optional[pulumi.Input[pulumi.InputType['LayeredTypeArgs']]] = None,
|
||||
__props__=None):
|
||||
if opts is None:
|
||||
opts = pulumi.ResourceOptions()
|
||||
if not isinstance(opts, pulumi.ResourceOptions):
|
||||
raise TypeError('Expected resource options to be a ResourceOptions instance')
|
||||
if opts.version is None:
|
||||
opts.version = _utilities.get_version()
|
||||
if opts.id is None:
|
||||
if __props__ is not None:
|
||||
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
|
||||
__props__ = FooArgs.__new__(FooArgs)
|
||||
|
||||
__props__.__dict__["argument"] = argument
|
||||
if backup_kube_client_settings is None and not opts.urn:
|
||||
raise TypeError("Missing required property 'backup_kube_client_settings'")
|
||||
__props__.__dict__["backup_kube_client_settings"] = backup_kube_client_settings
|
||||
__props__.__dict__["kube_client_settings"] = kube_client_settings
|
||||
__props__.__dict__["settings"] = settings
|
||||
__props__.__dict__["default_kube_client_settings"] = None
|
||||
super(Foo, __self__).__init__(
|
||||
'example:index:Foo',
|
||||
resource_name,
|
||||
__props__,
|
||||
opts)
|
||||
|
||||
@staticmethod
|
||||
def get(resource_name: str,
|
||||
id: pulumi.Input[str],
|
||||
opts: Optional[pulumi.ResourceOptions] = None) -> 'Foo':
|
||||
"""
|
||||
Get an existing Foo 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.
|
||||
"""
|
||||
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
|
||||
|
||||
__props__ = FooArgs.__new__(FooArgs)
|
||||
|
||||
__props__.__dict__["default_kube_client_settings"] = None
|
||||
return Foo(resource_name, opts=opts, __props__=__props__)
|
||||
|
||||
@property
|
||||
@pulumi.getter(name="defaultKubeClientSettings")
|
||||
def default_kube_client_settings(self) -> pulumi.Output[Optional['outputs.KubeClientSettings']]:
|
||||
"""
|
||||
A test for plain types
|
||||
"""
|
||||
return pulumi.get(self, "default_kube_client_settings")
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
# coding=utf-8
|
||||
# *** WARNING: this file was generated by test. ***
|
||||
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import warnings
|
||||
import pulumi
|
||||
import pulumi.runtime
|
||||
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
||||
from . import _utilities
|
||||
from ._inputs import *
|
||||
|
||||
__all__ = [
|
||||
'FuncWithAllOptionalInputsResult',
|
||||
'AwaitableFuncWithAllOptionalInputsResult',
|
||||
'func_with_all_optional_inputs',
|
||||
'func_with_all_optional_inputs_output',
|
||||
]
|
||||
|
||||
@pulumi.output_type
|
||||
class FuncWithAllOptionalInputsResult:
|
||||
def __init__(__self__, r=None):
|
||||
if r and not isinstance(r, str):
|
||||
raise TypeError("Expected argument 'r' to be a str")
|
||||
pulumi.set(__self__, "r", r)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def r(self) -> str:
|
||||
return pulumi.get(self, "r")
|
||||
|
||||
|
||||
class AwaitableFuncWithAllOptionalInputsResult(FuncWithAllOptionalInputsResult):
|
||||
# pylint: disable=using-constant-test
|
||||
def __await__(self):
|
||||
if False:
|
||||
yield self
|
||||
return FuncWithAllOptionalInputsResult(
|
||||
r=self.r)
|
||||
|
||||
|
||||
def func_with_all_optional_inputs(a: Optional[pulumi.InputType['HelmReleaseSettings']] = None,
|
||||
b: Optional[str] = None,
|
||||
opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableFuncWithAllOptionalInputsResult:
|
||||
"""
|
||||
Check codegen of functions with all optional inputs.
|
||||
|
||||
|
||||
:param pulumi.InputType['HelmReleaseSettings'] a: Property A
|
||||
:param str b: Property B
|
||||
"""
|
||||
__args__ = dict()
|
||||
__args__['a'] = a
|
||||
__args__['b'] = b
|
||||
if opts is None:
|
||||
opts = pulumi.InvokeOptions()
|
||||
if opts.version is None:
|
||||
opts.version = _utilities.get_version()
|
||||
__ret__ = pulumi.runtime.invoke('mypkg::funcWithAllOptionalInputs', __args__, opts=opts, typ=FuncWithAllOptionalInputsResult).value
|
||||
|
||||
return AwaitableFuncWithAllOptionalInputsResult(
|
||||
r=__ret__.r)
|
||||
|
||||
|
||||
@_utilities.lift_output_func(func_with_all_optional_inputs)
|
||||
def func_with_all_optional_inputs_output(a: Optional[pulumi.Input[Optional[pulumi.InputType['HelmReleaseSettings']]]] = None,
|
||||
b: Optional[pulumi.Input[Optional[str]]] = None,
|
||||
opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[FuncWithAllOptionalInputsResult]:
|
||||
"""
|
||||
Check codegen of functions with all optional inputs.
|
||||
|
||||
|
||||
:param pulumi.InputType['HelmReleaseSettings'] a: Property A
|
||||
:param str b: Property B
|
||||
"""
|
||||
...
|
7
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/mod1/__init__.py
vendored
Normal file
7
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/mod1/__init__.py
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
# coding=utf-8
|
||||
# *** WARNING: this file was generated by test. ***
|
||||
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
from .. import _utilities
|
||||
import typing
|
||||
from ._inputs import *
|
36
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/mod1/_inputs.py
vendored
Normal file
36
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/mod1/_inputs.py
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
# coding=utf-8
|
||||
# *** WARNING: this file was generated by test. ***
|
||||
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import warnings
|
||||
import pulumi
|
||||
import pulumi.runtime
|
||||
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
||||
from .. import _utilities
|
||||
|
||||
__all__ = [
|
||||
'TypArgs',
|
||||
]
|
||||
|
||||
@pulumi.input_type
|
||||
class TypArgs:
|
||||
def __init__(__self__, *,
|
||||
val: Optional[pulumi.Input[str]] = None):
|
||||
"""
|
||||
A test for namespaces (mod 1)
|
||||
"""
|
||||
if val is None:
|
||||
val = 'mod1'
|
||||
if val is not None:
|
||||
pulumi.set(__self__, "val", val)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def val(self) -> Optional[pulumi.Input[str]]:
|
||||
return pulumi.get(self, "val")
|
||||
|
||||
@val.setter
|
||||
def val(self, value: Optional[pulumi.Input[str]]):
|
||||
pulumi.set(self, "val", value)
|
||||
|
||||
|
7
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/mod2/__init__.py
vendored
Normal file
7
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/mod2/__init__.py
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
# coding=utf-8
|
||||
# *** WARNING: this file was generated by test. ***
|
||||
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
from .. import _utilities
|
||||
import typing
|
||||
from ._inputs import *
|
49
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/mod2/_inputs.py
vendored
Normal file
49
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/mod2/_inputs.py
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
# coding=utf-8
|
||||
# *** WARNING: this file was generated by test. ***
|
||||
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import warnings
|
||||
import pulumi
|
||||
import pulumi.runtime
|
||||
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
||||
from .. import _utilities
|
||||
from .. import mod1 as _mod1
|
||||
|
||||
__all__ = [
|
||||
'TypArgs',
|
||||
]
|
||||
|
||||
@pulumi.input_type
|
||||
class TypArgs:
|
||||
def __init__(__self__, *,
|
||||
mod1: Optional[pulumi.Input['_mod1.TypArgs']] = None,
|
||||
val: Optional[pulumi.Input[str]] = None):
|
||||
"""
|
||||
A test for namespaces (mod 2)
|
||||
"""
|
||||
if mod1 is not None:
|
||||
pulumi.set(__self__, "mod1", mod1)
|
||||
if val is None:
|
||||
val = 'mod2'
|
||||
if val is not None:
|
||||
pulumi.set(__self__, "val", val)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def mod1(self) -> Optional[pulumi.Input['_mod1.TypArgs']]:
|
||||
return pulumi.get(self, "mod1")
|
||||
|
||||
@mod1.setter
|
||||
def mod1(self, value: Optional[pulumi.Input['_mod1.TypArgs']]):
|
||||
pulumi.set(self, "mod1", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def val(self) -> Optional[pulumi.Input[str]]:
|
||||
return pulumi.get(self, "val")
|
||||
|
||||
@val.setter
|
||||
def val(self, value: Optional[pulumi.Input[str]]):
|
||||
pulumi.set(self, "val", value)
|
||||
|
||||
|
123
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/module_test.py
vendored
Normal file
123
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/module_test.py
vendored
Normal file
|
@ -0,0 +1,123 @@
|
|||
# coding=utf-8
|
||||
# *** WARNING: this file was generated by test. ***
|
||||
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import warnings
|
||||
import pulumi
|
||||
import pulumi.runtime
|
||||
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
||||
from . import _utilities
|
||||
from . import mod1 as _mod1
|
||||
from . import mod2 as _mod2
|
||||
from ._inputs import *
|
||||
|
||||
__all__ = ['ModuleTestArgs', 'ModuleTest']
|
||||
|
||||
@pulumi.input_type
|
||||
class ModuleTestArgs:
|
||||
def __init__(__self__, *,
|
||||
mod1: Optional[pulumi.Input['_mod1.TypArgs']] = None,
|
||||
val: Optional[pulumi.Input['TypArgs']] = None):
|
||||
"""
|
||||
The set of arguments for constructing a ModuleTest resource.
|
||||
"""
|
||||
if mod1 is not None:
|
||||
pulumi.set(__self__, "mod1", mod1)
|
||||
if val is not None:
|
||||
pulumi.set(__self__, "val", val)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def mod1(self) -> Optional[pulumi.Input['_mod1.TypArgs']]:
|
||||
return pulumi.get(self, "mod1")
|
||||
|
||||
@mod1.setter
|
||||
def mod1(self, value: Optional[pulumi.Input['_mod1.TypArgs']]):
|
||||
pulumi.set(self, "mod1", value)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def val(self) -> Optional[pulumi.Input['TypArgs']]:
|
||||
return pulumi.get(self, "val")
|
||||
|
||||
@val.setter
|
||||
def val(self, value: Optional[pulumi.Input['TypArgs']]):
|
||||
pulumi.set(self, "val", value)
|
||||
|
||||
|
||||
class ModuleTest(pulumi.CustomResource):
|
||||
@overload
|
||||
def __init__(__self__,
|
||||
resource_name: str,
|
||||
opts: Optional[pulumi.ResourceOptions] = None,
|
||||
mod1: Optional[pulumi.Input[pulumi.InputType['_mod1.TypArgs']]] = None,
|
||||
val: Optional[pulumi.Input[pulumi.InputType['TypArgs']]] = None,
|
||||
__props__=None):
|
||||
"""
|
||||
Create a ModuleTest 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.
|
||||
"""
|
||||
...
|
||||
@overload
|
||||
def __init__(__self__,
|
||||
resource_name: str,
|
||||
args: Optional[ModuleTestArgs] = None,
|
||||
opts: Optional[pulumi.ResourceOptions] = None):
|
||||
"""
|
||||
Create a ModuleTest resource with the given unique name, props, and options.
|
||||
:param str resource_name: The name of the resource.
|
||||
:param ModuleTestArgs 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(ModuleTestArgs, 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,
|
||||
mod1: Optional[pulumi.Input[pulumi.InputType['_mod1.TypArgs']]] = None,
|
||||
val: Optional[pulumi.Input[pulumi.InputType['TypArgs']]] = None,
|
||||
__props__=None):
|
||||
if opts is None:
|
||||
opts = pulumi.ResourceOptions()
|
||||
if not isinstance(opts, pulumi.ResourceOptions):
|
||||
raise TypeError('Expected resource options to be a ResourceOptions instance')
|
||||
if opts.version is None:
|
||||
opts.version = _utilities.get_version()
|
||||
if opts.id is None:
|
||||
if __props__ is not None:
|
||||
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
|
||||
__props__ = ModuleTestArgs.__new__(ModuleTestArgs)
|
||||
|
||||
__props__.__dict__["mod1"] = mod1
|
||||
__props__.__dict__["val"] = val
|
||||
super(ModuleTest, __self__).__init__(
|
||||
'example:index:moduleTest',
|
||||
resource_name,
|
||||
__props__,
|
||||
opts)
|
||||
|
||||
@staticmethod
|
||||
def get(resource_name: str,
|
||||
id: pulumi.Input[str],
|
||||
opts: Optional[pulumi.ResourceOptions] = None) -> 'ModuleTest':
|
||||
"""
|
||||
Get an existing ModuleTest 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.
|
||||
"""
|
||||
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
|
||||
|
||||
__props__ = ModuleTestArgs.__new__(ModuleTestArgs)
|
||||
|
||||
return ModuleTest(resource_name, opts=opts, __props__=__props__)
|
||||
|
79
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/outputs.py
vendored
Normal file
79
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/outputs.py
vendored
Normal file
|
@ -0,0 +1,79 @@
|
|||
# coding=utf-8
|
||||
# *** WARNING: this file was generated by test. ***
|
||||
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import warnings
|
||||
import pulumi
|
||||
import pulumi.runtime
|
||||
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
||||
from . import _utilities
|
||||
from . import outputs
|
||||
|
||||
__all__ = [
|
||||
'KubeClientSettings',
|
||||
]
|
||||
|
||||
@pulumi.output_type
|
||||
class KubeClientSettings(dict):
|
||||
"""
|
||||
Options for tuning the Kubernetes client used by a Provider.
|
||||
"""
|
||||
@staticmethod
|
||||
def __key_warning(key: str):
|
||||
suggest = None
|
||||
if key == "recTest":
|
||||
suggest = "rec_test"
|
||||
|
||||
if suggest:
|
||||
pulumi.log.warn(f"Key '{key}' not found in KubeClientSettings. Access the value via the '{suggest}' property getter instead.")
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
KubeClientSettings.__key_warning(key)
|
||||
return super().__getitem__(key)
|
||||
|
||||
def get(self, key: str, default = None) -> Any:
|
||||
KubeClientSettings.__key_warning(key)
|
||||
return super().get(key, default)
|
||||
|
||||
def __init__(__self__, *,
|
||||
burst: Optional[int] = None,
|
||||
qps: Optional[float] = None,
|
||||
rec_test: Optional['outputs.KubeClientSettings'] = None):
|
||||
"""
|
||||
Options for tuning the Kubernetes client used by a Provider.
|
||||
:param int burst: Maximum burst for throttle. Default value is 10.
|
||||
:param float qps: Maximum queries per second (QPS) to the API server from this client. Default value is 5.
|
||||
"""
|
||||
if burst is None:
|
||||
burst = _utilities.get_env_int('PULUMI_K8S_CLIENT_BURST')
|
||||
if burst is not None:
|
||||
pulumi.set(__self__, "burst", burst)
|
||||
if qps is None:
|
||||
qps = _utilities.get_env_float('PULUMI_K8S_CLIENT_QPS')
|
||||
if qps is not None:
|
||||
pulumi.set(__self__, "qps", qps)
|
||||
if rec_test is not None:
|
||||
pulumi.set(__self__, "rec_test", rec_test)
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def burst(self) -> Optional[int]:
|
||||
"""
|
||||
Maximum burst for throttle. Default value is 10.
|
||||
"""
|
||||
return pulumi.get(self, "burst")
|
||||
|
||||
@property
|
||||
@pulumi.getter
|
||||
def qps(self) -> Optional[float]:
|
||||
"""
|
||||
Maximum queries per second (QPS) to the API server from this client. Default value is 5.
|
||||
"""
|
||||
return pulumi.get(self, "qps")
|
||||
|
||||
@property
|
||||
@pulumi.getter(name="recTest")
|
||||
def rec_test(self) -> Optional['outputs.KubeClientSettings']:
|
||||
return pulumi.get(self, "rec_test")
|
||||
|
||||
|
95
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/provider.py
vendored
Normal file
95
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/provider.py
vendored
Normal file
|
@ -0,0 +1,95 @@
|
|||
# coding=utf-8
|
||||
# *** WARNING: this file was generated by test. ***
|
||||
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import warnings
|
||||
import pulumi
|
||||
import pulumi.runtime
|
||||
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
||||
from . import _utilities
|
||||
from ._inputs import *
|
||||
|
||||
__all__ = ['ProviderArgs', 'Provider']
|
||||
|
||||
@pulumi.input_type
|
||||
class ProviderArgs:
|
||||
def __init__(__self__, *,
|
||||
helm_release_settings: Optional[pulumi.Input['HelmReleaseSettingsArgs']] = None):
|
||||
"""
|
||||
The set of arguments for constructing a Provider resource.
|
||||
:param pulumi.Input['HelmReleaseSettingsArgs'] helm_release_settings: BETA FEATURE - Options to configure the Helm Release resource.
|
||||
"""
|
||||
if helm_release_settings is not None:
|
||||
pulumi.set(__self__, "helm_release_settings", helm_release_settings)
|
||||
|
||||
@property
|
||||
@pulumi.getter(name="helmReleaseSettings")
|
||||
def helm_release_settings(self) -> Optional[pulumi.Input['HelmReleaseSettingsArgs']]:
|
||||
"""
|
||||
BETA FEATURE - Options to configure the Helm Release resource.
|
||||
"""
|
||||
return pulumi.get(self, "helm_release_settings")
|
||||
|
||||
@helm_release_settings.setter
|
||||
def helm_release_settings(self, value: Optional[pulumi.Input['HelmReleaseSettingsArgs']]):
|
||||
pulumi.set(self, "helm_release_settings", value)
|
||||
|
||||
|
||||
class Provider(pulumi.ProviderResource):
|
||||
@overload
|
||||
def __init__(__self__,
|
||||
resource_name: str,
|
||||
opts: Optional[pulumi.ResourceOptions] = None,
|
||||
helm_release_settings: Optional[pulumi.Input[pulumi.InputType['HelmReleaseSettingsArgs']]] = None,
|
||||
__props__=None):
|
||||
"""
|
||||
The provider type for the kubernetes package.
|
||||
|
||||
:param str resource_name: The name of the resource.
|
||||
:param pulumi.ResourceOptions opts: Options for the resource.
|
||||
:param pulumi.Input[pulumi.InputType['HelmReleaseSettingsArgs']] helm_release_settings: BETA FEATURE - Options to configure the Helm Release resource.
|
||||
"""
|
||||
...
|
||||
@overload
|
||||
def __init__(__self__,
|
||||
resource_name: str,
|
||||
args: Optional[ProviderArgs] = None,
|
||||
opts: Optional[pulumi.ResourceOptions] = None):
|
||||
"""
|
||||
The provider type for the kubernetes package.
|
||||
|
||||
: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,
|
||||
helm_release_settings: Optional[pulumi.Input[pulumi.InputType['HelmReleaseSettingsArgs']]] = None,
|
||||
__props__=None):
|
||||
if opts is None:
|
||||
opts = pulumi.ResourceOptions()
|
||||
if not isinstance(opts, pulumi.ResourceOptions):
|
||||
raise TypeError('Expected resource options to be a ResourceOptions instance')
|
||||
if opts.version is None:
|
||||
opts.version = _utilities.get_version()
|
||||
if opts.id is None:
|
||||
if __props__ is not None:
|
||||
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
|
||||
__props__ = ProviderArgs.__new__(ProviderArgs)
|
||||
|
||||
__props__.__dict__["helm_release_settings"] = pulumi.Output.from_input(helm_release_settings).apply(pulumi.runtime.to_json) if helm_release_settings is not None else None
|
||||
super(Provider, __self__).__init__(
|
||||
'example',
|
||||
resource_name,
|
||||
__props__,
|
||||
opts)
|
||||
|
0
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/py.typed
vendored
Normal file
0
pkg/codegen/internal/test/testdata/env-helper/python/pulumi_example/py.typed
vendored
Normal file
58
pkg/codegen/internal/test/testdata/env-helper/python/setup.py
vendored
Normal file
58
pkg/codegen/internal/test/testdata/env-helper/python/setup.py
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
# coding=utf-8
|
||||
# *** WARNING: this file was generated by test. ***
|
||||
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
import errno
|
||||
from setuptools import setup, find_packages
|
||||
from setuptools.command.install import install
|
||||
from subprocess import check_call
|
||||
|
||||
|
||||
VERSION = "0.0.0"
|
||||
PLUGIN_VERSION = "0.0.0"
|
||||
|
||||
class InstallPluginCommand(install):
|
||||
def run(self):
|
||||
install.run(self)
|
||||
try:
|
||||
check_call(['pulumi', 'plugin', 'install', 'resource', 'example', PLUGIN_VERSION])
|
||||
except OSError as error:
|
||||
if error.errno == errno.ENOENT:
|
||||
print(f"""
|
||||
There was an error installing the example resource provider plugin.
|
||||
It looks like `pulumi` is not installed on your system.
|
||||
Please visit https://pulumi.com/ to install the Pulumi CLI.
|
||||
You may try manually installing the plugin by running
|
||||
`pulumi plugin install resource example {PLUGIN_VERSION}`
|
||||
""")
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
def readme():
|
||||
try:
|
||||
with open('README.md', encoding='utf-8') as f:
|
||||
return f.read()
|
||||
except FileNotFoundError:
|
||||
return "example Pulumi Package - Development Version"
|
||||
|
||||
|
||||
setup(name='pulumi_example',
|
||||
version=VERSION,
|
||||
long_description=readme(),
|
||||
long_description_content_type='text/markdown',
|
||||
cmdclass={
|
||||
'install': InstallPluginCommand,
|
||||
},
|
||||
packages=find_packages(),
|
||||
package_data={
|
||||
'pulumi_example': [
|
||||
'py.typed',
|
||||
]
|
||||
},
|
||||
install_requires=[
|
||||
'parver>=0.2.1',
|
||||
'pulumi',
|
||||
'semver>=2.8.1'
|
||||
],
|
||||
zip_safe=False)
|
234
pkg/codegen/internal/test/testdata/env-helper/schema.json
vendored
Normal file
234
pkg/codegen/internal/test/testdata/env-helper/schema.json
vendored
Normal file
|
@ -0,0 +1,234 @@
|
|||
{
|
||||
"version": "0.0.1",
|
||||
"name": "example",
|
||||
|
||||
"provider": {
|
||||
"description": "The provider type for the kubernetes package.",
|
||||
"type": "object",
|
||||
"inputProperties": {
|
||||
"helmReleaseSettings": {
|
||||
"$ref": "#/types/example:index:HelmReleaseSettings",
|
||||
"description": "BETA FEATURE - Options to configure the Helm Release resource."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"resources": {
|
||||
"example:index:Foo": {
|
||||
"description": "test new feature with resoruces",
|
||||
"inputProperties": {
|
||||
"argument": {
|
||||
"type": "string",
|
||||
"plain": true
|
||||
},
|
||||
"settings": {
|
||||
"$ref": "#/types/example:index:LayeredType",
|
||||
"description": "describing things"
|
||||
},
|
||||
"kubeClientSettings": {
|
||||
"$ref": "#/types/example:index:KubeClientSettings",
|
||||
"description": "Options for tuning the Kubernetes client used by a Provider."
|
||||
},
|
||||
"backupKubeClientSettings": {
|
||||
"$ref": "#/types/example:index:KubeClientSettings",
|
||||
"description": "Options for tuning the Kubernetes client used by a Provider."
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"defaultKubeClientSettings": {
|
||||
"$ref": "#/types/example:index:KubeClientSettings",
|
||||
"description": "A test for plain types",
|
||||
"plain": true
|
||||
}
|
||||
},
|
||||
"requiredInputs": ["backupKubeClientSettings"]
|
||||
},
|
||||
"example:index:moduleTest": {
|
||||
"inputProperties": {
|
||||
"val": {
|
||||
"$ref": "#/types/example:index:typ"
|
||||
},
|
||||
"mod1": {
|
||||
"$ref": "#/types/example:mod1:typ"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"types": {
|
||||
"example:mod1:typ": {
|
||||
"description": "A test for namespaces (mod 1)",
|
||||
"properties": {
|
||||
"val": {
|
||||
"type": "string",
|
||||
"default": "mod1"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"example:mod2:typ": {
|
||||
"description": "A test for namespaces (mod 2)",
|
||||
"properties": {
|
||||
"val": {
|
||||
"type": "string",
|
||||
"default": "mod2"
|
||||
},
|
||||
"mod1": {
|
||||
"$ref": "#/types/example:mod1:typ"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"example:index:typ": {
|
||||
"description": "A test for namespaces (mod main)",
|
||||
"properties": {
|
||||
"val": {
|
||||
"type": "string",
|
||||
"default": "mod main"
|
||||
},
|
||||
"mod1": {
|
||||
"$ref": "#/types/example:mod1:typ"
|
||||
},
|
||||
"mod2": {
|
||||
"$ref": "#/types/example:mod2:typ"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
|
||||
"example:index:HelmReleaseSettings": {
|
||||
"description": "BETA FEATURE - Options to configure the Helm Release resource.",
|
||||
"properties": {
|
||||
"driver": {
|
||||
"type": "string",
|
||||
"description": "The backend storage driver for Helm. Values are: configmap, secret, memory, sql.",
|
||||
"default": "secret",
|
||||
"defaultInfo": {
|
||||
"environment": ["PULUMI_K8S_HELM_DRIVER"]
|
||||
}
|
||||
},
|
||||
"pluginsPath": {
|
||||
"type": "string",
|
||||
"description": "The path to the helm plugins directory.",
|
||||
"defaultInfo": {
|
||||
"environment": ["PULUMI_K8S_HELM_PLUGINS_PATH"]
|
||||
}
|
||||
},
|
||||
"requiredArg": {
|
||||
"type": "string",
|
||||
"description": "to test required args"
|
||||
}
|
||||
},
|
||||
"required": ["requiredArg"],
|
||||
"type": "object"
|
||||
},
|
||||
"example:index:LayeredType": {
|
||||
"description": "Make sure that defaults propagate through types",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"answer": {
|
||||
"description": "The answer to the question",
|
||||
"type": "number",
|
||||
"default": 42
|
||||
},
|
||||
"question": {
|
||||
"description": "The question already answered",
|
||||
"type": "string",
|
||||
"default": "<unknown>",
|
||||
"defaultInfo": {
|
||||
"environment": ["PULUMI_THE_QUESTION"]
|
||||
}
|
||||
},
|
||||
"thinker": {
|
||||
"description": "To ask and answer",
|
||||
"type": "string",
|
||||
"default": "not a good interaction"
|
||||
},
|
||||
"other": {
|
||||
"$ref": "#/types/example:index:HelmReleaseSettings"
|
||||
},
|
||||
"plainOther": {
|
||||
"description": "Test how plain types interact",
|
||||
"$ref": "#/types/example:index:HelmReleaseSettings",
|
||||
"plain": true
|
||||
},
|
||||
"recursive": {
|
||||
"$ref": "#/types/example:index:LayeredType"
|
||||
}
|
||||
},
|
||||
"required": ["other", "thinker"]
|
||||
},
|
||||
"example:index:KubeClientSettings": {
|
||||
"description": "Options for tuning the Kubernetes client used by a Provider.",
|
||||
"properties": {
|
||||
"burst": {
|
||||
"type": "integer",
|
||||
"description": "Maximum burst for throttle. Default value is 10.",
|
||||
"defaultInfo": {
|
||||
"environment": ["PULUMI_K8S_CLIENT_BURST"]
|
||||
}
|
||||
},
|
||||
"qps": {
|
||||
"type": "number",
|
||||
"description": "Maximum queries per second (QPS) to the API server from this client. Default value is 5.",
|
||||
"defaultInfo": {
|
||||
"environment": ["PULUMI_K8S_CLIENT_QPS"]
|
||||
}
|
||||
},
|
||||
"recTest": {
|
||||
"$ref": "#/types/example:index:KubeClientSettings"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
|
||||
"functions": {
|
||||
"mypkg::funcWithAllOptionalInputs": {
|
||||
"description": "Check codegen of functions with all optional inputs.",
|
||||
"inputs": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"a": {
|
||||
"$ref": "#/types/example:index:HelmReleaseSettings",
|
||||
"description": "Property A"
|
||||
},
|
||||
"b": {
|
||||
"type": "string",
|
||||
"description": "Property B",
|
||||
"default": "defValue"
|
||||
}
|
||||
}
|
||||
},
|
||||
"outputs": {
|
||||
"properties": {
|
||||
"r": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"required": ["r"]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"language": {
|
||||
"csharp": {
|
||||
"packageReferences": {
|
||||
"Pulumi": "3.12"
|
||||
}
|
||||
},
|
||||
"go": {
|
||||
"importBasePath": "env-helper/example"
|
||||
},
|
||||
"nodejs": {
|
||||
"dependencies": {
|
||||
"@pulumi/pulumi": "^3.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^3.7.0"
|
||||
}
|
||||
},
|
||||
"python": {}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue