Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/tree/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/infracost/go-proto/pkg/tree/aws/apigateway"
"github.com/infracost/go-proto/pkg/tree/aws/apigatewayv2"
"github.com/infracost/go-proto/pkg/tree/aws/appautoscaling"
"github.com/infracost/go-proto/pkg/tree/aws/cloudfront"
"github.com/infracost/go-proto/pkg/tree/aws/ec2"
)

Expand All @@ -16,6 +17,7 @@ type AWS struct {
APIGateway apigateway.APIGateway `tree:"apigateway"`
APIGatewayV2 apigatewayv2.APIGatewayV2 `tree:"apigatewayv2"`
AppAutoScaling appautoscaling.AppAutoScaling `tree:"appautoscaling"`
CloudFront cloudfront.CloudFront `tree:"cloudfront"`
}

func (aws *AWS) PostProcess() {
Expand Down
6 changes: 6 additions & 0 deletions pkg/tree/aws/cloudfront/cloudfront.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package cloudfront

type CloudFront struct {
Distributions []Distribution `tree:"distributions"`
Functions []Function `tree:"functions"`
}
61 changes: 61 additions & 0 deletions pkg/tree/aws/cloudfront/distribution.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package cloudfront

import (
"github.com/infracost/go-proto/pkg/tree/resource"
"github.com/infracost/go-proto/pkg/tree/value"
)

type Distribution struct {
resource.Resource `tree:"-"`
DefaultRootObject value.String `tree:"default_root_object"`
WebACLID value.String `tree:"web_acl_id"`
Origins []Origin `tree:"origins"`
DefaultCacheBehaviour CacheBehaviour `tree:"default_cache_behaviour"`
OrderedCacheBehaviours []CacheBehaviour `tree:"ordered_cache_behaviours"`
LoggingConfig *LoggingConfig `tree:"logging_config"`
ViwerCertificate ViewerCertificate `tree:"viewer_certificate"`
}

type ViewerProtocolPolicy uint32

const (
ViewerProtocolPolicyAllowAll ViewerProtocolPolicy = iota
ViewerProtocolPolicyHTTPSOnly
ViewerProtocolPolicyRedirectToHTTPS
)

type SSLSupportMethod uint32

const (
SSLSupportMethodSniOnly SSLSupportMethod = iota
SSLSupportMethodVip
SSLSupportMethodStaticIP
)

type Origin struct {
DomainName value.String `tree:"domain_name"`
S3OriginConfig *S3OriginConfig `tree:"s3_origin_config"`
OriginShield *OriginShield `tree:"origin_shield"`
}

type S3OriginConfig struct {
OriginAccessIdentity value.String `tree:"origin_access_identity"`
}

type OriginShield struct {
Enabled value.Bool `tree:"enabled"`
OriginShieldRegion value.String `tree:"origin_shield_region"`
}

type CacheBehaviour struct {
ViewerProtocolPolicy value.Value[ViewerProtocolPolicy] `tree:"viewer_protocol_policy"`
FieldLevelEncryptionID value.String `tree:"field_level_encryption_id"`
}

type LoggingConfig struct {
Bucket value.String `tree:"bucket"`
}

type ViewerCertificate struct {
SSLSupportMethod value.Value[SSLSupportMethod] `tree:"ssl_support_method"`
}
7 changes: 7 additions & 0 deletions pkg/tree/aws/cloudfront/function.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package cloudfront

import "github.com/infracost/go-proto/pkg/tree/resource"

type Function struct {
resource.Resource `tree:"-"`
}
Loading