Skip to content

Commit

Permalink
Merge branch 'master' into feature/es_tagging_support
Browse files Browse the repository at this point in the history
  • Loading branch information
jflim committed Feb 2, 2025
2 parents 24e850a + 0283895 commit ccce68b
Show file tree
Hide file tree
Showing 169 changed files with 75,076 additions and 27,425 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,8 @@ jobs:
needs: [lint]
if: "!contains(github.event.pull_request.labels.*.name, 'java')"
uses: ./.github/workflows/tests_proxymode.yml

testcdk:
needs: [lint]
if: "!contains(github.event.pull_request.labels.*.name, 'java')"
uses: ./.github/workflows/tests_cdk.yml
45 changes: 45 additions & 0 deletions .github/workflows/tests_cdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Unit tests in Server Mode
on: [workflow_call]

jobs:
cdk_start:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Start MotoServer
run: |
pip install build
python -m build
docker run --rm -t --name motoserver -e TEST_SERVER_MODE=true -e MOTO_EC2_LOAD_DEFAULT_AMIS=false -e AWS_SECRET_ACCESS_KEY=server_secret -e AWS_ACCESS_KEY_ID=server_key -v `pwd`:/moto -p 5000:5000 -v /var/run/docker.sock:/var/run/docker.sock python:${{ matrix.python-version }}-slim /moto/scripts/ci_moto_server.sh &
python scripts/ci_wait_for_server.py
- name: Install CDK
id: install-cdk
run: |
sudo npm install -g aws-cdk
- name: Init CDK APP
run: |
mkdir ~/.aws && touch ~/.aws/credentials && echo -e "[default]\naws_access_key_id = test\naws_secret_access_key = test" > ~/.aws/credentials
mkdir cdk_example_app
cd cdk_example_app
cdk init app --language python
source .venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Bootstrap CDK
env:
AWS_ENDPOINT_URL: "http://localhost:5000"
run: |
pwd
ls -la
cd cdk_example_app
source .venv/bin/activate
cdk bootstrap -v
2 changes: 1 addition & 1 deletion .github/workflows/tests_sdk_ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@28c4deda893d5a96a6b2d958c5b47fc18d65c9d3
uses: ruby/setup-ruby@1287d2b408066abada82d5ad1c63652e758428d9
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Set up Python 3.8
Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,40 @@
Moto Changelog
==============

5.0.28
-----
Docker Digest for 5.0.28: _sha256:d3532929e4c498334949a014e9f0af6617ec1e89d92be690cd192fa3354ad7e6_

* General:
* Bootstrapping a CDK project is now supported

* New Services:
* S3 Tables:
* create_namespace()
* create_table()
* create_table_bucket()
* delete_namespace()
* delete_table()
* delete_table_bucket()
* get_metadata_location()
* get_table()
* get_table_bucket()
* list_namespaces()
* list_table_buckets()
* list_tables()
* rename_table()
* update_metadata_location()

* Miscellaneous:
* DynamoDB: delete_item() now returns ConsumedCapacity
* DynamoDB: transact_write_items() now returns a ReturnValuesOnConditionCheckFailure for all operations
* ECR: Lifecycle Policies() now support the tagPatternList-parameter
* S3: get_object() now returns the ETag when returning a 304 (Not Modified)
* SecretsManager: get_secret_value() no longer throws an error after calling rotate_secret(RotateImmediately=False)
* SecretsManager: list_secrets() now filters values with special chars correctly
* Organizations: list_roots() now returns the roots of the parent organization, if called from within a child organization


5.0.27
-----
Docker Digest for 5.0.27: _sha256:ac5312f68c6b748b667526025f9e7a8c2e4112837c258eee68f96fa36d9dbbef_
Expand Down
34 changes: 33 additions & 1 deletion IMPLEMENTATION_COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,7 @@
- [ ] register_organization_delegated_admin
- [X] remove_tags
- [ ] restore_event_data_store
- [ ] search_sample_queries
- [ ] start_dashboard_refresh
- [ ] start_event_data_store_ingestion
- [ ] start_import
Expand Down Expand Up @@ -7757,6 +7758,38 @@
- [ ] update_storage_lens_group
</details>

