Skip to content

Conversation

@baermat
Copy link
Member

@baermat baermat commented Oct 31, 2025

Motivation

This PR adds the platform application crud operations as well as the operations for the attributes, alongside tests including those for all special cases mentioned in the docs for these operations that I could find.

Currently failing test will be changed to not use list (so old remnants from other tests don't interfere)

Changes

  • add create-platform-endpoint, delete-endpoint, list-endpoint-by-platform-application
  • add get-endpoint-attributes, set-endpoint-attributes
  • add tests

Tests

Related

Closes PNX-86

@github-actions
Copy link

github-actions bot commented Oct 31, 2025

Test Results - Preflight, Unit

22 278 tests   - 98   20 526 ✅  - 100   15m 54s ⏱️ -4s
     1 suites ± 0    1 752 💤 +  2 
     1 files   ± 0        0 ❌ ±  0 

Results for commit 3259419. ± Comparison against base commit f829e69.

This pull request removes 170 and adds 72 tests. Note that renamed tests count towards both.
tests.unit.aws.protocol.test_op_router ‑ test_create_op_router_works_for_every_service[apptest]
tests.unit.aws.protocol.test_op_router ‑ test_create_op_router_works_for_every_service[iotfleethub]
tests.unit.aws.protocol.test_op_router ‑ test_create_op_router_works_for_every_service[lookoutmetrics]
tests.unit.aws.protocol.test_op_router ‑ test_create_op_router_works_for_every_service[lookoutvision]
tests.unit.aws.protocol.test_op_router ‑ test_create_op_router_works_for_every_service[qldb]
tests.unit.aws.protocol.test_op_router ‑ test_create_op_router_works_for_every_service[robomaker]
tests.unit.aws.test_connect.TestClientFactory ‑ test_typed_client_creation[qldb]
tests.unit.aws.test_connect.TestClientFactory ‑ test_typed_client_creation[qldb_session]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[apptest-rest-json-CreateTestCase]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[apptest-rest-json-CreateTestConfiguration]
…
tests.unit.aws.api.test_asf_providers ‑ test_provider_signatures[Ec2Provider-Ec2Api-create_ipam_prefix_list_resolver]
tests.unit.aws.api.test_asf_providers ‑ test_provider_signatures[Ec2Provider-Ec2Api-create_ipam_prefix_list_resolver_target]
tests.unit.aws.api.test_asf_providers ‑ test_provider_signatures[Ec2Provider-Ec2Api-delete_ipam_prefix_list_resolver]
tests.unit.aws.api.test_asf_providers ‑ test_provider_signatures[Ec2Provider-Ec2Api-delete_ipam_prefix_list_resolver_target]
tests.unit.aws.api.test_asf_providers ‑ test_provider_signatures[Ec2Provider-Ec2Api-describe_capacity_reservation_topology]
tests.unit.aws.api.test_asf_providers ‑ test_provider_signatures[Ec2Provider-Ec2Api-describe_ipam_prefix_list_resolver_targets]
tests.unit.aws.api.test_asf_providers ‑ test_provider_signatures[Ec2Provider-Ec2Api-describe_ipam_prefix_list_resolvers]
tests.unit.aws.api.test_asf_providers ‑ test_provider_signatures[Ec2Provider-Ec2Api-get_ipam_prefix_list_resolver_rules]
tests.unit.aws.api.test_asf_providers ‑ test_provider_signatures[Ec2Provider-Ec2Api-get_ipam_prefix_list_resolver_version_entries]
tests.unit.aws.api.test_asf_providers ‑ test_provider_signatures[Ec2Provider-Ec2Api-get_ipam_prefix_list_resolver_versions]
…

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 31, 2025

Test Results - Alternative Providers

198 tests   - 1 240    78 ✅  - 707   43s ⏱️ - 39m 36s
  1 suites  -     4   120 💤  - 533 
  1 files    -     4     0 ❌ ±  0 

Results for commit 3259419. ± Comparison against base commit f829e69.

This pull request removes 1262 and adds 22 tests. Note that renamed tests count towards both.
tests.aws.services.cloudformation.api.test_changesets ‑ test_autoexpand_capability_requirement
tests.aws.services.cloudformation.api.test_changesets ‑ test_create_and_then_remove_non_supported_resource_change_set
tests.aws.services.cloudformation.api.test_changesets ‑ test_create_and_then_remove_supported_resource_change_set
tests.aws.services.cloudformation.api.test_changesets ‑ test_create_and_then_update_refreshes_template_metadata
tests.aws.services.cloudformation.api.test_changesets ‑ test_create_change_set_create_existing
tests.aws.services.cloudformation.api.test_changesets ‑ test_create_change_set_invalid_params
tests.aws.services.cloudformation.api.test_changesets ‑ test_create_change_set_missing_stackname
tests.aws.services.cloudformation.api.test_changesets ‑ test_create_change_set_no_changes
tests.aws.services.cloudformation.api.test_changesets ‑ test_create_change_set_update_nonexisting
tests.aws.services.cloudformation.api.test_changesets ‑ test_create_change_set_update_without_parameters
…
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_custom_data
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_double_custom_data
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_idempotency
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_non_existent_app
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Data_Too_Long]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Invalid_Name_Credential]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Invalid_Name_Generic]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Invalid_Name_Principal]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_delete_endpoints_of_deleted_app
…

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 31, 2025

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   3m 19s ⏱️ +5s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 3259419. ± Comparison against base commit f829e69.

