diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5360e452..03f196446 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -102,6 +102,7 @@ jobs: runs-on: ubuntu-latest permissions: id-token: write + packages: write needs: [dotnettest, javatest, test, testserver ] if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'getmoto/moto' }} steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index be0712d27..b5a2827cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,24 @@ Moto Changelog ============== +4.2.10 +----- +Docker Digest for 4.2.10: + + New Methods: + * CognitoIdentity: list_identity_pools() + + Miscellaneous: + * Autoscaling: describe_tags() now supports the key/value filters + * CloudFormation: AWS::Logs::LogGroup now supports tags + * CloudWatch: get_metric_data() no longer throws an error when supplying >10 queries + * CognitoIdentity: get_credentials_for_identity() now returns Expiration as a number, fixing compatibility with the GoLang SDK + * EFS: describe_access_points() now supports the FileSystemId-parameter + * LakeFormation: list_permissions() now supports the DataLocation-parameter + * LakeFormation: register_resource() now throws an exception when registering an existing resource + * SQS: Ensure all responses are in JSON-format when required, fixing compatibility with the Ruby SDK + + 4.2.9 ----- Docker Digest for 4.2.9: _sha256:4e9d89322b5ca9196fa7efda78b1269580be7aa6879894950e2728edc946573f_ diff --git a/IMPLEMENTATION_COVERAGE.md b/IMPLEMENTATION_COVERAGE.md index 5d8ba44d1..7a75fb3ab 100644 --- a/IMPLEMENTATION_COVERAGE.md +++ b/IMPLEMENTATION_COVERAGE.md @@ -1137,7 +1137,7 @@ ## cognito-identity
-34% implemented +39% implemented - [X] create_identity_pool - [ ] delete_identities @@ -1151,7 +1151,7 @@ - [X] get_open_id_token_for_developer_identity - [ ] get_principal_tag_attribute_map - [X] list_identities -- [ ] list_identity_pools +- [X] list_identity_pools - [ ] list_tags_for_resource - [ ] lookup_developer_identity - [ ] merge_developer_identities @@ -1921,6 +1921,7 @@ - [ ] associate_enclave_certificate_iam_role - [X] associate_iam_instance_profile - [ ] associate_instance_event_window +- [ ] associate_ipam_byoasn - [ ] associate_ipam_resource_discovery - [ ] associate_nat_gateway_address - [X] associate_route_table @@ -2111,6 +2112,7 @@ - [ ] delete_vpn_connection_route - [X] delete_vpn_gateway - [ ] deprovision_byoip_cidr +- [ ] deprovision_ipam_byoasn - [ ] deprovision_ipam_pool_cidr - [ ] deprovision_public_ipv4_pool_cidr - [X] deregister_image @@ -2173,6 +2175,7 @@ - [X] describe_instance_types - [X] describe_instances - [X] describe_internet_gateways +- [ ] describe_ipam_byoasn - [ ] describe_ipam_pools - [ ] describe_ipam_resource_discoveries - [ ] describe_ipam_resource_discovery_associations @@ -2291,6 +2294,7 @@ - [ ] disassociate_enclave_certificate_iam_role - [X] disassociate_iam_instance_profile - [ ] disassociate_instance_event_window +- [ ] disassociate_ipam_byoasn - [ ] disassociate_ipam_resource_discovery - [ ] disassociate_nat_gateway_address - [X] disassociate_route_table @@ -2339,6 +2343,7 @@ - [ ] get_instance_uefi_data - [ ] get_ipam_address_history - [ ] get_ipam_discovered_accounts +- [ ] get_ipam_discovered_public_addresses - [ ] get_ipam_discovered_resource_cidrs - [ ] get_ipam_pool_allocations - [ ] get_ipam_pool_cidrs @@ -2444,6 +2449,7 @@ - [ ] move_address_to_vpc - [ ] move_byoip_cidr_to_ipam - [ ] provision_byoip_cidr +- [ ] provision_ipam_byoasn - [ ] provision_ipam_pool_cidr - [ ] provision_public_ipv4_pool_cidr - [ ] purchase_capacity_block @@ -2521,7 +2527,7 @@ ## ecr
-68% implemented +65% implemented - [ ] batch_check_layer_availability - [X] batch_delete_image @@ -2563,7 +2569,9 @@ - [ ] start_lifecycle_policy_preview - [X] tag_resource - [X] untag_resource +- [ ] update_pull_through_cache_rule - [ ] upload_layer_part +- [ ] validate_pull_through_cache_rule
## ecs @@ -3286,7 +3294,7 @@ ## glue
-32% implemented +31% implemented - [X] batch_create_partition - [ ] batch_delete_connection @@ -3366,6 +3374,8 @@ - [ ] get_classifiers - [ ] get_column_statistics_for_partition - [ ] get_column_statistics_for_table +- [ ] get_column_statistics_task_run +- [ ] get_column_statistics_task_runs - [ ] get_connection - [ ] get_connections - [X] get_crawler @@ -3426,6 +3436,7 @@ - [ ] get_workflow_runs - [ ] import_catalog_to_glue - [ ] list_blueprints +- [ ] list_column_statistics_task_runs - [X] list_crawlers - [ ] list_crawls - [ ] list_custom_entity_types @@ -3456,6 +3467,7 @@ - [ ] run_statement - [ ] search_tables - [ ] start_blueprint_run +- [ ] start_column_statistics_task_run - [X] start_crawler - [ ] start_crawler_schedule - [ ] start_data_quality_rule_recommendation_run @@ -3467,6 +3479,7 @@ - [ ] start_ml_labeling_set_generation_task_run - [X] start_trigger - [ ] start_workflow_run +- [ ] stop_column_statistics_task_run - [X] stop_crawler - [ ] stop_crawler_schedule - [X] stop_session @@ -5331,6 +5344,7 @@ - [X] create_ingestion - [ ] create_namespace - [ ] create_refresh_schedule +- [ ] create_role_membership - [ ] create_template - [ ] create_template_alias - [ ] create_theme @@ -5352,6 +5366,8 @@ - [ ] delete_iam_policy_assignment - [ ] delete_namespace - [ ] delete_refresh_schedule +- [ ] delete_role_custom_permission +- [ ] delete_role_membership - [ ] delete_template - [ ] delete_template_alias - [ ] delete_theme @@ -5389,6 +5405,7 @@ - [ ] describe_ip_restriction - [ ] describe_namespace - [ ] describe_refresh_schedule +- [ ] describe_role_custom_permission - [ ] describe_template - [ ] describe_template_alias - [ ] describe_template_definition @@ -5422,6 +5439,7 @@ - [ ] list_ingestions - [ ] list_namespaces - [ ] list_refresh_schedules +- [ ] list_role_memberships - [ ] list_tags_for_resource - [ ] list_template_aliases - [ ] list_template_versions @@ -5466,6 +5484,7 @@ - [ ] update_ip_restriction - [ ] update_public_sharing_settings - [ ] update_refresh_schedule +- [ ] update_role_custom_permission - [ ] update_template - [ ] update_template_alias - [ ] update_template_permissions @@ -5691,7 +5710,7 @@ ## redshift
-23% implemented +22% implemented - [ ] accept_reserved_node_exchange - [ ] add_partner @@ -5715,6 +5734,7 @@ - [ ] create_event_subscription - [ ] create_hsm_client_certificate - [ ] create_hsm_configuration +- [ ] create_redshift_idc_application - [ ] create_scheduled_action - [X] create_snapshot_copy_grant - [ ] create_snapshot_schedule @@ -5733,6 +5753,7 @@ - [ ] delete_hsm_client_certificate - [ ] delete_hsm_configuration - [ ] delete_partner +- [ ] delete_redshift_idc_application - [ ] delete_resource_policy - [ ] delete_scheduled_action - [X] delete_snapshot_copy_grant @@ -5767,6 +5788,7 @@ - [ ] describe_node_configuration_options - [ ] describe_orderable_cluster_options - [ ] describe_partners +- [ ] describe_redshift_idc_applications - [ ] describe_reserved_node_exchange_status - [ ] describe_reserved_node_offerings - [ ] describe_reserved_nodes @@ -5802,6 +5824,7 @@ - [ ] modify_custom_domain_association - [ ] modify_endpoint_access - [ ] modify_event_subscription +- [ ] modify_redshift_idc_application - [ ] modify_scheduled_action - [X] modify_snapshot_copy_retention_period - [ ] modify_snapshot_schedule @@ -7215,31 +7238,59 @@ ## sso-admin
-21% implemented +10% implemented - [ ] attach_customer_managed_policy_reference_to_permission_set - [ ] attach_managed_policy_to_permission_set - [X] create_account_assignment +- [ ] create_application +- [ ] create_application_assignment +- [ ] create_instance - [ ] create_instance_access_control_attribute_configuration - [X] create_permission_set +- [ ] create_trusted_token_issuer - [X] delete_account_assignment +- [ ] delete_application +- [ ] delete_application_access_scope +- [ ] delete_application_assignment +- [ ] delete_application_authentication_method +- [ ] delete_application_grant - [ ] delete_inline_policy_from_permission_set +- [ ] delete_instance - [ ] delete_instance_access_control_attribute_configuration - [X] delete_permission_set - [ ] delete_permissions_boundary_from_permission_set +- [ ] delete_trusted_token_issuer - [ ] describe_account_assignment_creation_status - [ ] describe_account_assignment_deletion_status +- [ ] describe_application +- [ ] describe_application_assignment +- [ ] describe_application_provider +- [ ] describe_instance - [ ] describe_instance_access_control_attribute_configuration - [X] describe_permission_set - [ ] describe_permission_set_provisioning_status +- [ ] describe_trusted_token_issuer - [ ] detach_customer_managed_policy_reference_from_permission_set - [ ] detach_managed_policy_from_permission_set +- [ ] get_application_access_scope +- [ ] get_application_assignment_configuration +- [ ] get_application_authentication_method +- [ ] get_application_grant - [ ] get_inline_policy_for_permission_set - [ ] get_permissions_boundary_for_permission_set - [ ] list_account_assignment_creation_status - [ ] list_account_assignment_deletion_status - [X] list_account_assignments +- [ ] list_account_assignments_for_principal - [ ] list_accounts_for_provisioned_permission_set +- [ ] list_application_access_scopes +- [ ] list_application_assignments +- [ ] list_application_assignments_for_principal +- [ ] list_application_authentication_methods +- [ ] list_application_grants +- [ ] list_application_providers +- [ ] list_applications - [ ] list_customer_managed_policy_references_in_permission_set - [ ] list_instances - [ ] list_managed_policies_in_permission_set @@ -7247,13 +7298,21 @@ - [X] list_permission_sets - [ ] list_permission_sets_provisioned_to_account - [ ] list_tags_for_resource +- [ ] list_trusted_token_issuers - [ ] provision_permission_set +- [ ] put_application_access_scope +- [ ] put_application_assignment_configuration +- [ ] put_application_authentication_method +- [ ] put_application_grant - [ ] put_inline_policy_to_permission_set - [ ] put_permissions_boundary_to_permission_set - [ ] tag_resource - [ ] untag_resource +- [ ] update_application +- [ ] update_instance - [ ] update_instance_access_control_attribute_configuration - [X] update_permission_set +- [ ] update_trusted_token_issuer
## stepfunctions @@ -7675,7 +7734,6 @@ - lookoutvision - m2 - machinelearning -- macie - macie2 - managedblockchain-query - marketplace-catalog @@ -7763,6 +7821,7 @@ - tnb - transfer - translate +- trustedadvisor - verifiedpermissions - voice-id - vpc-lattice diff --git a/MANIFEST.in b/MANIFEST.in index eeed788f7..d35a9d24a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,7 @@ include README.md LICENSE AUTHORS.md include requirements.txt requirements-dev.txt +include moto/py.typed include moto/config/resources/aws_managed_rules.json -include moto/ec2/_models/*.py include moto/ec2/resources/instance_types.json include moto/ec2/resources/instance_type_offerings/*/*.json include moto/ec2/resources/latest_amis/*.json @@ -14,7 +14,6 @@ include moto/moto_proxy/* include moto/moto_proxy/certs/__init__.py include moto/moto_proxy/certs/req.conf.tmpl include moto/rds/resources/cluster_options/*.json -include moto/servicequotas/resources/*/*.json include moto/ssm/resources/*.json include moto/ssm/resources/ami-amazon-linux-latest/*.json include moto/ssm/resources/ecs/optimized_amis/*.json diff --git a/docs/docs/faq.rst b/docs/docs/faq.rst index 96955863d..5380569e3 100644 --- a/docs/docs/faq.rst +++ b/docs/docs/faq.rst @@ -8,6 +8,12 @@ FAQ ====== +Why is my test data disappearing? +################################### +To prevent state from leaking across different tests, Moto automatically deletes any created data after a Moto-decorator ends. + +So make sure that your decorator is active for the entire duration of the test-method. + Is Moto concurrency safe? ############################ diff --git a/docs/docs/getting_started.rst b/docs/docs/getting_started.rst index df50a696d..a184aef0e 100644 --- a/docs/docs/getting_started.rst +++ b/docs/docs/getting_started.rst @@ -254,23 +254,33 @@ Here is an example: with mock_s3(): yield boto3.client("s3", region_name="us-east-1") + @pytest.fixture + def create_bucket1(s3): + boto3.client("s3").create_bucket(Bucket="b1") + + @pytest.fixture + def create_bucket2(s3): + boto3.client("s3").create_bucket(Bucket="b2") + + def test_s3_directly(s3): + s3.create_bucket(Bucket="somebucket") + + result = s3.list_buckets() + assert len(result["Buckets"]) == 1 + + def test_bucket_creation(create_bucket1, create_bucket2): + buckets = boto3.client("s3").list_buckets()["Buckets"] + assert len(result["Buckets"]) == 2 + In the code sample above, all of the AWS/mocked fixtures take in a parameter of `aws_credentials`, which sets the proper fake environment variables. The fake environment variables are used so that `botocore` doesn't try to locate real credentials on your system. -Next, once you need to do anything with the mocked AWS environment, do something like: +With Moto activated within the fixture, we can pass it to a test-method to ensure that any other AWS-calls are also mocked inside that test method. +We can also combine multiple fixtures that use the same Moto-fixture. -.. sourcecode:: python - - def test_create_bucket(s3): - # s3 is a fixture defined above that yields a boto3 s3 client. - # Feel free to instantiate another boto3 S3 client -- Keep note of the region though. - s3.create_bucket(Bucket="somebucket") - - result = s3.list_buckets() - assert len(result["Buckets"]) == 1 - assert result["Buckets"][0]["Name"] == "somebucket" +Moto will delete any data after the mock ends, so the state is not shared across methods. .. _pesky_imports_section: diff --git a/docs/docs/services/autoscaling.rst b/docs/docs/services/autoscaling.rst index b6e4fb294..35fd64370 100644 --- a/docs/docs/services/autoscaling.rst +++ b/docs/docs/services/autoscaling.rst @@ -64,7 +64,6 @@ autoscaling - [X] describe_tags Pagination is not yet implemented. - Only the `auto-scaling-group` and `propagate-at-launch` filters are implemented. - [ ] describe_termination_policy_types diff --git a/docs/docs/services/cognito-identity.rst b/docs/docs/services/cognito-identity.rst index af66b4204..f8b596a79 100644 --- a/docs/docs/services/cognito-identity.rst +++ b/docs/docs/services/cognito-identity.rst @@ -41,7 +41,11 @@ cognito-identity The MaxResults-parameter has not yet been implemented -- [ ] list_identity_pools +- [X] list_identity_pools + + The MaxResults-parameter has not yet been implemented + + - [ ] list_tags_for_resource - [ ] lookup_developer_identity - [ ] merge_developer_identities diff --git a/docs/docs/services/ec2.rst b/docs/docs/services/ec2.rst index 72e1ffbf2..95c9d6a8b 100644 --- a/docs/docs/services/ec2.rst +++ b/docs/docs/services/ec2.rst @@ -48,6 +48,7 @@ ec2 - [ ] associate_enclave_certificate_iam_role - [X] associate_iam_instance_profile - [ ] associate_instance_event_window +- [ ] associate_ipam_byoasn - [ ] associate_ipam_resource_discovery - [ ] associate_nat_gateway_address - [X] associate_route_table @@ -242,6 +243,7 @@ ec2 - [ ] delete_vpn_connection_route - [X] delete_vpn_gateway - [ ] deprovision_byoip_cidr +- [ ] deprovision_ipam_byoasn - [ ] deprovision_ipam_pool_cidr - [ ] deprovision_public_ipv4_pool_cidr - [X] deregister_image @@ -312,6 +314,7 @@ ec2 - [X] describe_instance_types - [X] describe_instances - [X] describe_internet_gateways +- [ ] describe_ipam_byoasn - [ ] describe_ipam_pools - [ ] describe_ipam_resource_discoveries - [ ] describe_ipam_resource_discovery_associations @@ -449,6 +452,7 @@ ec2 - [ ] disassociate_enclave_certificate_iam_role - [X] disassociate_iam_instance_profile - [ ] disassociate_instance_event_window +- [ ] disassociate_ipam_byoasn - [ ] disassociate_ipam_resource_discovery - [ ] disassociate_nat_gateway_address - [X] disassociate_route_table @@ -497,6 +501,7 @@ ec2 - [ ] get_instance_uefi_data - [ ] get_ipam_address_history - [ ] get_ipam_discovered_accounts +- [ ] get_ipam_discovered_public_addresses - [ ] get_ipam_discovered_resource_cidrs - [ ] get_ipam_pool_allocations - [ ] get_ipam_pool_cidrs @@ -606,6 +611,7 @@ ec2 - [ ] move_address_to_vpc - [ ] move_byoip_cidr_to_ipam - [ ] provision_byoip_cidr +- [ ] provision_ipam_byoasn - [ ] provision_ipam_pool_cidr - [ ] provision_public_ipv4_pool_cidr - [ ] purchase_capacity_block diff --git a/docs/docs/services/ecr.rst b/docs/docs/services/ecr.rst index 64cab0146..857f737af 100644 --- a/docs/docs/services/ecr.rst +++ b/docs/docs/services/ecr.rst @@ -77,5 +77,7 @@ ecr - [ ] start_lifecycle_policy_preview - [X] tag_resource - [X] untag_resource +- [ ] update_pull_through_cache_rule - [ ] upload_layer_part +- [ ] validate_pull_through_cache_rule diff --git a/docs/docs/services/glue.rst b/docs/docs/services/glue.rst index 3ec1b98fc..58fd07358 100644 --- a/docs/docs/services/glue.rst +++ b/docs/docs/services/glue.rst @@ -107,6 +107,8 @@ glue - [ ] get_classifiers - [ ] get_column_statistics_for_partition - [ ] get_column_statistics_for_table +- [ ] get_column_statistics_task_run +- [ ] get_column_statistics_task_runs - [ ] get_connection - [ ] get_connections - [X] get_crawler @@ -179,6 +181,7 @@ glue - [ ] get_workflow_runs - [ ] import_catalog_to_glue - [ ] list_blueprints +- [ ] list_column_statistics_task_runs - [X] list_crawlers - [ ] list_crawls - [ ] list_custom_entity_types @@ -209,6 +212,7 @@ glue - [ ] run_statement - [ ] search_tables - [ ] start_blueprint_run +- [ ] start_column_statistics_task_run - [X] start_crawler - [ ] start_crawler_schedule - [ ] start_data_quality_rule_recommendation_run @@ -220,6 +224,7 @@ glue - [ ] start_ml_labeling_set_generation_task_run - [X] start_trigger - [ ] start_workflow_run +- [ ] stop_column_statistics_task_run - [X] stop_crawler - [ ] stop_crawler_schedule - [X] stop_session diff --git a/docs/docs/services/lakeformation.rst b/docs/docs/services/lakeformation.rst index e328c98c2..fb95571c2 100644 --- a/docs/docs/services/lakeformation.rst +++ b/docs/docs/services/lakeformation.rst @@ -64,7 +64,7 @@ lakeformation - [X] list_lf_tags - [X] list_permissions - No parameters have been implemented yet + No pagination has been implemented yet. - [X] list_resources diff --git a/docs/docs/services/quicksight.rst b/docs/docs/services/quicksight.rst index 1cdc89deb..51e65ce0c 100644 --- a/docs/docs/services/quicksight.rst +++ b/docs/docs/services/quicksight.rst @@ -42,6 +42,7 @@ quicksight - [X] create_ingestion - [ ] create_namespace - [ ] create_refresh_schedule +- [ ] create_role_membership - [ ] create_template - [ ] create_template_alias - [ ] create_theme @@ -63,6 +64,8 @@ quicksight - [ ] delete_iam_policy_assignment - [ ] delete_namespace - [ ] delete_refresh_schedule +- [ ] delete_role_custom_permission +- [ ] delete_role_membership - [ ] delete_template - [ ] delete_template_alias - [ ] delete_theme @@ -100,6 +103,7 @@ quicksight - [ ] describe_ip_restriction - [ ] describe_namespace - [ ] describe_refresh_schedule +- [ ] describe_role_custom_permission - [ ] describe_template - [ ] describe_template_alias - [ ] describe_template_definition @@ -141,6 +145,7 @@ quicksight - [ ] list_ingestions - [ ] list_namespaces - [ ] list_refresh_schedules +- [ ] list_role_memberships - [ ] list_tags_for_resource - [ ] list_template_aliases - [ ] list_template_versions @@ -194,6 +199,7 @@ quicksight - [ ] update_ip_restriction - [ ] update_public_sharing_settings - [ ] update_refresh_schedule +- [ ] update_role_custom_permission - [ ] update_template - [ ] update_template_alias - [ ] update_template_permissions diff --git a/docs/docs/services/redshift.rst b/docs/docs/services/redshift.rst index 31bbeeaea..6abb8ead6 100644 --- a/docs/docs/services/redshift.rst +++ b/docs/docs/services/redshift.rst @@ -47,6 +47,7 @@ redshift - [ ] create_event_subscription - [ ] create_hsm_client_certificate - [ ] create_hsm_configuration +- [ ] create_redshift_idc_application - [ ] create_scheduled_action - [X] create_snapshot_copy_grant - [ ] create_snapshot_schedule @@ -65,6 +66,7 @@ redshift - [ ] delete_hsm_client_certificate - [ ] delete_hsm_configuration - [ ] delete_partner +- [ ] delete_redshift_idc_application - [ ] delete_resource_policy - [ ] delete_scheduled_action - [X] delete_snapshot_copy_grant @@ -99,6 +101,7 @@ redshift - [ ] describe_node_configuration_options - [ ] describe_orderable_cluster_options - [ ] describe_partners +- [ ] describe_redshift_idc_applications - [ ] describe_reserved_node_exchange_status - [ ] describe_reserved_node_offerings - [ ] describe_reserved_nodes @@ -134,6 +137,7 @@ redshift - [ ] modify_custom_domain_association - [ ] modify_endpoint_access - [ ] modify_event_subscription +- [ ] modify_redshift_idc_application - [ ] modify_scheduled_action - [X] modify_snapshot_copy_retention_period - [ ] modify_snapshot_schedule diff --git a/docs/docs/services/sso-admin.rst b/docs/docs/services/sso-admin.rst index 07eb000e2..6e6003a4c 100644 --- a/docs/docs/services/sso-admin.rst +++ b/docs/docs/services/sso-admin.rst @@ -30,20 +30,40 @@ sso-admin - [ ] attach_customer_managed_policy_reference_to_permission_set - [ ] attach_managed_policy_to_permission_set - [X] create_account_assignment +- [ ] create_application +- [ ] create_application_assignment +- [ ] create_instance - [ ] create_instance_access_control_attribute_configuration - [X] create_permission_set +- [ ] create_trusted_token_issuer - [X] delete_account_assignment +- [ ] delete_application +- [ ] delete_application_access_scope +- [ ] delete_application_assignment +- [ ] delete_application_authentication_method +- [ ] delete_application_grant - [ ] delete_inline_policy_from_permission_set +- [ ] delete_instance - [ ] delete_instance_access_control_attribute_configuration - [X] delete_permission_set - [ ] delete_permissions_boundary_from_permission_set +- [ ] delete_trusted_token_issuer - [ ] describe_account_assignment_creation_status - [ ] describe_account_assignment_deletion_status +- [ ] describe_application +- [ ] describe_application_assignment +- [ ] describe_application_provider +- [ ] describe_instance - [ ] describe_instance_access_control_attribute_configuration - [X] describe_permission_set - [ ] describe_permission_set_provisioning_status +- [ ] describe_trusted_token_issuer - [ ] detach_customer_managed_policy_reference_from_permission_set - [ ] detach_managed_policy_from_permission_set +- [ ] get_application_access_scope +- [ ] get_application_assignment_configuration +- [ ] get_application_authentication_method +- [ ] get_application_grant - [ ] get_inline_policy_for_permission_set - [ ] get_permissions_boundary_for_permission_set - [ ] list_account_assignment_creation_status @@ -53,7 +73,15 @@ sso-admin Pagination has not yet been implemented +- [ ] list_account_assignments_for_principal - [ ] list_accounts_for_provisioned_permission_set +- [ ] list_application_access_scopes +- [ ] list_application_assignments +- [ ] list_application_assignments_for_principal +- [ ] list_application_authentication_methods +- [ ] list_application_grants +- [ ] list_application_providers +- [ ] list_applications - [ ] list_customer_managed_policy_references_in_permission_set - [ ] list_instances - [ ] list_managed_policies_in_permission_set @@ -61,11 +89,19 @@ sso-admin - [X] list_permission_sets - [ ] list_permission_sets_provisioned_to_account - [ ] list_tags_for_resource +- [ ] list_trusted_token_issuers - [ ] provision_permission_set +- [ ] put_application_access_scope +- [ ] put_application_assignment_configuration +- [ ] put_application_authentication_method +- [ ] put_application_grant - [ ] put_inline_policy_to_permission_set - [ ] put_permissions_boundary_to_permission_set - [ ] tag_resource - [ ] untag_resource +- [ ] update_application +- [ ] update_instance - [ ] update_instance_access_control_attribute_configuration - [X] update_permission_set +- [ ] update_trusted_token_issuer diff --git a/moto/autoscaling/models.py b/moto/autoscaling/models.py index f0245da37..c57989431 100644 --- a/moto/autoscaling/models.py +++ b/moto/autoscaling/models.py @@ -472,10 +472,10 @@ class FakeAutoScalingGroup(CloudFormationModel): @tags.setter def tags(self, tags: List[Dict[str, str]]) -> None: for tag in tags: - if "resource_id" not in tag or not tag["resource_id"]: - tag["resource_id"] = self.name - if "resource_type" not in tag or not tag["resource_type"]: - tag["resource_type"] = "auto-scaling-group" + if "ResourceId" not in tag or not tag["ResourceId"]: + tag["ResourceId"] = self.name + if "ResourceType" not in tag or not tag["ResourceType"]: + tag["ResourceType"] = "auto-scaling-group" self._tags = tags @property @@ -1376,31 +1376,31 @@ class AutoScalingBackend(BaseBackend): def create_or_update_tags(self, tags: List[Dict[str, str]]) -> None: for tag in tags: - group_name = tag["resource_id"] + group_name = tag["ResourceId"] group = self.autoscaling_groups[group_name] old_tags = group.tags new_tags = [] # if key was in old_tags, update old tag for old_tag in old_tags: - if old_tag["key"] == tag["key"]: + if old_tag["Key"] == tag["Key"]: new_tags.append(tag) else: new_tags.append(old_tag) # if key was never in old_tag's add it (create tag) - if not any(new_tag["key"] == tag["key"] for new_tag in new_tags): + if not any(new_tag["Key"] == tag["Key"] for new_tag in new_tags): new_tags.append(tag) group.tags = new_tags def delete_tags(self, tags: List[Dict[str, str]]) -> None: for tag_to_delete in tags: - group_name = tag_to_delete["resource_id"] - key_to_delete = tag_to_delete["key"] + group_name = tag_to_delete["ResourceId"] + key_to_delete = tag_to_delete["Key"] group = self.autoscaling_groups[group_name] old_tags = group.tags - group.tags = [x for x in old_tags if x["key"] != key_to_delete] + group.tags = [x for x in old_tags if x["Key"] != key_to_delete] def attach_load_balancers( self, group_name: str, load_balancer_names: List[str] @@ -1563,18 +1563,16 @@ class AutoScalingBackend(BaseBackend): tags = list(itertools.chain(*[r.tags for r in resources])) for f in filters: if f["Name"] == "auto-scaling-group": - tags = [t for t in tags if t["resource_id"] in f["Values"]] + tags = [t for t in tags if t["ResourceId"] in f["Values"]] if f["Name"] == "propagate-at-launch": values = [v.lower() for v in f["Values"]] tags = [ - t - for t in tags - if t.get("propagate_at_launch", "").lower() in values + t for t in tags if t.get("PropagateAtLaunch", "").lower() in values ] if f["Name"] == "key": - tags = [t for t in tags if t["key"] in f["Values"]] + tags = [t for t in tags if t["Key"] in f["Values"]] if f["Name"] == "value": - tags = [t for t in tags if t["value"] in f["Values"]] + tags = [t for t in tags if t["Value"] in f["Values"]] return tags def enable_metrics_collection(self, group_name: str, metrics: List[str]) -> None: diff --git a/moto/autoscaling/responses.py b/moto/autoscaling/responses.py index 563bfe578..3240349f1 100644 --- a/moto/autoscaling/responses.py +++ b/moto/autoscaling/responses.py @@ -93,7 +93,7 @@ class AutoScalingResponse(BaseResponse): target_group_arns=self._get_multi_param("TargetGroupARNs.member"), placement_group=self._get_param("PlacementGroup"), termination_policies=self._get_multi_param("TerminationPolicies.member"), - tags=self._get_list_prefix("Tags.member"), + tags=params.get("Tags", []), capacity_rebalance=self._get_bool_param("CapacityRebalance", False), new_instances_protected_from_scale_in=self._get_bool_param( "NewInstancesProtectedFromScaleIn", False @@ -260,16 +260,14 @@ class AutoScalingResponse(BaseResponse): return template.render() def create_or_update_tags(self) -> str: - tags = self._get_list_prefix("Tags.member") - - self.autoscaling_backend.create_or_update_tags(tags) + self.autoscaling_backend.create_or_update_tags( + self._get_params().get("Tags", []) + ) template = self.response_template(UPDATE_AUTOSCALING_GROUP_TEMPLATE) return template.render() def delete_tags(self) -> str: - tags = self._get_list_prefix("Tags.member") - - self.autoscaling_backend.delete_tags(tags) + self.autoscaling_backend.delete_tags(self._get_params().get("Tags", [])) template = self.response_template(UPDATE_AUTOSCALING_GROUP_TEMPLATE) return template.render() @@ -1427,11 +1425,11 @@ DESCRIBE_TAGS_TEMPLATE = """