Skip to content

Commit

Permalink
datasources aws update
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWoolfenden committed Apr 10, 2024
1 parent d3cbcfd commit cbcf86e
Show file tree
Hide file tree
Showing 30 changed files with 350 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ jobs:
run: go test ./... -coverprofile=./cover.out

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@7598e39340e1dff4d6ebf7cf07a5e8184bde67e7 # v4.0.1
uses: codecov/codecov-action@fa9a6909dc02281d24b410b6ee3dd8c5675a2e76 # v4.3.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@65c74964a9ed8c44ed9f19d4bbc5757a6a8e9ab9 # codeql-bundle-v2.16.1
uses: github/codeql-action/init@99c9897648dded3fe63d6f328c46089dd57735ca # codeql-bundle-v2.17.0
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -57,7 +57,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@65c74964a9ed8c44ed9f19d4bbc5757a6a8e9ab9 # codeql-bundle-v2.16.1
uses: github/codeql-action/autobuild@99c9897648dded3fe63d6f328c46089dd57735ca # codeql-bundle-v2.17.0

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -70,4 +70,4 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@65c74964a9ed8c44ed9f19d4bbc5757a6a8e9ab9 # codeql-bundle-v2.16.1
uses: github/codeql-action/analyze@99c9897648dded3fe63d6f328c46089dd57735ca # codeql-bundle-v2.17.0
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
with:
go-version: 1.21.x
- name: Restore cache
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
Expand All @@ -37,7 +37,7 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- name: Restore cache
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
Expand Down
10 changes: 10 additions & 0 deletions src/aws_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,16 @@ func AwsDataLookup(find string) interface{} {
"aws_bedrock_custom_model": dataAwsBedrockCustomModel,
"aws_bedrock_custom_models": dataAwsBedrockCustomModels,
"aws_ssmcontacts_rotation": dataAwsSsmcontactsRotation,
"aws_apprunner_hosted_zone_id": placeholder,
"aws_batch_job_definition": dataAwsBatchJobDefinition,
"aws_cognito_user_group": dataAwsCognitoUserGroup,
"aws_cognito_user_groups": dataAwsCognitoUserGroups,
"aws_db_parameter_group": dataAwsDbParameterGroup,
"aws_medialive_input": dataAwsMedialiveInput,
"aws_redshift_data_shares": dataAwsRedshiftDataShares,
"aws_redshift_producer_data_shares": dataAwsRedshiftProducerDataShares,
"aws_resourceexplorer2_search": dataAwsResourceexplorer2Search,
"aws_servicecatalogappregistry_application": dataAwsServicecatalogappregistryApplication,
}

return TFLookup[find]
Expand Down
1 change: 1 addition & 0 deletions src/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ func TestGetPermissionMap(t *testing.T) {
args: args{
raw: []byte("bogus"),
attributes: []string{},
resource: "bogus",
},
wantErr: true,
},
Expand Down
44 changes: 42 additions & 2 deletions src/coverage/aws.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# todo aws

Resource percentage coverage 49.85
Datasource percentage coverage 100.00
Resource percentage coverage 48.74
Datasource percentage coverage 98.10

