pulumi-consul 3.12.0a1709360320__py3-none-any.whl → 3.13.0a1736832526__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.

Potentially problematic release.


This version of pulumi-consul might be problematic. Click here for more details.

Files changed (71) hide show
  1. pulumi_consul/__init__.py +10 -0
  2. pulumi_consul/_inputs.py +1592 -31
  3. pulumi_consul/_utilities.py +41 -5
  4. pulumi_consul/acl_auth_method.py +17 -14
  5. pulumi_consul/acl_binding_rule.py +12 -5
  6. pulumi_consul/acl_policy.py +9 -4
  7. pulumi_consul/acl_role.py +39 -30
  8. pulumi_consul/acl_role_policy_attachment.py +15 -8
  9. pulumi_consul/acl_token.py +36 -27
  10. pulumi_consul/acl_token_policy_attachment.py +7 -2
  11. pulumi_consul/acl_token_role_attachment.py +11 -4
  12. pulumi_consul/admin_partition.py +13 -4
  13. pulumi_consul/agent_service.py +7 -0
  14. pulumi_consul/autopilot_config.py +5 -0
  15. pulumi_consul/catalog_entry.py +16 -62
  16. pulumi_consul/certificate_authority.py +10 -51
  17. pulumi_consul/config/__init__.pyi +5 -0
  18. pulumi_consul/config/outputs.py +5 -0
  19. pulumi_consul/config/vars.py +5 -0
  20. pulumi_consul/config_entry.py +75 -26
  21. pulumi_consul/config_entry_service_defaults.py +58 -51
  22. pulumi_consul/config_entry_service_intentions.py +80 -71
  23. pulumi_consul/config_entry_service_resolver.py +94 -87
  24. pulumi_consul/config_entry_service_router.py +31 -62
  25. pulumi_consul/config_entry_service_splitter.py +104 -93
  26. pulumi_consul/config_entry_v2_exported_services.py +479 -0
  27. pulumi_consul/get_acl_auth_method.py +26 -8
  28. pulumi_consul/get_acl_policy.py +20 -5
  29. pulumi_consul/get_acl_role.py +24 -5
  30. pulumi_consul/get_acl_token.py +25 -5
  31. pulumi_consul/get_acl_token_secret_id.py +29 -11
  32. pulumi_consul/get_agent_config.py +17 -5
  33. pulumi_consul/get_agent_self.py +82 -5
  34. pulumi_consul/get_autopilot_health.py +16 -5
  35. pulumi_consul/get_catalog_nodes.py +21 -9
  36. pulumi_consul/get_catalog_service.py +56 -13
  37. pulumi_consul/get_catalog_services.py +53 -9
  38. pulumi_consul/get_config_entry.py +20 -5
  39. pulumi_consul/get_config_entry_v2_exported_services.py +232 -0
  40. pulumi_consul/get_datacenters.py +12 -5
  41. pulumi_consul/get_key_prefix.py +55 -38
  42. pulumi_consul/get_keys.py +44 -30
  43. pulumi_consul/get_network_area_members.py +26 -16
  44. pulumi_consul/get_network_segments.py +22 -14
  45. pulumi_consul/get_nodes.py +21 -9
  46. pulumi_consul/get_peering.py +22 -5
  47. pulumi_consul/get_peerings.py +14 -5
  48. pulumi_consul/get_service.py +56 -13
  49. pulumi_consul/get_service_health.py +28 -5
  50. pulumi_consul/get_services.py +53 -9
  51. pulumi_consul/intention.py +17 -12
  52. pulumi_consul/key_prefix.py +48 -50
  53. pulumi_consul/keys.py +26 -30
  54. pulumi_consul/license.py +9 -2
  55. pulumi_consul/namespace.py +13 -4
  56. pulumi_consul/namespace_policy_attachment.py +11 -4
  57. pulumi_consul/namespace_role_attachment.py +11 -4
  58. pulumi_consul/network_area.py +11 -15
  59. pulumi_consul/node.py +19 -19
  60. pulumi_consul/outputs.py +30 -27
  61. pulumi_consul/peering.py +13 -18
  62. pulumi_consul/peering_token.py +55 -11
  63. pulumi_consul/prepared_query.py +101 -101
  64. pulumi_consul/provider.py +11 -6
  65. pulumi_consul/pulumi-plugin.json +2 -1
  66. pulumi_consul/service.py +144 -19
  67. {pulumi_consul-3.12.0a1709360320.dist-info → pulumi_consul-3.13.0a1736832526.dist-info}/METADATA +7 -6
  68. pulumi_consul-3.13.0a1736832526.dist-info/RECORD +72 -0
  69. {pulumi_consul-3.12.0a1709360320.dist-info → pulumi_consul-3.13.0a1736832526.dist-info}/WHEEL +1 -1
  70. pulumi_consul-3.12.0a1709360320.dist-info/RECORD +0 -70
  71. {pulumi_consul-3.12.0a1709360320.dist-info → pulumi_consul-3.13.0a1736832526.dist-info}/top_level.txt +0 -0
