Skip to content

Commit

Permalink
aws resources
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWoolfenden committed Jan 29, 2025
1 parent cf624b6 commit a0ae8e5
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 67 deletions.
3 changes: 3 additions & 0 deletions src/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,9 @@ var tFLookup = map[string]interface{}{ //nolint:gochecknoglobals
"aws_config_organization_custom_policy_rule": awsConfigOrganizationCustomPolicyRule,
"aws_config_organization_custom_rule": awsConfigOrganizationCustomRule,
"aws_config_retention_configuration": awsConfigRetentionConfiguration,
"aws_costoptimizationhub_enrollment_status": awsCostoptimizationhubEnrollmentStatus,
"aws_costoptimizationhub_preferences": awsCostoptimizationhubPreferences,
"aws_customerprofiles_profile": awsCustomerprofilesProfile,
}

// GetAWSPermissions for AWS resources.
Expand Down
4 changes: 0 additions & 4 deletions src/coverage/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ Resource percentage coverage 80.05
Datasource percentage coverage 100.00

./resource.ps1 aws_cognito_managed_user_pool_client
./resource.ps1 aws_connect_lambda_function_association
./resource.ps1 aws_costoptimizationhub_enrollment_status
./resource.ps1 aws_costoptimizationhub_preferences
./resource.ps1 aws_customerprofiles_profile
./resource.ps1 aws_dataexchange_data_set
./resource.ps1 aws_dataexchange_revision
./resource.ps1 aws_detective_member
Expand Down
9 changes: 9 additions & 0 deletions src/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -3381,3 +3381,12 @@ var awsConfigOrganizationCustomRule []byte

//go:embed mapping/aws/resource/config/aws_config_retention_configuration.json
var awsConfigRetentionConfiguration []byte

//go:embed mapping/aws/resource/cost-optimization-hub/aws_costoptimizationhub_enrollment_status.json
var awsCostoptimizationhubEnrollmentStatus []byte

//go:embed mapping/aws/resource/cost-optimization-hub/aws_costoptimizationhub_preferences.json
var awsCostoptimizationhubPreferences []byte

//go:embed mapping/aws/resource/profile/aws_customerprofiles_profile.json
var awsCustomerprofilesProfile []byte
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
"modify": [],
"plan": []
}
]
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"apply": [
"cost-optimization-hub:UpdateEnrollmentStatus",
"cost-optimization-hub:ListEnrollmentStatuses"
],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"apply": [
"cost-optimization-hub:GetPreferences",
"cost-optimization-hub:UpdatePreferences"
],
"attributes": {
"tags": []
},
"destroy": [],
"modify": [],
"plan": []
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"profile:CreateDomain",
"profile:DeleteDomain",
"profile:GetDomain",
"profile:UpdateDomain"
"profile:UpdateDomain",
"profile:ListTagsForResource"
],
"attributes": {
"tags": [
Expand Down
23 changes: 23 additions & 0 deletions src/mapping/aws/resource/profile/aws_customerprofiles_profile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
{
"apply": [
"profile:CreateProfile",
"profile:DeleteProfile",
"profile:UpdateProfile",
"profile:ListTagsForResource"
],
"attributes": {
"tags": [
"profile:UntagResource",
"profile:TagResource"
]
},
"destroy": [
"profile:DeleteProfile"
],
"modify": [
"profile:UpdateProfile"
],
"plan": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resource "aws_costoptimizationhub_enrollment_status" "pike" {}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resource "aws_costoptimizationhub_preferences" "pike" {}
3 changes: 3 additions & 0 deletions terraform/aws/backup/aws_customerprofiles_profile.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resource "aws_customerprofiles_profile" "pike" {
domain_name = "example"
}
64 changes: 3 additions & 61 deletions terraform/aws/role/aws_iam_policy.basic.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,67 +7,9 @@ resource "aws_iam_policy" "basic" {
"Sid" : "VisualEditor0",
"Effect" : "Allow",
"Action" : [

"config:DeleteConfigRule",
"config:DescribeComplianceByConfigRule",
"config:DescribeConfigRules",
"config:ListTagsForResource",
"config:PutConfigRule",
"dynamodb:DeleteItem",
"dynamodb:DescribeTable",
"dynamodb:GetItem",
"dynamodb:PutItem",
"ec2:DescribeAccountAttributes",
"ec2:DescribeImages",
"ec2:DescribeInstanceAttribute",
"ec2:DescribeInstanceCreditSpecifications",
"ec2:DescribeInstanceTypes",
"ec2:DescribeInstances",
"ec2:DescribeNetworkInterfaces",
"ec2:DescribeTags",
"ec2:DescribeVolumes",
"ec2:ModifyInstanceAttribute",
"ec2:RunInstances",
"ec2:StartInstances",
"ec2:StopInstances",
"ec2:TerminateInstances",
"logs:CreateLogGroup",
"logs:DeleteLogGroup",
"logs:DescribeLogGroups",
"logs:ListTagsLogGroup",
"s3:DeleteObject",
"s3:GetObject",
"s3:ListBucket",
"s3:PutObject",

# aws_cloudwatch_log_delivery_source
"logs:PutDeliverySource",
"logs:DeleteDeliverySource",

# aws_cloudwatch_log_group
"logs:ListTagsForResource",

# aws_cloudwatch_log_index_policy
"logs:PutIndexPolicy",
"logs:DeleteIndexPolicy",
"logs:DescribeIndexPolicies",

# aws_cloudwatch_log_delivery_destination
"logs:PutDeliveryDestination",
"logs:GetDeliveryDestination",
"logs:DescribeDeliveryDestinations",
"logs:DeleteDeliveryDestination",

# aws_cloudwatch_log_anomaly_detector
"logs:CreateLogAnomalyDetector",
"logs:GetLogAnomalyDetector",
"logs:DeleteLogAnomalyDetector",
"logs:UpdateLogAnomalyDetector",

# aws_cloudwatch_log_delivery_destination_policy
"logs:PutDeliveryDestinationPolicy",
"logs:GetDeliveryDestinationPolicy",
"logs:DeleteDeliveryDestinationPolicy"
"profile:CreateProfile",
"profile:DeleteProfile",
"profile:UpdateProfile"
],
"Resource" : [
"*"
Expand Down

0 comments on commit a0ae8e5

Please sign in to comment.