Prep Release 4.1.7 (#6201)

This commit is contained in:
Bert Blommers 2023-04-11 14:31:46 +00:00 committed by GitHub
parent b4346e2eea
commit 2cf0130d13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 509 additions and 94 deletions

View File

@ -1,6 +1,76 @@
Moto Changelog Moto Changelog
============== ==============
4.1.7
-----
Docker Digest for 4.1.7: <autopopulateddigest>
New Services:
* LakeFormation:
* batch_grant_permissions()
* batch_revoke_permissions()
* create_lf_tag()
* delete_lf_tag()
* deregister_resource()
* describe_resource()
* get_data_lake_settings()
* get_lf_tag()
* grant_permissions()
* list_data_cells_filter()
* list_lf_tags()
* list_permissions()
* list_resources()
* put_data_lake_settings()
* register_resource()
* revoke_permissions()
* RDS Data:
* execute_statement()
* Scheduler:
* create_schedule()
* create_schedule_group()
* delete_schedule()
* delete_schedule_group()
* get_schedule()
* get_schedule_group()
* list_schedule_groups()
* list_schedules()
* list_tags_for_resource()
* tag_resource()
* untag_resource()
* update_schedule()
New Methods:
* Config:
* delete_retention_configuration()
* describe_retention_configurations()
* put_retention_configuration()
* EC2:
* get_launch_template_data()
* RDS:
* create_db_cluster_parameter_group()
* create_global_cluster()
* delete_db_cluster_parameter_group()
* delete_global_cluster()
* describe_db_cluster_parameter_groups()
* describe_db_cluster_parameters()
* describe_db_subnet_groups()
* describe_global_clusters()
* promote_read_replica_db_cluster()
* remove_from_global_cluster()
Miscellaneous:
* APIGateway now allows semicolons in paths
* CloudFormation now supports Fn::ToJsonString
* DynamoDB: update_item() now supports number-sets in the AttributeUpdates-parameter
* DynamoDB: query() - The KeyConditionExpression now allows enclosing the sort key condition in brackets
* EC2: assign_private_ip_addresses() now supports the PrivateIpAddresses-argument
* ECR: put_image() now supports the imageManifestMediaType parameter
* ECS: run_task() now validates the provided launch-type
* Logs: put_subscription_filter() now supports KinesisStream destinations
* RDS: describe_db_clusters() now supports filtering by db-cluster-id and engine
* RDS: describe_db_clusters() now returns the parameters KmsKeyId, NetworkType, DBSubnetGroupName, ScalingConfiguration
* S3: head_object() now returns the AcceptRanges header
* SQS: Improvements in the deduplication-logic
4.1.6 4.1.6
----- -----

View File

@ -1,3 +1,8 @@
## Supported CloudFormation resources
A list of all resources that can be created via CloudFormation.
Please let us know if you'd like support for a resource not yet listed here.
- AWS::ApiGateway::Deployment: - AWS::ApiGateway::Deployment:
- [x] create implemented - [x] create implemented
- [ ] update implemented - [ ] update implemented

View File

@ -1280,7 +1280,7 @@
## config ## config
<details> <details>
<summary>34% implemented</summary> <summary>38% implemented</summary>
- [X] batch_get_aggregate_resource_config - [X] batch_get_aggregate_resource_config
- [X] batch_get_resource_config - [X] batch_get_resource_config
@ -1297,7 +1297,7 @@
- [ ] delete_remediation_configuration - [ ] delete_remediation_configuration
- [ ] delete_remediation_exceptions - [ ] delete_remediation_exceptions
- [ ] delete_resource_config - [ ] delete_resource_config
- [ ] delete_retention_configuration - [X] delete_retention_configuration
- [ ] delete_stored_query - [ ] delete_stored_query
- [ ] deliver_config_snapshot - [ ] deliver_config_snapshot
- [ ] describe_aggregate_compliance_by_config_rules - [ ] describe_aggregate_compliance_by_config_rules
@ -1324,7 +1324,7 @@
- [ ] describe_remediation_configurations - [ ] describe_remediation_configurations
- [ ] describe_remediation_exceptions - [ ] describe_remediation_exceptions
- [ ] describe_remediation_execution_status - [ ] describe_remediation_execution_status
- [ ] describe_retention_configurations - [X] describe_retention_configurations
- [ ] get_aggregate_compliance_details_by_config_rule - [ ] get_aggregate_compliance_details_by_config_rule
- [ ] get_aggregate_config_rule_compliance_summary - [ ] get_aggregate_config_rule_compliance_summary
- [ ] get_aggregate_conformance_pack_compliance_summary - [ ] get_aggregate_conformance_pack_compliance_summary
@ -1363,7 +1363,7 @@
- [ ] put_remediation_configurations - [ ] put_remediation_configurations
- [ ] put_remediation_exceptions - [ ] put_remediation_exceptions
- [ ] put_resource_config - [ ] put_resource_config
- [ ] put_retention_configuration - [X] put_retention_configuration
- [ ] put_stored_query - [ ] put_stored_query
- [ ] select_aggregate_resource_config - [ ] select_aggregate_resource_config
- [ ] select_resource_config - [ ] select_resource_config
@ -2191,7 +2191,7 @@
- [ ] get_ipam_pool_allocations - [ ] get_ipam_pool_allocations
- [ ] get_ipam_pool_cidrs - [ ] get_ipam_pool_cidrs
- [ ] get_ipam_resource_cidrs - [ ] get_ipam_resource_cidrs
- [x] get_launch_template_data - [X] get_launch_template_data
- [ ] get_managed_prefix_list_associations - [ ] get_managed_prefix_list_associations
- [X] get_managed_prefix_list_entries - [X] get_managed_prefix_list_entries
- [ ] get_network_insights_access_scope_analysis_findings - [ ] get_network_insights_access_scope_analysis_findings
@ -2212,6 +2212,7 @@
- [ ] get_verified_access_group_policy - [ ] get_verified_access_group_policy
- [ ] get_vpn_connection_device_sample_configuration - [ ] get_vpn_connection_device_sample_configuration
- [ ] get_vpn_connection_device_types - [ ] get_vpn_connection_device_types
- [ ] get_vpn_tunnel_replacement_status
- [ ] import_client_vpn_client_certificate_revocation_list - [ ] import_client_vpn_client_certificate_revocation_list
- [ ] import_image - [ ] import_image
- [ ] import_instance - [ ] import_instance
@ -2312,6 +2313,7 @@
- [X] replace_route - [X] replace_route
- [X] replace_route_table_association - [X] replace_route_table_association
- [ ] replace_transit_gateway_route - [ ] replace_transit_gateway_route
- [ ] replace_vpn_tunnel
- [ ] report_instance_status - [ ] report_instance_status
- [X] request_spot_fleet - [X] request_spot_fleet
- [X] request_spot_instances - [X] request_spot_instances
@ -3454,6 +3456,7 @@
- [ ] disassociate_members - [ ] disassociate_members
- [X] enable_organization_admin_account - [X] enable_organization_admin_account
- [ ] get_administrator_account - [ ] get_administrator_account
- [ ] get_coverage_statistics
- [X] get_detector - [X] get_detector
- [X] get_filter - [X] get_filter
- [ ] get_findings - [ ] get_findings
@ -3468,6 +3471,7 @@
- [ ] get_threat_intel_set - [ ] get_threat_intel_set
- [ ] get_usage_statistics - [ ] get_usage_statistics
- [ ] invite_members - [ ] invite_members
- [ ] list_coverage
- [X] list_detectors - [X] list_detectors
- [ ] list_filters - [ ] list_filters
- [ ] list_findings - [ ] list_findings
@ -4169,6 +4173,7 @@
- [ ] get_runtime_management_config - [ ] get_runtime_management_config
- [X] invoke - [X] invoke
- [ ] invoke_async - [ ] invoke_async
- [ ] invoke_with_response_stream
- [ ] list_aliases - [ ] list_aliases
- [ ] list_code_signing_configs - [ ] list_code_signing_configs
- [X] list_event_source_mappings - [X] list_event_source_mappings
@ -4978,7 +4983,7 @@
## quicksight ## quicksight
<details> <details>
<summary>11% implemented</summary> <summary>10% implemented</summary>
- [ ] cancel_ingestion - [ ] cancel_ingestion
- [ ] create_account_customization - [ ] create_account_customization
@ -4994,6 +4999,7 @@
- [ ] create_iam_policy_assignment - [ ] create_iam_policy_assignment
- [X] create_ingestion - [X] create_ingestion
- [ ] create_namespace - [ ] create_namespace
- [ ] create_refresh_schedule
- [ ] create_template - [ ] create_template
- [ ] create_template_alias - [ ] create_template_alias
- [ ] create_theme - [ ] create_theme
@ -5003,6 +5009,7 @@
- [ ] delete_analysis - [ ] delete_analysis
- [ ] delete_dashboard - [ ] delete_dashboard
- [ ] delete_data_set - [ ] delete_data_set
- [ ] delete_data_set_refresh_properties
- [ ] delete_data_source - [ ] delete_data_source
- [ ] delete_folder - [ ] delete_folder
- [ ] delete_folder_membership - [ ] delete_folder_membership
@ -5010,6 +5017,7 @@
- [ ] delete_group_membership - [ ] delete_group_membership
- [ ] delete_iam_policy_assignment - [ ] delete_iam_policy_assignment
- [ ] delete_namespace - [ ] delete_namespace
- [ ] delete_refresh_schedule
- [ ] delete_template - [ ] delete_template
- [ ] delete_template_alias - [ ] delete_template_alias
- [ ] delete_theme - [ ] delete_theme
@ -5027,6 +5035,7 @@
- [ ] describe_dashboard_permissions - [ ] describe_dashboard_permissions
- [ ] describe_data_set - [ ] describe_data_set
- [ ] describe_data_set_permissions - [ ] describe_data_set_permissions
- [ ] describe_data_set_refresh_properties
- [ ] describe_data_source - [ ] describe_data_source
- [ ] describe_data_source_permissions - [ ] describe_data_source_permissions
- [ ] describe_folder - [ ] describe_folder
@ -5038,6 +5047,7 @@
- [ ] describe_ingestion - [ ] describe_ingestion
- [ ] describe_ip_restriction - [ ] describe_ip_restriction
- [ ] describe_namespace - [ ] describe_namespace
- [ ] describe_refresh_schedule
- [ ] describe_template - [ ] describe_template
- [ ] describe_template_alias - [ ] describe_template_alias
- [ ] describe_template_definition - [ ] describe_template_definition
@ -5063,6 +5073,7 @@
- [ ] list_iam_policy_assignments_for_user - [ ] list_iam_policy_assignments_for_user
- [ ] list_ingestions - [ ] list_ingestions
- [ ] list_namespaces - [ ] list_namespaces
- [ ] list_refresh_schedules
- [ ] list_tags_for_resource - [ ] list_tags_for_resource
- [ ] list_template_aliases - [ ] list_template_aliases
- [ ] list_template_versions - [ ] list_template_versions
@ -5072,6 +5083,7 @@
- [ ] list_themes - [ ] list_themes
- [ ] list_user_groups - [ ] list_user_groups
- [X] list_users - [X] list_users
- [ ] put_data_set_refresh_properties
- [X] register_user - [X] register_user
- [ ] restore_analysis - [ ] restore_analysis
- [ ] search_analyses - [ ] search_analyses
@ -5099,6 +5111,7 @@
- [ ] update_iam_policy_assignment - [ ] update_iam_policy_assignment
- [ ] update_ip_restriction - [ ] update_ip_restriction
- [ ] update_public_sharing_settings - [ ] update_public_sharing_settings
- [ ] update_refresh_schedule
- [ ] update_template - [ ] update_template
- [ ] update_template_alias - [ ] update_template_alias
- [ ] update_template_permissions - [ ] update_template_permissions
@ -5141,7 +5154,7 @@
## rds ## rds
<details> <details>
<summary>37% implemented</summary> <summary>38% implemented</summary>
- [ ] add_role_to_db_cluster - [ ] add_role_to_db_cluster
- [ ] add_role_to_db_instance - [ ] add_role_to_db_instance
@ -5213,7 +5226,7 @@
- [ ] describe_db_proxy_targets - [ ] describe_db_proxy_targets
- [ ] describe_db_security_groups - [ ] describe_db_security_groups
- [ ] describe_db_snapshot_attributes - [ ] describe_db_snapshot_attributes
- [ ] describe_db_snapshots - [X] describe_db_snapshots
- [X] describe_db_subnet_groups - [X] describe_db_subnet_groups
- [ ] describe_engine_default_cluster_parameters - [ ] describe_engine_default_cluster_parameters
- [ ] describe_engine_default_parameters - [ ] describe_engine_default_parameters
@ -5447,6 +5460,7 @@
- [ ] copy_project_version - [ ] copy_project_version
- [ ] create_collection - [ ] create_collection
- [ ] create_dataset - [ ] create_dataset
- [ ] create_face_liveness_session
- [ ] create_project - [ ] create_project
- [ ] create_project_version - [ ] create_project_version
- [ ] create_stream_processor - [ ] create_stream_processor
@ -5473,6 +5487,7 @@
- [ ] get_celebrity_recognition - [ ] get_celebrity_recognition
- [ ] get_content_moderation - [ ] get_content_moderation
- [ ] get_face_detection - [ ] get_face_detection
- [ ] get_face_liveness_session_results
- [X] get_face_search - [X] get_face_search
- [ ] get_label_detection - [ ] get_label_detection
- [ ] get_person_tracking - [ ] get_person_tracking
@ -6441,14 +6456,14 @@
## sqs ## sqs
<details> <details>
<summary>90% implemented</summary> <summary>100% implemented</summary>
- [X] add_permission - [X] add_permission
- [X] change_message_visibility - [X] change_message_visibility
- [ ] change_message_visibility_batch - [X] change_message_visibility_batch
- [X] create_queue - [X] create_queue
- [X] delete_message - [X] delete_message
- [ ] delete_message_batch - [X] delete_message_batch
- [X] delete_queue - [X] delete_queue
- [X] get_queue_attributes - [X] get_queue_attributes
- [X] get_queue_url - [X] get_queue_url

View File

@ -60,7 +60,7 @@ implementation_coverage:
git commit IMPLEMENTATION_COVERAGE.md -m "Updating implementation coverage" || true git commit IMPLEMENTATION_COVERAGE.md -m "Updating implementation coverage" || true
cloudformation_coverage: cloudformation_coverage:
./scripts/cloudformation_coverage.py > CLOUDFORMATION_COVERAGE.md ./scripts/cloudformation_coverage.py
git commit CLOUDFORMATION_COVERAGE.md -m "Updating CloudFormation coverage" || true git commit CLOUDFORMATION_COVERAGE.md -m "Updating CloudFormation coverage" || true
coverage: implementation_coverage cloudformation_coverage coverage: implementation_coverage cloudformation_coverage

193
docs/docs/services/cf.rst Normal file
View File

@ -0,0 +1,193 @@
.. _cloudformation_resources:
==================================
Supported CloudFormation resources
==================================
A list of all resources that can be created via CloudFormation.
Please let us know if you'd like support for a resource not yet listed here.
.. table::
+---------------------------------------+--------+--------+--------+-----------------------------------+
| | Create | Update | Delete | Fn::GetAtt |
+=======================================+========+========+========+===================================+
|AWS::ApiGateway::Deployment | x | | | - [ ] DeploymentId |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::ApiGateway::Method | x | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::ApiGateway::Resource | x | | | - [ ] ResourceId |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::AutoScaling::AutoScalingGroup | x | x | x | - [ ] LaunchConfigurationName |
+---------------------------------------+--------+--------+--------+ - [ ] LaunchTemplateSpecification |
| | | | | - [ ] MixedInstancesPolicy |
+---------------------------------------+--------+--------+--------+ - [ ] PlacementGroup |
| | | | | - [ ] VPCZoneIdentifier |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::AutoScaling::LaunchConfiguration | x | x | x | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::AutoScaling::ScheduledAction | x | | | - [ ] ScheduledActionName |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::Batch::ComputeEnvironment | x | | | - [ ] ComputeEnvironmentArn |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::Batch::JobDefinition | x | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::Batch::JobQueue | x | | | - [ ] JobQueueArn |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::CloudFormation::Stack | x | x | x | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::DataPipeline::Pipeline | x | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::DynamoDB::Table | x | | x | - [x] Arn |
+---------------------------------------+--------+--------+--------+ - [x] StreamArn |
| | | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::Instance | x | | x | - [x] AvailabilityZone |
+---------------------------------------+--------+--------+--------+ - [x] PrivateDnsName |
| | | | | - [x] PrivateIp |
+---------------------------------------+--------+--------+--------+ - [x] PublicDnsName |
| | | | | - [x] PublicIp |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::InternetGateway | x | | | - [ ] InternetGatewayId |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::LaunchTemplate | x | x | x | - [ ] LatestVersionNumber |
+---------------------------------------+--------+--------+--------+ - [ ] DefaultVersionNumber |
| | | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::NatGateway | x | | | - [ ] NatGatewayId |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::NetworkInterface | x | | | - [x] SecondaryPrivateIpAddresses |
+---------------------------------------+--------+--------+--------+ - [x] PrimaryPrivateIpAddress |
| | | | | - [ ] Id |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::Route | x | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::RouteTable | x | | | - [ ] RouteTableId |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::SecurityGroup | x | x | x | - [x] GroupId |
+---------------------------------------+--------+--------+--------+ - [ ] VpcId |
| | | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::SecurityGroupIngress | x | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::Subnet | x | | x | - [ ] VpcId |
+---------------------------------------+--------+--------+--------+ - [ ] NetworkAclAssociationId |
| | | | | - [ ] OutpostArn |
+---------------------------------------+--------+--------+--------+ - [x] AvailabilityZone |
| | | | | - [ ] SubnetId |
+---------------------------------------+--------+--------+--------+ - [ ] Ipv6CidrBlocks |
| | | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::SubnetRouteTableAssociation | x | | | - [ ] Id |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::TransitGateway | x | | | - [ ] Id |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::VPC | x | | x | - [ ] VpcId |
+---------------------------------------+--------+--------+--------+ - [ ] CidrBlockAssociations |
| | | | | - [ ] CidrBlock |
+---------------------------------------+--------+--------+--------+ - [ ] DefaultNetworkAcl |
| | | | | - [ ] Ipv6CidrBlocks |
+---------------------------------------+--------+--------+--------+ - [ ] DefaultSecurityGroup |
| | | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::VPCGatewayAttachment | x | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::VPCPeeringConnection | x | | | - [ ] Id |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::Volume | x | | | - [ ] VolumeId |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EC2::VolumeAttachment | x | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::ECR::Repository | x | x | | - [x] RepositoryUri |
+---------------------------------------+--------+--------+--------+ - [x] Arn |
| | | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::ECS::Cluster | x | x | | - [x] Arn |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::ECS::Service | x | x | | - [ ] ServiceArn |
+---------------------------------------+--------+--------+--------+ - [x] Name |
| | | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::ECS::TaskDefinition | x | x | | - [ ] TaskDefinitionArn |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EFS::FileSystem | x | x | x | - [ ] FileSystemId |
+---------------------------------------+--------+--------+--------+ - [ ] Arn |
| | | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::EFS::MountTarget | x | x | x | - [ ] IpAddress |
+---------------------------------------+--------+--------+--------+ - [ ] Id |
| | | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::Events::Archive | x | x | | - [x] Arn |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::Events::EventBus | x | x | x | - [x] Policy |
+---------------------------------------+--------+--------+--------+ - [x] Arn |
| | | | | - [x] Name |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::Events::Rule | x | x | x | - [x] Arn |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::IAM::AccessKey | x | x | x | - [x] SecretAccessKey |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::IAM::InstanceProfile | x | | x | - [x] Arn |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::IAM::ManagedPolicy | x | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::IAM::Policy | | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::IAM::Role | x | | x | - [x] Arn |
+---------------------------------------+--------+--------+--------+ - [ ] RoleId |
| | | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::IAM::User | x | x | x | - [x] Arn |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::KMS::Key | x | | | - [ ] KeyId |
+---------------------------------------+--------+--------+--------+ - [x] Arn |
| | | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::Kinesis::Stream | x | x | x | - [x] Arn |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::Logs::LogGroup | x | | | - [x] Arn |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::RDS::DBParameterGroup | x | | | - [ ] DBParameterGroupName |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::Redshift::Cluster | x | | | - [x] Endpoint.Address |
+---------------------------------------+--------+--------+--------+ - [x] Endpoint.Port |
| | | | | - [ ] Id |
+---------------------------------------+--------+--------+--------+ - [ ] DeferMaintenanceIdentifier |
| | | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::Route53::HealthCheck | x | | | - [ ] HealthCheckId |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::Route53::RecordSet | x | x | x | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::Route53::RecordSetGroup | x | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::S3::Bucket | x | x | x | - [x] Arn |
+---------------------------------------+--------+--------+--------+ - [x] DomainName |
| | | | | - [x] DualStackDomainName |
+---------------------------------------+--------+--------+--------+ - [x] RegionalDomainName |
| | | | | - [x] WebsiteURL |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::SNS::Topic | x | x | x | - [ ] TopicArn |
+---------------------------------------+--------+--------+--------+ - [x] TopicName |
| | | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::SQS::Queue | x | x | x | - [x] Arn |
+---------------------------------------+--------+--------+--------+ - [x] QueueName |
| | | | | - [ ] QueueUrl |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::SSM::Parameter | x | x | x | - [ ] Type |
+---------------------------------------+--------+--------+--------+ - [ ] Value |
| | | | | |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::SageMaker::Endpoint | x | x | x | - [x] EndpointName |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::SageMaker::EndpointConfig | x | x | x | - [x] EndpointConfigName |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::SageMaker::Model | x | x | x | - [x] ModelName |
+---------------------------------------+--------+--------+--------+-----------------------------------+
|AWS::StepFunctions::StateMachine | x | x | x | - [ ] StateMachineRevisionId |
+---------------------------------------+--------+--------+--------+ - [ ] Arn |
| | | | | - [x] Name |
+---------------------------------------+--------+--------+--------+-----------------------------------+

View File

@ -63,6 +63,8 @@ config
- [ ] delete_remediation_exceptions - [ ] delete_remediation_exceptions
- [ ] delete_resource_config - [ ] delete_resource_config
- [X] delete_retention_configuration - [X] delete_retention_configuration
This will delete the retention configuration if one is present with the provided name.
- [ ] delete_stored_query - [ ] delete_stored_query
- [ ] deliver_config_snapshot - [ ] deliver_config_snapshot
- [ ] describe_aggregate_compliance_by_config_rules - [ ] describe_aggregate_compliance_by_config_rules
@ -92,6 +94,12 @@ config
- [ ] describe_remediation_exceptions - [ ] describe_remediation_exceptions
- [ ] describe_remediation_execution_status - [ ] describe_remediation_execution_status
- [X] describe_retention_configurations - [X] describe_retention_configurations
This will return the retention configuration if one is present.
This should only receive at most 1 name in. It will raise a ValidationException if more than 1 is supplied.
- [ ] get_aggregate_compliance_details_by_config_rule - [ ] get_aggregate_compliance_details_by_config_rule
- [ ] get_aggregate_config_rule_compliance_summary - [ ] get_aggregate_config_rule_compliance_summary
- [ ] get_aggregate_conformance_pack_compliance_summary - [ ] get_aggregate_conformance_pack_compliance_summary
@ -180,6 +188,8 @@ config
- [ ] put_remediation_exceptions - [ ] put_remediation_exceptions
- [ ] put_resource_config - [ ] put_resource_config
- [X] put_retention_configuration - [X] put_retention_configuration
Creates a Retention Configuration.
- [ ] put_stored_query - [ ] put_stored_query
- [ ] select_aggregate_resource_config - [ ] select_aggregate_resource_config
- [ ] select_resource_config - [ ] select_resource_config

View File

@ -488,7 +488,7 @@ ec2
- [ ] get_ipam_pool_allocations - [ ] get_ipam_pool_allocations
- [ ] get_ipam_pool_cidrs - [ ] get_ipam_pool_cidrs
- [ ] get_ipam_resource_cidrs - [ ] get_ipam_resource_cidrs
- [ ] get_launch_template_data - [X] get_launch_template_data
- [ ] get_managed_prefix_list_associations - [ ] get_managed_prefix_list_associations
- [X] get_managed_prefix_list_entries - [X] get_managed_prefix_list_entries
- [ ] get_network_insights_access_scope_analysis_findings - [ ] get_network_insights_access_scope_analysis_findings
@ -509,6 +509,7 @@ ec2
- [ ] get_verified_access_group_policy - [ ] get_verified_access_group_policy
- [ ] get_vpn_connection_device_sample_configuration - [ ] get_vpn_connection_device_sample_configuration
- [ ] get_vpn_connection_device_types - [ ] get_vpn_connection_device_types
- [ ] get_vpn_tunnel_replacement_status
- [ ] import_client_vpn_client_certificate_revocation_list - [ ] import_client_vpn_client_certificate_revocation_list
- [ ] import_image - [ ] import_image
- [ ] import_instance - [ ] import_instance
@ -613,6 +614,7 @@ ec2
- [X] replace_route - [X] replace_route
- [X] replace_route_table_association - [X] replace_route_table_association
- [ ] replace_transit_gateway_route - [ ] replace_transit_gateway_route
- [ ] replace_vpn_tunnel
- [ ] report_instance_status - [ ] report_instance_status
- [X] request_spot_fleet - [X] request_spot_fleet
- [X] request_spot_instances - [X] request_spot_instances

View File

@ -52,6 +52,7 @@ guardduty
- [ ] disassociate_members - [ ] disassociate_members
- [X] enable_organization_admin_account - [X] enable_organization_admin_account
- [ ] get_administrator_account - [ ] get_administrator_account
- [ ] get_coverage_statistics
- [X] get_detector - [X] get_detector
- [X] get_filter - [X] get_filter
- [ ] get_findings - [ ] get_findings
@ -66,6 +67,7 @@ guardduty
- [ ] get_threat_intel_set - [ ] get_threat_intel_set
- [ ] get_usage_statistics - [ ] get_usage_statistics
- [ ] invite_members - [ ] invite_members
- [ ] list_coverage
- [X] list_detectors - [X] list_detectors
The MaxResults and NextToken-parameter have not yet been implemented. The MaxResults and NextToken-parameter have not yet been implemented.

View File

@ -83,6 +83,7 @@ lambda
- [ ] invoke_async - [ ] invoke_async
- [ ] invoke_with_response_stream
- [ ] list_aliases - [ ] list_aliases
- [ ] list_code_signing_configs - [ ] list_code_signing_configs
- [X] list_event_source_mappings - [X] list_event_source_mappings

View File

@ -37,6 +37,10 @@ mediaconnect
- [X] grant_flow_entitlements - [X] grant_flow_entitlements
- [ ] list_entitlements - [ ] list_entitlements
- [X] list_flows - [X] list_flows
Pagination is not yet implemented
- [ ] list_offerings - [ ] list_offerings
- [ ] list_reservations - [ ] list_reservations
- [X] list_tags_for_resource - [X] list_tags_for_resource

View File

@ -66,10 +66,18 @@ medialive
- [ ] describe_reservation - [ ] describe_reservation
- [ ] describe_schedule - [ ] describe_schedule
- [X] list_channels - [X] list_channels
Pagination is not yet implemented
- [ ] list_input_device_transfers - [ ] list_input_device_transfers
- [ ] list_input_devices - [ ] list_input_devices
- [ ] list_input_security_groups - [ ] list_input_security_groups
- [X] list_inputs - [X] list_inputs
Pagination is not yet implemented
- [ ] list_multiplex_programs - [ ] list_multiplex_programs
- [ ] list_multiplexes - [ ] list_multiplexes
- [ ] list_offerings - [ ] list_offerings

View File

@ -41,6 +41,7 @@ quicksight
- [ ] create_iam_policy_assignment - [ ] create_iam_policy_assignment
- [X] create_ingestion - [X] create_ingestion
- [ ] create_namespace - [ ] create_namespace
- [ ] create_refresh_schedule
- [ ] create_template - [ ] create_template
- [ ] create_template_alias - [ ] create_template_alias
- [ ] create_theme - [ ] create_theme
@ -50,6 +51,7 @@ quicksight
- [ ] delete_analysis - [ ] delete_analysis
- [ ] delete_dashboard - [ ] delete_dashboard
- [ ] delete_data_set - [ ] delete_data_set
- [ ] delete_data_set_refresh_properties
- [ ] delete_data_source - [ ] delete_data_source
- [ ] delete_folder - [ ] delete_folder
- [ ] delete_folder_membership - [ ] delete_folder_membership
@ -57,6 +59,7 @@ quicksight
- [ ] delete_group_membership - [ ] delete_group_membership
- [ ] delete_iam_policy_assignment - [ ] delete_iam_policy_assignment
- [ ] delete_namespace - [ ] delete_namespace
- [ ] delete_refresh_schedule
- [ ] delete_template - [ ] delete_template
- [ ] delete_template_alias - [ ] delete_template_alias
- [ ] delete_theme - [ ] delete_theme
@ -74,6 +77,7 @@ quicksight
- [ ] describe_dashboard_permissions - [ ] describe_dashboard_permissions
- [ ] describe_data_set - [ ] describe_data_set
- [ ] describe_data_set_permissions - [ ] describe_data_set_permissions
- [ ] describe_data_set_refresh_properties
- [ ] describe_data_source - [ ] describe_data_source
- [ ] describe_data_source_permissions - [ ] describe_data_source_permissions
- [ ] describe_folder - [ ] describe_folder
@ -85,6 +89,7 @@ quicksight
- [ ] describe_ingestion - [ ] describe_ingestion
- [ ] describe_ip_restriction - [ ] describe_ip_restriction
- [ ] describe_namespace - [ ] describe_namespace
- [ ] describe_refresh_schedule
- [ ] describe_template - [ ] describe_template
- [ ] describe_template_alias - [ ] describe_template_alias
- [ ] describe_template_definition - [ ] describe_template_definition
@ -118,6 +123,7 @@ quicksight
- [ ] list_iam_policy_assignments_for_user - [ ] list_iam_policy_assignments_for_user
- [ ] list_ingestions - [ ] list_ingestions
- [ ] list_namespaces - [ ] list_namespaces
- [ ] list_refresh_schedules
- [ ] list_tags_for_resource - [ ] list_tags_for_resource
- [ ] list_template_aliases - [ ] list_template_aliases
- [ ] list_template_versions - [ ] list_template_versions
@ -131,6 +137,7 @@ quicksight
The NextToken and MaxResults parameters are not yet implemented The NextToken and MaxResults parameters are not yet implemented
- [ ] put_data_set_refresh_properties
- [X] register_user - [X] register_user
The following parameters are not yet implemented: The following parameters are not yet implemented:
@ -163,6 +170,7 @@ quicksight
- [ ] update_iam_policy_assignment - [ ] update_iam_policy_assignment
- [ ] update_ip_restriction - [ ] update_ip_restriction
- [ ] update_public_sharing_settings - [ ] update_public_sharing_settings
- [ ] update_refresh_schedule
- [ ] update_template - [ ] update_template
- [ ] update_template_alias - [ ] update_template_alias
- [ ] update_template_permissions - [ ] update_template_permissions

View File

@ -95,7 +95,7 @@ rds
- [ ] describe_db_proxy_targets - [ ] describe_db_proxy_targets
- [ ] describe_db_security_groups - [ ] describe_db_security_groups
- [ ] describe_db_snapshot_attributes - [ ] describe_db_snapshot_attributes
- [ ] describe_db_snapshots - [X] describe_db_snapshots
- [X] describe_db_subnet_groups - [X] describe_db_subnet_groups
- [ ] describe_engine_default_cluster_parameters - [ ] describe_engine_default_cluster_parameters
- [ ] describe_engine_default_parameters - [ ] describe_engine_default_parameters

View File

@ -31,6 +31,7 @@ rekognition
- [ ] copy_project_version - [ ] copy_project_version
- [ ] create_collection - [ ] create_collection
- [ ] create_dataset - [ ] create_dataset
- [ ] create_face_liveness_session
- [ ] create_project - [ ] create_project
- [ ] create_project_version - [ ] create_project_version
- [ ] create_stream_processor - [ ] create_stream_processor
@ -57,6 +58,7 @@ rekognition
- [ ] get_celebrity_recognition - [ ] get_celebrity_recognition
- [ ] get_content_moderation - [ ] get_content_moderation
- [ ] get_face_detection - [ ] get_face_detection
- [ ] get_face_liveness_session_results
- [X] get_face_search - [X] get_face_search
This returns hardcoded values and none of the parameters are taken into account. This returns hardcoded values and none of the parameters are taken into account.

View File

@ -46,7 +46,11 @@ scheduler
The MaxResults-parameter and pagination options are not yet implemented The MaxResults-parameter and pagination options are not yet implemented
- [ ] list_schedules - [X] list_schedules
The following parameters are not yet implemented: MaxResults, NamePrefix, NextToken
- [X] list_tags_for_resource - [X] list_tags_for_resource
- [X] tag_resource - [X] tag_resource
- [X] untag_resource - [X] untag_resource

View File

@ -27,10 +27,10 @@ sqs
- [X] add_permission - [X] add_permission
- [X] change_message_visibility - [X] change_message_visibility
- [ ] change_message_visibility_batch - [X] change_message_visibility_batch
- [X] create_queue - [X] create_queue
- [X] delete_message - [X] delete_message
- [ ] delete_message_batch - [X] delete_message_batch
- [X] delete_queue - [X] delete_queue
- [X] get_queue_attributes - [X] get_queue_attributes
- [X] get_queue_url - [X] get_queue_url

View File

@ -49,6 +49,7 @@ Additional Resources
:caption: Implemented Services :caption: Implemented Services
docs/services/index docs/services/index
docs/services/cf
docs/services/patching_other_services docs/services/patching_other_services
.. toctree:: .. toctree::

View File

@ -255,3 +255,6 @@ class LaunchTemplateBackend:
templates = list(self.launch_templates.values()) templates = list(self.launch_templates.values())
return generic_filter(filters, templates) return generic_filter(filters, templates)
def get_launch_template_data(self, instance_id: str) -> Any:
return self.get_instance(instance_id) # type: ignore[attr-defined]

View File

@ -261,7 +261,7 @@ class LaunchTemplates(EC2BaseResponse):
def get_launch_template_data(self) -> str: def get_launch_template_data(self) -> str:
instance_id = self._get_param("InstanceId") instance_id = self._get_param("InstanceId")
instance = self.ec2_backend.get_instance(instance_id) instance = self.ec2_backend.get_launch_template_data(instance_id)
template = self.response_template(GET_LAUNCH_TEMPLATE_DATA_RESPONSE) template = self.response_template(GET_LAUNCH_TEMPLATE_DATA_RESPONSE)
return template.render(i=instance) return template.render(i=instance)

View File

@ -1601,7 +1601,7 @@ class RDSBackend(BaseBackend):
raise DBInstanceNotFoundError(db_instance_identifier) raise DBInstanceNotFoundError(db_instance_identifier)
return list(databases.values()) return list(databases.values())
def describe_database_snapshots( def describe_db_snapshots(
self, db_instance_identifier, db_snapshot_identifier, filters=None self, db_instance_identifier, db_snapshot_identifier, filters=None
): ):
snapshots = self.database_snapshots snapshots = self.database_snapshots
@ -1642,7 +1642,7 @@ class RDSBackend(BaseBackend):
return database return database
def restore_db_instance_from_db_snapshot(self, from_snapshot_id, overrides): def restore_db_instance_from_db_snapshot(self, from_snapshot_id, overrides):
snapshot = self.describe_database_snapshots( snapshot = self.describe_db_snapshots(
db_instance_identifier=None, db_snapshot_identifier=from_snapshot_id db_instance_identifier=None, db_snapshot_identifier=from_snapshot_id
)[0] )[0]
original_database = snapshot.database original_database = snapshot.database

View File

@ -330,7 +330,7 @@ class RDSResponse(BaseResponse):
db_snapshot_identifier = self._get_param("DBSnapshotIdentifier") db_snapshot_identifier = self._get_param("DBSnapshotIdentifier")
filters = self._get_multi_param("Filters.Filter.") filters = self._get_multi_param("Filters.Filter.")
filters = {f["Name"]: f["Values"] for f in filters} filters = {f["Name"]: f["Values"] for f in filters}
snapshots = self.backend.describe_database_snapshots( snapshots = self.backend.describe_db_snapshots(
db_instance_identifier, db_snapshot_identifier, filters db_instance_identifier, db_snapshot_identifier, filters
) )
template = self.response_template(DESCRIBE_SNAPSHOTS_TEMPLATE) template = self.response_template(DESCRIBE_SNAPSHOTS_TEMPLATE)

3
moto/sqs/constants.py Normal file
View File

@ -0,0 +1,3 @@
MAXIMUM_VISIBILITY_TIMEOUT = 43200
MAXIMUM_MESSAGE_LENGTH = 262144 # 256 KiB
DEFAULT_RECEIVED_MESSAGES = 1

View File

@ -20,6 +20,7 @@ from moto.core.utils import (
) )
from moto.moto_api._internal import mock_random as random from moto.moto_api._internal import mock_random as random
from moto.utilities.utils import md5_hash from moto.utilities.utils import md5_hash
from .constants import MAXIMUM_VISIBILITY_TIMEOUT
from .utils import generate_receipt_handle from .utils import generate_receipt_handle
from .exceptions import ( from .exceptions import (
MessageAttributesInvalid, MessageAttributesInvalid,
@ -985,6 +986,24 @@ class SQSBackend(BaseBackend):
queue.delete_message(receipt_handle) queue.delete_message(receipt_handle)
def delete_message_batch(self, queue_name, receipts):
success = []
errors = []
for receipt_and_id in receipts:
try:
self.delete_message(queue_name, receipt_and_id["receipt_handle"])
success.append(receipt_and_id["msg_user_id"])
except ReceiptHandleIsInvalid:
errors.append(
{
"Id": receipt_and_id["msg_user_id"],
"SenderFault": "true",
"Code": "ReceiptHandleIsInvalid",
"Message": f'The input receipt handle "{receipt_and_id["receipt_handle"]}" is not a valid receipt handle.',
}
)
return success, errors
def change_message_visibility(self, queue_name, receipt_handle, visibility_timeout): def change_message_visibility(self, queue_name, receipt_handle, visibility_timeout):
queue = self.get_queue(queue_name) queue = self.get_queue(queue_name)
for message in queue._messages: for message in queue._messages:
@ -1006,6 +1025,42 @@ class SQSBackend(BaseBackend):
return return
raise ReceiptHandleIsInvalid raise ReceiptHandleIsInvalid
def change_message_visibility_batch(self, queue_name: str, entries):
success = []
error = []
for entry in entries:
try:
visibility_timeout = int(entry["visibility_timeout"])
assert visibility_timeout <= MAXIMUM_VISIBILITY_TIMEOUT
except: # noqa: E722 Do not use bare except
error.append(
{
"Id": entry["id"],
"SenderFault": "true",
"Code": "InvalidParameterValue",
"Message": "Visibility timeout invalid",
}
)
continue
try:
self.change_message_visibility(
queue_name=queue_name,
receipt_handle=entry["receipt_handle"],
visibility_timeout=visibility_timeout,
)
success.append(entry["id"])
except ReceiptHandleIsInvalid as e:
error.append(
{
"Id": entry["id"],
"SenderFault": "true",
"Code": "ReceiptHandleIsInvalid",
"Message": e.description,
}
)
return success, error
def purge_queue(self, queue_name): def purge_queue(self, queue_name):
queue = self.get_queue(queue_name) queue = self.get_queue(queue_name)
queue._messages = [] queue._messages = []

View File

@ -6,19 +6,19 @@ from moto.core.utils import underscores_to_camelcase, camelcase_to_pascal
from moto.utilities.aws_headers import amz_crc32, amzn_request_id from moto.utilities.aws_headers import amz_crc32, amzn_request_id
from urllib.parse import urlparse from urllib.parse import urlparse
from .constants import (
DEFAULT_RECEIVED_MESSAGES,
MAXIMUM_MESSAGE_LENGTH,
MAXIMUM_VISIBILITY_TIMEOUT,
)
from .exceptions import ( from .exceptions import (
EmptyBatchRequest, EmptyBatchRequest,
InvalidAttributeName, InvalidAttributeName,
ReceiptHandleIsInvalid,
BatchEntryIdsNotDistinct, BatchEntryIdsNotDistinct,
) )
from .models import sqs_backends from .models import sqs_backends, SQSBackend
from .utils import parse_message_attributes, extract_input_message_attributes from .utils import parse_message_attributes, extract_input_message_attributes
MAXIMUM_VISIBILTY_TIMEOUT = 43200
MAXIMUM_MESSAGE_LENGTH = 262144 # 256 KiB
DEFAULT_RECEIVED_MESSAGES = 1
class SQSResponse(BaseResponse): class SQSResponse(BaseResponse):
@ -28,7 +28,7 @@ class SQSResponse(BaseResponse):
super().__init__(service_name="sqs") super().__init__(service_name="sqs")
@property @property
def sqs_backend(self): def sqs_backend(self) -> SQSBackend:
return sqs_backends[self.current_account][self.region] return sqs_backends[self.current_account][self.region]
@property @property
@ -59,7 +59,7 @@ class SQSResponse(BaseResponse):
def _get_validated_visibility_timeout(self, timeout=None): def _get_validated_visibility_timeout(self, timeout=None):
""" """
:raises ValueError: If specified visibility timeout exceeds MAXIMUM_VISIBILTY_TIMEOUT :raises ValueError: If specified visibility timeout exceeds MAXIMUM_VISIBILITY_TIMEOUT
:raises TypeError: If visibility timeout was not specified :raises TypeError: If visibility timeout was not specified
""" """
if timeout is not None: if timeout is not None:
@ -67,7 +67,7 @@ class SQSResponse(BaseResponse):
else: else:
visibility_timeout = int(self.querystring.get("VisibilityTimeout")[0]) visibility_timeout = int(self.querystring.get("VisibilityTimeout")[0])
if visibility_timeout > MAXIMUM_VISIBILTY_TIMEOUT: if visibility_timeout > MAXIMUM_VISIBILITY_TIMEOUT:
raise ValueError raise ValueError
return visibility_timeout return visibility_timeout
@ -134,40 +134,9 @@ class SQSResponse(BaseResponse):
queue_name = self._get_queue_name() queue_name = self._get_queue_name()
entries = self._get_list_prefix("ChangeMessageVisibilityBatchRequestEntry") entries = self._get_list_prefix("ChangeMessageVisibilityBatchRequestEntry")
success = [] success, error = self.sqs_backend.change_message_visibility_batch(
error = [] queue_name, entries
for entry in entries: )
try:
visibility_timeout = self._get_validated_visibility_timeout(
entry["visibility_timeout"]
)
except ValueError:
error.append(
{
"Id": entry["id"],
"SenderFault": "true",
"Code": "InvalidParameterValue",
"Message": "Visibility timeout invalid",
}
)
continue
try:
self.sqs_backend.change_message_visibility(
queue_name=queue_name,
receipt_handle=entry["receipt_handle"],
visibility_timeout=visibility_timeout,
)
success.append(entry["id"])
except ReceiptHandleIsInvalid as e:
error.append(
{
"Id": entry["id"],
"SenderFault": "true",
"Code": "ReceiptHandleIsInvalid",
"Message": e.description,
}
)
template = self.response_template(CHANGE_MESSAGE_VISIBILITY_BATCH_RESPONSE) template = self.response_template(CHANGE_MESSAGE_VISIBILITY_BATCH_RESPONSE)
return template.render(success=success, errors=error) return template.render(success=success, errors=error)
@ -359,23 +328,7 @@ class SQSResponse(BaseResponse):
raise BatchEntryIdsNotDistinct(receipt_and_id["msg_user_id"]) raise BatchEntryIdsNotDistinct(receipt_and_id["msg_user_id"])
receipt_seen.add(receipt) receipt_seen.add(receipt)
success = [] success, errors = self.sqs_backend.delete_message_batch(queue_name, receipts)
errors = []
for receipt_and_id in receipts:
try:
self.sqs_backend.delete_message(
queue_name, receipt_and_id["receipt_handle"]
)
success.append(receipt_and_id["msg_user_id"])
except ReceiptHandleIsInvalid:
errors.append(
{
"Id": receipt_and_id["msg_user_id"],
"SenderFault": "true",
"Code": "ReceiptHandleIsInvalid",
"Message": f'The input receipt handle "{receipt_and_id["receipt_handle"]}" is not a valid receipt handle.',
}
)
template = self.response_template(DELETE_MESSAGE_BATCH_RESPONSE) template = self.response_template(DELETE_MESSAGE_BATCH_RESPONSE)
return template.render(success=success, errors=errors) return template.render(success=success, errors=errors)
@ -811,7 +764,7 @@ ERROR_TOO_LONG_RESPONSE = """<ErrorResponse xmlns="http://queue.amazonaws.com/do
</ErrorResponse>""" </ErrorResponse>"""
ERROR_MAX_VISIBILITY_TIMEOUT_RESPONSE = ( ERROR_MAX_VISIBILITY_TIMEOUT_RESPONSE = (
f"Invalid request, maximum visibility timeout is {MAXIMUM_VISIBILTY_TIMEOUT}" f"Invalid request, maximum visibility timeout is {MAXIMUM_VISIBILITY_TIMEOUT}"
) )
ERROR_INEXISTENT_QUEUE = """<ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"> ERROR_INEXISTENT_QUEUE = """<ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">

View File

@ -1,8 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
import importlib from unittest.mock import patch
import json
import mock
import requests import requests
import os
import moto import moto
@ -10,6 +9,9 @@ import moto
moto.mock_all() moto.mock_all()
script_dir = os.path.dirname(os.path.abspath(__file__))
def check(condition): def check(condition):
if bool(condition): if bool(condition):
return "x" return "x"
@ -17,6 +19,10 @@ def check(condition):
return " " return " "
def utf_checkbox(condition):
return "" if bool(condition) else " "
def is_implemented(model, method_name): def is_implemented(model, method_name):
# method_name in model.__dict__ will be True if the method # method_name in model.__dict__ will be True if the method
# exists on the model and False if it's only inherited from # exists on the model and False if it's only inherited from
@ -73,7 +79,7 @@ class CloudFormationChecklist:
for attr in self.expected_attrs: for attr in self.expected_attrs:
try: try:
# TODO: Change the actual abstract method to return False # TODO: Change the actual abstract method to return False
with mock.patch( with patch(
"moto.core.common_models.CloudFormationModel.has_cfn_attr", "moto.core.common_models.CloudFormationModel.has_cfn_attr",
return_value=False, return_value=False,
): ):
@ -96,16 +102,86 @@ class CloudFormationChecklist:
return is_implemented(self.moto_model, "delete_from_cloudformation_json") return is_implemented(self.moto_model, "delete_from_cloudformation_json")
def write_main_document(supported):
implementation_coverage_file = "{}/../CLOUDFORMATION_COVERAGE.md".format(script_dir)
try:
os.remove(implementation_coverage_file)
except OSError:
pass
print("Writing to {}".format(implementation_coverage_file))
with open(implementation_coverage_file, "w+") as file:
file.write("## Supported CloudFormation resources")
file.write("\n\n")
file.write("A list of all resources that can be created via CloudFormation. \n")
file.write("Please let us know if you'd like support for a resource not yet listed here.")
file.write("\n\n")
for checklist in supported:
file.write(str(checklist))
file.write("\n")
def write_documentation(supported):
docs_file = "{}/../docs/docs/services/cf.rst".format(script_dir)
try:
os.remove(docs_file)
except OSError:
pass
print("Writing to {}".format(docs_file))
with open(docs_file, "w+") as file:
file.write(f".. _cloudformation_resources:\n")
file.write("\n")
file.write("==================================\n")
file.write("Supported CloudFormation resources\n")
file.write("==================================\n")
file.write("\n\n")
file.write("A list of all resources that can be created via CloudFormation. \n")
file.write("Please let us know if you'd like support for a resource not yet listed here.")
file.write("\n\n")
max_resource_name_length = max([len(cf.resource_name) for cf in supported]) + 2
max_fn_att_length = 35
file.write(".. table:: \n\n")
file.write(f" +{('-'*max_resource_name_length)}+--------+--------+--------+{('-' * max_fn_att_length)}+\n")
file.write(f" |{(' '*max_resource_name_length)}| Create | Update | Delete | {('Fn::GetAtt'.ljust(max_fn_att_length-2))} |\n")
file.write(f" +{('='*max_resource_name_length)}+========+========+========+{('=' * max_fn_att_length)}+\n")
for checklist in supported:
attrs = [f" - [{check(att not in checklist.missing_attrs)}] {att}" for att in checklist.expected_attrs]
first_attr = attrs[0] if attrs else ""
file.write(" |")
file.write(checklist.resource_name.ljust(max_resource_name_length))
file.write("|")
file.write(f" {check(checklist.creatable)} ")
file.write("|")
file.write(f" {check(checklist.updatable)} ")
file.write("|")
file.write(f" {check(checklist.deletable)} ")
file.write(f"|{first_attr.ljust(max_fn_att_length)}|")
file.write("\n")
for index, attr in enumerate(attrs[1:]):
if index % 2 == 0:
file.write(
f" +{('-' * max_resource_name_length)}+--------+--------+--------+{attr.ljust(max_fn_att_length)}|\n")
else:
file.write(
f" |{(' ' * max_resource_name_length)}| | | |{attr.ljust(max_fn_att_length)}|\n")
if len(attrs) > 1 and len(attrs) % 2 == 0:
file.write(f" |{(' ' * max_resource_name_length)}| | | |{(' ' * max_fn_att_length)}|\n")
file.write(f" +{('-'*max_resource_name_length)}+--------+--------+--------+{('-' * max_fn_att_length)}+\n")
if __name__ == "__main__": if __name__ == "__main__":
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html # https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html
cfn_spec = requests.get( cfn_spec = requests.get(
"https://dnwj8swjjbsbt.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" "https://dnwj8swjjbsbt.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json"
).json() ).json()
for resource_name, schema in sorted(cfn_spec["ResourceTypes"].items()): # Only collect checklists for models that implement CloudFormationModel;
checklist = CloudFormationChecklist(resource_name, schema) # otherwise the checklist is very long and mostly empty because there
# Only print checklists for models that implement CloudFormationModel; # are so many niche AWS services and resources that moto doesn't implement yet.
# otherwise the checklist is very long and mostly empty because there supported = [CloudFormationChecklist(resource_name, schema) for resource_name, schema in sorted(cfn_spec["ResourceTypes"].items()) if CloudFormationChecklist(resource_name, schema).moto_model]
# are so many niche AWS services and resources that moto doesn't #write_main_document(supported)
# implement yet. write_documentation(supported)
if checklist.moto_model:
print(checklist)