localstack 4.13.2.dev53__py3-none-any.whl → 4.14.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.
- {localstack-4.13.2.dev53.dist-info → localstack-4.14.0.dist-info}/METADATA +1 -1
- {localstack-4.13.2.dev53.dist-info → localstack-4.14.0.dist-info}/RECORD +7 -7
- localstack_cli/pro/core/cli/replicator.py +67 -30
- localstack_cli/version.py +2 -2
- {localstack-4.13.2.dev53.dist-info → localstack-4.14.0.dist-info}/WHEEL +0 -0
- {localstack-4.13.2.dev53.dist-info → localstack-4.14.0.dist-info}/entry_points.txt +0 -0
- {localstack-4.13.2.dev53.dist-info → localstack-4.14.0.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
localstack_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
localstack_cli/config.py,sha256=kjt-tEH5TG3EPtHReLr23DzAw5XI_hZF5d8GEzCfuns,67164
|
|
3
3
|
localstack_cli/constants.py,sha256=Z65z7evTRQGRf1buYMMvLwKZOI0XfzlUsNmeUGcONzQ,6304
|
|
4
|
-
localstack_cli/version.py,sha256=
|
|
4
|
+
localstack_cli/version.py,sha256=HK99J01s1g57btZFIWMu5zC8IUJbQB-DbpgMyQ_kkgE,706
|
|
5
5
|
localstack_cli/cli/__init__.py,sha256=S0u4eNluwhhLkiCC8UZNjhh27Pk-W7jeUiEv4k3VrXo,176
|
|
6
6
|
localstack_cli/cli/console.py,sha256=eMz2PfQRDG493uzXFqQZTbYTC4NhO6UOpx4ZricsGLI,346
|
|
7
7
|
localstack_cli/cli/core_plugin.py,sha256=bVbkbhIOegsfQvD3BF_T477K6v6yjK0lRn4eE5PpnSI,382
|
|
@@ -53,7 +53,7 @@ localstack_cli/pro/core/cli/extensions.py,sha256=8TBDd02J1VnUag-x7ppVxC9N0tgMP0O
|
|
|
53
53
|
localstack_cli/pro/core/cli/iam.py,sha256=iTRztn5Q01Q1kpcAE1RUyJWAuHe2iRK5mUO2JnOGjjw,6352
|
|
54
54
|
localstack_cli/pro/core/cli/license.py,sha256=kdtATn3j6HnpzUpj48ozKj0IRbbYCdVTG1FJgdZ9y8Q,2780
|
|
55
55
|
localstack_cli/pro/core/cli/localstack.py,sha256=Z3_7W7UgUGoNgh3m9NS6JjX9nFU1o9O8LbmV17S1Hu0,3620
|
|
56
|
-
localstack_cli/pro/core/cli/replicator.py,sha256=
|
|
56
|
+
localstack_cli/pro/core/cli/replicator.py,sha256=GKA-PqluhaJzcu9sTGf4cbnqN-rfh4GXZx3o1mnGhPE,12824
|
|
57
57
|
localstack_cli/pro/core/cli/state.py,sha256=iS8_qSqoxUlQj21nrVToazqjfM7PfBs-3RqoiwpIKn0,6696
|
|
58
58
|
localstack_cli/pro/core/cli/tree_view.py,sha256=K443WkwIxNRDi_rzPiQW5wBTq3dCgzfTiGbVNpeIJ68,7254
|
|
59
59
|
localstack_cli/runtime/__init__.py,sha256=sdfCHRYcw9uvUZsUNzRPh1vEh9kx8w1v1wgOORYnfZs,231
|
|
@@ -105,8 +105,8 @@ localstack_cli/utils/container_utils/docker_cmd_client.py,sha256=4UPKOZTyu2TgPlE
|
|
|
105
105
|
localstack_cli/utils/container_utils/docker_sdk_client.py,sha256=6lnBhjT03otVGBm15WDq3LAfZnxLc4Q1lyjHAyFHsbM,40460
|
|
106
106
|
localstack_cli/utils/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
107
107
|
localstack_cli/utils/server/tcp_proxy.py,sha256=0ehOD5muo2cBCg0boXzKhzF14KfwlJ7VUtM5i8X7M5A,4006
|
|
108
|
-
localstack-4.
|
|
109
|
-
localstack-4.
|
|
110
|
-
localstack-4.
|
|
111
|
-
localstack-4.
|
|
112
|
-
localstack-4.
|
|
108
|
+
localstack-4.14.0.dist-info/METADATA,sha256=-P-9fsQsX_XqJl2dG7JbKvz3T-XvpQE2CpE-8xeMLS0,2703
|
|
109
|
+
localstack-4.14.0.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
|
|
110
|
+
localstack-4.14.0.dist-info/entry_points.txt,sha256=ogxbxjXC9xK1eksf9CUvOEl09SY2qpUt19SVya0WYAY,933
|
|
111
|
+
localstack-4.14.0.dist-info/top_level.txt,sha256=02blzxjv7TnyriE5gkWIM_UqKTSBiCFPgRG5ZBO5R0Y,15
|
|
112
|
+
localstack-4.14.0.dist-info/RECORD,,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import os
|
|
3
|
+
import re
|
|
3
4
|
import subprocess as sp
|
|
4
5
|
import sys
|
|
5
6
|
import time
|
|
@@ -40,6 +41,10 @@ The replicator command group allows you to replicate AWS resources into LocalSta
|
|
|
40
41
|
)
|
|
41
42
|
|
|
42
43
|
|
|
44
|
+
def run_check_output(cmd) -> str:
|
|
45
|
+
return sp.check_output(cmd, stderr=sp.PIPE, env=os.environ).decode("utf-8").strip()
|
|
46
|
+
|
|
47
|
+
|
|
43
48
|
class ProfileLoadError(RuntimeError):
|
|
44
49
|
def __init__(self, profile_name: str):
|
|
45
50
|
super().__init__(f"Could not find profile '{profile_name}'")
|
|
@@ -96,49 +101,58 @@ def get_awscli_config() -> AWSConfig | None:
|
|
|
96
101
|
try:
|
|
97
102
|
# get credentials values
|
|
98
103
|
cmd = ["aws", "configure", "export-credentials"]
|
|
99
|
-
|
|
100
|
-
credentials = json.loads(output.decode("utf8"))
|
|
104
|
+
credentials = json.loads(run_check_output(cmd))
|
|
101
105
|
except sp.CalledProcessError as exc:
|
|
102
106
|
if b"AWS CLI version 2" in exc.stderr:
|
|
103
107
|
print(
|
|
104
108
|
"Warning: awscli v1 installed. Please use v2 for auto detection of credentials",
|
|
105
109
|
file=sys.stderr,
|
|
106
110
|
)
|
|
107
|
-
|
|
111
|
+
return None
|
|
108
112
|
|
|
109
113
|
try:
|
|
110
114
|
# try to get the endpoint url
|
|
111
115
|
cmd = ["aws", "configure", "get", "endpoint_url"]
|
|
112
|
-
endpoint_url =
|
|
116
|
+
endpoint_url = run_check_output(cmd)
|
|
113
117
|
except sp.CalledProcessError:
|
|
114
118
|
# If there are no endpoint configured an exception is raised we do a last
|
|
115
119
|
# check in the environment to find the endpoint url
|
|
116
120
|
endpoint_url = os.getenv("AWS_ENDPOINT_URL")
|
|
117
121
|
|
|
118
122
|
try:
|
|
119
|
-
# get
|
|
120
|
-
cmd = ["aws", "configure", "
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
123
|
+
# try to get the region from configure
|
|
124
|
+
cmd = ["aws", "configure", "get", "region"]
|
|
125
|
+
region_name = run_check_output(cmd)
|
|
126
|
+
except sp.CalledProcessError:
|
|
127
|
+
# If there are no default configured an exception is raised we do a last
|
|
128
|
+
# check in the environment to find the region
|
|
129
|
+
region_name = os.getenv("AWS_DEFAULT_REGION")
|
|
130
|
+
|
|
131
|
+
if not region_name:
|
|
132
|
+
try:
|
|
133
|
+
# older awscli versions do not return the region to the command `aws configure get region`.
|
|
134
|
+
# We need to rely on the configure list in this case
|
|
135
|
+
cmd = ["aws", "configure", "list"]
|
|
136
|
+
for line in run_check_output(cmd).splitlines():
|
|
137
|
+
if "region" not in line:
|
|
138
|
+
continue
|
|
139
|
+
# aws changed the format of configure and added `:` in delimiters
|
|
140
|
+
words = re.split(r"[:\s]+", line)
|
|
141
|
+
try:
|
|
142
|
+
region_name = words[1]
|
|
143
|
+
break
|
|
144
|
+
except IndexError:
|
|
145
|
+
return None
|
|
146
|
+
except (sp.CalledProcessError, FileNotFoundError):
|
|
147
|
+
return None
|
|
148
|
+
|
|
149
|
+
return AWSConfig(
|
|
150
|
+
aws_access_key_id=credentials["AccessKeyId"],
|
|
151
|
+
aws_secret_access_key=credentials["SecretAccessKey"],
|
|
152
|
+
aws_session_token=credentials.get("SessionToken"),
|
|
153
|
+
region_name=region_name,
|
|
154
|
+
endpoint_url=endpoint_url,
|
|
155
|
+
)
|
|
142
156
|
|
|
143
157
|
|
|
144
158
|
def get_source_config(profile_dir: Path | None = None) -> AWSConfig:
|
|
@@ -148,13 +162,36 @@ def get_source_config(profile_dir: Path | None = None) -> AWSConfig:
|
|
|
148
162
|
return awscli_source_config
|
|
149
163
|
|
|
150
164
|
source_config = get_aws_env_config("AWS")
|
|
165
|
+
profile_name = source_config.get("profile_name")
|
|
166
|
+
|
|
167
|
+
if source_config.get("aws_access_key_id") and not source_config.get("aws_secret_access_key"):
|
|
168
|
+
raise CLIError(
|
|
169
|
+
"Unable to retrieve credentials: Partial credentials found in env."
|
|
170
|
+
" Need both 'AWS_ACCESS_KEY_ID' and 'AWS_SECRET_ACCESS_KEY'"
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
if profile_name:
|
|
174
|
+
config_file_source_config = get_config_from_profile(
|
|
175
|
+
profile_name=profile_name, profile_dir=profile_dir
|
|
176
|
+
)
|
|
177
|
+
if source_config.get("aws_secret_access_key"):
|
|
178
|
+
# before merging, if the secret access key is in the env vars we need to ensure the session token from the
|
|
179
|
+
# config file isn't carried along
|
|
180
|
+
config_file_source_config.pop("aws_session_token", None)
|
|
181
|
+
config_file_source_config.update(source_config)
|
|
182
|
+
source_config = config_file_source_config
|
|
183
|
+
|
|
184
|
+
errors = []
|
|
151
185
|
|
|
152
186
|
if not source_config.get("region_name"):
|
|
153
|
-
|
|
187
|
+
errors.append("'AWS_DEFAULT_REGION' must bet set in environment or in profile.")
|
|
154
188
|
if not source_config.get("aws_access_key_id"):
|
|
155
|
-
|
|
189
|
+
errors.append("'AWS_ACCESS_KEY_ID' must bet set in environment or in profile.")
|
|
156
190
|
if not source_config.get("aws_secret_access_key"):
|
|
157
|
-
|
|
191
|
+
errors.append("'AWS_SECRET_ACCESS_KEY' must bet set in environment or in profile.")
|
|
192
|
+
|
|
193
|
+
if errors:
|
|
194
|
+
raise CLIError("\n".join(errors))
|
|
158
195
|
|
|
159
196
|
return source_config
|
|
160
197
|
|
localstack_cli/version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '4.
|
|
32
|
-
__version_tuple__ = version_tuple = (4,
|
|
31
|
+
__version__ = version = '4.14.0'
|
|
32
|
+
__version_tuple__ = version_tuple = (4, 14, 0)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|