./resource.ps1 aws_accessanalyzer_archive_rule
./resource.ps1 aws_account_region
./resource.ps1 aws_acmpca_permission
./resource.ps1 aws_acmpca_policy
./resource.ps1 aws_amplify_app
Expand Down Expand Up @@ -32,6 +33,7 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_apprunner_connection
./resource.ps1 aws_apprunner_custom_domain_association
./resource.ps1 aws_apprunner_default_auto_scaling_configuration_version
./resource.ps1 aws_apprunner_deployment
./resource.ps1 aws_apprunner_observability_configuration
./resource.ps1 aws_apprunner_service
./resource.ps1 aws_apprunner_vpc_connector
Expand All @@ -55,6 +57,7 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_athena_prepared_statement
./resource.ps1 aws_bedrock_custom_model
./resource.ps1 aws_bedrock_model_invocation_logging_configuration
./resource.ps1 aws_bedrock_provisioned_model_throughput
./resource.ps1 aws_chime_voice_connector
./resource.ps1 aws_chime_voice_connector_group
./resource.ps1 aws_chime_voice_connector_logging
Expand All @@ -71,7 +74,9 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_cleanrooms_configured_table
./resource.ps1 aws_cloud9_environment_membership
./resource.ps1 aws_cloudcontrolapi_resource
./resource.ps1 aws_cloudfront_key_value_store
./resource.ps1 aws_cloudfront_realtime_log_config
./resource.ps1 aws_cloudfrontkeyvaluestore_key
./resource.ps1 aws_cloudhsm_v2_cluster
./resource.ps1 aws_cloudhsm_v2_hsm
./resource.ps1 aws_cognito_identity_pool_provider_principal_tag
Expand All @@ -86,8 +91,10 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_config_organization_custom_rule
./resource.ps1 aws_config_organization_managed_rule
./resource.ps1 aws_config_remediation_configuration
./resource.ps1 aws_config_retention_configuration
./resource.ps1 aws_connect_lambda_function_association
./resource.ps1 aws_controltower_control
./resource.ps1 aws_controltower_landing_zone
./resource.ps1 aws_cur_report_definition
./resource.ps1 aws_customerprofiles_domain
./resource.ps1 aws_customerprofiles_profile
Expand Down Expand Up @@ -124,6 +131,9 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_devicefarm_network_profile
./resource.ps1 aws_devicefarm_project
./resource.ps1 aws_devicefarm_upload
./resource.ps1 aws_devopsguru_event_sources_config
./resource.ps1 aws_devopsguru_notification_channel
./resource.ps1 aws_devopsguru_resource_collection
./resource.ps1 aws_directory_service_conditional_forwarder
./resource.ps1 aws_directory_service_radius_settings
./resource.ps1 aws_directory_service_region
Expand Down Expand Up @@ -156,6 +166,8 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_dx_public_virtual_interface
./resource.ps1 aws_dx_transit_virtual_interface
./resource.ps1 aws_dynamodb_kinesis_streaming_destination
./resource.ps1 aws_dynamodb_resource_policy
./resource.ps1 aws_dynamodb_table_export
./resource.ps1 aws_dynamodb_table_replica
./resource.ps1 aws_ebs_fast_snapshot_restore
./resource.ps1 aws_ebs_snapshot_import
Expand All @@ -169,6 +181,7 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_ec2_image_block_public_access
./resource.ps1 aws_ec2_instance
./resource.ps1 aws_ec2_instance_connect_endpoint
./resource.ps1 aws_ec2_instance_metadata_defaults
./resource.ps1 aws_ec2_instance_state
./resource.ps1 aws_ec2_local_gateway_route
./resource.ps1 aws_ec2_local_gateway_route_table_vpc_association
Expand Down Expand Up @@ -311,10 +324,12 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_kinesis_resource_policy
./resource.ps1 aws_kinesisanalyticsv2_application
./resource.ps1 aws_kinesisanalyticsv2_application_snapshot
./resource.ps1 aws_lakeformation_data_cells_filter
./resource.ps1 aws_lakeformation_data_lake_settings
./resource.ps1 aws_lakeformation_lf_tag
./resource.ps1 aws_lakeformation_permissions
./resource.ps1 aws_lakeformation_resource
./resource.ps1 aws_lakeformation_resource_lf_tag
./resource.ps1 aws_lakeformation_resource_lf_tags
./resource.ps1 aws_lb_listener_certificate
./resource.ps1 aws_lb_ssl_negotiation_policy
Expand Down Expand Up @@ -352,6 +367,9 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_lightsail_lb_certificate_attachment
./resource.ps1 aws_lightsail_lb_https_redirection_policy
./resource.ps1 aws_lightsail_lb_stickiness_policy
./resource.ps1 aws_m2_application
./resource.ps1 aws_m2_deployment
./resource.ps1 aws_m2_environment
./resource.ps1 aws_macie2_account
./resource.ps1 aws_macie2_classification_export_configuration
./resource.ps1 aws_macie2_classification_job
Expand Down Expand Up @@ -430,6 +448,7 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_organizations_organization
./resource.ps1 aws_organizations_organizational_unit
./resource.ps1 aws_organizations_resource_policy
./resource.ps1 aws_osis_pipeline
./resource.ps1 aws_pinpoint_adm_channel
./resource.ps1 aws_pinpoint_apns_channel
./resource.ps1 aws_pinpoint_apns_sandbox_channel
Expand Down Expand Up @@ -473,11 +492,14 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_rds_export_task
./resource.ps1 aws_rds_reserved_instance
./resource.ps1 aws_redshift_cluster_snapshot
./resource.ps1 aws_redshift_data_share_authorization
./resource.ps1 aws_redshift_data_share_consumer_association
./resource.ps1 aws_redshift_endpoint_access
./resource.ps1 aws_redshift_endpoint_authorization
./resource.ps1 aws_redshift_partner
./resource.ps1 aws_redshift_resource_policy
./resource.ps1 aws_redshiftdata_statement
./resource.ps1 aws_redshiftserverless_custom_domain_association
./resource.ps1 aws_redshiftserverless_endpoint_access
./resource.ps1 aws_redshiftserverless_namespace
./resource.ps1 aws_redshiftserverless_resource_policy
Expand Down Expand Up @@ -556,6 +578,9 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_schemas_schema
./resource.ps1 aws_securityhub_account
./resource.ps1 aws_securityhub_action_target
./resource.ps1 aws_securityhub_automation_rule
./resource.ps1 aws_securityhub_configuration_policy
./resource.ps1 aws_securityhub_configuration_policy_association
./resource.ps1 aws_securityhub_finding_aggregator
./resource.ps1 aws_securityhub_insight
./resource.ps1 aws_securityhub_invite_accepter
Expand All @@ -566,14 +591,18 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_securityhub_standards_control
./resource.ps1 aws_securityhub_standards_subscription
./resource.ps1 aws_securitylake_aws_log_source
./resource.ps1 aws_securitylake_custom_log_source
./resource.ps1 aws_securitylake_data_lake
./resource.ps1 aws_securitylake_subscriber
./resource.ps1 aws_securitylake_subscriber_notification
./resource.ps1 aws_serverlessapplicationrepository_cloudformation_stack
./resource.ps1 aws_service_discovery_http_namespace
./resource.ps1 aws_service_discovery_instance
./resource.ps1 aws_service_discovery_private_dns_namespace
./resource.ps1 aws_service_discovery_public_dns_namespace
./resource.ps1 aws_service_discovery_service
./resource.ps1 aws_servicecatalog_provisioning_artifact
./resource.ps1 aws_servicecatalogappregistry_application
./resource.ps1 aws_ses_active_receipt_rule_set
./resource.ps1 aws_ses_configuration_set
./resource.ps1 aws_ses_email_identity
Expand All @@ -593,6 +622,7 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_shield_application_layer_automatic_response
./resource.ps1 aws_shield_drt_access_log_bucket_association
./resource.ps1 aws_shield_drt_access_role_arn_association
./resource.ps1 aws_shield_proactive_engagement
./resource.ps1 aws_shield_protection
./resource.ps1 aws_shield_protection_group
./resource.ps1 aws_shield_protection_health_check_association
Expand Down Expand Up @@ -665,3 +695,13 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_worklink_website_certificate_authority_association
./resource.ps1 aws_workspaces_connection_alias
./resource.ps1 aws_workspaces_ip_group
./resource.ps1 aws_apprunner_hosted_zone_id -type data
./resource.ps1 aws_batch_job_definition -type data
./resource.ps1 aws_cognito_user_group -type data
./resource.ps1 aws_cognito_user_groups -type data
./resource.ps1 aws_db_parameter_group -type data
./resource.ps1 aws_medialive_input -type data
./resource.ps1 aws_redshift_data_shares -type data
./resource.ps1 aws_redshift_producer_data_shares -type data
./resource.ps1 aws_resourceexplorer2_search -type data
./resource.ps1 aws_servicecatalogappregistry_application -type data
30 changes: 25 additions & 5 deletions src/coverage/azure.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# todo azure

