Skip to content

Commit

Permalink
update aws datasources
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWoolfenden committed Jan 13, 2025
1 parent 178ab5d commit 6016c28
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 7 deletions.
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@3096afedf9873361b2b2f65e1445b13272c83eb8 # codeql-bundle-v2.20.0
uses: github/codeql-action/init@3407610120cd5656b6fc71991415cb50748b9489 # codeql-bundle-v2.20.1
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@3096afedf9873361b2b2f65e1445b13272c83eb8 # codeql-bundle-v2.20.0
uses: github/codeql-action/autobuild@3407610120cd5656b6fc71991415cb50748b9489 # codeql-bundle-v2.20.1

# ℹ️ 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@3096afedf9873361b2b2f65e1445b13272c83eb8 # codeql-bundle-v2.20.0
uses: github/codeql-action/analyze@3407610120cd5656b6fc71991415cb50748b9489 # codeql-bundle-v2.20.1
3 changes: 3 additions & 0 deletions src/aws_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,9 @@ var tFLookupDataAWS = map[string]interface{}{
"aws_spot_datafeed_subscription": dataAwsSpotDatafeedSubscription,
"aws_servicecatalogappregistry_attribute_group": dataServicecatalogappregistryAttributeGroup,
"aws_servicecatalogappregistry_attribute_group_associations": dataServicecatalogappregistryAttributeGroupAssociations,
"aws_route53_records": dataAwsRoute53Records,
"aws_cloudwatch_event_buses": dataAwsCloudwatchEventBuses,
"aws_ecs_clusters": dataAwsEcsClusters,
}

// GetAWSDataPermissions gets permissions required for datasource's.
Expand Down
13 changes: 9 additions & 4 deletions src/coverage/aws.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# todo aws

Resource percentage coverage 72.68
Datasource percentage coverage 99.65
Resource percentage coverage 72.33
Datasource percentage coverage 99.47

./resource.ps1 aws_amplify_backend_environment
./resource.ps1 aws_amplify_webhook
Expand Down Expand Up @@ -38,7 +38,9 @@ Datasource percentage coverage 99.65
./resource.ps1 aws_bedrock_guardrail
./resource.ps1 aws_bedrock_guardrail_version
./resource.ps1 aws_bedrock_inference_profile
./resource.ps1 aws_bedrockagent_agent_collaborator
./resource.ps1 aws_bedrockagent_agent_knowledge_base_association
./resource.ps1 aws_cleanrooms_membership
./resource.ps1 aws_cloud9_environment_membership
./resource.ps1 aws_cloudcontrolapi_resource
./resource.ps1 aws_cloudformation_stack_instances
Expand All @@ -47,6 +49,10 @@ Datasource percentage coverage 99.65
./resource.ps1 aws_cloudhsm_v2_hsm
./resource.ps1 aws_cloudtrail_organization_delegated_admin_account
./resource.ps1 aws_cloudwatch_log_anomaly_detector
./resource.ps1 aws_cloudwatch_log_delivery
./resource.ps1 aws_cloudwatch_log_delivery_destination
./resource.ps1 aws_cloudwatch_log_delivery_destination_policy
./resource.ps1 aws_cloudwatch_log_delivery_source
./resource.ps1 aws_cloudwatch_log_index_policy
./resource.ps1 aws_codebuild_fleet
./resource.ps1 aws_codeconnections_connection
Expand Down Expand Up @@ -400,8 +406,7 @@ Datasource percentage coverage 99.65
./resource.ps1 aws_vpc_ipv6_cidr_block_association
./resource.ps1 aws_vpc_network_performance_metric_subscription
./resource.ps1 aws_vpc_security_group_vpc_association
./resource.ps1 aws_vpclattice_resource_gateway
./resource.ps1 aws_wafregional_web_acl_association
./resource.ps1 aws_worklink_fleet
./resource.ps1 aws_worklink_website_certificate_authority_association
./resource.ps1 aws_cloudwatch_event_buses -type data
./resource.ps1 aws_ecs_clusters -type data
9 changes: 9 additions & 0 deletions src/files_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -1542,3 +1542,12 @@ var dataServicecatalogappregistryAttributeGroup []byte

//go:embed mapping/aws/data/servicecatalog/aws_servicecatalogappregistry_attribute_group_associations.json
var dataServicecatalogappregistryAttributeGroupAssociations []byte

//go:embed mapping/aws/data/route53/aws_route53_records.json
var dataAwsRoute53Records []byte

//go:embed mapping/aws/data/cloudwatch/aws_cloudwatch_event_buses.json
var dataAwsCloudwatchEventBuses []byte

//go:embed mapping/aws/data/ecs/aws_ecs_clusters.json
var dataAwsEcsClusters []byte
13 changes: 13 additions & 0 deletions src/mapping/aws/data/cloudwatch/aws_cloudwatch_event_buses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"events:ListEventBuses"
]
}
]
13 changes: 13 additions & 0 deletions src/mapping/aws/data/ecs/aws_ecs_clusters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"ecs:ListClusters"
]
}
]
13 changes: 13 additions & 0 deletions src/mapping/aws/data/route53/aws_route53_records.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"route53:ListResourceRecordSets"
]
}
]
7 changes: 7 additions & 0 deletions terraform/aws/backup/data.aws_cloudwatch_event_buses.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "aws_cloudwatch_event_buses" "pike" {
name_prefix = "pike"
}

output "aws_cloudwatch_event_buses" {
value = data.aws_cloudwatch_event_buses.pike
}
6 changes: 6 additions & 0 deletions terraform/aws/backup/data.aws_ecs_clusters.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
data "aws_ecs_clusters" "pike" {
}

output "aws_ecs_clusters" {
value = data.aws_ecs_clusters.pike
}
7 changes: 7 additions & 0 deletions terraform/aws/backup/data.aws_route53_records.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "aws_route53_records" "pike" {
zone_id = "Z0613304D03LG1SU5BI"
}

output "aws_route53_records" {
value = data.aws_route53_records.pike
}
6 changes: 6 additions & 0 deletions terraform/aws/role/aws_iam_policy.basic.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ resource "aws_iam_policy" "basic" {
"Effect" : "Allow",
"Action" : [
"servicecatalog:GetAttributeGroup",

"route53:ListResourceRecordSets",

"events:ListEventBuses",

"ecs:ListClusters"
],
"Resource" : [
"*"
Expand Down

0 comments on commit 6016c28

Please sign in to comment.