Skip to content

Commit 7fc08f9

Browse files
authored
feat(aws): add encryption fields and DAX/AppSync resources for finops policies (#67)
1 parent e3b59de commit 7fc08f9

10 files changed

Lines changed: 48 additions & 8 deletions

File tree

pkg/tree/aws/appsync/api_cache.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package appsync
2+
3+
import (
4+
"github.com/infracost/go-proto/pkg/tree/resource"
5+
"github.com/infracost/go-proto/pkg/tree/value"
6+
)
7+
8+
type APICache struct {
9+
resource.Resource `tree:"-"`
10+
AtRestEncryptionEnabled value.Bool `tree:"at_rest_encryption_enabled"`
11+
TransitEncryptionEnabled value.Bool `tree:"transit_encryption_enabled"`
12+
}

pkg/tree/aws/appsync/appsync.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package appsync
2+
3+
type AppSync struct {
4+
APICaches []APICache `tree:"api_caches"`
5+
}

pkg/tree/aws/aws.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/infracost/go-proto/pkg/tree/aws/apigateway"
99
"github.com/infracost/go-proto/pkg/tree/aws/apigatewayv2"
1010
"github.com/infracost/go-proto/pkg/tree/aws/appautoscaling"
11+
"github.com/infracost/go-proto/pkg/tree/aws/appsync"
1112
"github.com/infracost/go-proto/pkg/tree/aws/backup"
1213
"github.com/infracost/go-proto/pkg/tree/aws/batch"
1314
"github.com/infracost/go-proto/pkg/tree/aws/cloudformation"
@@ -69,6 +70,7 @@ type AWS struct {
6970
APIGateway apigateway.APIGateway `tree:"apigateway"`
7071
APIGatewayV2 apigatewayv2.APIGatewayV2 `tree:"apigatewayv2"`
7172
AppAutoScaling appautoscaling.AppAutoScaling `tree:"appautoscaling"`
73+
AppSync appsync.AppSync `tree:"appsync"`
7274
Backup backup.Backup `tree:"backup"`
7375
Batch batch.Batch `tree:"batch"`
7476
CloudFormation cloudformation.CloudFormation `tree:"cloudformation"`

pkg/tree/aws/backup/vault.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package backup
22

3-
import "github.com/infracost/go-proto/pkg/tree/resource"
3+
import (
4+
"github.com/infracost/go-proto/pkg/tree/resource"
5+
"github.com/infracost/go-proto/pkg/tree/value"
6+
)
47

58
type Vault struct {
69
resource.Resource `tree:"-"`
10+
KmsKeyArn value.String `tree:"kms_key_arn"`
711
}

pkg/tree/aws/docdb/cluster.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ import (
77

88
type Cluster struct {
99
resource.Resource `tree:"-"`
10-
BackupRetentionPeriod value.Int `tree:"backup_retention_period"`
10+
BackupRetentionPeriod value.Int `tree:"backup_retention_period"`
11+
StorageEncrypted value.Bool `tree:"storage_encrypted"`
1112
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package dynamodb
2+
3+
import (
4+
"github.com/infracost/go-proto/pkg/tree/resource"
5+
"github.com/infracost/go-proto/pkg/tree/value"
6+
)
7+
8+
type DAXCluster struct {
9+
resource.Resource `tree:"-"`
10+
ClusterEndpointEncryptionType value.String `tree:"cluster_endpoint_encryption_type"`
11+
ServerSideEncryptionEnabled value.Bool `tree:"server_side_encryption_enabled"`
12+
}

pkg/tree/aws/dynamodb/dynamodb.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dynamodb
22

33
type DynamoDB struct {
4-
Tables []Table `tree:"tables"`
4+
Tables []Table `tree:"tables"`
5+
DAXClusters []DAXCluster `tree:"dax_clusters"`
56
}

pkg/tree/aws/ec2/ebs_volume.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type EBSVolume struct {
1212
SizeGB value.Int `tree:"size"`
1313
ThroughputMiBperS value.Int `tree:"throughput"`
1414
MultiAttach value.Bool `tree:"multi_attach"`
15+
Encrypted value.Bool `tree:"encrypted"`
1516
}
1617

1718
type EBSVolumeType uint32

pkg/tree/aws/neptune/cluster.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ import (
66
)
77

88
type Cluster struct {
9-
resource.Resource `tree:"-"`
10-
Identifier value.String `tree:"identifier"`
11-
BackupRetentionPeriod value.Int `tree:"backup_retention_period"`
12-
StorageType value.Value[NeptuneStorageType] `tree:"storage_type"`
13-
EnableCloudwatchLogsExports value.List[string] `tree:"enable_cloudwatch_logs_exports"`
9+
resource.Resource `tree:"-"`
10+
Identifier value.String `tree:"identifier"`
11+
BackupRetentionPeriod value.Int `tree:"backup_retention_period"`
12+
StorageType value.Value[NeptuneStorageType] `tree:"storage_type"`
13+
EnableCloudwatchLogsExports value.List[string] `tree:"enable_cloudwatch_logs_exports"`
14+
StorageEncrypted value.Bool `tree:"storage_encrypted"`
1415
}
1516

1617
type NeptuneStorageType uint32

pkg/tree/aws/redshift/cluster.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ type Cluster struct {
99
resource.Resource `tree:"-"`
1010
NodeType value.String `tree:"node_type"`
1111
NumberOfNodes value.Int `tree:"number_of_nodes"`
12+
Encrypted value.Bool `tree:"encrypted"`
1213
}

0 commit comments

Comments
 (0)