♻️ This comment has been updated with latest results.

Comment on lines 151 to 154
class PlatformEndpoint(TypedDict, total=False):
PlatformEndpointArn: str
Attributes: dict[str, str]
PlatformApplicationArn: str
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type exists in the Api as well, but without the PlatformApplicationArn. Having a reference back to the owning object makes delete easier so we don't have to iterate over all applications, however it might not be worth losing the advantage of sticking exactly to the spec. Wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good point! I believe @giograno is starting to establish a pattern here, where we use a dataclass to wrap the existing spec type, and add more data to it.

See https://github.com/localstack/localstack-pro/pull/5397

Something like:

from localstack.aws.api.sns import PlatformApplication

@dataclasses.dataclass
class PlatformApplicationDetails:
    platform_application: PlatformApplication
    platform_application_arn: str

I hope it's okay, I'll go ahead and push those to get the PR in this week 👍

Comment on lines 725 to 730
Endpoints=[
{
"EndpointArn": endpoint_arn,
"Attributes": store.platform_endpoints.get(endpoint_arn, {}).get("Attributes"),
}
for endpoint_arn in page
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is slightly more complex than it needs to be due to the mentioned deviation of the type. A good example of the trade off I mentioned before

@baermat baermat added semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes labels Oct 31, 2025
@github-actions
Copy link

github-actions bot commented Oct 31, 2025

LocalStack Community integration with Pro

    2 files  ±    0      2 suites  ±0   59m 8s ⏱️ - 1h 4m 12s
2 926 tests  - 1 968  2 771 ✅  - 1 754  155 💤  - 214  0 ❌ ±0 
2 928 runs   - 1 968  2 771 ✅  - 1 754  157 💤  - 214  0 ❌ ±0 

Results for commit 3259419. ± Comparison against base commit f829e69.

This pull request removes 1990 and adds 22 tests. Note that renamed tests count towards both.
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_lambda_dynamodb
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_opensearch_crud
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_search_books
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_setup
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_destination_sns
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_infra
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_prefill_dynamodb_table
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input0-SUCCEEDED]
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input1-SUCCEEDED]
…
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_custom_data
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_double_custom_data
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_idempotency
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_non_existent_app
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Data_Too_Long]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Invalid_Name_Credential]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Invalid_Name_Generic]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Invalid_Name_Principal]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_delete_endpoints_of_deleted_app
…
This pull request removes 224 skipped tests and adds 10 skipped tests. Note that renamed tests count towards both.
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input4-FAILED]
tests.aws.scenario.mythical_mysfits.test_mythical_misfits.TestMythicalMisfitsScenario ‑ test_deployed_infra_state
tests.aws.scenario.mythical_mysfits.test_mythical_misfits.TestMythicalMisfitsScenario ‑ test_populate_data
tests.aws.scenario.mythical_mysfits.test_mythical_misfits.TestMythicalMisfitsScenario ‑ test_user_clicks_are_stored
tests.aws.services.cloudcontrol.test_cloudcontrol_api.TestCloudControlResourceApi ‑ test_api_exceptions
tests.aws.services.cloudcontrol.test_cloudcontrol_api.TestCloudControlResourceApi ‑ test_create_exceptions
tests.aws.services.cloudcontrol.test_cloudcontrol_api.TestCloudControlResourceApi ‑ test_create_invalid_desiredstate
tests.aws.services.cloudcontrol.test_cloudcontrol_api.TestCloudControlResourceApi ‑ test_double_create_with_client_token
tests.aws.services.cloudcontrol.test_cloudcontrol_api.TestCloudControlResourceApi ‑ test_lifecycle
…
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_custom_data
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Data_Too_Long]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Invalid_Name_Credential]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Invalid_Name_Generic]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Invalid_Name_Principal]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_set_platform_endpoint_attributes_invalid_attributes[Data_Too_Long]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_set_platform_endpoint_attributes_invalid_attributes[Empty]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_set_platform_endpoint_attributes_invalid_attributes[Invalid_Name_Credential]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_set_platform_endpoint_attributes_invalid_attributes[Invalid_Name_Generic]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_set_platform_endpoint_attributes_invalid_attributes[Invalid_Name_Principal]

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 31, 2025