## s3tables
<details>
<summary>53% implemented</summary>

- [X] create_namespace
- [X] create_table
- [X] create_table_bucket
- [X] delete_namespace
- [X] delete_table
- [X] delete_table_bucket
- [ ] delete_table_bucket_policy
- [ ] delete_table_policy
- [X] get_namespace
- [X] get_table
- [X] get_table_bucket
- [ ] get_table_bucket_maintenance_configuration
- [ ] get_table_bucket_policy
- [ ] get_table_maintenance_configuration
- [ ] get_table_maintenance_job_status
- [ ] get_table_metadata_location
- [ ] get_table_policy
- [X] list_namespaces
- [X] list_table_buckets
- [X] list_tables
- [ ] put_table_bucket_maintenance_configuration
- [ ] put_table_bucket_policy
- [ ] put_table_maintenance_configuration
- [ ] put_table_policy
- [X] rename_table
- [X] update_table_metadata_location
</details>

## sagemaker
<details>
<summary>31% implemented</summary>
Expand Down Expand Up @@ -9584,7 +9617,6 @@
- route53profiles
- rum
- s3outposts
- s3tables
- sagemaker-a2i-runtime
- sagemaker-edge
- sagemaker-featurestore-runtime
Expand Down
1 change: 1 addition & 0 deletions docs/docs/services/cloudtrail.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ cloudtrail
- [ ] register_organization_delegated_admin
- [X] remove_tags
- [ ] restore_event_data_store
- [ ] search_sample_queries
- [ ] start_dashboard_refresh
- [ ] start_event_data_store_ingestion
- [ ] start_import
Expand Down
45 changes: 45 additions & 0 deletions docs/docs/services/s3tables.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.. _implementedservice_s3tables:

.. |start-h3| raw:: html

<h3>

.. |end-h3| raw:: html

</h3>

========
s3tables
========

.. autoclass:: moto.s3tables.models.S3TablesBackend

|start-h3| Implemented features for this service |end-h3|

- [X] create_namespace
- [X] create_table
- [X] create_table_bucket
- [X] delete_namespace
- [X] delete_table
- [X] delete_table_bucket
- [ ] delete_table_bucket_policy
- [ ] delete_table_policy
- [X] get_namespace
- [X] get_table
- [X] get_table_bucket
- [ ] get_table_bucket_maintenance_configuration
- [ ] get_table_bucket_policy
- [ ] get_table_maintenance_configuration
- [ ] get_table_maintenance_job_status
- [ ] get_table_metadata_location
- [ ] get_table_policy
- [X] list_namespaces
- [X] list_table_buckets
- [X] list_tables
- [ ] put_table_bucket_maintenance_configuration
- [ ] put_table_bucket_policy
- [ ] put_table_maintenance_configuration
- [ ] put_table_policy
- [X] rename_table
- [X] update_table_metadata_location

2 changes: 1 addition & 1 deletion moto/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from moto.core.decorator import mock_aws as mock_aws

