diff --git a/.github/workflows/infracost.yml b/.github/workflows/infracost.yml new file mode 100644 index 00000000..a0969620 --- /dev/null +++ b/.github/workflows/infracost.yml @@ -0,0 +1,54 @@ +name: Generate Infra cost report +on: + pull_request: + types: [opened, synchronize, closed] + push: + branches: + - main + +env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock +jobs: + infracost-pull-request-checks: + name: Infracost Pull Request Checks + if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write # Required to post comments + steps: + - name: Setup Infracost + uses: infracost/actions/setup@v3 + with: + api-key: ${{ secrets.INFRACOST_API_KEY }} + + - name: Checkout base branch + uses: actions/checkout@v4 + with: + ref: '${{ github.event.pull_request.base.ref }}' + + - name: Generate Infracost cost estimate baseline + run: | + infracost breakdown --path=terraform/ \ + --format=json \ + --usage-file infracost-usage.yml \ + --out-file=/tmp/infracost-base.json + + - name: Checkout PR branch + uses: actions/checkout@v4 + + - name: Generate Infracost diff + run: | + infracost diff --path=terraform/ \ + --format=json \ + --usage-file infracost-usage.yml \ + --compare-to=/tmp/infracost-base.json \ + --out-file=/tmp/infracost.json + + - name: Post Infracost comment + run: | + infracost comment github --path=/tmp/infracost.json \ + --repo=$GITHUB_REPOSITORY \ + --github-token=${{ github.token }} \ + --pull-request=${{ github.event.pull_request.number }} \ + --behavior=update diff --git a/infracost-usage.yml b/infracost-usage.yml new file mode 100644 index 00000000..f15d7c75 --- /dev/null +++ b/infracost-usage.yml @@ -0,0 +1,982 @@ +# This predefined usage file attempts to set each usage-based cost as +# $5/month for common configurations, helping engineers understand that +# these resources are not free. +# See docs: https://infracost.io/usage-file/ +version: 0.1 +resource_type_default_usage: + aws_acmpca_certificate_authority: + monthly_requests: 6 # Monthly private certificate requests. + aws_alb: + new_connections: 2500 # Number of newly established connections per second on average. + active_connections: 2500 # Number of active connections per minute on average. + processed_bytes_gb: 250 # The number of bytes processed by the load balancer for HTTP(S) requests and responses in GB. + rule_evaluations: 2500 # The product of number of rules processed by the load balancer and the request rate. + aws_api_gateway_rest_api: + monthly_requests: 1437500 # Monthly requests to the Rest API Gateway. + aws_apigatewayv2_api: + monthly_requests: 5000000 # Monthly requests to the HTTP API Gateway. + request_size_kb: 128 # Average request size sent to the HTTP API Gateway in KB. Requests are metered in 512KB increments, maximum size is 10MB. + monthly_messages: 5000000 # Monthly number of messages sent to the Websocket API Gateway. + message_size_kb: 8 # Average size of the messages sent to the Websocket API Gateway in KB. Messages are metered in 32 KB increments, maximum size is 128KB. + monthly_connection_mins: 20000000 # Monthly total connection minutes to Websockets. + aws_backup_vault: + monthly_efs_warm_restore_gb: 208 # Monthly number of EFS warm restore in GB. + monthly_efs_cold_restore_gb: 138 # Monthly number of EFS cold restore in GB. + monthly_efs_item_restore_requests: 8 # Monthly number of EFS item-level restore requests. + monthly_efs_warm_backup_gb: 83 # Monthly number of EFS warm backups in GB. + monthly_efs_cold_backup_gb: 416 # Monthly number of EFS cold backups in GB. + monthly_ebs_snapshot_gb: 90 # Monthly number of EBS snapshots in GB. + monthly_rds_snapshot_gb: 52 # Monthly number of RDS snapshots in GB. + monthly_aurora_snapshot_gb: 208 # Monthly number of Aurora snapshots in GB. + monthly_dynamodb_backup_gb: 44 # Monthly number of DynamoDB backups in GB. + monthly_dynamodb_restore_gb: 29 # Monthly number of DynamoDB restore in GB. + monthly_fsx_windows_backup_gb: 95 # Monthly number of FSX Windows backups in GB. + monthly_fsx_lustre_backup_gb: 95 # Monthly number of FSX Lustre backups in GB. + aws_cloudformation_stack: + monthly_handler_operations: 5555 # Monthly number of non-free handler operations (resources outside of the AWS::*, Alexa::*, and Custom::* namespaces). + monthly_duration_secs: 62500 # Monthly duration of non-free handler operations that go above 30 seconds, in seconds. + aws_cloudformation_stack_set: + monthly_handler_operations: 5555 # Monthly number of non-free handler operations (resources outside of the AWS::*, Alexa::*, and Custom::* namespaces). + monthly_duration_secs: 62500 # Monthly duration of non-free handler operations that go above 30 seconds, in seconds. + aws_cloudfront_distribution: + monthly_data_transfer_to_internet_gb: # Monthly regional data transfer out to internet from the following, in GB: + us: 60 # United States, Mexico, Canada + europe: 60 # Europe, Israel + south_africa: 0 # South Africa, Kenya, Middle East + south_america: 0 # South America + japan: 0 # Japan + australia: 0 # Australia, New Zealand + asia_pacific: 0 # Hong Kong, Philippines, Singapore, South Korea, Taiwan, Thailand + india: 0 # India + monthly_data_transfer_to_origin_gb: # Monthly regional data transfer out to origin from the following, in GB: + us: 250 # United States, Mexico, Canada + europe: 250 # Europe, Israel + south_africa: 0 # South Africa, Kenya, Middle East + south_america: 0 # South America + japan: 0 # Japan + australia: 0 # Australia, New Zealand + asia_pacific: 0 # Hong Kong, Philippines, Singapore, South Korea, Taiwan, Thailand + india: 0 # India + monthly_http_requests: # Monthly number of HTTP requests to: + us: 6750000 # United States, Mexico, Canada + europe: 5750000 # Europe, Israel + south_africa: 0 # South Africa, Kenya, Middle East + south_america: 0 # South America + japan: 0 # Japan + australia: 0 # Australia, New Zealand + asia_pacific: 0 # Hong Kong, Philippines, Singapore, South Korea, Taiwan, Thailand + india: 0 # India + monthly_https_requests: # Monthly number of HTTPS requests to: + us: 5000000 # United States, Mexico, Canada + europe: 4250000 # Europe, Israel + south_africa: 0 # South Africa, Kenya, Middle East + south_america: 0 # South America + japan: 0 # Japan + australia: 0 # Australia, New Zealand + asia_pacific: 0 # Hong Kong, Philippines, Singapore, South Korea, Taiwan, Thailand + india: 0 # India + monthly_shield_requests: # Monthly number of shield requests to: + us: 3125000 # United States + europe: 3125000 # Europe + south_america: 0 # South America + japan: 0 # Japan + australia: 0 # Australia + singapore: 0 # Singapore + south_korea: 0 # South Korea + india: 0 # India + monthly_invalidation_requests: 1250 # Monthly number of invalidation requests. + monthly_encryption_requests: 2500000 # Monthly number of field level encryption requests. + monthly_log_lines: 500000000 # Monthly number of real-time log lines. + custom_ssl_certificates: 0 # Number of dedicated IP custom SSL certificates. + aws_cloudhsm_v2_hsm: + monthly_hrs: 3.125 # Monthly number of hours the HSM ran for. + aws_cloudtrail: + monthly_additional_management_events: 250000 # Monthly additional copies of read and write management events. The first copy of management events per region is free, so this should only be non-zero if there are multiple trails recording management events in this region. + monthly_data_events: 5000000 # Monthly data events delivered to S3, Lambda or DynamoDB + monthly_insight_events: 1428571 # Monthly CloudTrail Insight events + aws_cloudwatch_event_bus: + monthly_custom_events: 5000000 # Monthly custom events published. Each 64 KB chunk of payload is billed as 1 event. + monthly_third_party_events: 5000000 # Monthly third-party and cross-account events published. Each 64 KB chunk of payload is billed as 1 event. + monthly_archive_processing_gb: 50 # Monthly archive event processing in GB. + archive_storage_gb: 217 # Archive storage used for event replay in GB. + monthly_schema_discovery_events: 50000000 # Monthly events ingested for schema discovery. Each 8 KB chunk of payload is billed as 1 event. + aws_cloudwatch_log_group: + storage_gb: 166 # Total data stored by CloudWatch logs in GB. + monthly_data_ingested_gb: 10 # Monthly data ingested by CloudWatch logs in GB. + monthly_data_scanned_gb: 1000 # Monthly data scanned by CloudWatch logs insights in GB. + aws_codebuild_project: + monthly_build_mins: 500 # Monthly total duration of builds in minutes. Each build is rounded up to the nearest minute. + aws_config_config_rule: + monthly_rule_evaluations: 5000 # Monthly config rule evaluations. + aws_config_configuration_recorder: + monthly_config_items: 1666 # Monthly config item records. + monthly_custom_config_items: 1666 # Monthly custom config item records. + aws_config_organization_custom_rule: + monthly_rule_evaluations: 5000 # Monthly config rule evaluations. + aws_config_organization_managed_rule: + monthly_rule_evaluations: 5000 # Monthly config rule evaluations. + aws_db_instance: + additional_backup_storage_gb: 238 # Amount of backup storage used that is in excess of 100% of the storage size for all databases in GB. + monthly_standard_io_requests: 50000000 # Monthly number of input/output requests for database. + monthly_additional_performance_insights_requests: 500000 # Monthly Performance Insights API requests above the 1000000 requests included in the free tier. + aws_directory_service_directory: + additional_domain_controllers: 0.135 # The number of domain controllers in the directory service provisioned in addition to the minimum 2 controllers + shared_accounts: 0.375 # Number of accounts that Microsoft AD directory is shared with + aws_docdb_cluster: + backup_storage_gb: 238 # Amount of backup storage that is in excess of 100% of the storage size for the cluster in GB. + aws_docdb_cluster_instance: + data_storage_gb: 50 # Total storage for cluster in GB. + monthly_io_requests: 25000000 # Monthly number of input/output requests for cluster. + monthly_cpu_credit_hrs: 55 # Monthly CPU credits used over the instance baseline in vCPU-hours, only applicable for T3 instances. + aws_docdb_cluster_snapshot: + backup_storage_gb: 238 # Amount of backup storage that is in excess of 100% of the storage size for the cluster in GB. + aws_dx_gateway_association: + monthly_data_processed_gb: 250 # Monthly data processed by the DX gateway association per month in GB. + aws_dynamodb_table: + monthly_write_request_units: 4000000 # Monthly write request units in (used for on-demand DynamoDB). + monthly_read_request_units: 20000000 # Monthly read request units in (used for on-demand DynamoDB). + storage_gb: 20 # Total storage for tables in GB. + pitr_backup_storage_gb: 25 # Total storage for Point-In-Time Recovery (PITR) backups in GB. + on_demand_backup_storage_gb: 50 # Total storage for on-demand backups in GB. + monthly_data_restored_gb: 33 # Monthly size of restored data in GB. + monthly_streams_read_request_units: 25000000 # Monthly streams read request units. + aws_ebs_snapshot: + monthly_list_block_requests: 8333333 # Monthly number of ListChangedBlocks and ListSnapshotBlocks requests. + monthly_get_block_requests: 1666666 # Monthly number of GetSnapshotBlock requests (block size is 512KiB). + monthly_put_block_requests: 833333 # Monthly number of PutSnapshotBlock requests (block size is 512KiB). + fast_snapshot_restore_hours: 6 # Monthly number of DSU-hours for Fast snapshot restore + aws_ebs_volume: + monthly_standard_io_requests: 100000000 # Monthly I/O requests for standard volume (Magnetic storage). + aws_ec2_transit_gateway_vpc_attachment: + monthly_data_processed_gb: 250 # Monthly data processed by the EC2 transit gateway attachment(s) in GB. + aws_ecr_repository: + storage_gb: 50 # Total size of ECR repository in GB. + aws_efs_file_system: + storage_gb: 31 # Total storage for Standard class in GB. + infrequent_access_storage_gb: 375 # Total storage for Infrequent Access class in GB. + monthly_infrequent_access_read_gb: 500 # Monthly infrequent access read requests in GB. + monthly_infrequent_access_write_gb: 500 # Monthly infrequent access write requests in GB. + aws_elasticache_cluster: + snapshot_storage_size_gb: 58 # Size of Redis snapshots in GB. + aws_elasticache_replication_group: + snapshot_storage_size_gb: 58 # Size of Redis snapshots in GB. + aws_elb: + monthly_data_processed_gb: 625 # Monthly data processed by a Classic Load Balancer in GB. + aws_fsx_openzfs_file_system: + backup_storage_gb: 100 # Total storage used for backups in GB. + aws_fsx_windows_file_system: + backup_storage_gb: 100 # Total storage used for backups in GB. + aws_glue_catalog_database: + monthly_objects: 500000 # Monthly number of objects stored above the free one million object storage limit. + monthly_requests: 5000000 # Monthly number of requests to the db beyond the free one million requests limit. + aws_glue_crawler: + monthly_hours: 11 # Monthly number of hours the Glue crawler ran for. + aws_glue_job: + monthly_hours: 11 # Monthly number of hours the Glue job ran for. + aws_grafana_workspace: + editors_administrator_licenses: 1 # Number of editor/administrator licenses. + viewer_licenses: 1 # Number of viewer licenses. + aws_kinesis_analytics_application: + kinesis_processing_units: 0.0525 # Number of Kinesis processing units. + durable_application_backup_gb: 208 # Total amount of durable application backup in GB. + aws_kinesisanalyticsv2_application: + kinesis_processing_units: 0.0525 # Number of Kinesis processing units. + durable_application_backup_gb: 208 # Total amount of durable application backup in GB. + aws_kinesisanalyticsv2_application_snapshot: + durable_application_backup_gb: 208 # Total amount of durable application backups in GB. + aws_kinesis_firehose_delivery_stream: + monthly_data_ingested_gb: 142 # Monthly data ingested by the Delivery Stream in GB. + aws_kinesis_stream: + monthly_on_demand_data_in_gb: 62 # Monthly data ingested by the stream in GB. + monthly_on_demand_data_out_gb: 125 # Monthly data egressed by the stream in GB total, (not per consumer application). + monthly_on_demand_efo_data_out_gb: 100 # Monthly data egressed by the stream in GB to EFO consumers. + monthly_on_demand_extended_retention_gb: 50 # Monthly data stored by the stream in GB that exceeds the 24 hour retention period but is less than 7 days. + monthly_on_demand_long_term_retention_gb: 217 # Monthly data stored by the stream in GB that exceeds the 7 day retention period. + monthly_provisioned_put_units: 357142857 # Monthly provisioned put units for the stream. + monthly_provisioned_extended_retention_gb: 250 # Monthly data stored by the stream in GB that exceeds the 24 hour retention period but is less than 7 days. + monthly_provisioned_long_term_retention_gb: 217 # Monthly data stored by the stream in GB that exceeds the 7 day retention period. + monthly_provisioned_long_term_retrieval_gb: 238 # Monthly data retrieved by the stream in GB that exceeds the 7 day retention period. + monthly_provisioned_efo_data_out_gb: 384 # Monthly data egressed by the stream in GB to EFO consumers. + monthly_provisioned_efo_consumer_hours: 333 # Monthly hours of EFO consumer application usage. + aws_lambda_function: + monthly_requests: 250000 # Monthly requests to the Lambda function. + request_duration_ms: 200 # Average duration of each request in milliseconds. + aws_lambda_provisioned_concurrency_config: + monthly_duration_hrs: 13 # Number of hours in a month that provisioned concurrency will be enabled. + request_duration_ms: 10 # Average duration of each request in milliseconds during the enabled period. + monthly_requests: 25000000 # Number of requests sent to the function during the enabled period. + memory_mb: 128 # Memory size of the Lambda function. + aws_lb: + new_connections: 2500 # Number of newly established connections per second on average. + active_connections: 2500 # Number of active connections per minute on average. + processed_bytes_gb: 250 # The number of bytes processed by the load balancer for HTTP(S) requests and responses in GB. + rule_evaluations: 2500 # The product of number of rules processed by the load balancer and the request rate. + aws_mq_broker: + storage_size_gb: 50 # Data storage per instance in GB. + aws_mwaa_environment: + additional_workers: 0.625 # Average number of monthly additional worker instances + additional_schedulers: 0 # Average number of monthly additional scheduler instances + meta_database_gb: 50 # Total storage used for meta database + aws_nat_gateway: + monthly_data_processed_gb: 111 # Monthly data processed by the NAT Gateway in GB. + aws_neptune_cluster: + storage_gb: 43 # Total storage for the cluster in GB. + monthly_io_requests: 21551724 # Monthly number of input/output requests for cluster. + backup_storage_gb: 227 # Total storage used for backups in GB. + aws_neptune_cluster_instance: + monthly_cpu_credit_hrs: 2 # Number of hours in a month, where you expect to burst the baseline credit balance of a "t3" instance type. + aws_neptune_cluster_snapshot: + backup_storage_gb: 227 # Total storage used for backup snapshots in GB. + aws_networkfirewall_firewall: + monthly_data_processed_gb: 76 # Monthly data processed by the Network Firewall in GB. + aws_rds_cluster: + capacity_units_per_hr: 0.5 # Number of Aurora Capacity Units per hour. Only used when engine_mode is "serverless" + storage_gb: 50 # Storage amount in GB allocated to the aurora cluster. + write_requests_per_sec: 4 # Total number of writes per second for the cluster. + read_requests_per_sec: 4 # Total number of reads per second for the cluster. + backup_snapshot_size_gb: 59 # Individual storage size for backup snapshots, used in conjunction with resource parameter "backup_retention_period". + average_statements_per_hr: 2500 # Number of statements generated per hour when backtrack is enabled. Only available for MySQl-compatible Aurora + change_records_per_statement: 0.095 # Records changed per statement executed. + backtrack_window_hrs: 150 # The duration window for which Aurora will support rewinding the DB cluster to a specific point in time. + snapshot_export_size_gb: 500 # Size of snapshot that's exported to s3 in parquet format. + aws_rds_cluster_instance: + monthly_additional_performance_insights_requests: 500000 # Monthly Performance Insights API requests above the 1000000 requests included in the free tier. + capacity_units_per_hr: 0.5 # Number of Aurora Capacity Units per hour. Only used for Aurora Serverless V2 (when instance class is "db.serverless") + aws_redshift_cluster: + managed_storage_gb: 208 + excess_concurrency_scaling_secs: 5555 + spectrum_data_scanned_tb: 1 + backup_storage_gb: 217 + aws_route53_record: + monthly_standard_queries: 12500000 # Monthly number of Standard queries. + monthly_latency_based_queries: 8333333 # Monthly number of Latency Based Routing queries. + monthly_geo_queries: 7142857 # Monthly number of Geo DNS and Geoproximity queries. + aws_route53_resolver_endpoint: + monthly_queries: 12500000 # Monthly number of DNS queries processed through the endpoints. + aws_s3_bucket_analytics_configuration: + monthly_monitored_objects: 50000000 # Monthly number of monitored objects by S3 Analytics Storage Class Analysis. + aws_s3_bucket_inventory: + monthly_listed_objects: 2000000000 # Monthly number of listed objects. + aws_s3_bucket: + object_tags: 5000000 # Total object tags. Only for AWS provider V3. + standard: # Usages of S3 Standard: + storage_gb: 225 # Total storage in GB. + monthly_tier_1_requests: 1000000 # Monthly PUT, COPY, POST, LIST requests (Tier 1). + monthly_tier_2_requests: 12500000 # Monthly GET, SELECT, and all other requests (Tier 2). + monthly_select_data_scanned_gb: 2500 # Monthly data scanned by S3 Select in GB. + monthly_select_data_returned_gb: 7250 # Monthly data returned by S3 Select in GB. + intelligent_tiering: # Usages of S3 Intelligent - Tiering: + frequent_access_storage_gb: 0 # Total storage for Frequent Access Tier in GB. + infrequent_access_storage_gb: 0 # Total storage for Infrequent Access Tier in GB. + monitored_objects: 0 # Total objects monitored by the Intelligent Tiering. + monthly_tier_1_requests: 0 # Monthly PUT, COPY, POST, LIST requests (Tier 1). + monthly_tier_2_requests: 0 # Monthly GET, SELECT, and all other requests (Tier 2). + monthly_lifecycle_transition_requests: 0 # Monthly Lifecycle Transition requests. + monthly_select_data_scanned_gb: 0 # Monthly data scanned by S3 Select in GB. + monthly_select_data_returned_gb: 0 # Monthly data returned by S3 Select in GB. + early_delete_gb: 0 # If an archive is deleted within 1 months of being uploaded, you will be charged an early deletion fee per GB. + standard_infrequent_access: # Usages of S3 Standard - Infrequent Access: + storage_gb: 0 # Total storage in GB. + monthly_tier_1_requests: 0 # Monthly PUT, COPY, POST, LIST requests (Tier 1). + monthly_tier_2_requests: 0 # Monthly GET, SELECT, and all other requests (Tier 2). + monthly_lifecycle_transition_requests: 0 # Monthly Lifecycle Transition requests. + monthly_data_retrieval_gb: 0 # Monthly data retrievals in GB + monthly_select_data_scanned_gb: 0 # Monthly data scanned by S3 Select in GB. + monthly_select_data_returned_gb: 0 # Monthly data returned by S3 Select in GB. + one_zone_infrequent_access: # Usages of S3 One Zone - Infrequent Access: + storage_gb: 0 # Total storage in GB. + monthly_tier_1_requests: 0 # Monthly PUT, COPY, POST, LIST requests (Tier 1). + monthly_tier_2_requests: 0 # Monthly GET, SELECT, and all other requests (Tier 2). + monthly_lifecycle_transition_requests: 0 # Monthly Lifecycle Transition requests. + monthly_data_retrieval_gb: 0 # Monthly data retrievals in GB + monthly_select_data_scanned_gb: 0 # Monthly data scanned by S3 Select in GB. + monthly_select_data_returned_gb: 0 # Monthly data returned by S3 Select in GB. + glacier_flexible_retrieval: # Usages of S3 Glacier Flexible Retrieval: + storage_gb: 0 # Total storage in GB. + monthly_tier_1_requests: 0 # Monthly PUT, COPY, POST, LIST requests (Tier 1). + monthly_tier_2_requests: 0 # Monthly GET, SELECT, and all other requests (Tier 2). + monthly_lifecycle_transition_requests: 0 # Monthly Lifecycle Transition requests. + monthly_standard_select_data_scanned_gb: 0 # Monthly data scanned by S3 Select in GB (for standard level of S3 Glacier). + monthly_standard_select_data_returned_gb: 0 # Monthly data returned by S3 Select in GB (for standard level of S3 Glacier). + monthly_bulk_select_data_scanned_gb: 0 # Monthly data scanned by S3 Select in GB (for bulk level of S3 Glacier) + monthly_bulk_select_data_returned_gb: 0 # Monthly data returned by S3 Select in GB (for bulk level of S3 Glacier) + monthly_expedited_select_data_scanned_gb: 0 # Monthly data scanned by S3 Select in GB (for expedited level of S3 Glacier) + monthly_expedited_select_data_returned_gb: 0 # Monthly data returned by S3 Select in GB (for expedited level of S3 Glacier) + monthly_standard_data_retrieval_requests: 0 # Monthly data Retrieval requests (for standard level of S3 Glacier). + monthly_expedited_data_retrieval_requests: 0 # Monthly data Retrieval requests (for expedited level of S3 Glacier). + monthly_standard_data_retrieval_gb: 0 # Monthly data retrievals in GB (for standard level of S3 Glacier). + monthly_expedited_data_retrieval_gb: 0 # Monthly data retrievals in GB (for expedited level of S3 Glacier). + early_delete_gb: 0 # If an archive is deleted within 3 months of being uploaded, you will be charged an early deletion fee per GB. + glacier_deep_archive: # Usages of S3 Glacier Deep Archive: + storage_gb: 0 # Total storage in GB. + monthly_tier_1_requests: 0 # Monthly PUT, COPY, POST, LIST requests (Tier 1). + monthly_tier_2_requests: 0 # Monthly GET, SELECT, and all other requests (Tier 2). + monthly_lifecycle_transition_requests: 0 # Monthly Lifecycle Transition requests. + monthly_standard_data_retrieval_requests: 0 # Monthly data Retrieval requests (for standard level of S3 Glacier). + monthly_bulk_data_retrieval_requests: 0 # Monthly data Retrieval requests (for bulk level of S3 Glacier). + monthly_standard_data_retrieval_gb: 0 # Monthly data retrievals in GB (for standard level of S3 Glacier). + monthly_bulk_data_retrieval_gb: 0 # Monthly data retrievals in GB (for bulk level of S3 Glacier). + early_delete_gb: 0 # If an archive is deleted within 6 months of being uploaded, you will be charged an early deletion fee per GB. + aws_secretsmanager_secret: + monthly_requests: 1000000 # Monthly API requests to Secrets Manager. + aws_sfn_state_machine: + monthly_transitions: 200000 # Monthly number of state transitions. Only applicable for Standard Workflows. + monthly_requests: 5000000 # Monthly number of workflow requests. Only applicable for Express Workflows. + memory_mb: 32 # Average amount of memory consumed by workflow in MB. Only applicable for Express Workflows. + workflow_duration_ms: 125 # Average duration of workflow in milliseconds. Only applicable for Express Workflows. + aws_sns_topic: + monthly_requests: 325 # Monthly requests to SNS. + request_size_kb: 16 # Size of requests to SNS + http_subscriptions: 6500 # Number of HTTP/HTTPS subscriptions + email_subscriptions: 200 # Number of Email/Email-JSON subscriptions + kinesis_subscriptions: 20000 # Number of Kinesis Firehose subscriptions + mobile_push_subscriptions: 8000 # Number of Mobile Push subscriptions + macos_subscriptions: 8000 # Number of MacOS subscriptions + sms_subscriptions: 0 # Number of SMS subscriptions + sms_notification_price: 0.002 # Average price for each SMS notification + aws_sqs_queue: + monthly_requests: 12500000 # Monthly requests to SQS. + request_size_kb: 16 # Size of requests to SQS, billed in 64KB chunks. So 1M requests at 128KB uses 2M requests. + aws_ssm_activation: + instances: 1 # Number of instances being managed. + aws_ssm_parameter: + monthly_api_interactions: 1000000 # Monthly API interactions. + parameter_storage_hrs: 182 # Number of hours in the month parameters will be stored for. + aws_transfer_server: + monthly_data_downloaded_gb: 125 # Monthly data downloaded over enabled protocols in GB. + monthly_data_uploaded_gb: 125 # Monthly data uploaded over enabled protocols in GB. + aws_vpc_endpoint: + monthly_data_processed_gb: 500 # Monthly data processed by the VPC endpoint(s) in GB. + aws_vpn_connection: + monthly_data_processed_gb: 250 # Monthly data processed through a transit gateway attached to your VPN Connection in GB. + aws_waf_web_acl: + rule_group_rules: 1 # Total number of Rule Group rules used by the Web ACL. + monthly_requests: 8333333 # Monthly number of web requests received. + aws_wafv2_web_acl: + rule_group_rules: 1 # Total number of Rule Group rules used by the Web ACL. + managed_rule_group_rules: 2 # Total number of Managed Rule Group rules used by the Web ACL. + monthly_requests: 8333333 # Monthly number of web requests received. + # + # Terraform AzureRM resources + # + azurerm_app_configuration: + monthly_additional_requests: 833333 # Monthly number of requests which are above the included 200,000 per day per replica. + azurerm_api_management: + monthly_api_calls: 1427500 # Monthly number of api calls (only for consumption tier). + self_hosted_gateway_count: 0 # Number of self-hosted gateways (only for premium tier). + azurerm_application_gateway: + monthly_data_processed_gb: 0 # Monthly data processed by the Application Gateway in GB. + monthly_v2_capacity_units: 350 # Number capacity(for v2) units gateway. + azurerm_application_insights: + monthly_data_ingested_gb: 2.175 # Monthly amount of data ingested in GB. + azurerm_automation_account: + non_azure_config_node_count: 0 # Number of non-Azure configuration nodes. + monthly_watcher_hrs: 2500 # Monthly number of watcher hours. + monthly_job_run_mins: 2500 # Monthly number of job run minutes. + azurerm_automation_dsc_configuration: + non_azure_config_node_count: 0 # Number of non-Azure configuration nodes. + azurerm_automation_dsc_nodeconfiguration: + non_azure_config_node_count: 0 # Number of non-Azure configuration nodes. + azurerm_automation_job_schedule: + monthly_job_run_mins: 2500 # Monthly number of job run minutes. + azurerm_bastion_host: + monthly_outbound_data_gb: 41 # Monthly outbound data in GB. + azurerm_cdn_endpoint: + monthly_outbound_gb: 61 # Monthly number of outbound data transfers in GB. + monthly_rules_engine_requests: 8250000 # Monthly number of rules engine requests. + azurerm_cognitive_account: + monthly_speech_to_text_standard_hrs: 5 # Monthly number of hours of Speech to Text audio hours + monthly_speech_to_text_standard_batch_hrs: 14 # Monthly number of hours of Speech to Text audio hours for batch processing + monthly_speech_to_text_custom_hrs: 4.3 # Monthly number of hours of Speech to Text audio hours for Custom Speech Model + monthly_speech_to_text_custom_batch_hrs: 11 # Monthly number of hours of Speech to Text audio hours for Custom Speech Model batch processing + monthly_speech_to_text_custom_endpoint_hrs: 93 # Monthly number of hours of Speech to Text audio hours for Custom Speech Model endpoint hosting + monthly_speech_to_text_custom_training_hrs: 0.5 # Monthly number of hours of Speech to Text audio hours for Custom Speech Model training + monthly_speech_to_text_enhanced_add_ons_hrs: 17 # Monthly number of hours of Speech to Text audio hours for enhanced add-on features + monthly_speech_to_text_conversation_transcription_multi_channel_audio_hrs: 2.4 # Monthly number of hours of Speech to Text audio hours for conversation transcription multi-channel audio + monthly_text_to_speech_neural_chars: 333_333 # Monthly number of characters for Text to Speech with neural voices + monthly_text_to_speech_custom_neural_training_hrs: 0.1 # Monthly number of hours of Text to Speech Customized Neural training + monthly_text_to_speech_custom_neural_chars: 208_333 # Monthly number of characters for Text to Speech with Custom Ceural Voices + monthly_text_to_speech_custom_neural_endpoint_hrs: 1.3 # Monthly number of hours of Text to Speech Custom Neural Voice endpoint hosting + monthly_text_to_speech_long_audio_chars: 50_000 # Monthly number of characters for Text to Speech with Long Audio Creation + monthly_text_to_speech_personal_voice_profiles: 8.3 # Monthly number of personal voice profiles for Text to Speech + monthly_text_to_speech_personal_voice_chars: 208_333 # Monthly number of characters for Text to Speech with Personal Voice Profiles + monthly_speech_translation_hrs: 2 # Monthly number of hours of Speech Translation audio hours + monthly_speaker_verification_transactions: 1_000 # Monthly number of speaker verification transactions + monthly_speaker_identification_transactions: 500 # Monthly number of speaker identification transactions + monthly_voice_profiles: 25_000 # Monthly number of voice profiles + # LUIS + monthly_luis_text_requests: 3_333 # Monthly number of text requests to LUIS + monthly_luis_speech_requests: 909 # Monthly number of speech requests to LUIS + # TextAnalytics + monthly_language_text_analytics_records: 5_000 # Monthly number of Text Analytics records (Sentiment Analysis, Key Phrase Extraction, Language Detection, Named Entity Recognition, PII Detection) + monthly_language_summarization_records: 2_500 # Monthly number of summarization records + monthly_language_conversational_language_understanding_records: 2_500 # Monthly number of Conversational Language Understanding and Orchestration Workflow records. + monthly_language_conversational_language_understanding_advanced_training_hours: 1.7 # Monthly number of Conversational Language Understanding and Orchestration Workflow advanced training hours. + monthly_language_customized_text_classification_records: 1_000 # Monthly number of customized text classification records. + monthly_language_customized_summarization_records: 1_250 # Monthly number of customized summarization records. + monthly_language_customized_question_answering_records: 3_333 # Monthly number of customized question answering records. + monthly_language_customized_training_hours: 1.7 # Monthly number of customized training hours. + monthly_language_text_analytics_for_health_records: 1_450 # Monthly number of Text Analytics for health records. + azurerm_cognitive_deployment: + # SpeechServices + monthly_language_input_tokens: 10_000_000 # Monthly number of language input tokens. + monthly_language_output_tokens: 3_333_333 # Monthly number of language output tokens. + monthly_code_interpreter_sessions: 167 # Monthly number of code interpreter sessions. + monthly_base_model_tokens: 712 # Monthly number of base model tokens. + monthly_fine_tuning_training_hours: 0.1 # Monthly number of fine-tuning training hours. + monthly_fine_tuning_hosting_hours: 1.7 # Monthly number of fine-tuning hosting hours. + monthly_fine_tuning_input_tokens: 3_333_333 # Monthly number of fine-tuning input tokens. + monthly_fine_tuning_output_tokens: 2_500_000 # Monthly number of fine-tuning output tokens. + monthly_standard_1024_1024_images: 125 # Monthly number of standard 1024x1024 (low res) images. + monthly_standard_1024_1792_images: 63 # Monthly number of standard 1024x1792 (high res) images. + monthly_hd_1024_1024_images: 63 # Monthly number of HD 1024x1024 (low res) images. + monthly_hd_1024_1792_images: 42 # Monthly number of HD 1024x1792 (high res) images. + monthly_text_embedding_tokens: 250_000_000 # Monthly number of text embedding tokens. + monthly_text_to_speech_characters: 333_333 # Monthly number of text to speech characters. + monthly_text_to_speech_hours: 13.9 # Monthly number of text to speech hours. + azurerm_container_registry: + storage_gb: 50 + monthly_build_vcpu_hrs: 13.875 + # + # These resources need to be converted to CoreResource before default usages are fully supported. + # + # azurerm_cosmosdb_cassandra_keyspace: + # storage_gb: 1000 # Total size of storage in GB. + # monthly_serverless_request_units: 10000000 # Monthly number of serverless request units. + # monthly_restored_data_gb: 3000 # Monthly total amount of point-in-time restore data in GB. + # monthly_analytical_storage_write_operations: 1000000 # Monthly number of write analytical storage operations. + # monthly_analytical_storage_read_operations: 1000000 # Monthly number of read analytical storage operations. + # max_request_units_utilization_percentage: 50 # Average utilisation of the maximum RU/s, starting at 10%. Possible values from 10 to 100. + # + # azurerm_cosmosdb_cassandra_table: + # storage_gb: 1000 # Total size of storage in GB. + # monthly_serverless_request_units: 10000000 # Monthly number of serverless request units. + # monthly_restored_data_gb: 3000 # Monthly total amount of point-in-time restore data in GB. + # monthly_analytical_storage_write_operations: 1000000 # Monthly number of write analytical storage operations. + # monthly_analytical_storage_read_operations: 1000000 # Monthly number of read analytical storage operations. + # max_request_units_utilization_percentage: 50 # Average utilisation of the maximum RU/s, starting at 10%. Possible values from 10 to 100. + # + # azurerm_cosmosdb_gremlin_database: + # storage_gb: 1000 # Total size of storage in GB. + # monthly_serverless_request_units: 10000000 # Monthly number of serverless request units. + # monthly_restored_data_gb: 3000 # Monthly total amount of point-in-time restore data in GB. + # monthly_analytical_storage_write_operations: 1000000 # Monthly number of write analytical storage operations. + # monthly_analytical_storage_read_operations: 1000000 # Monthly number of read analytical storage operations. + # max_request_units_utilization_percentage: 50 # Average utilisation of the maximum RU/s, starting at 10%. Possible values from 10 to 100. + # + # azurerm_cosmosdb_gremlin_graph: + # storage_gb: 1000 # Total size of storage in GB. + # monthly_serverless_request_units: 10000000 # Monthly number of serverless request units. + # monthly_restored_data_gb: 3000 # Monthly total amount of point-in-time restore data in GB. + # monthly_analytical_storage_write_operations: 1000000 # Monthly number of write analytical storage operations. + # monthly_analytical_storage_read_operations: 1000000 # Monthly number of read analytical storage operations. + # max_request_units_utilization_percentage: 50 # Average utilisation of the maximum RU/s, starting at 10%. Possible values from 10 to 100. + # + # azurerm_cosmosdb_mongo_collection: + # storage_gb: 1000 # Total size of storage in GB. + # monthly_serverless_request_units: 10000000 # Monthly number of serverless request units. + # monthly_restored_data_gb: 3000 # Monthly total amount of point-in-time restore data in GB. + # monthly_analytical_storage_write_operations: 1000000 # Monthly number of write analytical storage operations. + # monthly_analytical_storage_read_operations: 1000000 # Monthly number of read analytical storage operations. + # max_request_units_utilization_percentage: 50 # Average utilisation of the maximum RU/s, starting at 10%. Possible values from 10 to 100. + # + # azurerm_cosmosdb_mongo_database: + # storage_gb: 1000 # Total size of storage in GB. + # monthly_serverless_request_units: 10000000 # Monthly number of serverless request units. + # monthly_restored_data_gb: 3000 # Monthly total amount of point-in-time restore data in GB. + # monthly_analytical_storage_write_operations: 1000000 # Monthly number of write analytical storage operations. + # monthly_analytical_storage_read_operations: 1000000 # Monthly number of read analytical storage operations. + # max_request_units_utilization_percentage: 50 # Average utilisation of the maximum RU/s, starting at 10%. Possible values from 10 to 100. + # + # azurerm_cosmosdb_sql_container: + # storage_gb: 1000 # Total size of storage in GB. + # monthly_serverless_request_units: 10000000 # Monthly number of serverless request units. + # monthly_restored_data_gb: 3000 # Monthly total amount of point-in-time restore data in GB. + # monthly_analytical_storage_write_operations: 1000000 # Monthly number of write analytical storage operations. + # monthly_analytical_storage_read_operations: 1000000 # Monthly number of read analytical storage operations. + # max_request_units_utilization_percentage: 50 # Average utilisation of the maximum RU/s, starting at 10%. Possible values from 10 to 100. + # + # azurerm_cosmosdb_sql_database: + # storage_gb: 1000 # Total size of storage in GB. + # monthly_serverless_request_units: 10000000 # Monthly number of serverless request units. + # monthly_restored_data_gb: 3000 # Monthly total amount of point-in-time restore data in GB. + # monthly_analytical_storage_write_operations: 1000000 # Monthly number of write analytical storage operations. + # monthly_analytical_storage_read_operations: 1000000 # Monthly number of read analytical storage operations. + # max_request_units_utilization_percentage: 50 # Average utilisation of the maximum RU/s, starting at 10%. Possible values from 10 to 100. + # + # azurerm_cosmosdb_table: + # storage_gb: 1000 # Total size of storage in GB. + # monthly_serverless_request_units: 10000000 # Monthly number of serverless request units. + # monthly_restored_data_gb: 3000 # Monthly total amount of point-in-time restore data in GB. + # monthly_analytical_storage_write_operations: 1000000 # Monthly number of write analytical storage operations. + # monthly_analytical_storage_read_operations: 1000000 # Monthly number of read analytical storage operations. + # max_request_units_utilization_percentage: 50 # Average utilisation of the maximum RU/s, starting at 10%. Possible values from 10 to 100. + # + azurerm_data_factory: + monthly_read_write_operation_entities: 500000 # Monthly entities for Read/Write operations. + monthly_monitoring_operation_entities: 1000000 # Monthly entities for Monitoring operations. + azurerm_data_factory_integration_runtime_azure: + monthly_orchestration_runs: 5000 # Monthly Orchestration runs for runtime. + azurerm_data_factory_integration_runtime_managed: + monthly_orchestration_runs: 5000 # Monthly Orchestration runs for runtime. + azurerm_data_factory_integration_runtime_self_hosted: + monthly_orchestration_runs: 3333 # Monthly Orchestration runs for runtime. + azurerm_databricks_workspace: + monthly_all_purpose_compute_dbu_hrs: 12 # Monthly number of All-purpose Compute Databricks Units in DBU-hours. + monthly_jobs_compute_dbu_hrs: 33 # Monthly number of Jobs Compute Databricks Units in DBU-hours. + monthly_jobs_light_compute_dbu_hrs: 71 # Monthly number of Jobs Light Compute Databricks Units in DBU-hours. + azurerm_federated_identity_credential: + monthly_active_p1_users: 51573 # Monthly number of active users if you are using the Premium P1 license. + azurerm_function_app: + monthly_executions: 25000000 # Monthly executions to the function. Only applicable for Consumption plan. + execution_duration_ms: 25 # Average duration of each execution in milliseconds. Only applicable for Consumption plan. + memory_mb: 32 + azurerm_dns_a_record: + monthly_queries: 12500000 # Monthly number of DNS queries + azurerm_dns_aaaa_record: + monthly_queries: 12500000 # Monthly number of DNS queries + azurerm_dns_caa_record: + monthly_queries: 12500000 # Monthly number of DNS queries + azurerm_dns_cname_record: + monthly_queries: 12500000 # Monthly number of DNS queries + azurerm_dns_mx_record: + monthly_queries: 12500000 # Monthly number of DNS queries + azurerm_dns_ns_record: + monthly_queries: 12500000 # Monthly number of DNS queries + azurerm_dns_ptr_record: + monthly_queries: 12500000 # Monthly number of DNS queries + azurerm_dns_srv_record: + monthly_queries: 12500000 # Monthly number of DNS queries + azurerm_dns_txt_record: + monthly_queries: 12500000 # Monthly number of DNS queries + azurerm_eventgrid_topic: + monthly_operations: 832500 # Monthly number of operations above the free 100k operation limit. + azurerm_eventgrid_system_topic: + monthly_operations: 832500 # Monthly number of operations above the free 100k operation limit. + # + # These resources need to be converted to CoreResource before default usages are fully supported. + # + # azurerm_eventhub_namespace: + # monthly_ingress_events: 100000000 # Monthly number of ingress events, only applicable for Basic and Standard namespaces. + # retention_storage_gb: 10000 # Total data stored for retention in GB, used to calculate Extended Retention costs, only applicable for Dedicated namespaces. + # throughput_or_capacity_units: 10 # Number of Throughput Units (for Basic and Standard) and Capacity units (for Dedicated) namespaces. + # capture_enabled: false # Defines if capture is enabled for the Event Hub Standard namespaces, can be: true, false. + # azurerm_firewall: + # monthly_data_processed_gb: 100000 # Monthly data processed by the firewall in GB. + # + azurerm_frontdoor: + monthly_outbound_data_transfer_gb: # Monthly outbound data transfer from the following, in GB: + us_gov: 0 # US Gov + north_america_europe_africa: 50000 # North America, Europe and Africa + asia_pacific: 0 # Asia Pacific (including Japan) + south_america: 0 # South America + australia: 0 # Australia + india: 0 # India + monthly_inbound_data_transfer_gb: 500 # Monthly inbound data transfer in GB + azurerm_frontdoor_firewall_policy: + monthly_custom_rule_requests: 832500 # Monthly number of custom rule requests + monthly_managed_ruleset_requests: 5000000 # Monthly number of managed ruleset requests + # + # This resource need to be converted to CoreResource before default usages are fully supported. + # + # azurerm_hdinsight_kafka_cluster: + # monthly_os_disk_operations: 1000000 # Average number of disk operations (writes, reads, deletes) using a unit size of 256KiB per OS disk per month. + # + azurerm_iothub_dps: + monthly_operations: 50000 # Monthly number of device provisioning operations + azurerm_linux_function_app: + monthly_executions: 25000000 # Monthly executions to the function. Only applicable for Consumption plan. + execution_duration_ms: 25 # Average duration of each execution in milliseconds. Only applicable for Consumption plan. + memory_mb: 32 + # + # These resources need to be converted to CoreResource before default usages are fully supported. + # + # azurerm_key_vault_certificate: + # monthly_certificate_renewal_requests: 100 # Monthly number of certificate renewal requests. + # monthly_certificate_other_operations: 100000 # Monthly number of non-renewal certificate operations. + # + # azurerm_key_vault_key: + # monthly_secrets_operations: 10000 # Monthly number of secrets transactions. + # monthly_key_rotation_renewals: 50 # Monthly number of Managed Azure Storage account key rotation renewals. + # monthly_protected_keys_operations: 1000000 # Monthly number of Software or HSM transactions. + # hsm_protected_keys: 3000 # Number of protected keys. + # + azurerm_kubernetes_cluster: + load_balancer: + monthly_data_processed_gb: 10000 # Monthly inbound and outbound data processed in GB. + azurerm_lb: + monthly_data_processed_gb: 1000 # Monthly inbound and outbound data processed in GB. + azurerm_linux_virtual_machine: + os_disk: + monthly_disk_operations: 1000000000 # Number of disk operations (writes, reads, deletes) using a unit size of 256KiB. + azurerm_linux_virtual_machine_scale_set: + os_disk: + monthly_disk_operations: 1000000000 # Number of disk operations (writes, reads, deletes) using a unit size of 256KiB per instance in the scale set. + azurerm_log_analytics_workspace: + monthly_log_data_ingestion_gb: 1.65 # Monthly log data ingested by the workspace in GB (only used for Pay-as-you-go workspaces). + monthly_additional_log_data_retention_gb: 37 # Monthly additional GB of data retained past the free allowance. + monthly_log_data_export_gb: 37 # Monthly data in GB exported from the workspace. + monthly_sentinel_data_ingestion_gb: 1.65 # Monthly data in GB exported from Microsoft Sentinel, this only applies when it is enabled. + monthly_basic_log_data_ingestion_gb: 7 # Monthly data ingested by the workspace to basic tables in GB + monthly_basic_log_search_gb: 775 # Monthly basic log data queried in GB + monthly_archive_data_gb: 192 # Monthly archived data in GB + monthly_archive_data_restored_gb: 37 # Monthly data restored from archive in GB + monthly_archive_data_searched_gb: 775 # Monthly data searched in archive with a Search Job, in GB + azurerm_logic_app_standard: + monthly_standard_connector_calls: 40000 # Monthly number of Standard Connector calls. + monthly_enterprise_connector_calls: 5000 # Monthly number of Enterprise Connector calls. + azurerm_managed_disk: + monthly_disk_operations: 100000000 # Number of disk operations (writes, reads, deletes) using a unit size of 256KiB. + # + # This resource need to be converted to CoreResource before default usages are fully supported. + # + # azurerm_mariadb_server: + # additional_backup_storage_gb: 2000 # Additional consumption of backup storage in GB. + # + azurerm_monitor_action_group: + monthly_notifications: 250000 + azure_monitor_data_collection_rule: + monthly_custom_metrics_samples: 312500000 + azurerm_monitor_diagnostic_setting: + monthly_platform_log_gb: 15 + azurerm_mssql_database: + monthly_vcore_hours: 9 # Monthly number of used vCore-hours for serverless compute. + long_term_retention_storage_gb: 100 # Number of GBs used by long-term retention backup storage. + backup_storage_gb: 25 # Number of GBs used by Point-In-Time Restore (PITR) backup storage. + extra_data_storage_gb: 30 # Override number of GBs used by extra data storage. + azurerm_mssql_managed_instance: + backup_storage_gb: 42 # Number of GBs used by Point-In-Time Restore (PITR) backup storage. + long_term_retention_storage_gb: 167 # Number of GBs used by long-term retention backup storage. + azurerm_mysql_flexible_server: + additional_backup_storage_gb: 52 # Additional backup storage in GB. If geo-redundancy is enabled, you should set this to twice the required storage capacity. + azurerm_mysql_server: + additional_backup_storage_gb: 50 # Additional consumption of backup storage in GB. + azurerm_nat_gateway: + monthly_data_processed_gb: 111 # Monthly data processed by the NAT Gateway in GB. + # + # This resource need to be converted to CoreResource before default usages are fully supported. + # + # azurerm_network_connection_monitor: + # tests: 100000 # Overrides the number of tests done in the connection monitor + # + azurerm_network_ddos_protection_plan: + overage_amount: 0 # Monthly number of protected resources over the plan protection limit (100). + azurerm_network_watcher: + monthly_diagnostic_checks: 5000 # Monthly number of diagnostic API calls. + azurerm_network_watcher_flow_log: + monthly_logs_collected_gb: 11 # Monthly amount of logs collected in GB. + # + # These resources need to be converted to CoreResource before default usages are fully supported. + # + # azurerm_network_watcher_flow_log, Traffic Analytics data processed (10 min interval), GB, 3.5, 5.71 + # azurerm_network_watcher_flow_log, Traffic Analytics data processed (60 min interval), GB, 2.3, 8.7 + # + # azurerm_notification_hub_namespace: + # monthly_pushes: 1000000 # Monthly total number number of additional pushes. + # + azurerm_point_to_site_vpn_gateway: + monthly_p2s_connections_hrs: 410 # Monthly connection hours to the point to site gateway + azurerm_virtual_network_peering: + monthly_data_transfer_gb: 142 # Monthly inbound/outbound data transferred by the VNET peering in GB. + azurerm_postgresql_flexible_server: + additional_backup_storage_gb: 52 # Additional backup storage in GB. If geo-redundancy is enabled, you should set this to twice the required storage capacity. + # + # This resource need to be converted to CoreResource before default usages are fully supported. + # + # azurerm_postgresql_server: + # additional_backup_storage_gb: 200 # Additional consumption of backup storage in GB. + # + azurerm_private_dns_a_record: + monthly_queries: 12500000 # Monthly number of DNS queries + azurerm_private_dns_aaaa_record: + monthly_queries: 12500000 # Monthly number of DNS queries + azurerm_private_dns_cname_record: + monthly_queries: 12500000 # Monthly number of DNS queries + azurerm_private_dns_mx_record: + monthly_queries: 12500000 # Monthly number of DNS queries + azurerm_private_dns_ptr_record: + monthly_queries: 12500000 # Monthly number of DNS queries + azurerm_private_dns_srv_record: + monthly_queries: 12500000 # Monthly number of DNS queries + azurerm_private_dns_txt_record: + monthly_queries: 12500000 # Monthly number of DNS queries + # + # This resource need to be converted to CoreResource before default usages are fully supported. + # + # azurerm_private_endpoint: + # monthly_inbound_data_processed_gb: 100 # Monthly inbound data processed in GB. + # monthly_outbound_data_processed_gb: 100 # Monthly outbound data processed in GB. + # + azurerm_recovery_services_vault: + azurerm_backup_protected_vm: # Any protected VMs that come under this vault can be configured with the following + disk_utilization_gb: 100 # Total size in GB of the data that will be backed up into the recovery service vault. Defaults to the entire storage capacity of the VM. + additional_backup_retention_gb: 25 # Total size in GB of the additional data stored by this VM because of retention rules. + # + # This resource need to be converted to CoreResource before default usages are fully supported. + # + # azurerm_search_service: + # monthly_images_extracted: 1000000 # Monthly number of extracted images + # + azurerm_security_center_subscription_pricing: + cosmosdb_request_units: 575 # Average number of RUs/hour for Microsoft Defender for Azure Cosmos DB. Applied when resource_type = CosmosDbs. + monthly_app_service_nodes: 0.35 # Monthly number of App Service nodes for Microsoft Defender for App Service. Applied when resource_type = AppServices. + monthly_arm_subscriptions: 1 # Monthly number of subscriptions for Microsoft Defender for ARM. Applied when resource_type = Arm. + monthly_container_registry_images: 17 # Monthly number of images for Microsoft Defender for Container Registries. Applied when resource_type = ContainerRegistry. + monthly_containers_vcores: 0 # Monthly number of vCores for Microsoft Defender for Containers. Applied when resource_type = Containers. + monthly_dns_queries: 7250000 # Monthly number of queries for Microsoft Defender for DNS. Applied when resource_type = Dns. + monthly_key_vaults: 20 # Monthly number of key vaults for Microsoft Defender for Key Vault. Applied when resource_type = KeyVaults. + monthly_kubernetes_cores: 2 # Monthly number of cores for Microsoft Defender for Kubernetes. Applied when resource_type = KubernetesService. + monthly_mariadb_instances: 0.325 # Monthly number of instances for Microsoft Defender for MariaDB. Applied when resource_type = OpenSourceRelationalDatabases. + monthly_mysql_instances: 0.325 # Monthly number of instances for Microsoft Defender for MySQL. Applied when resource_type = OpenSourceRelationalDatabases. + monthly_postgresql_instances: 0.325 # Monthly number of instances for Microsoft Defender for PostgreSQL. Applied when resource_type = OpenSourceRelationalDatabases. + monthly_servers_plan_1_nodes: 1 # Monthly number of servers for Microsoft Defender for Servers Plan 1. Applied when resource_type = VirtualMachines. + monthly_servers_plan_2_nodes: 0.35 # Monthly number of servers for Microsoft Defender for Servers Plan 2. Applied when resource_type = VirtualMachines. + monthly_sql_azure_connected_instances: 0.325 # Monthly number of instances for Microsoft Defender for SQL on Azure-connected databases. Applied when resource_type = SqlServerVirtualMachines. + monthly_sql_outside_azure_vcores: 0.45 # Monthly number of vCores for Microsoft Defender for SQL outside Azure. Applied when resource_type = SqlServers. + monthly_storage_accounts: 0 # Monthly number of storage accounts for Microsoft Defender for Storage. Applied when resource_type = StorageAccounts. + azurerm_servicebus_namespace: + monthly_messaging_operations: 9500000 # Monthly number of messaging operations, used for Standard tier only + monthly_brokered_connections: 165 # Monthly number of brokered connections, used for Standard tier only + azurerm_signalr_service: + monthly_additional_messages: 5000000 # Monthly number of messages above the included 1M per unit per day + azurerm_snapshot: + storage_gb: 100 # Total size of snapshot disk in GB. + azurerm_sql_database: + monthly_vcore_hours: 9 # Monthly number of used vCore-hours for serverless compute. + long_term_retention_storage_gb: 100 # Number of GBs used by long-term retention backup storage. + backup_storage_gb: 25 # Number of GBs used by Point-In-Time Restore (PITR) backup storage. + extra_data_storage_gb: 30 # Override number of GBs used by extra data storage. + azurerm_sql_managed_instance: + backup_storage_gb: 42 # Number of GBs used by Point-In-Time Restore (PITR) backup storage. + long_term_retention_storage_gb: 167 # Number of GBs used by long-term retention backup storage. + azurerm_storage_account: + data_at_rest_storage_gb: 220 # Total size of Data at Rest in GB (File storage). + early_deletion_gb: 325 # Total size of Early deletion data in GB. + snapshots_storage_gb: 220 # Total size of Snapshots in GB (File storage). + metadata_at_rest_storage_gb: 167 # Total size of Metadata in GB (File storage). + storage_gb: 250 # Total size of storage in GB. + monthly_iterative_write_operations: 350000 # Monthly number of Iterative write operations (GPv2). + monthly_write_operations: 925000 # Monthly number of Write operations. + monthly_list_and_create_container_operations: 925000 # Monthly number of List and Create Container operations. + monthly_iterative_read_operations: 350000 # Monthly number of Iterative read operations (GPv2). + monthly_read_operations: 11500000 # Monthly number of Read operations. + monthly_other_operations: 11500000 # Monthly number of All other operations. + monthly_data_retrieval_gb: 500 # Monthly number of data retrieval in GB. + monthly_data_write_gb: 250 # Monthly number of data write in GB. + blob_index_tags: 1275000 # Total number of Blob indexes. + azurerm_storage_queue: + monthly_storage_gb: 83 # Monthly amount of storage used in GB. + monthly_class_1_operations: 12500000 # Monthly number of Class 1 operations + monthly_class_2_operations: 13750000 # Monthly number of Class 2 operations + monthly_geo_replication_data_transfer_gb: 250 # Monthly amount of Geo-replication data transfer in GB + azurerm_storage_share: + storage_gb: 250 # Total size of storage in GB. Overrides any provided `quota`. + monthly_write_operations: 925000 # Monthly number of Write operations. + monthly_list_operations: 925000 # Monthly number of List and Create Container operations. + monthly_read_operations: 11500000 # Monthly number of Read operations. + monthly_other_operations: 11500000 # Monthly number of All other operations. + monthly_data_retrieval_gb: 500 # Monthly number of data retrieval in GB. + snapshots_storage_gb: 220 # Total size of Snapshots in GB + metadata_at_rest_storage_gb: 167 # Total size of Metadata in GB + azurerm_synapse_sql_pool: + storage_tb: 0 # Total storage size, including snapshots, in TB. + # + # This resource need to be converted to CoreResource before default usages are fully supported. + # + # azurerm_synapse_workspace: + # serverless_sql_pool_size_tb: 4 # Total storage size, including snapshots, in TB. + # monthly_datapipeline_azure_hosted_activity_runs: 3 # Monthly number of Azure hosted activity runs. + # monthly_datapipeline_azure_hosted_data_integration_units: 1 # Monthly number of Azure hosted data integration units. + # monthly_datapipeline_azure_hosted_data_integration_hours: 31 # Monthly number of Azure hosted data integration hours. + # monthly_datapipeline_azure_hosted_integration_runtime_hours: 200 # Monthly number of Azure hosted integration runtime hours. + # monthly_datapipeline_azure_hosted_external_integration_runtime_hours: 4000 # Monthly number of Azure hosted external integration runtime hours. + # monthly_datapipeline_self_hosted_activity_runs: 1 # Monthly number of self hosted activity runs. + # monthly_datapipeline_self_hosted_data_movement_hours: 10 # Monthly number of self hosted data movement hours. + # monthly_datapipeline_self_hosted_integration_runtime_hours: 200 # Monthly number of self hosted integration runtime hours. + # monthly_datapipeline_self_hosted_external_integration_runtime_hours: 4000 # Monthly number of self hosted external integration runtime hours. + # dataflow_basic_instances: 1 # Number of Data Flow basic instances. + # dataflow_basic_vcores: 8 # Number of Data Flow basic vCores. + # monthly_dataflow_basic_hours: 1 # Monthly number of Data Flow basic hours (this is multiplied by the number of instances and vCores). + # dataflow_standard_instances: 1 # Number of Data Flow standard instances. + # dataflow_standard_vcores: 12 # Number of Data Flow standard vCores. + # monthly_dataflow_standard_hours: 1 # Monthly number of Data Flow standard hours (this is multiplied by the number of instances and vCores). + # + azurerm_traffic_manager_profile: + monthly_dns_queries: 9250000 # Monthly number of DNS queries + monthly_traffic_view_data_points: 2500000 # Monthly number of Traffic View data points processes + azurerm_virtual_hub: + monthly_data_processed_gb: 250 # Monthly data processed by the Virtual WAN Hub in GB + azurerm_virtual_machine_scale_set: + storage_profile_os_disk: + monthly_disk_operations: 1000000000 # Monthly number of main disk operations (writes, reads, deletes) using a unit size of 256KiB. + storage_profile_data_disk: + monthly_disk_operations: 25000000 # Monthly number of disk operations (writes, reads, deletes) using a unit size of 256KiB per additional disk. + azurerm_virtual_machine: + storage_os_disk: + monthly_disk_operations: 1000000000 # Monthly number of main disk operations (writes, reads, deletes) using a unit size of 256KiB. + storage_data_disk: + monthly_disk_operations: 25000000 # Monthly number of disk operations (writes, reads, deletes) using a unit size of 256KiB per additional disk. + azurerm_windows_function_app: + monthly_executions: 25000000 # Monthly executions to the function. Only applicable for Consumption plan. + execution_duration_ms: 25 # Average duration of each execution in milliseconds. Only applicable for Consumption plan. + memory_mb: 32 + azurerm_windows_virtual_machine: + os_disk: + monthly_disk_operations: 1000000000 # Number of disk operations (writes, reads, deletes) using a unit size of 256KiB. + azurerm_windows_virtual_machine_scale_set: + os_disk: + monthly_disk_operations: 1000000000 # Number of disk operations (writes, reads, deletes) using a unit size of 256KiB per instance in the scale set. + azurerm_virtual_network_gateway: + p2s_connection: 32 # Total number of p2s tunnels. + monthly_data_transfer_gb: 142 # Monthly data transfer in GB. + # + # Terraform GCP resources + # + google_artifact_registry_repository: + storage_gb: 50 # Total data stored in the repository in GB + monthly_egress_data_transfer_gb: # Monthly data delivered from the artifact registry repository in GB. You can specify any number of Google Cloud regions below, replacing - for _ e.g.: + europe_north1: 0 # GB of data delivered from the artifact registry to europe-north1. + google_bigquery_dataset: + monthly_queries_tb: 0.8 # Monthly number of bytes processed (also referred to as bytes read) in TB. + google_bigquery_table: + monthly_active_storage_gb: 217 # Monthly number of active storage modifications in GB. + monthly_long_term_storage_gb: 312 # Monthly number of long-term storage modifications in GB. + monthly_streaming_inserts_mb: 100000 # Monthly number of streaming data inserts in MB. + monthly_storage_write_api_gb: 200 # Monthly number of storage write api in GB. + monthly_storage_read_api_tb: 4 # Monthly number of storage read api in TB. + google_cloudfunctions_function: + request_duration_ms: 10 # Average duration of each request in milliseconds. + monthly_function_invocations: 12500000 # Monthly number of function invocations. + monthly_outbound_data_gb: 41 # Monthly data transferred from the function out to somewhere else in GB. + google_compute_external_vpn_gateway: + monthly_egress_data_transfer_gb: # Monthly data transfer from VPN gateway to the following, in GB: + worldwide: 0 # to a Google Cloud region on another continent. + china: 0 # China excluding Hong Kong. + australia: 0 # Australia. + google_compute_forwarding_rule: + monthly_ingress_data_gb: 625 + google_compute_global_forwarding_rule: + monthly_ingress_data_gb: 625 + google_compute_ha_vpn_gateway: + monthly_egress_data_transfer_gb: # Monthly VM-VM data transfer from VPN gateway to the following, in GB: + same_region: 0 # VMs in the same Google Cloud region. + us_or_canada: 0 # From a Google Cloud region in the US or Canada to another Google Cloud region in the US or Canada. + europe: 0 # Between Google Cloud regions within Europe. + asia: 0 # Between Google Cloud regions within Asia. + south_america: 0 # Between Google Cloud regions within South America. + oceania: 0 # Indonesia and Oceania to/from any Google Cloud region. + worldwide: 0 # to a Google Cloud region on another continent. + google_compute_image: + storage_gb: 100 # Total size of image storage in GB. + google_compute_machine_image: + storage_gb: 100 # Total size of machine image storage in GB. + google_compute_region_target_http_proxy: + monthly_proxy_instances: 0 + monthly_data_processed_gb: 625 + google_compute_region_target_https_proxy: + monthly_proxy_instances: 0 + monthly_data_processed_gb: 625 + google_compute_router_nat: + assigned_vms: 4 # Number of VM instances assigned to the NAT gateway + monthly_data_processed_gb: 111 # Monthly data processed (ingress and egress) by the NAT gateway in GB + google_compute_snapshot: + storage_gb: 192 # Total size of snapshot disk storage in GB. + google_compute_target_grpc_proxy: + monthly_proxy_instances: 0 + monthly_data_processed_gb: 625 + google_compute_target_http_proxy: + monthly_proxy_instances: 0 + monthly_data_processed_gb: 625 + google_compute_target_https_proxy: + monthly_proxy_instances: 0 + monthly_data_processed_gb: 625 + google_compute_target_ssl_proxy: + monthly_proxy_instances: 0 + monthly_data_processed_gb: 625 + google_compute_target_tcp_proxy: + monthly_proxy_instances: 0 + monthly_data_processed_gb: 625 + google_compute_vpn_gateway: + monthly_egress_data_transfer_gb: # Monthly VM-VM data transfer from VPN gateway to the following, in GB: + same_region: 0 # VMs in the same Google Cloud region. + us_or_canada: 0 # From a Google Cloud region in the US or Canada to another Google Cloud region in the US or Canada. + europe: 0 # Between Google Cloud regions within Europe. + asia: 0 # Between Google Cloud regions within Asia. + south_america: 0 # Between Google Cloud regions within South America. + oceania: 0 # Indonesia and Oceania to/from any Google Cloud region. + worldwide: 0 # to a Google Cloud region on another continent. + google_container_cluster: + autopilot_vcpu_count: 153 # Number of vCPUs used by Autopilot pods. Only relevant for Autopilot mode. + autopilot_memory_gb: 1.375 # Total memory used by Autopilot pods. Only relevant for Autopilot mode. + autopilot_ephemeral_storage_gb: 125 # Total ephemeral storage used by Autopilot pods. Only relevant for Autopilot mode. + google_container_registry: + storage_gb: 192 # Total size of bucket in GB. + monthly_class_a_operations: 1000000 # Monthly number of class A operations (object adds, bucket/object list). + monthly_class_b_operations: 12500000 # Monthly number of class B operations (object gets, retrieve bucket/object metadata). + monthly_data_retrieval_gb: 250 # Monthly amount of data retrieved in GB. + monthly_egress_data_transfer_gb: # Monthly data transfer from Cloud Storage to the following, in GB: + same_continent: 0 # Same continent. + worldwide: 0 # Worldwide excluding Asia, Australia. + asia: 0 # Asia excluding China, but including Hong Kong. + china: 0 # China excluding Hong Kong. + australia: 0 # Australia. + google_dns_record_set: + monthly_queries: 12500000 # Monthly DNS queries. + google_kms_crypto_key: + key_versions: 83 # Number of key versions. + monthly_key_operations: 1666666 # Monthly number of key operations. + google_logging_billing_account_bucket_config: + monthly_logging_data_gb: 10 # Monthly logging data in GB. + google_logging_billing_account_sink: + monthly_logging_data_gb: 10 # Monthly logging data in GB. + google_logging_folder_bucket_config: + monthly_logging_data_gb: 10 # Monthly logging data in GB. + google_logging_folder_sink: + monthly_logging_data_gb: 10 # Monthly logging data in GB. + google_logging_organization_bucket_config: + monthly_logging_data_gb: 10 # Monthly logging data in GB. + google_logging_organization_sink: + monthly_logging_data_gb: 10 # Monthly logging data in GB. + google_logging_project_bucket_config: + monthly_logging_data_gb: 10 # Monthly logging data in GB. + google_logging_project_sink: + monthly_logging_data_gb: 10 # Monthly logging data in GB. + google_monitoring_metric_descriptor: + monthly_monitoring_data_mb: 19 # Monthly monitoring data in MB (only for chargeable metrics). + monthly_api_calls: 500000 # Monthly read API calls (write calls are free). + google_pubsub_subscription: + monthly_message_data_tb: 0.125 # Monthly amount of message data pulled by the subscription in TB. + storage_gb: 18 # Storage for retaining acknowledged messages in GB. + snapshot_storage_gb: 18 # Snapshot storage for unacknowledged messages in GB. + google_pubsub_topic: + monthly_message_data_tb: 0.125 # Monthly amount of message data published to the topic in TB. + google_redis_cluster: + backup_storage_gb: 61 # Amount of backup storage in GB. + google_secret_manager_secret: + active_secret_versions: 83 # Number of active secret versions in each month. NOTE: this is used only when secret versions are not defined. + monthly_access_operations: 1666666 # Monthly number of access operations + monthly_rotation_notifications: 100 # Monthly number of rotation notifications + google_secret_manager_secret_version: + monthly_access_operations: 1666666 # Monthly number of access operations + google_service_networking_connection: + monthly_egress_data_transfer_gb: # Monthly VM-VM data transfer from VPN gateway to the following, in GB: + same_region: 0 # VMs in the same Google Cloud region. + us_or_canada: 0 # From a Google Cloud region in the US or Canada to another Google Cloud region in the US or Canada. + europe: 0 # Between Google Cloud regions within Europe. + asia: 0 # Between Google Cloud regions within Asia. + south_america: 0 # Between Google Cloud regions within South America. + oceania: 0 # Indonesia and Oceania to/from any Google Cloud region. + worldwide: 0 # to a Google Cloud region on another continent. + google_sql_database_instance: + backup_storage_gb: 62 # Amount of backup storage in GB. + google_storage_bucket: + storage_gb: 192 # Total size of bucket in GB. + monthly_class_a_operations: 1000000 # Monthly number of class A operations (object adds, bucket/object list). + monthly_class_b_operations: 12500000 # Monthly number of class B operations (object gets, retrieve bucket/object metadata). + monthly_data_retrieval_gb: 250 # Monthly amount of data retrieved in GB. + monthly_egress_data_transfer_gb: # Monthly data transfer from Cloud Storage to the following, in GB: + same_continent: 0 # Same continent. + worldwide: 0 # Worldwide excluding Asia, Australia. + asia: 0 # Asia excluding China, but including Hong Kong. + china: 0 # China excluding Hong Kong. + australia: 0 # Australia. diff --git a/src/api/routes/events.ts b/src/api/routes/events.ts index 36ac3f3f..1bbdd5d4 100644 --- a/src/api/routes/events.ts +++ b/src/api/routes/events.ts @@ -318,7 +318,7 @@ const eventsPlugin: FastifyPluginAsyncZodOpenApi = async ( schema: withRoles( [AppRoles.EVENTS_MANAGER], withTags(["Events"], { - body: postRequestSchema.partial(), + body: postRequestSchema, params: z.object({ id: z.string().min(1).meta({ description: "Event ID to modify.", @@ -327,12 +327,7 @@ const eventsPlugin: FastifyPluginAsyncZodOpenApi = async ( }), response: { 201: { - description: "The event has been modified.", - content: { - "application/json": { - schema: z.null(), - }, - }, + description: "The event has been modified successfully.", }, 404: notFoundError, }, @@ -345,64 +340,29 @@ const eventsPlugin: FastifyPluginAsyncZodOpenApi = async ( if (!request.username) { throw new UnauthenticatedError({ message: "Username not found." }); } + try { - const updatableFields = Object.keys(postRequestSchema.shape); const entryUUID = request.params.id; - const requestData = request.body; - - const setParts: string[] = []; - const removeParts: string[] = []; - const expressionAttributeNames: Record = {}; - const expressionAttributeValues: Record = {}; - - setParts.push("#updatedAt = :updatedAt"); - expressionAttributeNames["#updatedAt"] = "updatedAt"; - expressionAttributeValues[":updatedAt"] = new Date().toISOString(); - - updatableFields.forEach((key) => { - if (Object.hasOwn(requestData, key)) { - setParts.push(`#${key} = :${key}`); - expressionAttributeNames[`#${key}`] = key; - expressionAttributeValues[`:${key}`] = - requestData[key as keyof typeof requestData]; - } else { - removeParts.push(`#${key}`); - expressionAttributeNames[`#${key}`] = key; - } - }); - - // Construct the final UpdateExpression by combining SET and REMOVE - let updateExpression = `SET ${setParts.join(", ")}`; - if (removeParts.length > 0) { - updateExpression += ` REMOVE ${removeParts.join(", ")}`; - } + const updatedItem = { + ...request.body, + id: entryUUID, + updatedAt: new Date().toISOString(), + }; - const command = new UpdateItemCommand({ + const command = new PutItemCommand({ TableName: genericConfig.EventsDynamoTableName, - Key: { id: { S: entryUUID } }, - UpdateExpression: updateExpression, - ExpressionAttributeNames: expressionAttributeNames, + Item: marshall(updatedItem), ConditionExpression: "attribute_exists(id)", - ExpressionAttributeValues: marshall(expressionAttributeValues), ReturnValues: "ALL_OLD", }); + let oldAttributes; - let updatedEntry; try { - oldAttributes = (await fastify.dynamoClient.send(command)).Attributes; - + const result = await fastify.dynamoClient.send(command); + oldAttributes = result.Attributes; if (!oldAttributes) { - throw new DatabaseInsertError({ - message: "Item not found or update failed.", - }); + throw new NotFoundError({ endpointName: request.url }); } - - const oldEntry = oldAttributes ? unmarshall(oldAttributes) : null; - // we know updateData has no undefines because we filtered them out. - updatedEntry = { - ...oldEntry, - ...requestData, - } as unknown as IUpdateDiscord; } catch (e: unknown) { if ( e instanceof Error && @@ -414,16 +374,24 @@ const eventsPlugin: FastifyPluginAsyncZodOpenApi = async ( throw e; } request.log.error(e); - throw new DiscordEventError({}); + throw new DatabaseInsertError({ + message: "Failed to update event in Dynamo table.", + }); } - if (updatedEntry.featured && !updatedEntry.repeats) { + + const updatedEntryForDiscord = updatedItem as unknown as IUpdateDiscord; + + if ( + updatedEntryForDiscord.featured && + !updatedEntryForDiscord.repeats + ) { try { await updateDiscord( { botToken: fastify.secretConfig.discord_bot_token, guildId: fastify.environmentConfig.DiscordGuildId, }, - updatedEntry, + updatedEntryForDiscord, request.username, false, request.log, @@ -437,10 +405,11 @@ const eventsPlugin: FastifyPluginAsyncZodOpenApi = async ( ); if (e instanceof Error) { - request.log.error(`Failed to publish event to Discord: ${e} `); + request.log.error(`Failed to publish event to Discord: ${e}`); } } } + const postUpdatePromises = [ atomicIncrementCacheCounter( fastify.dynamoClient, @@ -466,14 +435,8 @@ const eventsPlugin: FastifyPluginAsyncZodOpenApi = async ( }), ]; await Promise.all(postUpdatePromises); - - reply - .status(201) - .header( - "Location", - `${fastify.environmentConfig.UserFacingUrl}/api/v1/events/${entryUUID}`, - ) - .send(); + reply.header("location", request.url); + reply.status(201).send(); } catch (e: unknown) { if (e instanceof Error) { request.log.error(`Failed to update DynamoDB: ${e.toString()}`); @@ -487,6 +450,7 @@ const eventsPlugin: FastifyPluginAsyncZodOpenApi = async ( } }, ); + fastify.withTypeProvider().post( "", { diff --git a/terraform/modules/frontend/main.tf b/terraform/modules/frontend/main.tf index 603006b0..92db83c2 100644 --- a/terraform/modules/frontend/main.tf +++ b/terraform/modules/frontend/main.tf @@ -2,6 +2,40 @@ resource "aws_s3_bucket" "frontend" { bucket = "${var.BucketPrefix}-${var.ProjectId}" } +resource "aws_s3_bucket_lifecycle_configuration" "frontend" { + bucket = aws_s3_bucket.frontend.id + + rule { + id = "AbortIncompleteMultipartUploads" + status = "Enabled" + + abort_incomplete_multipart_upload { + days_after_initiation = 1 + } + } + + rule { + id = "ObjectLifecycle" + status = "Enabled" + + filter {} + + transition { + days = 30 + storage_class = "INTELLIGENT_TIERING" + } + + noncurrent_version_transition { + noncurrent_days = 30 + storage_class = "STANDARD_IA" + } + + noncurrent_version_expiration { + noncurrent_days = 60 + } + } +} + data "archive_file" "ui" { type = "zip" source_dir = "${path.module}/../../../dist_ui/" diff --git a/terraform/modules/lambdas/main.tf b/terraform/modules/lambdas/main.tf index 189c9926..9e8dd1dd 100644 --- a/terraform/modules/lambdas/main.tf +++ b/terraform/modules/lambdas/main.tf @@ -418,13 +418,13 @@ resource "aws_lambda_function_url" "slow_api_lambda_function_url" { } module "lambda_warmer_main" { - source = "github.com/acm-uiuc/terraform-modules/lambda-warmer?ref=b52f22e32c6c07af9b1b4750a226882aaccc769d" + source = "git::https://github.com/acm-uiuc/terraform-modules.git//lambda-warmer?ref=b52f22e32c6c07af9b1b4750a226882aaccc769d" function_to_warm = local.core_api_lambda_name is_streaming_lambda = true } module "lambda_warmer_slow" { - source = "github.com/acm-uiuc/terraform-modules/lambda-warmer?ref=b52f22e32c6c07af9b1b4750a226882aaccc769d" + source = "git::https://github.com/acm-uiuc/terraform-modules.git//lambda-warmer?ref=b52f22e32c6c07af9b1b4750a226882aaccc769d" function_to_warm = local.core_api_slow_lambda_name is_streaming_lambda = true } diff --git a/tests/live/events.test.ts b/tests/live/events.test.ts index 738af643..3a8af9f0 100644 --- a/tests/live/events.test.ts +++ b/tests/live/events.test.ts @@ -129,7 +129,14 @@ describe("Event lifecycle tests", async () => { "Content-Type": "application/json", }, body: JSON.stringify({ - description: "An event of all time THAT HAS BEEN MODIFIED", + title: "Modified Live Testing Event", + description: "An event of all time", + start: "2024-12-31T02:00:00", + end: "2024-12-31T03:30:00", + location: "ACM Room (Siebel 1104)", + host: "ACM", + featured: true, + repeats: "weekly", }), }, ); @@ -154,9 +161,7 @@ describe("Event lifecycle tests", async () => { expect(response.status).toBe(200); expect(responseJson).toHaveProperty("id"); expect(responseJson).toHaveProperty("description"); - expect(responseJson["description"]).toStrictEqual( - "An event of all time THAT HAS BEEN MODIFIED", - ); + expect(responseJson["title"]).toStrictEqual("Modified Live Testing Event"); }); test("deleting a previously-created event", { timeout: 30000 }, async () => { diff --git a/tests/unit/eventPost.test.ts b/tests/unit/eventPost.test.ts index 8058e52d..a8cbbc21 100644 --- a/tests/unit/eventPost.test.ts +++ b/tests/unit/eventPost.test.ts @@ -498,9 +498,9 @@ describe("Event modification tests", async () => { const ourError = new Error("Nonexistent event."); ourError.name = "ConditionalCheckFailedException"; ddbMock - .on(UpdateItemCommand, { + .on(PutItemCommand, { TableName: genericConfig.EventsDynamoTableName, - Key: { id: { S: eventUuid } }, + Item: { id: { S: eventUuid } }, }) .rejects(ourError); const testJwt = createJwt(); @@ -509,7 +509,12 @@ describe("Event modification tests", async () => { .patch(`/api/v1/events/${eventUuid}`) .set("authorization", `Bearer ${testJwt}`) .send({ - paidEventId: "sp24_semiformal_2", + description: "First test event", + host: "Social Committee", + location: "Siebel Center", + start: "2024-09-25T18:00:00", + title: "Event 1", + featured: false, }); expect(response.statusCode).toBe(404); @@ -531,9 +536,8 @@ describe("Event modification tests", async () => { }; ddbMock.reset(); ddbMock - .on(UpdateItemCommand, { + .on(PutItemCommand, { TableName: genericConfig.EventsDynamoTableName, - Key: { id: { S: eventUuid } }, }) .resolves({ Attributes: marshall(event) }); const testJwt = createJwt(); @@ -541,9 +545,7 @@ describe("Event modification tests", async () => { const response = await supertest(app.server) .patch(`/api/v1/events/${eventUuid}`) .set("authorization", `Bearer ${testJwt}`) - .send({ - paidEventId: "sp24_semiformal_2", - }); + .send(event); expect(response.statusCode).toBe(201); expect(response.header["location"]).toBeDefined();