pulumi-std 2.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pulumi_std/__init__.py +121 -0
- pulumi_std/_utilities.py +331 -0
- pulumi_std/abs.py +70 -0
- pulumi_std/abspath.py +70 -0
- pulumi_std/alltrue.py +70 -0
- pulumi_std/anytrue.py +70 -0
- pulumi_std/base64decode.py +68 -0
- pulumi_std/base64encode.py +68 -0
- pulumi_std/base64gzip.py +68 -0
- pulumi_std/base64sha256.py +70 -0
- pulumi_std/base64sha512.py +70 -0
- pulumi_std/basename.py +68 -0
- pulumi_std/bcrypt.py +74 -0
- pulumi_std/ceil.py +68 -0
- pulumi_std/chomp.py +68 -0
- pulumi_std/chunklist.py +72 -0
- pulumi_std/cidrhost.py +78 -0
- pulumi_std/cidrnetmask.py +74 -0
- pulumi_std/cidrsubnet.py +82 -0
- pulumi_std/cidrsubnets.py +72 -0
- pulumi_std/coalesce.py +68 -0
- pulumi_std/coalescelist.py +68 -0
- pulumi_std/compact.py +68 -0
- pulumi_std/concat.py +68 -0
- pulumi_std/contains.py +72 -0
- pulumi_std/csvdecode.py +82 -0
- pulumi_std/dirname.py +68 -0
- pulumi_std/distinct.py +68 -0
- pulumi_std/element.py +72 -0
- pulumi_std/endswith.py +72 -0
- pulumi_std/file.py +68 -0
- pulumi_std/filebase64.py +68 -0
- pulumi_std/filebase64sha256.py +68 -0
- pulumi_std/filebase64sha512.py +68 -0
- pulumi_std/fileexists.py +68 -0
- pulumi_std/filemd5.py +68 -0
- pulumi_std/filesha1.py +68 -0
- pulumi_std/filesha256.py +68 -0
- pulumi_std/filesha512.py +68 -0
- pulumi_std/flatten.py +70 -0
- pulumi_std/floor.py +68 -0
- pulumi_std/format.py +72 -0
- pulumi_std/formatlist.py +72 -0
- pulumi_std/indent.py +72 -0
- pulumi_std/index.py +72 -0
- pulumi_std/join.py +72 -0
- pulumi_std/jsondecode.py +72 -0
- pulumi_std/jsonencode.py +72 -0
- pulumi_std/keys.py +68 -0
- pulumi_std/length.py +68 -0
- pulumi_std/log.py +72 -0
- pulumi_std/lookup.py +76 -0
- pulumi_std/lower.py +68 -0
- pulumi_std/map.py +68 -0
- pulumi_std/matchkeys.py +74 -0
- pulumi_std/max.py +68 -0
- pulumi_std/md5.py +68 -0
- pulumi_std/merge.py +70 -0
- pulumi_std/min.py +68 -0
- pulumi_std/parseint.py +76 -0
- pulumi_std/pathexpand.py +68 -0
- pulumi_std/pow.py +72 -0
- pulumi_std/provider.py +77 -0
- pulumi_std/pulumi-plugin.json +5 -0
- pulumi_std/py.typed +0 -0
- pulumi_std/range.py +80 -0
- pulumi_std/regex.py +72 -0
- pulumi_std/regexall.py +72 -0
- pulumi_std/replace.py +86 -0
- pulumi_std/reverse.py +68 -0
- pulumi_std/rsadecrypt.py +74 -0
- pulumi_std/setintersection.py +68 -0
- pulumi_std/sha1.py +68 -0
- pulumi_std/sha256.py +68 -0
- pulumi_std/sha512.py +68 -0
- pulumi_std/signum.py +68 -0
- pulumi_std/slice.py +76 -0
- pulumi_std/sort.py +68 -0
- pulumi_std/split.py +72 -0
- pulumi_std/startswith.py +72 -0
- pulumi_std/strrev.py +68 -0
- pulumi_std/substr.py +76 -0
- pulumi_std/sum.py +68 -0
- pulumi_std/timeadd.py +84 -0
- pulumi_std/timecmp.py +84 -0
- pulumi_std/timestamp.py +64 -0
- pulumi_std/title.py +68 -0
- pulumi_std/tobool.py +70 -0
- pulumi_std/tolist.py +68 -0
- pulumi_std/tonumber.py +70 -0
- pulumi_std/toset.py +68 -0
- pulumi_std/tostring.py +70 -0
- pulumi_std/transpose.py +68 -0
- pulumi_std/trim.py +72 -0
- pulumi_std/trimprefix.py +72 -0
- pulumi_std/trimspace.py +70 -0
- pulumi_std/trimsuffix.py +72 -0
- pulumi_std/upper.py +68 -0
- pulumi_std/urlencode.py +68 -0
- pulumi_std/uuid.py +64 -0
- pulumi_std/values.py +68 -0
- pulumi_std/zipmap.py +72 -0
- pulumi_std-2.3.0.dist-info/METADATA +47 -0
- pulumi_std-2.3.0.dist-info/RECORD +106 -0
- pulumi_std-2.3.0.dist-info/WHEEL +5 -0
- pulumi_std-2.3.0.dist-info/top_level.txt +1 -0
pulumi_std/__init__.py
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
# *** WARNING: this file was generated by pulumi-language-python. ***
|
|
3
|
+
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
|
+
|
|
5
|
+
import builtins as _builtins
|
|
6
|
+
from . import _utilities
|
|
7
|
+
import typing
|
|
8
|
+
# Export this package's modules as members:
|
|
9
|
+
from .abs import *
|
|
10
|
+
from .abspath import *
|
|
11
|
+
from .alltrue import *
|
|
12
|
+
from .anytrue import *
|
|
13
|
+
from .base64decode import *
|
|
14
|
+
from .base64encode import *
|
|
15
|
+
from .base64gzip import *
|
|
16
|
+
from .base64sha256 import *
|
|
17
|
+
from .base64sha512 import *
|
|
18
|
+
from .basename import *
|
|
19
|
+
from .bcrypt import *
|
|
20
|
+
from .ceil import *
|
|
21
|
+
from .chomp import *
|
|
22
|
+
from .chunklist import *
|
|
23
|
+
from .cidrhost import *
|
|
24
|
+
from .cidrnetmask import *
|
|
25
|
+
from .cidrsubnet import *
|
|
26
|
+
from .cidrsubnets import *
|
|
27
|
+
from .coalesce import *
|
|
28
|
+
from .coalescelist import *
|
|
29
|
+
from .compact import *
|
|
30
|
+
from .concat import *
|
|
31
|
+
from .contains import *
|
|
32
|
+
from .csvdecode import *
|
|
33
|
+
from .dirname import *
|
|
34
|
+
from .distinct import *
|
|
35
|
+
from .element import *
|
|
36
|
+
from .endswith import *
|
|
37
|
+
from .file import *
|
|
38
|
+
from .filebase64 import *
|
|
39
|
+
from .filebase64sha256 import *
|
|
40
|
+
from .filebase64sha512 import *
|
|
41
|
+
from .fileexists import *
|
|
42
|
+
from .filemd5 import *
|
|
43
|
+
from .filesha1 import *
|
|
44
|
+
from .filesha256 import *
|
|
45
|
+
from .filesha512 import *
|
|
46
|
+
from .flatten import *
|
|
47
|
+
from .floor import *
|
|
48
|
+
from .format import *
|
|
49
|
+
from .formatlist import *
|
|
50
|
+
from .indent import *
|
|
51
|
+
from .index import *
|
|
52
|
+
from .join import *
|
|
53
|
+
from .jsondecode import *
|
|
54
|
+
from .jsonencode import *
|
|
55
|
+
from .keys import *
|
|
56
|
+
from .length import *
|
|
57
|
+
from .log import *
|
|
58
|
+
from .lookup import *
|
|
59
|
+
from .lower import *
|
|
60
|
+
from .map import *
|
|
61
|
+
from .matchkeys import *
|
|
62
|
+
from .max import *
|
|
63
|
+
from .md5 import *
|
|
64
|
+
from .merge import *
|
|
65
|
+
from .min import *
|
|
66
|
+
from .parseint import *
|
|
67
|
+
from .pathexpand import *
|
|
68
|
+
from .pow import *
|
|
69
|
+
from .provider import *
|
|
70
|
+
from .range import *
|
|
71
|
+
from .regex import *
|
|
72
|
+
from .regexall import *
|
|
73
|
+
from .replace import *
|
|
74
|
+
from .reverse import *
|
|
75
|
+
from .rsadecrypt import *
|
|
76
|
+
from .setintersection import *
|
|
77
|
+
from .sha1 import *
|
|
78
|
+
from .sha256 import *
|
|
79
|
+
from .sha512 import *
|
|
80
|
+
from .signum import *
|
|
81
|
+
from .slice import *
|
|
82
|
+
from .sort import *
|
|
83
|
+
from .split import *
|
|
84
|
+
from .startswith import *
|
|
85
|
+
from .strrev import *
|
|
86
|
+
from .substr import *
|
|
87
|
+
from .sum import *
|
|
88
|
+
from .timeadd import *
|
|
89
|
+
from .timecmp import *
|
|
90
|
+
from .timestamp import *
|
|
91
|
+
from .title import *
|
|
92
|
+
from .tobool import *
|
|
93
|
+
from .tolist import *
|
|
94
|
+
from .tonumber import *
|
|
95
|
+
from .toset import *
|
|
96
|
+
from .tostring import *
|
|
97
|
+
from .transpose import *
|
|
98
|
+
from .trim import *
|
|
99
|
+
from .trimprefix import *
|
|
100
|
+
from .trimspace import *
|
|
101
|
+
from .trimsuffix import *
|
|
102
|
+
from .upper import *
|
|
103
|
+
from .urlencode import *
|
|
104
|
+
from .uuid import *
|
|
105
|
+
from .values import *
|
|
106
|
+
from .zipmap import *
|
|
107
|
+
_utilities.register(
|
|
108
|
+
resource_modules="""
|
|
109
|
+
[]
|
|
110
|
+
""",
|
|
111
|
+
resource_packages="""
|
|
112
|
+
[
|
|
113
|
+
{
|
|
114
|
+
"pkg": "std",
|
|
115
|
+
"token": "pulumi:providers:std",
|
|
116
|
+
"fqn": "pulumi_std",
|
|
117
|
+
"class": "Provider"
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
"""
|
|
121
|
+
)
|
pulumi_std/_utilities.py
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
# *** WARNING: this file was generated by pulumi-language-python. ***
|
|
3
|
+
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
import asyncio
|
|
7
|
+
import functools
|
|
8
|
+
import importlib.metadata
|
|
9
|
+
import importlib.util
|
|
10
|
+
import inspect
|
|
11
|
+
import json
|
|
12
|
+
import os
|
|
13
|
+
import sys
|
|
14
|
+
import typing
|
|
15
|
+
import warnings
|
|
16
|
+
import base64
|
|
17
|
+
|
|
18
|
+
import pulumi
|
|
19
|
+
import pulumi.runtime
|
|
20
|
+
from pulumi.runtime.sync_await import _sync_await
|
|
21
|
+
from pulumi.runtime.proto import resource_pb2
|
|
22
|
+
|
|
23
|
+
from semver import VersionInfo as SemverVersion
|
|
24
|
+
from parver import Version as PEP440Version
|
|
25
|
+
|
|
26
|
+
C = typing.TypeVar("C", bound=typing.Callable)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def get_env(*args):
|
|
30
|
+
for v in args:
|
|
31
|
+
value = os.getenv(v)
|
|
32
|
+
if value is not None:
|
|
33
|
+
return value
|
|
34
|
+
return None
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def get_env_bool(*args):
|
|
38
|
+
str = get_env(*args)
|
|
39
|
+
if str is not None:
|
|
40
|
+
# NOTE: these values are taken from https://golang.org/src/strconv/atob.go?s=351:391#L1, which is what
|
|
41
|
+
# Terraform uses internally when parsing boolean values.
|
|
42
|
+
if str in ["1", "t", "T", "true", "TRUE", "True"]:
|
|
43
|
+
return True
|
|
44
|
+
if str in ["0", "f", "F", "false", "FALSE", "False"]:
|
|
45
|
+
return False
|
|
46
|
+
return None
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def get_env_int(*args):
|
|
50
|
+
str = get_env(*args)
|
|
51
|
+
if str is not None:
|
|
52
|
+
try:
|
|
53
|
+
return int(str)
|
|
54
|
+
except:
|
|
55
|
+
return None
|
|
56
|
+
return None
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def get_env_float(*args):
|
|
60
|
+
str = get_env(*args)
|
|
61
|
+
if str is not None:
|
|
62
|
+
try:
|
|
63
|
+
return float(str)
|
|
64
|
+
except:
|
|
65
|
+
return None
|
|
66
|
+
return None
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def _get_semver_version():
|
|
70
|
+
# __name__ is set to the fully-qualified name of the current module, In our case, it will be
|
|
71
|
+
# <some module>._utilities. <some module> is the module we want to query the version for.
|
|
72
|
+
root_package, *rest = __name__.split('.')
|
|
73
|
+
|
|
74
|
+
# pkg_resources uses setuptools to inspect the set of installed packages. We use it here to ask
|
|
75
|
+
# for the currently installed version of the root package (i.e. us) and get its version.
|
|
76
|
+
|
|
77
|
+
# Unfortunately, PEP440 and semver differ slightly in incompatible ways. The Pulumi engine expects
|
|
78
|
+
# to receive a valid semver string when receiving requests from the language host, so it's our
|
|
79
|
+
# responsibility as the library to convert our own PEP440 version into a valid semver string.
|
|
80
|
+
|
|
81
|
+
pep440_version_string = importlib.metadata.version(root_package)
|
|
82
|
+
pep440_version = PEP440Version.parse(pep440_version_string)
|
|
83
|
+
(major, minor, patch) = pep440_version.release
|
|
84
|
+
prerelease = None
|
|
85
|
+
if pep440_version.pre_tag == 'a':
|
|
86
|
+
prerelease = f"alpha.{pep440_version.pre}"
|
|
87
|
+
elif pep440_version.pre_tag == 'b':
|
|
88
|
+
prerelease = f"beta.{pep440_version.pre}"
|
|
89
|
+
elif pep440_version.pre_tag == 'rc':
|
|
90
|
+
prerelease = f"rc.{pep440_version.pre}"
|
|
91
|
+
elif pep440_version.dev is not None:
|
|
92
|
+
# PEP440 has explicit support for dev builds, while semver encodes them as "prerelease" versions. To bridge
|
|
93
|
+
# between the two, we convert our dev build version into a prerelease tag. This matches what all of our other
|
|
94
|
+
# packages do when constructing their own semver string.
|
|
95
|
+
prerelease = f"dev.{pep440_version.dev}"
|
|
96
|
+
elif pep440_version.local is not None:
|
|
97
|
+
# PEP440 only allows a small set of prerelease tags, so when converting an arbitrary prerelease,
|
|
98
|
+
# PypiVersion in /pkg/codegen/python/utilities.go converts it to a local version. Therefore, we need to
|
|
99
|
+
# do the reverse conversion here and set the local version as the prerelease tag.
|
|
100
|
+
prerelease = pep440_version.local
|
|
101
|
+
|
|
102
|
+
return SemverVersion(major=major, minor=minor, patch=patch, prerelease=prerelease)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# Determine the version once and cache the value, which measurably improves program performance.
|
|
106
|
+
_version = _get_semver_version()
|
|
107
|
+
_version_str = str(_version)
|
|
108
|
+
|
|
109
|
+
def get_resource_opts_defaults() -> pulumi.ResourceOptions:
|
|
110
|
+
return pulumi.ResourceOptions(
|
|
111
|
+
version=get_version(),
|
|
112
|
+
plugin_download_url=get_plugin_download_url(),
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
def get_invoke_opts_defaults() -> pulumi.InvokeOptions:
|
|
116
|
+
return pulumi.InvokeOptions(
|
|
117
|
+
version=get_version(),
|
|
118
|
+
plugin_download_url=get_plugin_download_url(),
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
def get_resource_args_opts(resource_args_type, resource_options_type, *args, **kwargs):
|
|
122
|
+
"""
|
|
123
|
+
Return the resource args and options given the *args and **kwargs of a resource's
|
|
124
|
+
__init__ method.
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
resource_args, opts = None, None
|
|
128
|
+
|
|
129
|
+
# If the first item is the resource args type, save it and remove it from the args list.
|
|
130
|
+
if args and isinstance(args[0], resource_args_type):
|
|
131
|
+
resource_args, args = args[0], args[1:]
|
|
132
|
+
|
|
133
|
+
# Now look at the first item in the args list again.
|
|
134
|
+
# If the first item is the resource options class, save it.
|
|
135
|
+
if args and isinstance(args[0], resource_options_type):
|
|
136
|
+
opts = args[0]
|
|
137
|
+
|
|
138
|
+
# If resource_args is None, see if "args" is in kwargs, and, if so, if it's typed as the
|
|
139
|
+
# the resource args type.
|
|
140
|
+
if resource_args is None:
|
|
141
|
+
a = kwargs.get("args")
|
|
142
|
+
if isinstance(a, resource_args_type):
|
|
143
|
+
resource_args = a
|
|
144
|
+
|
|
145
|
+
# If opts is None, look it up in kwargs.
|
|
146
|
+
if opts is None:
|
|
147
|
+
opts = kwargs.get("opts")
|
|
148
|
+
|
|
149
|
+
return resource_args, opts
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
# Temporary: just use pulumi._utils.lazy_import once everyone upgrades.
|
|
153
|
+
def lazy_import(fullname):
|
|
154
|
+
|
|
155
|
+
import pulumi._utils as u
|
|
156
|
+
f = getattr(u, 'lazy_import', None)
|
|
157
|
+
if f is None:
|
|
158
|
+
f = _lazy_import_temp
|
|
159
|
+
|
|
160
|
+
return f(fullname)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
# Copied from pulumi._utils.lazy_import, see comments there.
|
|
164
|
+
def _lazy_import_temp(fullname):
|
|
165
|
+
m = sys.modules.get(fullname, None)
|
|
166
|
+
if m is not None:
|
|
167
|
+
return m
|
|
168
|
+
|
|
169
|
+
spec = importlib.util.find_spec(fullname)
|
|
170
|
+
|
|
171
|
+
m = sys.modules.get(fullname, None)
|
|
172
|
+
if m is not None:
|
|
173
|
+
return m
|
|
174
|
+
|
|
175
|
+
loader = importlib.util.LazyLoader(spec.loader)
|
|
176
|
+
spec.loader = loader
|
|
177
|
+
module = importlib.util.module_from_spec(spec)
|
|
178
|
+
|
|
179
|
+
m = sys.modules.get(fullname, None)
|
|
180
|
+
if m is not None:
|
|
181
|
+
return m
|
|
182
|
+
|
|
183
|
+
sys.modules[fullname] = module
|
|
184
|
+
loader.exec_module(module)
|
|
185
|
+
return module
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
class Package(pulumi.runtime.ResourcePackage):
|
|
189
|
+
def __init__(self, pkg_info):
|
|
190
|
+
super().__init__()
|
|
191
|
+
self.pkg_info = pkg_info
|
|
192
|
+
|
|
193
|
+
def version(self):
|
|
194
|
+
return _version
|
|
195
|
+
|
|
196
|
+
def construct_provider(self, name: str, typ: str, urn: str) -> pulumi.ProviderResource:
|
|
197
|
+
if typ != self.pkg_info['token']:
|
|
198
|
+
raise Exception(f"unknown provider type {typ}")
|
|
199
|
+
Provider = getattr(lazy_import(self.pkg_info['fqn']), self.pkg_info['class'])
|
|
200
|
+
return Provider(name, pulumi.ResourceOptions(urn=urn))
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
class Module(pulumi.runtime.ResourceModule):
|
|
204
|
+
def __init__(self, mod_info):
|
|
205
|
+
super().__init__()
|
|
206
|
+
self.mod_info = mod_info
|
|
207
|
+
|
|
208
|
+
def version(self):
|
|
209
|
+
return _version
|
|
210
|
+
|
|
211
|
+
def construct(self, name: str, typ: str, urn: str) -> pulumi.Resource:
|
|
212
|
+
class_name = self.mod_info['classes'].get(typ, None)
|
|
213
|
+
|
|
214
|
+
if class_name is None:
|
|
215
|
+
raise Exception(f"unknown resource type {typ}")
|
|
216
|
+
|
|
217
|
+
TheClass = getattr(lazy_import(self.mod_info['fqn']), class_name)
|
|
218
|
+
return TheClass(name, pulumi.ResourceOptions(urn=urn))
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
def register(resource_modules, resource_packages):
|
|
222
|
+
resource_modules = json.loads(resource_modules)
|
|
223
|
+
resource_packages = json.loads(resource_packages)
|
|
224
|
+
|
|
225
|
+
for pkg_info in resource_packages:
|
|
226
|
+
pulumi.runtime.register_resource_package(pkg_info['pkg'], Package(pkg_info))
|
|
227
|
+
|
|
228
|
+
for mod_info in resource_modules:
|
|
229
|
+
pulumi.runtime.register_resource_module(
|
|
230
|
+
mod_info['pkg'],
|
|
231
|
+
mod_info['mod'],
|
|
232
|
+
Module(mod_info))
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
_F = typing.TypeVar('_F', bound=typing.Callable[..., typing.Any])
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
def lift_output_func(func: typing.Any) -> typing.Callable[[_F], _F]:
|
|
239
|
+
"""Decorator internally used on {fn}_output lifted function versions
|
|
240
|
+
to implement them automatically from the un-lifted function."""
|
|
241
|
+
|
|
242
|
+
func_sig = inspect.signature(func)
|
|
243
|
+
|
|
244
|
+
def lifted_func(*args, opts=None, **kwargs):
|
|
245
|
+
bound_args = func_sig.bind(*args, **kwargs)
|
|
246
|
+
# Convert tuple to list, see pulumi/pulumi#8172
|
|
247
|
+
args_list = list(bound_args.args)
|
|
248
|
+
return pulumi.Output.from_input({
|
|
249
|
+
'args': args_list,
|
|
250
|
+
'kwargs': bound_args.kwargs
|
|
251
|
+
}).apply(lambda resolved_args: func(*resolved_args['args'],
|
|
252
|
+
opts=opts,
|
|
253
|
+
**resolved_args['kwargs']))
|
|
254
|
+
|
|
255
|
+
return (lambda _: lifted_func)
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
def call_plain(
|
|
259
|
+
tok: str,
|
|
260
|
+
props: pulumi.Inputs,
|
|
261
|
+
res: typing.Optional[pulumi.Resource] = None,
|
|
262
|
+
typ: typing.Optional[type] = None,
|
|
263
|
+
) -> typing.Any:
|
|
264
|
+
"""
|
|
265
|
+
Wraps pulumi.runtime.plain to force the output and return it plainly.
|
|
266
|
+
"""
|
|
267
|
+
|
|
268
|
+
output = pulumi.runtime.call(tok, props, res, typ)
|
|
269
|
+
|
|
270
|
+
# Ingoring deps silently. They are typically non-empty, r.f() calls include r as a dependency.
|
|
271
|
+
result, known, secret, _ = _sync_await(asyncio.create_task(_await_output(output)))
|
|
272
|
+
|
|
273
|
+
problem = None
|
|
274
|
+
if not known:
|
|
275
|
+
problem = ' an unknown value'
|
|
276
|
+
elif secret:
|
|
277
|
+
problem = ' a secret value'
|
|
278
|
+
|
|
279
|
+
if problem:
|
|
280
|
+
raise AssertionError(
|
|
281
|
+
f"Plain resource method '{tok}' incorrectly returned {problem}. "
|
|
282
|
+
+ "This is an error in the provider, please report this to the provider developer."
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
return result
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
async def _await_output(o: pulumi.Output[typing.Any]) -> typing.Tuple[object, bool, bool, set]:
|
|
289
|
+
return (
|
|
290
|
+
await o._future,
|
|
291
|
+
await o._is_known,
|
|
292
|
+
await o._is_secret,
|
|
293
|
+
await o._resources,
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
# This is included to provide an upgrade path for users who are using a version
|
|
298
|
+
# of the Pulumi SDK (<3.121.0) that does not include the `deprecated` decorator.
|
|
299
|
+
def deprecated(message: str) -> typing.Callable[[C], C]:
|
|
300
|
+
"""
|
|
301
|
+
Decorator to indicate a function is deprecated.
|
|
302
|
+
|
|
303
|
+
As well as inserting appropriate statements to indicate that the function is
|
|
304
|
+
deprecated, this decorator also tags the function with a special attribute
|
|
305
|
+
so that Pulumi code can detect that it is deprecated and react appropriately
|
|
306
|
+
in certain situations.
|
|
307
|
+
|
|
308
|
+
message is the deprecation message that should be printed if the function is called.
|
|
309
|
+
"""
|
|
310
|
+
|
|
311
|
+
def decorator(fn: C) -> C:
|
|
312
|
+
if not callable(fn):
|
|
313
|
+
raise TypeError("Expected fn to be callable")
|
|
314
|
+
|
|
315
|
+
@functools.wraps(fn)
|
|
316
|
+
def deprecated_fn(*args, **kwargs):
|
|
317
|
+
warnings.warn(message)
|
|
318
|
+
pulumi.warn(f"{fn.__name__} is deprecated: {message}")
|
|
319
|
+
|
|
320
|
+
return fn(*args, **kwargs)
|
|
321
|
+
|
|
322
|
+
deprecated_fn.__dict__["_pulumi_deprecated_callable"] = fn
|
|
323
|
+
return typing.cast(C, deprecated_fn)
|
|
324
|
+
|
|
325
|
+
return decorator
|
|
326
|
+
|
|
327
|
+
def get_plugin_download_url():
|
|
328
|
+
return None
|
|
329
|
+
|
|
330
|
+
def get_version():
|
|
331
|
+
return _version_str
|
pulumi_std/abs.py
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
# *** WARNING: this file was generated by pulumi-language-python. ***
|
|
3
|
+
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
|
+
|
|
5
|
+
import builtins as _builtins
|
|
6
|
+
import warnings
|
|
7
|
+
import sys
|
|
8
|
+
import pulumi
|
|
9
|
+
import pulumi.runtime
|
|
10
|
+
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
|
11
|
+
if sys.version_info >= (3, 11):
|
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
|
13
|
+
else:
|
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
|
15
|
+
from . import _utilities
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
'AbsResult',
|
|
19
|
+
'AwaitableAbsResult',
|
|
20
|
+
'abs',
|
|
21
|
+
'abs_output',
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
@pulumi.output_type
|
|
25
|
+
class AbsResult:
|
|
26
|
+
def __init__(__self__, result=None):
|
|
27
|
+
if result and not isinstance(result, float):
|
|
28
|
+
raise TypeError("Expected argument 'result' to be a float")
|
|
29
|
+
pulumi.set(__self__, "result", result)
|
|
30
|
+
|
|
31
|
+
@_builtins.property
|
|
32
|
+
@pulumi.getter
|
|
33
|
+
def result(self) -> _builtins.float:
|
|
34
|
+
return pulumi.get(self, "result")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class AwaitableAbsResult(AbsResult):
|
|
38
|
+
# pylint: disable=using-constant-test
|
|
39
|
+
def __await__(self):
|
|
40
|
+
if False:
|
|
41
|
+
yield self
|
|
42
|
+
return AbsResult(
|
|
43
|
+
result=self.result)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def abs(input: Optional[_builtins.float] = None,
|
|
47
|
+
opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableAbsResult:
|
|
48
|
+
"""
|
|
49
|
+
Returns the absolute value of a given float.
|
|
50
|
+
Example: abs(1) returns 1, and abs(-1) would also return 1, whereas abs(-3.14) would return 3.14.
|
|
51
|
+
"""
|
|
52
|
+
__args__ = dict()
|
|
53
|
+
__args__['input'] = input
|
|
54
|
+
opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
|
|
55
|
+
__ret__ = pulumi.runtime.invoke('std:index:abs', __args__, opts=opts, typ=AbsResult).value
|
|
56
|
+
|
|
57
|
+
return AwaitableAbsResult(
|
|
58
|
+
result=pulumi.get(__ret__, 'result'))
|
|
59
|
+
def abs_output(input: Optional[pulumi.Input[_builtins.float]] = None,
|
|
60
|
+
opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[AbsResult]:
|
|
61
|
+
"""
|
|
62
|
+
Returns the absolute value of a given float.
|
|
63
|
+
Example: abs(1) returns 1, and abs(-1) would also return 1, whereas abs(-3.14) would return 3.14.
|
|
64
|
+
"""
|
|
65
|
+
__args__ = dict()
|
|
66
|
+
__args__['input'] = input
|
|
67
|
+
opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
|
|
68
|
+
__ret__ = pulumi.runtime.invoke_output('std:index:abs', __args__, opts=opts, typ=AbsResult)
|
|
69
|
+
return __ret__.apply(lambda __response__: AbsResult(
|
|
70
|
+
result=pulumi.get(__response__, 'result')))
|
pulumi_std/abspath.py
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
# *** WARNING: this file was generated by pulumi-language-python. ***
|
|
3
|
+
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
|
+
|
|
5
|
+
import builtins as _builtins
|
|
6
|
+
import warnings
|
|
7
|
+
import sys
|
|
8
|
+
import pulumi
|
|
9
|
+
import pulumi.runtime
|
|
10
|
+
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
|
11
|
+
if sys.version_info >= (3, 11):
|
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
|
13
|
+
else:
|
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
|
15
|
+
from . import _utilities
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
'AbspathResult',
|
|
19
|
+
'AwaitableAbspathResult',
|
|
20
|
+
'abspath',
|
|
21
|
+
'abspath_output',
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
@pulumi.output_type
|
|
25
|
+
class AbspathResult:
|
|
26
|
+
def __init__(__self__, result=None):
|
|
27
|
+
if result and not isinstance(result, str):
|
|
28
|
+
raise TypeError("Expected argument 'result' to be a str")
|
|
29
|
+
pulumi.set(__self__, "result", result)
|
|
30
|
+
|
|
31
|
+
@_builtins.property
|
|
32
|
+
@pulumi.getter
|
|
33
|
+
def result(self) -> _builtins.str:
|
|
34
|
+
return pulumi.get(self, "result")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class AwaitableAbspathResult(AbspathResult):
|
|
38
|
+
# pylint: disable=using-constant-test
|
|
39
|
+
def __await__(self):
|
|
40
|
+
if False:
|
|
41
|
+
yield self
|
|
42
|
+
return AbspathResult(
|
|
43
|
+
result=self.result)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def abspath(input: Optional[_builtins.str] = None,
|
|
47
|
+
opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableAbspathResult:
|
|
48
|
+
"""
|
|
49
|
+
Returns an absolute representation of the specified path.
|
|
50
|
+
If the path is not absolute it will be joined with the current working directory to turn it into an absolute path.
|
|
51
|
+
"""
|
|
52
|
+
__args__ = dict()
|
|
53
|
+
__args__['input'] = input
|
|
54
|
+
opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
|
|
55
|
+
__ret__ = pulumi.runtime.invoke('std:index:abspath', __args__, opts=opts, typ=AbspathResult).value
|
|
56
|
+
|
|
57
|
+
return AwaitableAbspathResult(
|
|
58
|
+
result=pulumi.get(__ret__, 'result'))
|
|
59
|
+
def abspath_output(input: Optional[pulumi.Input[_builtins.str]] = None,
|
|
60
|
+
opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[AbspathResult]:
|
|
61
|
+
"""
|
|
62
|
+
Returns an absolute representation of the specified path.
|
|
63
|
+
If the path is not absolute it will be joined with the current working directory to turn it into an absolute path.
|
|
64
|
+
"""
|
|
65
|
+
__args__ = dict()
|
|
66
|
+
__args__['input'] = input
|
|
67
|
+
opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
|
|
68
|
+
__ret__ = pulumi.runtime.invoke_output('std:index:abspath', __args__, opts=opts, typ=AbspathResult)
|
|
69
|
+
return __ret__.apply(lambda __response__: AbspathResult(
|
|
70
|
+
result=pulumi.get(__response__, 'result')))
|
pulumi_std/alltrue.py
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
# *** WARNING: this file was generated by pulumi-language-python. ***
|
|
3
|
+
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
|
+
|
|
5
|
+
import builtins as _builtins
|
|
6
|
+
import warnings
|
|
7
|
+
import sys
|
|
8
|
+
import pulumi
|
|
9
|
+
import pulumi.runtime
|
|
10
|
+
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
|
11
|
+
if sys.version_info >= (3, 11):
|
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
|
13
|
+
else:
|
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
|
15
|
+
from . import _utilities
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
'AlltrueResult',
|
|
19
|
+
'AwaitableAlltrueResult',
|
|
20
|
+
'alltrue',
|
|
21
|
+
'alltrue_output',
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
@pulumi.output_type
|
|
25
|
+
class AlltrueResult:
|
|
26
|
+
def __init__(__self__, result=None):
|
|
27
|
+
if result and not isinstance(result, bool):
|
|
28
|
+
raise TypeError("Expected argument 'result' to be a bool")
|
|
29
|
+
pulumi.set(__self__, "result", result)
|
|
30
|
+
|
|
31
|
+
@_builtins.property
|
|
32
|
+
@pulumi.getter
|
|
33
|
+
def result(self) -> _builtins.bool:
|
|
34
|
+
return pulumi.get(self, "result")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class AwaitableAlltrueResult(AlltrueResult):
|
|
38
|
+
# pylint: disable=using-constant-test
|
|
39
|
+
def __await__(self):
|
|
40
|
+
if False:
|
|
41
|
+
yield self
|
|
42
|
+
return AlltrueResult(
|
|
43
|
+
result=self.result)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def alltrue(input: Optional[Sequence[Any]] = None,
|
|
47
|
+
opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableAlltrueResult:
|
|
48
|
+
"""
|
|
49
|
+
Returns true if all elements in a given collection are true or \\"true\\".
|
|
50
|
+
It also returns true if the collection is empty.
|
|
51
|
+
"""
|
|
52
|
+
__args__ = dict()
|
|
53
|
+
__args__['input'] = input
|
|
54
|
+
opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
|
|
55
|
+
__ret__ = pulumi.runtime.invoke('std:index:alltrue', __args__, opts=opts, typ=AlltrueResult).value
|
|
56
|
+
|
|
57
|
+
return AwaitableAlltrueResult(
|
|
58
|
+
result=pulumi.get(__ret__, 'result'))
|
|
59
|
+
def alltrue_output(input: Optional[pulumi.Input[Sequence[Any]]] = None,
|
|
60
|
+
opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[AlltrueResult]:
|
|
61
|
+
"""
|
|
62
|
+
Returns true if all elements in a given collection are true or \\"true\\".
|
|
63
|
+
It also returns true if the collection is empty.
|
|
64
|
+
"""
|
|
65
|
+
__args__ = dict()
|
|
66
|
+
__args__['input'] = input
|
|
67
|
+
opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
|
|
68
|
+
__ret__ = pulumi.runtime.invoke_output('std:index:alltrue', __args__, opts=opts, typ=AlltrueResult)
|
|
69
|
+
return __ret__.apply(lambda __response__: AlltrueResult(
|
|
70
|
+
result=pulumi.get(__response__, 'result')))
|