__title__ = "moto"
__version__ = "5.0.28.dev"
__version__ = "5.0.29.dev"
4 changes: 2 additions & 2 deletions moto/athena/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(
self.configuration["EnforceWorkGroupConfiguration"] = True
if "EngineVersion" not in self.configuration:
self.configuration["EngineVersion"] = {
"EffectiveEngineVersion": "Athena engine " "version 3",
"EffectiveEngineVersion": "Athena engine version 3",
"SelectedEngineVersion": "AUTO",
}
if "PublishCloudWatchMetricsEnabled" not in self.configuration:
Expand Down Expand Up @@ -346,7 +346,7 @@ def _store_query_result_in_s3(self, exec_id: str) -> None:
for row in self.query_results[exec_id].rows:
query_result += ",".join(
[
f"\"{r['VarCharValue']}\"" if "VarCharValue" in r else ""
f'"{r["VarCharValue"]}"' if "VarCharValue" in r else ""
for r in row["Data"]
]
)
Expand Down
5 changes: 3 additions & 2 deletions moto/backend_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,18 @@
"route53resolver",
re.compile("https?://route53resolver\\.(.+)\\.amazonaws\\.com"),
),
("s3", re.compile("https?://s3(?!-control)(.*)\\.amazonaws.com")),
("s3", re.compile("https?://s3(?!(-control|tables))(.*)\\.amazonaws.com")),
(
"s3",
re.compile(
"https?://(?P<bucket_name>[a-zA-Z0-9\\-_.]*)\\.?s3(?!-control)(.*)\\.amazonaws.com"
"https?://(?P<bucket_name>[a-zA-Z0-9\\-_.]*)\\.?s3(?!(-control|tables))(.*)\\.amazonaws.com"
),
),
(
"s3control",
re.compile("https?://([0-9]+)\\.s3-control\\.(.+)\\.amazonaws\\.com"),
),
("s3tables", re.compile("https?://s3tables\\.(.+)\\.amazonaws\\.com")),
("sagemaker", re.compile("https?://api\\.sagemaker\\.(.+)\\.amazonaws.com")),
(
"sagemakermetrics",
Expand Down
4 changes: 4 additions & 0 deletions moto/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
from moto.route53resolver.models import Route53ResolverBackend
from moto.s3.models import S3Backend
from moto.s3control.models import S3ControlBackend
from moto.s3tables.models import S3TablesBackend
from moto.sagemaker.models import SageMakerModelBackend
from moto.sagemakermetrics.models import SageMakerMetricsBackend
from moto.sagemakerruntime.models import SageMakerRuntimeBackend
Expand Down Expand Up @@ -307,6 +308,7 @@ def get_service_from_url(url: str) -> Optional[str]:
"Literal['s3']",
"Literal['s3bucket_path']",
"Literal['s3control']",
"Literal['s3tables']",
"Literal['sagemaker']",
"Literal['sagemaker-metrics']",
"Literal['sagemaker-runtime']",
Expand Down Expand Up @@ -753,6 +755,8 @@ def get_backend(
) -> "BackendDict[WorkSpacesWebBackend]": ...
@overload
def get_backend(name: "Literal['xray']") -> "BackendDict[XRayBackend]": ...
@overload
def get_backend(name: "Literal['s3tables']") -> "BackendDict[S3TablesBackend]": ...


def get_backend(name: SERVICE_NAMES) -> "BackendDict[SERVICE_BACKEND]":
Expand Down
2 changes: 1 addition & 1 deletion moto/cloudformation/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ def set_stack_policy(self) -> str:
</member>
{% endfor %}
</Tags>
<EnableTerminationProtection>{{ stack.enable_termination_protection }}</EnableTerminationProtection>
<EnableTerminationProtection>{{ 'true' if stack.enable_termination_protection else 'false' }}</EnableTerminationProtection>
{% if stack.timeout_in_mins %}
<TimeoutInMinutes>{{ stack.timeout_in_mins }}</TimeoutInMinutes>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion moto/config/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class InvalidResourceParameters(JsonRESTError):
def __init__(self) -> None:
super().__init__(
"ValidationException",
"Both Resource ID and Resource Name " "cannot be specified in the request",
"Both Resource ID and Resource Name cannot be specified in the request",
)


Expand Down
3 changes: 1 addition & 2 deletions moto/config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,7 @@ def __init__(
# A more specific message will be used here instead.
if not event_source:
raise MissingRequiredConfigRuleParameterException(
"Missing required parameter in ConfigRule.SourceDetails: "
"'EventSource'"
"Missing required parameter in ConfigRule.SourceDetails: 'EventSource'"
)
if event_source not in SourceDetail.EVENT_SOURCES:
raise ValidationException(
Expand Down
Loading

0 comments on commit ccce68b

Please sign in to comment.