cloud-foundry 0.2.1__tar.gz → 0.2.3__tar.gz
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.
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/PKG-INFO +1 -1
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/__init__.py +1 -1
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/queue.py +29 -4
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/topic.py +29 -4
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/.gitignore +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/LICENSE +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/README.md +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/archive_builder.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/mail_publisher.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/__init__.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/api_waf.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/cdn.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/cdn_api_origin.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/cdn_site_origin.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/connection_store.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/custom_domain.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/document_repository.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/domain.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/function.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/idle_reaper.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/publisher.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/python_function.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/rest_api.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/site_bucket.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/ui_publisher.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/websocket_api.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/pulumi/websocket_function.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/python_archive_builder.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/services/authorization_api/security_lambda.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/services/mail_publisher.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/utils/aws_openapi_editor.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/utils/hash_comparator.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/utils/logger.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/utils/names.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/utils/openapi_editor.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/cloud_foundry/utils/websocket_utils.py +0 -0
- {cloud_foundry-0.2.1 → cloud_foundry-0.2.3}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cloud-foundry
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: cloud-foundry is a curated set of cloud components that can be used to assemble cloud-based applications.
|
|
5
5
|
Project-URL: Documentation, https://github.com/DanRepik/cloud-foundry
|
|
6
6
|
Project-URL: Source, https://github.com/DanRepik/cloud-foundry
|
|
@@ -39,9 +39,15 @@ class QueueArgs:
|
|
|
39
39
|
self,
|
|
40
40
|
visibility_timeout: Optional[int] = None,
|
|
41
41
|
message_retention: Optional[int] = None,
|
|
42
|
+
receive_wait_time: Optional[int] = None,
|
|
43
|
+
tags: Optional[dict[str, str]] = None,
|
|
42
44
|
) -> None:
|
|
43
45
|
self.visibility_timeout = visibility_timeout or 300 # 5 minutes
|
|
44
46
|
self.message_retention = message_retention or 345600 # 4 days
|
|
47
|
+
# 0 (short polling) matches SQS's own default, so leaving this
|
|
48
|
+
# unset is a no-op for existing callers.
|
|
49
|
+
self.receive_wait_time = receive_wait_time or 0
|
|
50
|
+
self.tags = tags or {}
|
|
45
51
|
|
|
46
52
|
|
|
47
53
|
class Queue(ComponentResource):
|
|
@@ -83,10 +89,12 @@ class Queue(ComponentResource):
|
|
|
83
89
|
self.name = name
|
|
84
90
|
"""Create SQS queue with DLQ."""
|
|
85
91
|
# Dead letter queue
|
|
92
|
+
dlq_name = f"{resource_id(self.name)}-dlq"
|
|
86
93
|
self.dlq = aws.sqs.Queue(
|
|
87
94
|
f"{name}-dlq",
|
|
88
|
-
name=
|
|
95
|
+
name=dlq_name,
|
|
89
96
|
message_retention_seconds=1209600, # 14 days
|
|
97
|
+
tags={"Name": dlq_name, **args.tags},
|
|
90
98
|
opts=ResourceOptions(
|
|
91
99
|
parent=self,
|
|
92
100
|
ignore_changes=["region", "tagsAll"],
|
|
@@ -94,11 +102,13 @@ class Queue(ComponentResource):
|
|
|
94
102
|
)
|
|
95
103
|
|
|
96
104
|
# Main queue
|
|
105
|
+
queue_name = resource_id(self.name)
|
|
97
106
|
self.queue = aws.sqs.Queue(
|
|
98
107
|
name,
|
|
99
|
-
name=
|
|
108
|
+
name=queue_name,
|
|
100
109
|
visibility_timeout_seconds=args.visibility_timeout,
|
|
101
110
|
message_retention_seconds=args.message_retention,
|
|
111
|
+
receive_wait_time_seconds=args.receive_wait_time,
|
|
102
112
|
redrive_policy=self.dlq.arn.apply(
|
|
103
113
|
lambda arn: json.dumps(
|
|
104
114
|
{
|
|
@@ -107,6 +117,7 @@ class Queue(ComponentResource):
|
|
|
107
117
|
}
|
|
108
118
|
)
|
|
109
119
|
),
|
|
120
|
+
tags={"Name": queue_name, **args.tags},
|
|
110
121
|
opts=ResourceOptions(
|
|
111
122
|
parent=self,
|
|
112
123
|
ignore_changes=["region", "tagsAll"],
|
|
@@ -195,6 +206,8 @@ def queue(
|
|
|
195
206
|
name: str,
|
|
196
207
|
visibility_timeout: Optional[int] = None,
|
|
197
208
|
message_retention: Optional[int] = None,
|
|
209
|
+
receive_wait_time: Optional[int] = None,
|
|
210
|
+
tags: Optional[dict[str, str]] = None,
|
|
198
211
|
opts: ResourceOptions = None,
|
|
199
212
|
) -> Queue:
|
|
200
213
|
"""Factory function to create a Queue component.
|
|
@@ -204,6 +217,13 @@ def queue(
|
|
|
204
217
|
Defaults to None (300 seconds).
|
|
205
218
|
message_retention (Optional[int]): Message retention period in
|
|
206
219
|
seconds. Defaults to None (345600 seconds).
|
|
220
|
+
receive_wait_time (Optional[int]): Long-polling wait time in
|
|
221
|
+
seconds for ReceiveMessage calls. Defaults to None (0, i.e.
|
|
222
|
+
short polling -- SQS's own default).
|
|
223
|
+
tags (Optional[dict[str, str]]): Extra tags applied to both the
|
|
224
|
+
main queue and its DLQ, alongside the "Name" tag each already
|
|
225
|
+
gets set to its own resource_id()-generated name. A "Name" key
|
|
226
|
+
here overrides that default.
|
|
207
227
|
opts (ResourceOptions, optional): Pulumi resource options.
|
|
208
228
|
Defaults to None.
|
|
209
229
|
Returns:
|
|
@@ -212,13 +232,18 @@ def queue(
|
|
|
212
232
|
>>> my_queue = queue(
|
|
213
233
|
... name="my-message-queue",
|
|
214
234
|
... visibility_timeout=300,
|
|
215
|
-
... message_retention=345600
|
|
235
|
+
... message_retention=345600,
|
|
236
|
+
... receive_wait_time=20,
|
|
237
|
+
... tags={"Environment": "prod"},
|
|
216
238
|
... )
|
|
217
239
|
"""
|
|
218
240
|
return Queue(
|
|
219
241
|
name,
|
|
220
242
|
QueueArgs(
|
|
221
|
-
visibility_timeout=visibility_timeout,
|
|
243
|
+
visibility_timeout=visibility_timeout,
|
|
244
|
+
message_retention=message_retention,
|
|
245
|
+
receive_wait_time=receive_wait_time,
|
|
246
|
+
tags=tags,
|
|
222
247
|
),
|
|
223
248
|
opts,
|
|
224
249
|
)
|
|
@@ -12,10 +12,14 @@ class TopicArgs:
|
|
|
12
12
|
"""Arguments for Topic component."""
|
|
13
13
|
|
|
14
14
|
def __init__(
|
|
15
|
-
self,
|
|
15
|
+
self,
|
|
16
|
+
display_name: Optional[str],
|
|
17
|
+
subscriptions: Optional[list[dict]] = None,
|
|
18
|
+
tags: Optional[dict[str, str]] = None,
|
|
16
19
|
):
|
|
17
20
|
self.display_name = display_name
|
|
18
21
|
self.subscriptions = subscriptions
|
|
22
|
+
self.tags = tags or {}
|
|
19
23
|
|
|
20
24
|
|
|
21
25
|
class Topic(ComponentResource):
|
|
@@ -44,10 +48,12 @@ class Topic(ComponentResource):
|
|
|
44
48
|
super().__init__("cloud_foundry:topic:Topic", name, {}, opts)
|
|
45
49
|
|
|
46
50
|
self.name = name
|
|
51
|
+
topic_name = resource_id(name)
|
|
47
52
|
self.topic = aws.sns.Topic(
|
|
48
53
|
name,
|
|
49
|
-
name=
|
|
54
|
+
name=topic_name,
|
|
50
55
|
display_name=args.display_name or name,
|
|
56
|
+
tags={"Name": topic_name, **args.tags},
|
|
51
57
|
opts=ResourceOptions(parent=self),
|
|
52
58
|
)
|
|
53
59
|
|
|
@@ -69,6 +75,17 @@ class Topic(ComponentResource):
|
|
|
69
75
|
"""Get the ARN of the SNS topic."""
|
|
70
76
|
return self.topic.arn
|
|
71
77
|
|
|
78
|
+
@property
|
|
79
|
+
def topic_name(self) -> Output[str]:
|
|
80
|
+
"""Get the deployed AWS name of the SNS topic.
|
|
81
|
+
|
|
82
|
+
Named `topic_name` rather than `name` because `self.name` already
|
|
83
|
+
holds the logical component name (a plain str, used internally for
|
|
84
|
+
default display_name and subscription resource naming) -- reusing
|
|
85
|
+
`name` for this would shadow that with an Output[str] and break it.
|
|
86
|
+
"""
|
|
87
|
+
return self.topic.name
|
|
88
|
+
|
|
72
89
|
def subscribe(self, queue: Queue, opts: ResourceOptions = None) -> None:
|
|
73
90
|
"""Subscribe an SQS queue to this SNS topic.
|
|
74
91
|
Args:
|
|
@@ -121,6 +138,7 @@ def topic(
|
|
|
121
138
|
name: str,
|
|
122
139
|
display_name: Optional[str] = None,
|
|
123
140
|
subscriptions: Optional[list[dict]] = None,
|
|
141
|
+
tags: Optional[dict[str, str]] = None,
|
|
124
142
|
opts: ResourceOptions = None,
|
|
125
143
|
) -> Topic:
|
|
126
144
|
"""Factory function to create a Topic component.
|
|
@@ -131,6 +149,10 @@ def topic(
|
|
|
131
149
|
subscriptions (Optional[list[dict]]): List of subscription configs.
|
|
132
150
|
Each config should be a dict with a 'queue' key for SQS queues.
|
|
133
151
|
Defaults to None.
|
|
152
|
+
tags (Optional[dict[str, str]]): Extra tags applied to the topic,
|
|
153
|
+
alongside the "Name" tag it already gets set to its own
|
|
154
|
+
resource_id()-generated name. A "Name" key here overrides
|
|
155
|
+
that default.
|
|
134
156
|
opts (ResourceOptions, optional): Pulumi resource options.
|
|
135
157
|
Defaults to None.
|
|
136
158
|
Returns:
|
|
@@ -139,9 +161,12 @@ def topic(
|
|
|
139
161
|
>>> my_topic = topic(
|
|
140
162
|
... name="my-topic",
|
|
141
163
|
... display_name="My Topic",
|
|
142
|
-
... subscriptions=[{"queue": my_queue}]
|
|
164
|
+
... subscriptions=[{"queue": my_queue}],
|
|
165
|
+
... tags={"Environment": "prod"},
|
|
143
166
|
... )
|
|
144
167
|
"""
|
|
145
168
|
return Topic(
|
|
146
|
-
name,
|
|
169
|
+
name,
|
|
170
|
+
TopicArgs(display_name=display_name, subscriptions=subscriptions, tags=tags),
|
|
171
|
+
opts,
|
|
147
172
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|