Skip to content

Commit

Permalink
location resources
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWoolfenden committed Dec 6, 2023
1 parent 3129d32 commit c050b96
Show file tree
Hide file tree
Showing 16 changed files with 164 additions and 39 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func main() {
},
{
Name: "remote",
Aliases: []string{"m"},
Aliases: []string{"o"},
Usage: "Create/Update the Policy and set credentials/secret for Github Action",
Flags: []cli.Flag{
&cli.StringFlag{
Expand Down Expand Up @@ -318,7 +318,7 @@ func main() {
},
{
Name: "pull",
Aliases: []string{"p"},
Aliases: []string{"l"},
Usage: "Clones remote repo and scans it using pike",
Flags: []cli.Flag{
&cli.StringFlag{
Expand Down
5 changes: 5 additions & 0 deletions src/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,11 @@ func AwsLookup(name string) interface{} {
"aws_vpc_ipam_scope": awsVpcIpamScope,
"aws_vpc_security_group_egress_rule": awsVpcSecurityGroupEgressRule,
"aws_vpc_security_group_ingress_rule": awsVpcSecurityGroupIngressRule,
"aws_location_geofence_collection": awsLocationGeofenceCollection,
"aws_location_map": awsLocationMap,
"aws_location_place_index": awsLocationPlaceIndex,
"aws_location_route_calculator": awsLocationRouteCalculator,
"aws_location_tracker": awsLocationTracker,
}

return TFLookup[name]
Expand Down
7 changes: 1 addition & 6 deletions src/coverage/aws.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# todo aws

Resource percentage coverage 40.22
Resource percentage coverage 41.38
Datasource percentage coverage 99.60

./resource.ps1 aws_accessanalyzer_analyzer
Expand Down Expand Up @@ -413,11 +413,6 @@ Datasource percentage coverage 99.60
./resource.ps1 aws_load_balancer_backend_server_policy
./resource.ps1 aws_load_balancer_listener_policy
./resource.ps1 aws_load_balancer_policy
./resource.ps1 aws_location_geofence_collection
./resource.ps1 aws_location_map
./resource.ps1 aws_location_place_index
./resource.ps1 aws_location_route_calculator
./resource.ps1 aws_location_tracker
./resource.ps1 aws_location_tracker_association
./resource.ps1 aws_macie2_account
./resource.ps1 aws_macie2_classification_export_configuration
Expand Down
15 changes: 15 additions & 0 deletions src/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -1443,3 +1443,18 @@ var awsVpcSecurityGroupEgressRule []byte

//go:embed mapping/aws/resource/ec2/aws_vpc_security_group_ingress_rule.json
var awsVpcSecurityGroupIngressRule []byte

//go:embed mapping/aws/resource/location/aws_location_geofence_collection.json
var awsLocationGeofenceCollection []byte

//go:embed mapping/aws/resource/location/aws_location_map.json
var awsLocationMap []byte

//go:embed mapping/aws/resource/location/aws_location_place_index.json
var awsLocationPlaceIndex []byte

//go:embed mapping/aws/resource/location/aws_location_route_calculator.json
var awsLocationRouteCalculator []byte

//go:embed mapping/aws/resource/location/aws_location_tracker.json
var awsLocationTracker []byte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
11 changes: 11 additions & 0 deletions src/mapping/aws/resource/location/aws_location_map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
11 changes: 11 additions & 0 deletions src/mapping/aws/resource/location/aws_location_place_index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
11 changes: 11 additions & 0 deletions src/mapping/aws/resource/location/aws_location_tracker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"apply": [],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
9 changes: 9 additions & 0 deletions terraform/aws/backup/aws_location_geofence_collection.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "aws_location_geofence_collection" "pike" {
collection_name = "pikey"
description = "pike"
kms_key_id = "arn:aws:kms:eu-west-2:680235478471:key/554dbedc-3cf9-4aec-b621-9c4387bed449"
tags = {
pike = "permissions"
# another="tag"
}
}
12 changes: 12 additions & 0 deletions terraform/aws/backup/aws_location_map.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource "aws_location_map" "pike" {
description = "pikey"
configuration {
style = "VectorHereBerlin"
}

map_name = "pike"
tags = {
pike = "permissions"
# another="tag"
}
}
14 changes: 14 additions & 0 deletions terraform/aws/backup/aws_location_place_index.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resource "aws_location_place_index" "pike" {
data_source = "Esri"
index_name = "pike"

data_source_configuration {
intended_use = "SingleUse"
}

description = "pikey"
tags = {
pike = "permissions"
# another="tag"
}
}
9 changes: 9 additions & 0 deletions terraform/aws/backup/aws_location_route_calculator.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "aws_location_route_calculator" "pike" {
calculator_name = "pike"
data_source = "Esri"
description = "pikey"
tags = {
pike = "permissions"
# another="tag"
}
}
3 changes: 3 additions & 0 deletions terraform/aws/backup/aws_location_tracker.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resource "aws_location_tracker" "pike" {
tracker_name = "pike"
}
4 changes: 4 additions & 0 deletions terraform/aws/duff/aws_location_tracker_association.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#resource "aws_location_tracker_association" "pike" {
# consumer_arn = aws_location_geofence_collection.pike.collection_arn
# tracker_name = aws_location_tracker.pike.tracker_name
#}
66 changes: 35 additions & 31 deletions terraform/aws/role/aws_iam_policy.basic.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,46 @@ resource "aws_iam_policy" "basic" {
"Sid" : "0",
"Effect" : "Allow",
"Action" : [
//dependson
"ec2:CreateSecurityGroup",
"ec2:DescribeSecurityGroups",
"ec2:DescribeNetworkInterfaces",
"ec2:DeleteSecurityGroup",
//aws_location_tracker
"geo:CreateTracker",
"geo:DescribeTracker",
"geo:DeleteTracker",

//aws_vpc_ipam
"ec2:CreateIpam",
"ec2:ModifyIpam",
"iam:CreateServiceLinkedRole",
"ec2:DescribeIpams",
"ec2:DeleteIpam",
"ec2:CreateTags",
"ec2:DeleteTags",
"ec2:DescribeTags",
//aws_location_route_calculator
"geo:TagResource",
"geo:UntagResource",
"geo:CreateRouteCalculator",
"geo:DescribeRouteCalculator",
"geo:ListTagsForResource",
"geo:DeleteRouteCalculator",
"geo:UpdateRouteCalculator",

//aws_vpc_ipam_pool
"ec2:CreateIpamPool",
"ec2:DescribeIpamPools",
"ec2:DeleteIpamPool",
"ec2:CreateTags",
"ec2:DeleteTags",
"ec2:ModifyIpamPool",
//aws_location_map
"geo:TagResource",
"geo:UntagResource",
"geo:CreateMap",
"geo:DescribeMap",
"geo:DescribeMap",
"geo:DeleteMap",
"geo:UpdateMap",

//aws_vpc_ipam_pool_cidr
"ec2:ProvisionIpamPoolCidr",
"ec2:GetIpamPoolCidrs",
//aws_location_geofence_collection
"geo:TagResource",
"geo:UntagResource",
"geo:CreateGeofenceCollection",
"kms:DescribeKey",
"kms:CreateGrant",
"geo:DescribeGeofenceCollection",
"geo:DeleteGeofenceCollection",

//aws_vpc_ipam_preview_next_cidr
"ec2:AllocateIpamPoolCidr",
//aws_location_place_index
"geo:TagResource",
"geo:CreatePlaceIndex",
"geo:DescribePlaceIndex",
"geo:DeletePlaceIndex",
"geo:UntagResource",
"geo:UpdatePlaceIndex",

//aws_vpc_ipam_pool_cidr_allocation
"ec2:AllocateIpamPoolCidr",
"ec2:GetIpamPoolAllocations",
"ec2:ReleaseIpamPoolAllocation",
"ec2:DeprovisionIpamPoolCidr",
],
"Resource" : "*",
}
Expand Down

0 comments on commit c050b96

Please sign in to comment.