Test Results (amd64) - Integration, Bootstrap

    5 files  ±    0      5 suites  ±0   1h 27m 29s ⏱️ - 1h 12m 42s
2 950 tests  - 2 318  2 798 ✅  - 1 941  152 💤  - 377  0 ❌ ±0 
2 956 runs   - 2 318  2 798 ✅  - 1 941  158 💤  - 377  0 ❌ ±0 

Results for commit 3259419. ± Comparison against base commit f829e69.

This pull request removes 2340 and adds 22 tests. Note that renamed tests count towards both.
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_lambda_dynamodb
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_opensearch_crud
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_search_books
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_setup
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_destination_sns
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_infra
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_prefill_dynamodb_table
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input0-SUCCEEDED]
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input1-SUCCEEDED]
…
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_custom_data
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_double_custom_data
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_idempotency
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_non_existent_app
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Data_Too_Long]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Invalid_Name_Credential]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Invalid_Name_Generic]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Invalid_Name_Principal]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_delete_endpoints_of_deleted_app
…
This pull request removes 387 skipped tests and adds 10 skipped tests. Note that renamed tests count towards both.
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input4-FAILED]
tests.aws.scenario.mythical_mysfits.test_mythical_misfits.TestMythicalMisfitsScenario ‑ test_deployed_infra_state
tests.aws.scenario.mythical_mysfits.test_mythical_misfits.TestMythicalMisfitsScenario ‑ test_populate_data
tests.aws.scenario.mythical_mysfits.test_mythical_misfits.TestMythicalMisfitsScenario ‑ test_user_clicks_are_stored
tests.aws.services.cloudcontrol.test_cloudcontrol_api.TestCloudControlResourceApi ‑ test_api_exceptions
tests.aws.services.cloudcontrol.test_cloudcontrol_api.TestCloudControlResourceApi ‑ test_create_exceptions
tests.aws.services.cloudcontrol.test_cloudcontrol_api.TestCloudControlResourceApi ‑ test_create_invalid_desiredstate
tests.aws.services.cloudcontrol.test_cloudcontrol_api.TestCloudControlResourceApi ‑ test_double_create_with_client_token
tests.aws.services.cloudcontrol.test_cloudcontrol_api.TestCloudControlResourceApi ‑ test_lifecycle
…
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_custom_data
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Data_Too_Long]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Invalid_Name_Credential]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Invalid_Name_Generic]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_create_platform_endpoint_with_invalid_attributes[Invalid_Name_Principal]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_set_platform_endpoint_attributes_invalid_attributes[Data_Too_Long]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_set_platform_endpoint_attributes_invalid_attributes[Empty]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_set_platform_endpoint_attributes_invalid_attributes[Invalid_Name_Credential]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_set_platform_endpoint_attributes_invalid_attributes[Invalid_Name_Generic]
tests.aws.services.sns.test_sns.TestSNSPlatformEndpointCrud ‑ test_set_platform_endpoint_attributes_invalid_attributes[Invalid_Name_Principal]

♻️ This comment has been updated with latest results.

@baermat baermat marked this pull request as ready for review October 31, 2025 23:35
@baermat baermat requested a review from bentsku as a code owner October 31, 2025 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants