Skip to content

Commit

Permalink
more datasources
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWoolfenden committed Feb 12, 2023
1 parent e96d53f commit 5b1848c
Show file tree
Hide file tree
Showing 39 changed files with 340 additions and 27 deletions.
18 changes: 18 additions & 0 deletions src/aws_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,24 @@ func GetAWSDataPermissions(result ResourceV2) ([]string, error) {
"aws_codecommit_approval_rule_template": dataAwsCodecommitApprovalRuleTemplate,
"aws_codecommit_repository": dataAwsCodecommitRepository,
"aws_codestarconnections_connection": dataAwsCodestarconnectionsConnection,
"aws_batch_compute_environment": dataAwsBatchComputeEnvironment,
"aws_batch_job_queue": dataAwsBatchJobQueue,
"aws_batch_scheduling_policy": dataAwsBatchSchedulingPolicy,
"aws_ce_cost_category": dataAwsCeCostCategory,
"aws_ce_tags": dataAwsCeTags,
"aws_cloudcontrolapi_resource": dataAwsCloudcontrolapiResource,
"aws_cloudfront_cache_policy": dataAwsCloudfrontCachePolicy,
"aws_cloudfront_distribution": dataAwsCloudfrontDistribution,
"aws_cloudfront_function": dataAwsCloudfrontFunction,
"aws_cloudfront_log_delivery_canonical_user_id": placeholder,
"aws_cloudfront_origin_access_identities": dataAwsCloudfrontOriginAccessIdentities,
"aws_cloudfront_origin_access_identity": dataAwsCloudfrontOriginAccessIdentity,
"aws_cloudfront_origin_request_policy": dataAwsCloudfrontOriginRequestPolicy,
"aws_cloudfront_realtime_log_config": dataAwsCloudfrontRealtimeLogConfig,
"aws_cloudfront_response_headers_policy": dataAwsCloudfrontResponseHeadersPolicy,
"aws_service_discovery_dns_namespace": dataAwsServiceDiscoveryDNSNamespace,
"aws_service_discovery_http_namespace": dataAwsServiceDiscoveryHTTPNamespace,
"aws_service_discovery_service": dataAwsServiceDiscoveryService,
}

var Permissions []string
Expand Down
51 changes: 51 additions & 0 deletions src/files_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,3 +438,54 @@ var dataAwsCodecommitRepository []byte

//go:embed mapping/aws/data/codestar-connections/aws_codestarconnections_connection.json
var dataAwsCodestarconnectionsConnection []byte

//go:embed mapping/aws/data/batch/aws_batch_compute_environment.json
var dataAwsBatchComputeEnvironment []byte

//go:embed mapping/aws/data/batch/aws_batch_job_queue.json
var dataAwsBatchJobQueue []byte

//go:embed mapping/aws/data/batch/aws_batch_scheduling_policy.json
var dataAwsBatchSchedulingPolicy []byte

//go:embed mapping/aws/data/ce/aws_ce_cost_category.json
var dataAwsCeCostCategory []byte

//go:embed mapping/aws/data/ce/aws_ce_tags.json
var dataAwsCeTags []byte

//go:embed mapping/aws/data/cloudformation/aws_cloudcontrolapi_resource.json
var dataAwsCloudcontrolapiResource []byte

//go:embed mapping/aws/data/cloudfront/aws_cloudfront_cache_policy.json
var dataAwsCloudfrontCachePolicy []byte

//go:embed mapping/aws/data/cloudfront/aws_cloudfront_distribution.json
var dataAwsCloudfrontDistribution []byte

//go:embed mapping/aws/data/cloudfront/aws_cloudfront_function.json
var dataAwsCloudfrontFunction []byte

//go:embed mapping/aws/data/cloudfront/aws_cloudfront_origin_access_identities.json
var dataAwsCloudfrontOriginAccessIdentities []byte

//go:embed mapping/aws/data/cloudfront/aws_cloudfront_origin_access_identity.json
var dataAwsCloudfrontOriginAccessIdentity []byte

//go:embed mapping/aws/data/cloudfront/aws_cloudfront_origin_request_policy.json
var dataAwsCloudfrontOriginRequestPolicy []byte

//go:embed mapping/aws/data/cloudfront/aws_cloudfront_realtime_log_config.json
var dataAwsCloudfrontRealtimeLogConfig []byte

//go:embed mapping/aws/data/cloudfront/aws_cloudfront_response_headers_policy.json
var dataAwsCloudfrontResponseHeadersPolicy []byte

//go:embed mapping/aws/data/servicediscovery/aws_service_discovery_dns_namespace.json
var dataAwsServiceDiscoveryDNSNamespace []byte

//go:embed mapping/aws/data/servicediscovery/aws_service_discovery_http_namespace.json
var dataAwsServiceDiscoveryHTTPNamespace []byte