Resource percentage coverage 5.07
Datasource percentage coverage 39.62
Resource percentage coverage 4.99
Datasource percentage coverage 39.25

./resource.ps1 azurerm_aadb2c_directory
./resource.ps1 azurerm_active_directory_domain_service
Expand Down Expand Up @@ -168,6 +168,8 @@ Datasource percentage coverage 39.62
./resource.ps1 azurerm_cdn_frontdoor_secret
./resource.ps1 azurerm_cdn_frontdoor_security_policy
./resource.ps1 azurerm_cdn_profile
./resource.ps1 azurerm_chaos_studio_capability
./resource.ps1 azurerm_chaos_studio_experiment
./resource.ps1 azurerm_chaos_studio_target
./resource.ps1 azurerm_cognitive_account_customer_managed_key
./resource.ps1 azurerm_cognitive_deployment
Expand All @@ -177,6 +179,7 @@ Datasource percentage coverage 39.62
./resource.ps1 azurerm_consumption_budget_resource_group
./resource.ps1 azurerm_consumption_budget_subscription
./resource.ps1 azurerm_container_app
./resource.ps1 azurerm_container_app_custom_domain
./resource.ps1 azurerm_container_app_environment
./resource.ps1 azurerm_container_app_environment_certificate
./resource.ps1 azurerm_container_app_environment_dapr_component
Expand Down Expand Up @@ -271,9 +274,11 @@ Datasource percentage coverage 39.62
./resource.ps1 azurerm_data_factory_trigger_tumbling_window
./resource.ps1 azurerm_data_protection_backup_instance_blob_storage
./resource.ps1 azurerm_data_protection_backup_instance_disk
./resource.ps1 azurerm_data_protection_backup_instance_kubernetes_cluster
./resource.ps1 azurerm_data_protection_backup_instance_postgresql
./resource.ps1 azurerm_data_protection_backup_policy_blob_storage
./resource.ps1 azurerm_data_protection_backup_policy_disk
./resource.ps1 azurerm_data_protection_backup_policy_kubernetes_cluster
./resource.ps1 azurerm_data_protection_backup_policy_postgresql
./resource.ps1 azurerm_data_protection_backup_vault
./resource.ps1 azurerm_data_protection_resource_guard
Expand All @@ -298,6 +303,8 @@ Datasource percentage coverage 39.62
./resource.ps1 azurerm_dedicated_host
./resource.ps1 azurerm_dedicated_host_group
./resource.ps1 azurerm_dev_center
./resource.ps1 azurerm_dev_center_catalog
./resource.ps1 azurerm_dev_center_gallery
./resource.ps1 azurerm_dev_center_project
./resource.ps1 azurerm_digital_twins_endpoint_eventgrid
./resource.ps1 azurerm_digital_twins_endpoint_eventhub
Expand All @@ -316,11 +323,11 @@ Datasource percentage coverage 39.62
./resource.ps1 azurerm_dns_mx_record
./resource.ps1 azurerm_dns_ns_record
./resource.ps1 azurerm_dns_ptr_record
./resource.ps1 azurerm_dns_soa_record
./resource.ps1 azurerm_dns_srv_record
./resource.ps1 azurerm_dns_txt_record
./resource.ps1 azurerm_elastic_cloud_elasticsearch
./resource.ps1 azurerm_elastic_san
./resource.ps1 azurerm_elastic_san_volume
./resource.ps1 azurerm_elastic_san_volume_group
./resource.ps1 azurerm_email_communication_service
./resource.ps1 azurerm_eventgrid_domain
Expand Down Expand Up @@ -397,6 +404,7 @@ Datasource percentage coverage 39.62
./resource.ps1 azurerm_iot_time_series_insights_standard_environment
./resource.ps1 azurerm_iotcentral_application
./resource.ps1 azurerm_iotcentral_application_network_rule_set
./resource.ps1 azurerm_iotcentral_organization
./resource.ps1 azurerm_iothub
./resource.ps1 azurerm_iothub_certificate
./resource.ps1 azurerm_iothub_consumer_group
Expand Down Expand Up @@ -431,6 +439,8 @@ Datasource percentage coverage 39.62
./resource.ps1 azurerm_kubernetes_cluster_node_pool
./resource.ps1 azurerm_kubernetes_cluster_trusted_access_role_binding
./resource.ps1 azurerm_kubernetes_fleet_manager
./resource.ps1 azurerm_kubernetes_fleet_member
./resource.ps1 azurerm_kubernetes_fleet_update_run
./resource.ps1 azurerm_kubernetes_fleet_update_strategy
./resource.ps1 azurerm_kubernetes_flux_configuration
./resource.ps1 azurerm_kusto_attached_database_configuration
Expand Down Expand Up @@ -643,7 +653,6 @@ Datasource percentage coverage 39.62
./resource.ps1 azurerm_new_relic_monitor
./resource.ps1 azurerm_new_relic_tag_rule
./resource.ps1 azurerm_nginx_certificate
./resource.ps1 azurerm_nginx_configuration
./resource.ps1 azurerm_nginx_deployment
./resource.ps1 azurerm_notification_hub
./resource.ps1 azurerm_notification_hub_authorization_rule
Expand Down Expand Up @@ -823,6 +832,7 @@ Datasource percentage coverage 39.62
./resource.ps1 azurerm_spring_cloud_api_portal_custom_domain
./resource.ps1 azurerm_spring_cloud_app
./resource.ps1 azurerm_spring_cloud_app_cosmosdb_association
./resource.ps1 azurerm_spring_cloud_app_dynamics_application_performance_monitoring
./resource.ps1 azurerm_spring_cloud_app_mysql_association
./resource.ps1 azurerm_spring_cloud_app_redis_association
./resource.ps1 azurerm_spring_cloud_application_insights_application_performance_monitoring
Expand Down Expand Up @@ -861,6 +871,9 @@ Datasource percentage coverage 39.62
./resource.ps1 azurerm_stack_hci_cluster
./resource.ps1 azurerm_static_site
./resource.ps1 azurerm_static_site_custom_domain
./resource.ps1 azurerm_static_web_app
./resource.ps1 azurerm_static_web_app_custom_domain
./resource.ps1 azurerm_static_web_app_function_app_registration
./resource.ps1 azurerm_storage_account_local_user
./resource.ps1 azurerm_storage_blob
./resource.ps1 azurerm_storage_blob_inventory_policy
Expand Down Expand Up @@ -937,6 +950,8 @@ Datasource percentage coverage 39.62
./resource.ps1 azurerm_synapse_workspace_security_alert_policy
./resource.ps1 azurerm_synapse_workspace_sql_aad_admin
./resource.ps1 azurerm_synapse_workspace_vulnerability_assessment
./resource.ps1 azurerm_system_center_virtual_machine_manager_availability_set
./resource.ps1 azurerm_system_center_virtual_machine_manager_server
./resource.ps1 azurerm_template_deployment
./resource.ps1 azurerm_tenant_template_deployment
./resource.ps1 azurerm_traffic_manager_azure_endpoint
Expand Down Expand Up @@ -995,6 +1010,8 @@ Datasource percentage coverage 39.62
./resource.ps1 azurerm_windows_function_app_slot
./resource.ps1 azurerm_windows_web_app
./resource.ps1 azurerm_windows_web_app_slot
./resource.ps1 azurerm_workloads_sap_single_node_virtual_instance
./resource.ps1 azurerm_workloads_sap_three_tier_virtual_instance
./resource.ps1 azurerm_aadb2c_directory -type data
./resource.ps1 azurerm_active_directory_domain_service -type data
./resource.ps1 azurerm_advisor_recommendations -type data
Expand Down Expand Up @@ -1044,6 +1061,7 @@ Datasource percentage coverage 39.62
./resource.ps1 azurerm_data_share_dataset_kusto_database -type data
./resource.ps1 azurerm_database_migration_project -type data
./resource.ps1 azurerm_database_migration_service -type data
./resource.ps1 azurerm_databricks_access_connector -type data
./resource.ps1 azurerm_databricks_workspace -type data
./resource.ps1 azurerm_databricks_workspace_private_endpoint_connection -type data
./resource.ps1 azurerm_dedicated_host -type data
Expand Down Expand Up @@ -1148,7 +1166,6 @@ Datasource percentage coverage 39.62
./resource.ps1 azurerm_network_security_group -type data
./resource.ps1 azurerm_network_service_tags -type data
./resource.ps1 azurerm_nginx_certificate -type data
./resource.ps1 azurerm_nginx_configuration -type data
./resource.ps1 azurerm_nginx_deployment -type data
./resource.ps1 azurerm_notification_hub -type data
./resource.ps1 azurerm_notification_hub_namespace -type data
Expand Down Expand Up @@ -1186,4 +1203,7 @@ Datasource percentage coverage 39.62
./resource.ps1 azurerm_recovery_services_vault -type data
./resource.ps1 azurerm_sentinel_alert_rule_anomaly -type data
./resource.ps1 azurerm_servicebus_topic_authorization_rule -type data
./resource.ps1 azurerm_static_web_app -type data
./resource.ps1 azurerm_system_center_virtual_machine_manager_inventory_items -type data
./resource.ps1 azurerm_virtual_desktop_application_group -type data
./resource.ps1 azurerm_virtual_desktop_workspace -type data
Loading

0 comments on commit cbcf86e

Please sign in to comment.