Core
pulumi_extra.resource_
Utility functions for working with Pulumi resources.
References: - https://github.com/tlinhart/pulumi-aws-tags
get_resource_cls(resource_type)
cached
Get the Pulumi resource class for a given resource type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resource_type
|
str
|
Resource type to get the class for. |
required |
Returns:
| Type | Description |
|---|---|
Any | None
|
Pulumi resource class if found, otherwise |
Source code in pulumi_extra/resource_.py
resource_has_attribute(resource_type, attribute)
cached
Check if a Pulumi resource type has a given attribute.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resource_type
|
str
|
Resource type to check. |
required |
attribute
|
str
|
Attribute to check for. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
|
Source code in pulumi_extra/resource_.py
pulumi_extra.stack_reference
Utils for stack references.
get_stack_outputs(*refs)
Get outputs from a output reference shorthands. Supports brace expansion.
- Single output reference: (
"<stack_ref>:<output_key>"). - Multiple outputs using brace expansion: (
"<stack_ref>:{<output_key_1>,<output_key_2>}").
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*refs
|
str
|
Output references. |
()
|
Source code in pulumi_extra/stack_reference.py
get_stack_reference(ref)
cached
Resolve given stack reference shorthand to fully qualified stack reference.
The shorthand can be one of the following:
-
"{stack}"Returns the stack reference for the current project and organization.
-
"{project}/{stack}"Returns the stack reference for the current organization.
-
"{organization}/{project}/{stack}"No change is made to the stack reference.
Source code in pulumi_extra/stack_reference.py
re_export(*refs)
Re-export outputs from a output reference shorthands.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*refs
|
str
|
Output references. |
()
|
Source code in pulumi_extra/stack_reference.py
pulumi_extra.output
Utils for outputs.
render_template(template, *, context=None, inputs=None)
Render a template file with the given context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
template
|
Path | str
|
The template file or inline template string. |
required |
context
|
Mapping[str, Any] | None
|
The context to render the template with. Conflicts with inputs. |
None
|
inputs
|
Mapping[str, Input[Any]] | None
|
The inputs to render the template with. Conflicts with context. |
None
|
Source code in pulumi_extra/output.py
pulumi_extra.transforms
override_default_provider(*rt_or_it, provider)
Override the default provider for resources and invokes of given types.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*rt_or_it
|
str
|
Resource types or invoke tokens to match. |
()
|
provider
|
ProviderResource
|
Provider to override. |
required |
Source code in pulumi_extra/transforms/runtime.py
override_invoke(*invoke_tokens, args=None, opts=None)
Pulumi transform factory for invoke tokens (get_*).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*invoke_tokens
|
str
|
Invoke tokens to match. Supports glob patterns and brace expand. |
()
|
args
|
_Args | Callable[[_Args], _Args] | None
|
Invoke arguments to override, or a callable that returns the new arguments from given |
None
|
opts
|
InvokeOptions | Callable[[InvokeOptions], InvokeOptions] | None
|
Invoke options to override, or a callable that returns the new options given |
None
|
Source code in pulumi_extra/transforms/invoke.py
override_invoke_defaults(*invoke_tokens, defaults)
Pulumi transform factory that provides default arguments to matching invoke tokens.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*invoke_tokens
|
str
|
Invoke tokens to match. |
()
|
defaults
|
dict[str, Any]
|
Default arguments. |
required |
Source code in pulumi_extra/transforms/invoke.py
override_invoke_options(*invoke_tokens, **options)
Pulumi transform factory that overrides the invoke options for matching invoke tokens.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*invoke_tokens
|
str
|
Invoke tokens to match. |
()
|
options
|
Any
|
Arguments of |
{}
|
Source code in pulumi_extra/transforms/invoke.py
override_resource(*resource_types, props=None, opts=None)
Pulumi transform factory for resources.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*resource_types
|
str
|
Resource types to match. Supports glob patterns and brace expand. |
()
|
props
|
_Props | Callable[[_Props], _Props] | None
|
Resource properties to override, or a callable that returns the new properties from given |
None
|
opts
|
ResourceOptions | Callable[[ResourceOptions], ResourceOptions] | None
|
Resource options to override, or a callable that returns the new options given |
None
|
Source code in pulumi_extra/transforms/resource_.py
override_resource_defaults(*resource_types, defaults)
Pulumi transform factory that provides default properties to matching resource types.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*resource_types
|
str
|
Resource type to match. |
()
|
defaults
|
dict[str, Input[Any]]
|
Default properties. |
required |
Source code in pulumi_extra/transforms/resource_.py
override_resource_options(*resource_types, **options)
Pulumi transform factory that overrides the resource options for resources of given types.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*resource_types
|
str
|
Resource types to match. |
()
|
options
|
Any
|
Arguments of |
{}
|