//go:embed mapping/aws/data/servicediscovery/aws_service_discovery_service.json
var dataAwsServiceDiscoveryService []byte
13 changes: 13 additions & 0 deletions src/mapping/aws/data/batch/aws_batch_compute_environment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"batch:DescribeComputeEnvironments"
]
}
]
13 changes: 13 additions & 0 deletions src/mapping/aws/data/batch/aws_batch_job_queue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"batch:DescribeJobQueues"
]
}
]
13 changes: 13 additions & 0 deletions src/mapping/aws/data/batch/aws_batch_scheduling_policy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"batch:DescribeSchedulingPolicies"
]
}
]
13 changes: 13 additions & 0 deletions src/mapping/aws/data/ce/aws_ce_cost_category.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"ce:DescribeCostCategoryDefinition"
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"destroy": [],
"modify": [],
"plan": [
"iam:ListRoles"
"ce:GetTags"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"cloudformation:GetResource"
]
}
]
13 changes: 13 additions & 0 deletions src/mapping/aws/data/cloudfront/aws_cloudfront_cache_policy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"cloudfront:ListCachePolicies"
]
}
]
13 changes: 13 additions & 0 deletions src/mapping/aws/data/cloudfront/aws_cloudfront_distribution.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"cloudfront:GetDistribution"
]
}
]
13 changes: 13 additions & 0 deletions src/mapping/aws/data/cloudfront/aws_cloudfront_function.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"cloudfront:DescribeFunction"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"cloudfront:ListCloudFrontOriginAccessIdentities"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"cloudfront:GetCloudFrontOriginAccessIdentity"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"cloudfront:ListOriginRequestPolicies"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"cloudfront:GetRealtimeLogConfig"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"cloudfront:ListResponseHeadersPolicies"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"servicediscovery:ListNamespaces"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"servicediscovery:ListNamespaces"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": [
"servicediscovery:ListServices"
]
}
]
3 changes: 3 additions & 0 deletions terraform/aws/backup/data.aws_batch_compute_environment.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "aws_batch_compute_environment" "pike" {
compute_environment_name = "pike"
}
3 changes: 3 additions & 0 deletions terraform/aws/backup/data.aws_batch_job_queue.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "aws_batch_job_queue" "pike" {
name = "pike"
}
3 changes: 3 additions & 0 deletions terraform/aws/backup/data.aws_batch_scheduling_policy.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "aws_batch_scheduling_policy" "pike" {
arn = "arn:aws:batch:us-east-1:680235478471:scheduling-policy/pike"
}
3 changes: 3 additions & 0 deletions terraform/aws/backup/data.aws_ce_cost_category.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "aws_ce_cost_category" "pike" {
cost_category_arn = "costCategoryARNbutlonger"
}
6 changes: 6 additions & 0 deletions terraform/aws/backup/data.aws_ce_tags.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
data "aws_ce_tags" "pike" {
time_period {
start = "2021-01-01"
end = "2022-12-01"
}
}
4 changes: 4 additions & 0 deletions terraform/aws/backup/data.aws_cloudcontrolapi_resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "aws_cloudcontrolapi_resource" "pike" {
identifier = "pike"
type_name = "AWS::ECS::Cluster"
}
3 changes: 3 additions & 0 deletions terraform/aws/backup/data.aws_cloudfront_cache_policy.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "aws_cloudfront_cache_policy" "pike" {
name = "pike"
}
3 changes: 3 additions & 0 deletions terraform/aws/backup/data.aws_cloudfront_distribution.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "aws_cloudfront_distribution" "pike" {
id = "pike"
}
4 changes: 4 additions & 0 deletions terraform/aws/backup/data.aws_cloudfront_function.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "aws_cloudfront_function" "pike" {
name = "pike"
stage = "DEVELOPMENT"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
data "aws_cloudfront_log_delivery_canonical_user_id" "pike" {}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
data "aws_cloudfront_origin_access_identities" "pike" {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "aws_cloudfront_origin_access_identity" "pike" {
id = "pike"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "aws_cloudfront_origin_request_policy" "pike" {
name = "pike"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "aws_cloudfront_realtime_log_config" "pike" {
name = "pike"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "aws_cloudfront_response_headers_policy" "pike" {
name = "pike"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "aws_service_discovery_dns_namespace" "pike" {
name = "example.terraform.local"
type = "DNS_PRIVATE"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "aws_service_discovery_http_namespace" "pike" {
name = "development"
}
4 changes: 4 additions & 0 deletions terraform/aws/backup/data.aws_service_discovery_service.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "aws_service_discovery_service" "pike" {
name = "example"
namespace_id = "NAMESPACE_ID_VALUE"
}
Loading

0 comments on commit 5b1848c

Please sign in to comment.