@@ -4,9 +4,14 @@
4
4
 
5
5
  import copy
6
6
  import warnings
7
+ import sys
7
8
  import pulumi
8
9
  import pulumi.runtime
9
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
10
15
  from . import _utilities
11
16
 
12
17
  __all__ = [
@@ -132,14 +137,11 @@ def get_config_entry(kind: Optional[str] = None,
132
137
  name=pulumi.get(__ret__, 'name'),
133
138
  namespace=pulumi.get(__ret__, 'namespace'),
134
139
  partition=pulumi.get(__ret__, 'partition'))
135
-
136
-
137
- @_utilities.lift_output_func(get_config_entry)
138
140
  def get_config_entry_output(kind: Optional[pulumi.Input[str]] = None,
139
141
  name: Optional[pulumi.Input[str]] = None,
140
142
  namespace: Optional[pulumi.Input[Optional[str]]] = None,
141
143
  partition: Optional[pulumi.Input[Optional[str]]] = None,
142
- opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetConfigEntryResult]:
144
+ opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetConfigEntryResult]:
143
145
  """
144
146
  Use this data source to access information about an existing resource.
145
147
 
@@ -148,4 +150,17 @@ def get_config_entry_output(kind: Optional[pulumi.Input[str]] = None,
148
150
  :param str namespace: The namespace the config entry is associated with.
149
151
  :param str partition: The partition the config entry is associated with.
150
152
  """
