cloud-foundry 0.4.0__tar.gz → 0.4.2__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.
Files changed (40) hide show
  1. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/PKG-INFO +1 -1
  2. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/__init__.py +1 -1
  3. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/migrations/forget_site_objects.py +31 -2
  4. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/cdn_site_origin.py +5 -3
  5. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/.gitignore +0 -0
  6. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/LICENSE +0 -0
  7. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/README.md +0 -0
  8. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/archive_builder.py +0 -0
  9. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/mail_publisher.py +0 -0
  10. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/migrations/__init__.py +0 -0
  11. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/__init__.py +0 -0
  12. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/api_waf.py +0 -0
  13. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/cdn.py +0 -0
  14. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/cdn_api_origin.py +0 -0
  15. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/connection_store.py +0 -0
  16. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/custom_domain.py +0 -0
  17. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/document_repository.py +0 -0
  18. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/domain.py +0 -0
  19. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/function.py +0 -0
  20. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/idle_reaper.py +0 -0
  21. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/publisher.py +0 -0
  22. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/python_function.py +0 -0
  23. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/queue.py +0 -0
  24. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/rest_api.py +0 -0
  25. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/site_bucket.py +0 -0
  26. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/topic.py +0 -0
  27. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/ui_publisher.py +0 -0
  28. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/websocket_api.py +0 -0
  29. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/pulumi/websocket_function.py +0 -0
  30. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/python_archive_builder.py +0 -0
  31. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/services/authorization_api/security_lambda.py +0 -0
  32. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/services/mail_publisher.py +0 -0
  33. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/utils/aws_openapi_editor.py +0 -0
  34. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/utils/hash_comparator.py +0 -0
  35. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/utils/idle_reaper_client.py +0 -0
  36. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/utils/logger.py +0 -0
  37. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/utils/names.py +0 -0
  38. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/utils/openapi_editor.py +0 -0
  39. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/cloud_foundry/utils/websocket_utils.py +0 -0
  40. {cloud_foundry-0.4.0 → cloud_foundry-0.4.2}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloud-foundry
3
- Version: 0.4.0
3
+ Version: 0.4.2
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
@@ -27,4 +27,4 @@ from cloud_foundry.utils.idle_reaper_client import request_mapping_enable # noq
27
27
  from cloud_foundry.utils.names import resource_id # noqa: F401
28
28
  from cloud_foundry.utils.names import project_slug # noqa: F401
29
29
 
30
- version = "0.4.0"
30
+ version = "0.4.2"
@@ -11,7 +11,10 @@ Run this once per stack, right before the first `pulumi up` with the new
11
11
  cloud_foundry. It removes the per-file resources from the Pulumi state only;
12
12
  the S3 objects stay where they are, and the next deploy takes them over.
13
13
 
14
- python -m cloud_foundry.migrations.forget_site_objects --stack dev [--cwd infra/api] [--dry-run]
14
+ python -m cloud_foundry.migrations.forget_site_objects --stack dev [--cwd <project dir>] [--dry-run]
15
+
16
+ --cwd is the Pulumi project directory (the one holding Pulumi.yaml),
17
+ relative to where you run the command; it defaults to the current directory.
15
18
 
16
19
  The exported state is saved next to the working directory first, so
17
20
  `pulumi stack import --file <backup>` puts it back if needed.
@@ -20,6 +23,7 @@ The exported state is saved next to the working directory first, so
20
23
  import argparse
21
24
  import json
22
25
  import os
26
+ import shutil
23
27
  import subprocess
24
28
  import sys
25
29
  import tempfile
@@ -69,14 +73,39 @@ def _pulumi(args: list[str], cwd: str) -> None:
69
73
  subprocess.run(["pulumi", *args], cwd=cwd, check=True)
70
74
 
71
75
 
76
+ def _project_problem(cwd: str) -> str | None:
77
+ """Why ``cwd`` can't be used as the Pulumi project directory, if it can't."""
78
+ if not os.path.isdir(cwd):
79
+ return f"{cwd} does not exist"
80
+ if not any(os.path.isfile(os.path.join(cwd, name)) for name in ("Pulumi.yaml", "Pulumi.yml")):
81
+ return f"{cwd} has no Pulumi.yaml"
82
+ return None
83
+
84
+
72
85
  def main(argv: list[str] | None = None) -> int:
73
86
  parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
74
87
  parser.add_argument("--stack", required=True)
75
- parser.add_argument("--cwd", default=".", help="Pulumi project directory")
88
+ parser.add_argument(
89
+ "--cwd",
90
+ default=".",
91
+ help="Pulumi project directory, relative to where you run this (default: current directory)",
92
+ )
76
93
  parser.add_argument("--dry-run", action="store_true", help="report only; change nothing")
77
94
  args = parser.parse_args(argv)
78
95
 
79
96
  cwd = os.path.abspath(args.cwd)
97
+ problem = _project_problem(cwd)
98
+ if problem:
99
+ print(
100
+ f"{problem}. --cwd must be the Pulumi project directory, relative to "
101
+ f"where you run this command (it defaults to the current directory). "
102
+ f"Nothing was changed.",
103
+ file=sys.stderr,
104
+ )
105
+ return 2
106
+ if shutil.which("pulumi") is None:
107
+ print("The pulumi CLI is not on PATH. Nothing was changed.", file=sys.stderr)
108
+ return 2
80
109
  stamp = time.strftime("%Y%m%dT%H%M%S")
81
110
  backup = os.path.join(cwd, f"{args.stack}-state-backup-{stamp}.json")
82
111
  _pulumi(["stack", "export", "--stack", args.stack, "--file", backup], cwd)
@@ -119,9 +119,11 @@ class SiteOrigin(pulumi.ComponentResource):
119
119
  origin_id=self.origin_id,
120
120
  origin_access_control_id=origin_access_control.id,
121
121
  origin_path=origin_path,
122
- s3_origin_config=aws.cloudfront.DistributionOriginS3OriginConfigArgs(
123
- origin_access_identity=""
124
- ),
122
+ # No s3_origin_config: access goes through the origin access
123
+ # control above, and an S3 origin without one gets CloudFront's
124
+ # empty-identity config anyway. Declaring the empty block made
125
+ # every preview show an origins update, because the provider
126
+ # reads that block back as absent.
125
127
  )
126
128
 
127
129
  if origin_shield_region:
File without changes
File without changes
File without changes