151
- ...
153
+ __args__ = dict()
154
+ __args__['kind'] = kind
155
+ __args__['name'] = name
156
+ __args__['namespace'] = namespace
157
+ __args__['partition'] = partition
158
+ opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
159
+ __ret__ = pulumi.runtime.invoke_output('consul:index/getConfigEntry:getConfigEntry', __args__, opts=opts, typ=GetConfigEntryResult)
160
+ return __ret__.apply(lambda __response__: GetConfigEntryResult(
161
+ config_json=pulumi.get(__response__, 'config_json'),
162
+ id=pulumi.get(__response__, 'id'),
163
+ kind=pulumi.get(__response__, 'kind'),
164
+ name=pulumi.get(__response__, 'name'),
165
+ namespace=pulumi.get(__response__, 'namespace'),
166
+ partition=pulumi.get(__response__, 'partition')))
@@ -0,0 +1,232 @@
1
+ # coding=utf-8
2
+ # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
3
+ # *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+
5
+ import copy
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
+ 'GetConfigEntryV2ExportedServicesResult',
19
+ 'AwaitableGetConfigEntryV2ExportedServicesResult',
20
+ 'get_config_entry_v2_exported_services',
21
+ 'get_config_entry_v2_exported_services_output',
22
+ ]
23
+
24
+ @pulumi.output_type
25
+ class GetConfigEntryV2ExportedServicesResult:
26
+ """
27
+ A collection of values returned by getConfigEntryV2ExportedServices.
28
+ """
29
+ def __init__(__self__, id=None, kind=None, name=None, namespace=None, partition=None, partition_consumers=None, peer_consumers=None, sameness_group_consumers=None, services=None):
30
+ if id and not isinstance(id, str):
31
+ raise TypeError("Expected argument 'id' to be a str")
32
+ pulumi.set(__self__, "id", id)
33
+ if kind and not isinstance(kind, str):
34
+ raise TypeError("Expected argument 'kind' to be a str")
35
+ pulumi.set(__self__, "kind", kind)
36
+ if name and not isinstance(name, str):
37
+ raise TypeError("Expected argument 'name' to be a str")
38
+ pulumi.set(__self__, "name", name)
39
+ if namespace and not isinstance(namespace, str):
40
+ raise TypeError("Expected argument 'namespace' to be a str")
41
+ pulumi.set(__self__, "namespace", namespace)
42
+ if partition and not isinstance(partition, str):
43
+ raise TypeError("Expected argument 'partition' to be a str")
44
+ pulumi.set(__self__, "partition", partition)
45
+ if partition_consumers and not isinstance(partition_consumers, list):
46
+ raise TypeError("Expected argument 'partition_consumers' to be a list")
47
+ pulumi.set(__self__, "partition_consumers", partition_consumers)
48
+ if peer_consumers and not isinstance(peer_consumers, list):
49
+ raise TypeError("Expected argument 'peer_consumers' to be a list")
50
+ pulumi.set(__self__, "peer_consumers", peer_consumers)
51
+ if sameness_group_consumers and not isinstance(sameness_group_consumers, list):
52
+ raise TypeError("Expected argument 'sameness_group_consumers' to be a list")
53
+ pulumi.set(__self__, "sameness_group_consumers", sameness_group_consumers)
54
+ if services and not isinstance(services, list):
55
+ raise TypeError("Expected argument 'services' to be a list")
56
+ pulumi.set(__self__, "services", services)
57
+
58
+ @property
59
+ @pulumi.getter
60
+ def id(self) -> str:
61
+ """
62
+ The provider-assigned unique ID for this managed resource.
63
+ """
64
+ return pulumi.get(self, "id")
65
+
66
+ @property
67
+ @pulumi.getter
68
+ def kind(self) -> str:
69
+ """
70
+ The kind of exported services config (ExportedServices, NamespaceExportedServices, PartitionExportedServices).
71
+ """
72
+ return pulumi.get(self, "kind")
73
+
74
+ @property
75
+ @pulumi.getter
76
+ def name(self) -> str:
77
+ """
78
+ The name of the config entry to read.
79
+ """
80
+ return pulumi.get(self, "name")
81
+
82
+ @property
83
+ @pulumi.getter
84
+ def namespace(self) -> Optional[str]:
85
+ """
86
+ The namespace the config entry is associated with.
87
+ """
88
+ return pulumi.get(self, "namespace")
89
+
90
+ @property
91
+ @pulumi.getter
92
+ def partition(self) -> Optional[str]:
93
+ """
94
+ The partition the config entry is associated with.
95
+ """
96
+ return pulumi.get(self, "partition")
97
+
98
+ @property
99
+ @pulumi.getter(name="partitionConsumers")
100
+ def partition_consumers(self) -> Optional[Sequence[str]]:
101
+ """
102
+ The exported service partition consumers.
103
+ """
104
+ return pulumi.get(self, "partition_consumers")
105
+
106
+ @property
107
+ @pulumi.getter(name="peerConsumers")
108
+ def peer_consumers(self) -> Optional[Sequence[str]]:
109
+ """
110
+ The exported service peer consumers.
111
+ """
112
+ return pulumi.get(self, "peer_consumers")
113
+
114
+ @property
115
+ @pulumi.getter(name="samenessGroupConsumers")
116
+ def sameness_group_consumers(self) -> Optional[Sequence[str]]:
117
+ """
118
+ The exported service sameness group consumers.
119
+ """
120
+ return pulumi.get(self, "sameness_group_consumers")
121
+
122
+ @property
123
+ @pulumi.getter
124
+ def services(self) -> Optional[Sequence[str]]:
125
+ """
126
+ The exported services.
127
+ """
128
+ return pulumi.get(self, "services")
129
+
130
+
131
+ class AwaitableGetConfigEntryV2ExportedServicesResult(GetConfigEntryV2ExportedServicesResult):
132
+ # pylint: disable=using-constant-test
133
+ def __await__(self):
134
+ if False:
135
+ yield self
136
+ return GetConfigEntryV2ExportedServicesResult(
137
+ id=self.id,
138
+ kind=self.kind,
139
+ name=self.name,
140
+ namespace=self.namespace,
141
+ partition=self.partition,
142
+ partition_consumers=self.partition_consumers,
143
+ peer_consumers=self.peer_consumers,
144
+ sameness_group_consumers=self.sameness_group_consumers,
145
+ services=self.services)
146
+
147
+
148
+ def get_config_entry_v2_exported_services(kind: Optional[str] = None,
149
+ name: Optional[str] = None,
150
+ namespace: Optional[str] = None,
151
+ partition: Optional[str] = None,
152
+ partition_consumers: Optional[Sequence[str]] = None,
153
+ peer_consumers: Optional[Sequence[str]] = None,
154
+ sameness_group_consumers: Optional[Sequence[str]] = None,
155
+ services: Optional[Sequence[str]] = None,
156
+ opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetConfigEntryV2ExportedServicesResult:
157
+ """
158
+ Use this data source to access information about an existing resource.
159
+
160
+ :param str kind: The kind of exported services config (ExportedServices, NamespaceExportedServices, PartitionExportedServices).
161
+ :param str name: The name of the config entry to read.
162
+ :param str namespace: The namespace the config entry is associated with.
163
+ :param str partition: The partition the config entry is associated with.
164
+ :param Sequence[str] partition_consumers: The exported service partition consumers.
165
+ :param Sequence[str] peer_consumers: The exported service peer consumers.
166
+ :param Sequence[str] sameness_group_consumers: The exported service sameness group consumers.
167
+ :param Sequence[str] services: The exported services.
168
+ """
169
+ __args__ = dict()
170
+ __args__['kind'] = kind
171
+ __args__['name'] = name
172
+ __args__['namespace'] = namespace
173
+ __args__['partition'] = partition
174
+ __args__['partitionConsumers'] = partition_consumers
175
+ __args__['peerConsumers'] = peer_consumers
176
+ __args__['samenessGroupConsumers'] = sameness_group_consumers
177
+ __args__['services'] = services
178
+ opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
179
+ __ret__ = pulumi.runtime.invoke('consul:index/getConfigEntryV2ExportedServices:getConfigEntryV2ExportedServices', __args__, opts=opts, typ=GetConfigEntryV2ExportedServicesResult).value
180
+
181
+ return AwaitableGetConfigEntryV2ExportedServicesResult(
182
+ id=pulumi.get(__ret__, 'id'),
183
+ kind=pulumi.get(__ret__, 'kind'),
184
+ name=pulumi.get(__ret__, 'name'),
185
+ namespace=pulumi.get(__ret__, 'namespace'),
186
+ partition=pulumi.get(__ret__, 'partition'),
187
+ partition_consumers=pulumi.get(__ret__, 'partition_consumers'),
188
+ peer_consumers=pulumi.get(__ret__, 'peer_consumers'),
189
+ sameness_group_consumers=pulumi.get(__ret__, 'sameness_group_consumers'),
190
+ services=pulumi.get(__ret__, 'services'))
191
+ def get_config_entry_v2_exported_services_output(kind: Optional[pulumi.Input[str]] = None,
192
+ name: Optional[pulumi.Input[str]] = None,
193
+ namespace: Optional[pulumi.Input[Optional[str]]] = None,
194
+ partition: Optional[pulumi.Input[Optional[str]]] = None,
195
+ partition_consumers: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
196
+ peer_consumers: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
197
+ sameness_group_consumers: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
198
+ services: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
199
+ opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetConfigEntryV2ExportedServicesResult]:
200
+ """
201
+ Use this data source to access information about an existing resource.
202
+
203
+ :param str kind: The kind of exported services config (ExportedServices, NamespaceExportedServices, PartitionExportedServices).
204
+ :param str name: The name of the config entry to read.
205
+ :param str namespace: The namespace the config entry is associated with.
206
+ :param str partition: The partition the config entry is associated with.
207
+ :param Sequence[str] partition_consumers: The exported service partition consumers.
208
+ :param Sequence[str] peer_consumers: The exported service peer consumers.
209
+ :param Sequence[str] sameness_group_consumers: The exported service sameness group consumers.
210
+ :param Sequence[str] services: The exported services.
211
+ """
212
+ __args__ = dict()
213
+ __args__['kind'] = kind
214
+ __args__['name'] = name
215
+ __args__['namespace'] = namespace
216
+ __args__['partition'] = partition
217
+ __args__['partitionConsumers'] = partition_consumers
218
+ __args__['peerConsumers'] = peer_consumers
219
+ __args__['samenessGroupConsumers'] = sameness_group_consumers
220
+ __args__['services'] = services
221
+ opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
222
+ __ret__ = pulumi.runtime.invoke_output('consul:index/getConfigEntryV2ExportedServices:getConfigEntryV2ExportedServices', __args__, opts=opts, typ=GetConfigEntryV2ExportedServicesResult)
223
+ return __ret__.apply(lambda __response__: GetConfigEntryV2ExportedServicesResult(
224
+ id=pulumi.get(__response__, 'id'),
225
+ kind=pulumi.get(__response__, 'kind'),
226
+ name=pulumi.get(__response__, 'name'),
227
+ namespace=pulumi.get(__response__, 'namespace'),
228
+ partition=pulumi.get(__response__, 'partition'),
229
+ partition_consumers=pulumi.get(__response__, 'partition_consumers'),
230
+ peer_consumers=pulumi.get(__response__, 'peer_consumers'),
231
+ sameness_group_consumers=pulumi.get(__response__, 'sameness_group_consumers'),
232
+ services=pulumi.get(__response__, 'services')))
@@ -4,9 +4,14 @@
4
4
 
5
5
  import copy
6
6
  import warnings
7
+ import sys
7
8
  import pulumi
8
9
  import pulumi.runtime
9
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
10
15
  from . import _utilities
11
16
 
12
17
  __all__ = [
@@ -70,12 +75,14 @@ def get_datacenters(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGet
70
75
  return AwaitableGetDatacentersResult(
71
76
  datacenters=pulumi.get(__ret__, 'datacenters'),
72
77
  id=pulumi.get(__ret__, 'id'))
73
-
74
-
75
- @_utilities.lift_output_func(get_datacenters)
76
- def get_datacenters_output(opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetDatacentersResult]:
78
+ def get_datacenters_output(opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetDatacentersResult]:
77
79
  """
78
80
  The `get_datacenters` data source returns the list of all knwown Consul
79
81
  datacenters.
80
82
  """
81
- ...
83
+ __args__ = dict()
84
+ opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
85
+ __ret__ = pulumi.runtime.invoke_output('consul:index/getDatacenters:getDatacenters', __args__, opts=opts, typ=GetDatacentersResult)
86
+ return __ret__.apply(lambda __response__: GetDatacentersResult(
87
+ datacenters=pulumi.get(__response__, 'datacenters'),
88
+ id=pulumi.get(__response__, 'id')))
@@ -4,9 +4,14 @@
4
4
 
5
5
  import copy
6
6
  import warnings
7
+ import sys
7
8
  import pulumi
8
9
  import pulumi.runtime
9
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
10
15
  from . import _utilities
11
16
  from . import outputs
12
17
  from ._inputs import *
@@ -104,12 +109,9 @@ class GetKeyPrefixResult:
104
109
 
105
110
  @property
106
111
  @pulumi.getter
107
- def token(self) -> Optional[str]:
108
- warnings.warn("""The token argument has been deprecated and will be removed in a future release.
109
- Please use the token argument in the provider configuration""", DeprecationWarning)
110
- pulumi.log.warn("""token is deprecated: The token argument has been deprecated and will be removed in a future release.
112
+ @_utilities.deprecated("""The token argument has been deprecated and will be removed in a future release.
111
113
  Please use the token argument in the provider configuration""")
112
-
114
+ def token(self) -> Optional[str]:
113
115
  return pulumi.get(self, "token")
114
116
 
115
117
  @property
@@ -139,7 +141,7 @@ def get_key_prefix(datacenter: Optional[str] = None,
139
141
  namespace: Optional[str] = None,
140
142
  partition: Optional[str] = None,
141
143
  path_prefix: Optional[str] = None,
142
- subkey_collection: Optional[Sequence[pulumi.InputType['GetKeyPrefixSubkeyCollectionArgs']]] = None,
144
+ subkey_collection: Optional[Sequence[Union['GetKeyPrefixSubkeyCollectionArgs', 'GetKeyPrefixSubkeyCollectionArgsDict']]] = None,
143
145
  token: Optional[str] = None,
144
146
  opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetKeyPrefixResult:
145
147
  """
@@ -150,16 +152,16 @@ def get_key_prefix(datacenter: Optional[str] = None,
150
152
  import pulumi_aws as aws
151
153
  import pulumi_consul as consul
152
154
 
153
- app_key_prefix = consul.get_key_prefix(datacenter="nyc1",
155
+ app = consul.get_key_prefix(datacenter="nyc1",
156
+ token="abcd",
154
157
  path_prefix="myapp/config/",
155
- subkey_collection=[consul.GetKeyPrefixSubkeyCollectionArgs(
156
- default="ami-1234",
157
- name="ami",
158
- path="app/launch_ami",
159
- )],
160
- token="abcd")
158
+ subkey_collection=[{
159
+ "name": "ami",
160
+ "path": "app/launch_ami",
161
+ "default": "ami-1234",
162
+ }])
161
163
  # Start our instance with the dynamic ami value
162
- app_instance = aws.ec2.Instance("appInstance", ami=app_key_prefix.var["ami"])
164
+ app_instance = aws.index.Instance("app", ami=app.var.ami)
163
165
  ```
164
166
 
165
167
  ```python
@@ -167,11 +169,11 @@ def get_key_prefix(datacenter: Optional[str] = None,
167
169
  import pulumi_aws as aws
168
170
  import pulumi_consul as consul
169
171
 
170
- web_key_prefix = consul.get_key_prefix(datacenter="nyc1",
171
- path_prefix="myapp/config/",
172
- token="efgh")
172
+ web = consul.get_key_prefix(datacenter="nyc1",
173
+ token="efgh",
174
+ path_prefix="myapp/config/")
173
175
  # Start our instance with the dynamic ami value
174
- web_instance = aws.ec2.Instance("webInstance", ami=web_key_prefix.subkeys["app/launch_ami"])
176
+ web_instance = aws.index.Instance("web", ami=web.subkeys.app_launch_ami)
175
177
  ```
176
178
 
177
179
 
@@ -182,7 +184,7 @@ def get_key_prefix(datacenter: Optional[str] = None,
182
184
  :param str path_prefix: Specifies the common prefix shared by all keys
183
185
  that will be read by this data source instance. In most cases, this will
184
186
  end with a slash to read a "folder" of subkeys.
185
- :param Sequence[pulumi.InputType['GetKeyPrefixSubkeyCollectionArgs']] subkey_collection: Specifies a subkey in Consul to be read. Supported
187
+ :param Sequence[Union['GetKeyPrefixSubkeyCollectionArgs', 'GetKeyPrefixSubkeyCollectionArgsDict']] subkey_collection: Specifies a subkey in Consul to be read. Supported
186
188
  values documented below. Multiple blocks supported.
187
189
  :param str token: The ACL token to use. This overrides the
188
190
  token that the agent provides by default.
@@ -207,16 +209,13 @@ def get_key_prefix(datacenter: Optional[str] = None,
207
209
  subkeys=pulumi.get(__ret__, 'subkeys'),
208
210
  token=pulumi.get(__ret__, 'token'),
209
211
  var=pulumi.get(__ret__, 'var'))
210
-
211
-
212
- @_utilities.lift_output_func(get_key_prefix)
213
212
  def get_key_prefix_output(datacenter: Optional[pulumi.Input[Optional[str]]] = None,
214
213
  namespace: Optional[pulumi.Input[Optional[str]]] = None,
215
214
  partition: Optional[pulumi.Input[Optional[str]]] = None,
216
215
  path_prefix: Optional[pulumi.Input[str]] = None,
217
- subkey_collection: Optional[pulumi.Input[Optional[Sequence[pulumi.InputType['GetKeyPrefixSubkeyCollectionArgs']]]]] = None,
216
+ subkey_collection: Optional[pulumi.Input[Optional[Sequence[Union['GetKeyPrefixSubkeyCollectionArgs', 'GetKeyPrefixSubkeyCollectionArgsDict']]]]] = None,
218
217
  token: Optional[pulumi.Input[Optional[str]]] = None,
219
- opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetKeyPrefixResult]:
218
+ opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetKeyPrefixResult]:
220
219
  """
221
220
  ## Example Usage
222
221
 
@@ -225,16 +224,16 @@ def get_key_prefix_output(datacenter: Optional[pulumi.Input[Optional[str]]] = No
225
224
  import pulumi_aws as aws
226
225
  import pulumi_consul as consul
227
226
 
228
- app_key_prefix = consul.get_key_prefix(datacenter="nyc1",
227
+ app = consul.get_key_prefix(datacenter="nyc1",
228
+ token="abcd",
229
229
  path_prefix="myapp/config/",
230
- subkey_collection=[consul.GetKeyPrefixSubkeyCollectionArgs(
231
- default="ami-1234",
232
- name="ami",
233
- path="app/launch_ami",
234
- )],
235
- token="abcd")
230
+ subkey_collection=[{
231
+ "name": "ami",
232
+ "path": "app/launch_ami",
233
+ "default": "ami-1234",
234
+ }])
236
235
  # Start our instance with the dynamic ami value
237
- app_instance = aws.ec2.Instance("appInstance", ami=app_key_prefix.var["ami"])
236
+ app_instance = aws.index.Instance("app", ami=app.var.ami)
238
237
  ```
239
238
 
240
239
  ```python
@@ -242,11 +241,11 @@ def get_key_prefix_output(datacenter: Optional[pulumi.Input[Optional[str]]] = No
242
241
  import pulumi_aws as aws
243
242
  import pulumi_consul as consul
244
243
 
245
- web_key_prefix = consul.get_key_prefix(datacenter="nyc1",
246
- path_prefix="myapp/config/",
247
- token="efgh")
244
+ web = consul.get_key_prefix(datacenter="nyc1",
245
+ token="efgh",
246
+ path_prefix="myapp/config/")
248
247
  # Start our instance with the dynamic ami value
249
- web_instance = aws.ec2.Instance("webInstance", ami=web_key_prefix.subkeys["app/launch_ami"])
248
+ web_instance = aws.index.Instance("web", ami=web.subkeys.app_launch_ami)
250
249
  ```
251
250
 
252
251
 
@@ -257,9 +256,27 @@ def get_key_prefix_output(datacenter: Optional[pulumi.Input[Optional[str]]] = No
257
256
  :param str path_prefix: Specifies the common prefix shared by all keys
258
257
  that will be read by this data source instance. In most cases, this will
259
258
  end with a slash to read a "folder" of subkeys.
260
- :param Sequence[pulumi.InputType['GetKeyPrefixSubkeyCollectionArgs']] subkey_collection: Specifies a subkey in Consul to be read. Supported
259
+ :param Sequence[Union['GetKeyPrefixSubkeyCollectionArgs', 'GetKeyPrefixSubkeyCollectionArgsDict']] subkey_collection: Specifies a subkey in Consul to be read. Supported
261
260
  values documented below. Multiple blocks supported.
262
261
  :param str token: The ACL token to use. This overrides the
263
262
  token that the agent provides by default.
264
263
  """
265
- ...
264
+ __args__ = dict()
265
+ __args__['datacenter'] = datacenter
266
+ __args__['namespace'] = namespace
267
+ __args__['partition'] = partition
268
+ __args__['pathPrefix'] = path_prefix
269
+ __args__['subkeyCollection'] = subkey_collection
270
+ __args__['token'] = token
271
+ opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
272
+ __ret__ = pulumi.runtime.invoke_output('consul:index/getKeyPrefix:getKeyPrefix', __args__, opts=opts, typ=GetKeyPrefixResult)
273
+ return __ret__.apply(lambda __response__: GetKeyPrefixResult(
274
+ datacenter=pulumi.get(__response__, 'datacenter'),
275
+ id=pulumi.get(__response__, 'id'),
276
+ namespace=pulumi.get(__response__, 'namespace'),
277
+ partition=pulumi.get(__response__, 'partition'),
278
+ path_prefix=pulumi.get(__response__, 'path_prefix'),
279
+ subkey_collection=pulumi.get(__response__, 'subkey_collection'),
280
+ subkeys=pulumi.get(__response__, 'subkeys'),
281
+ token=pulumi.get(__response__, 'token'),
282
+ var=pulumi.get(__response__, 'var')))
pulumi_consul/get_keys.py CHANGED
@@ -4,9 +4,14 @@
4
4
 
5
5
  import copy
6
6
  import warnings
7
+ import sys
7
8
  import pulumi
8
9
  import pulumi.runtime
9
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
10
15
  from . import _utilities
11
16
  from . import outputs
12
17
  from ._inputs import *
@@ -99,15 +104,12 @@ class GetKeysResult:
99
104
 
100
105
  @property
101
106
  @pulumi.getter
107
+ @_utilities.deprecated("""The token argument has been deprecated and will be removed in a future release.
108
+ Please use the token argument in the provider configuration""")
102
109
  def token(self) -> Optional[str]:
103
110
  """
104
111
  The ACL token to use. This overrides the token that the agent provides by default.
105
112
  """
106
- warnings.warn("""The token argument has been deprecated and will be removed in a future release.
107
- Please use the token argument in the provider configuration""", DeprecationWarning)
108
- pulumi.log.warn("""token is deprecated: The token argument has been deprecated and will be removed in a future release.
109
- Please use the token argument in the provider configuration""")
110
-
111
113
  return pulumi.get(self, "token")
112
114
 
113
115
  @property
@@ -137,7 +139,7 @@ class AwaitableGetKeysResult(GetKeysResult):
137
139
 
138
140
  def get_keys(datacenter: Optional[str] = None,
139
141
  error_on_missing_keys: Optional[bool] = None,
140
- keys: Optional[Sequence[pulumi.InputType['GetKeysKeyArgs']]] = None,
142
+ keys: Optional[Sequence[Union['GetKeysKeyArgs', 'GetKeysKeyArgsDict']]] = None,
141
143
  namespace: Optional[str] = None,
142
144
  partition: Optional[str] = None,
143
145
  token: Optional[str] = None,
@@ -152,21 +154,20 @@ def get_keys(datacenter: Optional[str] = None,
152
154
  import pulumi_aws as aws
153
155
  import pulumi_consul as consul
154
156
 
155
- app_keys = consul.get_keys(datacenter="nyc1",
156
- keys=[consul.GetKeysKeyArgs(
157
- name="ami",
158
- path="service/app/launch_ami",
159
- default="ami-1234",
160
- )])
157
+ app = consul.get_keys(datacenter="nyc1",
158
+ keys=[{
159
+ "name": "ami",
160
+ "path": "service/app/launch_ami",
161
+ "default": "ami-1234",
162
+ }])
161
163
  # Start our instance with the dynamic ami value
162
- app_instance = aws.ec2.Instance("appInstance", ami=app_keys.var["ami"])
163
- # ...
164
+ app_instance = aws.index.Instance("app", ami=app.var.ami)
164
165
  ```
165
166
 
166
167
 
167
168
  :param str datacenter: The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
168
169
  :param bool error_on_missing_keys: Whether to return an error when a key is absent from the KV store and no default is configured. This defaults to `false`.
169
- :param Sequence[pulumi.InputType['GetKeysKeyArgs']] keys: Specifies a key in Consul to be read. Supported values documented below. Multiple blocks supported.
170
+ :param Sequence[Union['GetKeysKeyArgs', 'GetKeysKeyArgsDict']] keys: Specifies a key in Consul to be read. Supported values documented below. Multiple blocks supported.
170
171
  :param str namespace: The namespace to lookup the keys.
171
172
  :param str partition: The partition to lookup the keys.
172
173
  :param str token: The ACL token to use. This overrides the token that the agent provides by default.
@@ -190,16 +191,13 @@ def get_keys(datacenter: Optional[str] = None,
190
191
  partition=pulumi.get(__ret__, 'partition'),
191
192
  token=pulumi.get(__ret__, 'token'),
192
193
  var=pulumi.get(__ret__, 'var'))
193
-
194
-
195
- @_utilities.lift_output_func(get_keys)
196
194
  def get_keys_output(datacenter: Optional[pulumi.Input[Optional[str]]] = None,
197
195
  error_on_missing_keys: Optional[pulumi.Input[Optional[bool]]] = None,
198
- keys: Optional[pulumi.Input[Optional[Sequence[pulumi.InputType['GetKeysKeyArgs']]]]] = None,
196
+ keys: Optional[pulumi.Input[Optional[Sequence[Union['GetKeysKeyArgs', 'GetKeysKeyArgsDict']]]]] = None,
199
197
  namespace: Optional[pulumi.Input[Optional[str]]] = None,
200
198
  partition: Optional[pulumi.Input[Optional[str]]] = None,
201
199
  token: Optional[pulumi.Input[Optional[str]]] = None,
202
- opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetKeysResult]:
200
+ opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetKeysResult]:
203
201
  """
204
202
  The `Keys` datasource reads values from the Consul key/value store. This is a powerful way to dynamically set values in templates.
205
203
 
@@ -210,23 +208,39 @@ def get_keys_output(datacenter: Optional[pulumi.Input[Optional[str]]] = None,
210
208
  import pulumi_aws as aws
211
209
  import pulumi_consul as consul
212
210
 
213
- app_keys = consul.get_keys(datacenter="nyc1",
214
- keys=[consul.GetKeysKeyArgs(
215
- name="ami",
216
- path="service/app/launch_ami",
217
- default="ami-1234",
218
- )])
211
+ app = consul.get_keys(datacenter="nyc1",
212
+ keys=[{
213
+ "name": "ami",
214
+ "path": "service/app/launch_ami",
215
+ "default": "ami-1234",
216
+ }])
219
217
  # Start our instance with the dynamic ami value
220
- app_instance = aws.ec2.Instance("appInstance", ami=app_keys.var["ami"])
221
- # ...
218
+ app_instance = aws.index.Instance("app", ami=app.var.ami)
222
219
  ```
223
220
 
224
221
 
225
222
  :param str datacenter: The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
226
223
  :param bool error_on_missing_keys: Whether to return an error when a key is absent from the KV store and no default is configured. This defaults to `false`.
227
- :param Sequence[pulumi.InputType['GetKeysKeyArgs']] keys: Specifies a key in Consul to be read. Supported values documented below. Multiple blocks supported.
224
+ :param Sequence[Union['GetKeysKeyArgs', 'GetKeysKeyArgsDict']] keys: Specifies a key in Consul to be read. Supported values documented below. Multiple blocks supported.
228
225
  :param str namespace: The namespace to lookup the keys.
229
226
  :param str partition: The partition to lookup the keys.
230
227
  :param str token: The ACL token to use. This overrides the token that the agent provides by default.
231
228
  """
232
- ...
229
+ __args__ = dict()
230
+ __args__['datacenter'] = datacenter
231
+ __args__['errorOnMissingKeys'] = error_on_missing_keys
232
+ __args__['keys'] = keys
233
+ __args__['namespace'] = namespace
234
+ __args__['partition'] = partition
235
+ __args__['token'] = token
236
+ opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
237
+ __ret__ = pulumi.runtime.invoke_output('consul:index/getKeys:getKeys', __args__, opts=opts, typ=GetKeysResult)
238
+ return __ret__.apply(lambda __response__: GetKeysResult(
239
+ datacenter=pulumi.get(__response__, 'datacenter'),
240
+ error_on_missing_keys=pulumi.get(__response__, 'error_on_missing_keys'),
241
+ id=pulumi.get(__response__, 'id'),
242
+ keys=pulumi.get(__response__, 'keys'),
243
+ namespace=pulumi.get(__response__, 'namespace'),
244
+ partition=pulumi.get(__response__, 'partition'),
245
+ token=pulumi.get(__response__, 'token'),
246
+ var=pulumi.get(__response__, 'var')))