Skip to content

Commit

Permalink
Merge pull request #299 from overmindtech/281-cloudfront-distribution…
Browse files Browse the repository at this point in the history
…-mapping-not-working

Made region empty so it matches the account ID
  • Loading branch information
dylanratcliffe authored Sep 26, 2023
2 parents 785e011 + 56f0ddf commit 46fe9fb
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 36 deletions.
26 changes: 0 additions & 26 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,8 @@ github.com/aws/aws-sdk-go-v2 v1.21.0 h1:gMT0IW+03wtYJhRqTVYn0wLzwdnK9sRMcxmtfGzR
github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.13 h1:OPLEkmhXf6xFPiz0bLeDArZIDx1NNS4oJyG4nv3Gct0=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.13/go.mod h1:gpAbvyDGQFozTEmlTFO8XcQKHzubdq0LzRyJpG6MiXM=
github.com/aws/aws-sdk-go-v2/config v1.18.39 h1:oPVyh6fuu/u4OiW4qcuQyEtk7U7uuNBmHmJSLg1AJsQ=
github.com/aws/aws-sdk-go-v2/config v1.18.39/go.mod h1:+NH/ZigdPckFpgB1TRcRuWCB/Kbbvkxc/iNAKTq5RhE=
github.com/aws/aws-sdk-go-v2/config v1.18.41 h1:Go7z97YDsBJVNAaL7pDPKB6LeHEsAkHmFe+CeK30fUQ=
github.com/aws/aws-sdk-go-v2/config v1.18.41/go.mod h1:+yR45+A0LIMKT8bWOKo90Hy9rSrovEmEKoPKLmmVec8=
github.com/aws/aws-sdk-go-v2/credentials v1.13.37 h1:BvEdm09+ZEh2XtN+PVHPcYwKY3wIeB6pw7vPRM4M9/U=
github.com/aws/aws-sdk-go-v2/credentials v1.13.37/go.mod h1:ACLrdkd4CLZyXOghZ8IYumQbcooAcp2jo/s2xsFH8IM=
github.com/aws/aws-sdk-go-v2/credentials v1.13.39 h1:UnwBXDIHKDaejSXaRzKR57IdGCizk+z1DEhnsFpus7Q=
github.com/aws/aws-sdk-go-v2/credentials v1.13.39/go.mod h1:OJ9P239A90TnglJEF3qofKiNeEM6PCV/m+aNGV5WC24=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 h1:uDZJF1hu0EVT/4bogChk8DyjSF6fof6uL/0Y26Ma7Fg=
Expand All @@ -72,10 +68,6 @@ github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.27.7 h1:qULF+ElcvjjSEO1+z5x+T
github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.27.7/go.mod h1:1HKxVrj5wsKy/wb2v07vzTSd+YPV1sDsWxferwPK7PA=
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.21.5 h1:EeNQ3bDA6hlx3vifHf7LT/l9dh9w7D2XgCdaD11TRU4=
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.21.5/go.mod h1:X3ThW5RPV19hi7bnQ0RMAiBjZbzxj4rZlj+qdctbMWY=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.117.0 h1:Yq39vbwQX+Xw+Ubcsg/ElwO+TWAxAIAdrREtpjGnCHw=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.117.0/go.mod h1:0FhI2Rzcv5BNM3dNnbcCx2qa2naFZoAidJi11cQgzL0=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.118.0 h1:ueSJS07XpOwCFhYTHh/Jjw856+U+u0Dv5LIIPOB1/Ns=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.118.0/go.mod h1:0FhI2Rzcv5BNM3dNnbcCx2qa2naFZoAidJi11cQgzL0=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.119.0 h1:oFrb1aQ07i+v63FOTywSG8xL/OYZbk+HmPE8FKSzkRk=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.119.0/go.mod h1:0FhI2Rzcv5BNM3dNnbcCx2qa2naFZoAidJi11cQgzL0=
github.com/aws/aws-sdk-go-v2/service/ecs v1.30.1 h1:bOS7hAfvd8+glVAG88WnvRITe5N1vopGFHh10ORe/BI=
Expand All @@ -84,8 +76,6 @@ github.com/aws/aws-sdk-go-v2/service/efs v1.21.6 h1:Hk/hIxTQ2OcLqG/rThJSwawnXwNf
github.com/aws/aws-sdk-go-v2/service/efs v1.21.6/go.mod h1:cws4IYv3vkLS4pZzStRQH6AcBISp5JlI+dgBA/seDbA=
github.com/aws/aws-sdk-go-v2/service/eks v1.29.5 h1:6eSpTHOsDixcFIvPdiAAVdyCru3k2jIVRPdIQfGzfc8=
github.com/aws/aws-sdk-go-v2/service/eks v1.29.5/go.mod h1:TwqefcyPlF31NTF+fH34tJ2VwMMR6c74IbiiUgA6kVY=
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.16.5 h1:DfvVNjrKOQpJyll4gDvHbFRkbSmQvFqcEljgR3/RSz4=
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.16.5/go.mod h1:xCxinsYWeneLsHYY9O2lbIzT1ZgjzuRPMjdUFgE798I=
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.17.0 h1:mVmdrDqWO/Vpc8pWMALzWwzRh1PKOnYIdY1LpSJXiek=
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.17.0/go.mod h1:xCxinsYWeneLsHYY9O2lbIzT1ZgjzuRPMjdUFgE798I=
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.21.4 h1:hcJmu7oeocSOHQKaifUoMWaSxengFuvGriP7SvuVvTw=
Expand All @@ -108,20 +98,12 @@ github.com/aws/aws-sdk-go-v2/service/rds v1.54.0 h1:FmExQnV6PXPAwP2DT3nXlWyKtCJ3
github.com/aws/aws-sdk-go-v2/service/rds v1.54.0/go.mod h1:UNv1vk1fU1NJefzteykVpVLA88w4WxB05g3vp2kQhYM=
github.com/aws/aws-sdk-go-v2/service/route53 v1.29.5 h1:6wPin3WPyQpBl/QZsoNUnqvXy4Ib1Ygv7VagGvLKJAc=
github.com/aws/aws-sdk-go-v2/service/route53 v1.29.5/go.mod h1:6zl0jh5MUKuJ07eHn3MNeLOVutxwl8m9vQltZjoLakM=
github.com/aws/aws-sdk-go-v2/service/s3 v1.38.5 h1:A42xdtStObqy7NGvzZKpnyNXvoOmm+FENobZ0/ssHWk=
github.com/aws/aws-sdk-go-v2/service/s3 v1.38.5/go.mod h1:rDGMZA7f4pbmTtPOk5v5UM2lmX6UAbRnMDJeDvnH7AM=
github.com/aws/aws-sdk-go-v2/service/s3 v1.39.0 h1:VZ2WMkKLio5tVjYfThcy5+pb6YHGd6B6egq75FfM6hU=
github.com/aws/aws-sdk-go-v2/service/s3 v1.39.0/go.mod h1:rDGMZA7f4pbmTtPOk5v5UM2lmX6UAbRnMDJeDvnH7AM=
github.com/aws/aws-sdk-go-v2/service/sso v1.13.6 h1:2PylFCfKCEDv6PeSN09pC/VUiRd10wi1VfHG5FrW0/g=
github.com/aws/aws-sdk-go-v2/service/sso v1.13.6/go.mod h1:fIAwKQKBFu90pBxx07BFOMJLpRUGu8VOzLJakeY+0K4=
github.com/aws/aws-sdk-go-v2/service/sso v1.14.0 h1:AR/hlTsCyk1CwlyKnPFvIMvnONydRjDDRT9OGb0i+/g=
github.com/aws/aws-sdk-go-v2/service/sso v1.14.0/go.mod h1:fIAwKQKBFu90pBxx07BFOMJLpRUGu8VOzLJakeY+0K4=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6 h1:pSB560BbVj9ZlJZF4WYj5zsytWHWKxg+NgyGV4B2L58=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6/go.mod h1:yygr8ACQRY2PrEcy3xsUI357stq2AxnFM6DIsR9lij4=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.0 h1:UniOmlPJelksyP5dGjfRoFTmLDy4/o0HH1lK2Op7zC8=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.0/go.mod h1:yygr8ACQRY2PrEcy3xsUI357stq2AxnFM6DIsR9lij4=
github.com/aws/aws-sdk-go-v2/service/sts v1.21.5 h1:CQBFElb0LS8RojMJlxRSo/HXipvTZW2S44Lt9Mk2aYQ=
github.com/aws/aws-sdk-go-v2/service/sts v1.21.5/go.mod h1:VC7JDqsqiwXukYEDjoHh9U0fOJtNWh04FPQz4ct4GGU=
github.com/aws/aws-sdk-go-v2/service/sts v1.22.0 h1:s4bioTgjSFRwOoyEFzAVCmFmoowBgjTR8gkrF/sQ4wk=
github.com/aws/aws-sdk-go-v2/service/sts v1.22.0/go.mod h1:VC7JDqsqiwXukYEDjoHh9U0fOJtNWh04FPQz4ct4GGU=
github.com/aws/smithy-go v1.14.2 h1:MJU9hqBGbvWZdApzpvoF2WAIJDbtjK2NDJSiJP7HblQ=
Expand Down Expand Up @@ -272,18 +254,12 @@ github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA
github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/nats-io/jwt/v2 v2.5.0 h1:WQQ40AAlqqfx+f6ku+i0pOVm+ASirD4fUh+oQsiE9Ak=
github.com/nats-io/jwt/v2 v2.5.0/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI=
github.com/nats-io/jwt/v2 v2.5.2 h1:DhGH+nKt+wIkDxM6qnVSKjokq5t59AZV5HRcFW0zJwU=
github.com/nats-io/jwt/v2 v2.5.2/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI=
github.com/nats-io/nats-server/v2 v2.9.22 h1:rzl88pqWFFrU4G00ed+JnY+uGHSLZ+3jrxDnJxzKwGA=
github.com/nats-io/nats-server/v2 v2.9.22/go.mod h1:wEjrEy9vnqIGE4Pqz4/c75v9Pmaq7My2IgFmnykc4C0=
github.com/nats-io/nats.go v1.28.0 h1:Th4G6zdsz2d0OqXdfzKLClo6bOfoI/b1kInhRtFIy5c=
github.com/nats-io/nats.go v1.28.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc=
github.com/nats-io/nats.go v1.29.0 h1:dSXZ+SZeGyTdHVYeXimeq12FsIpb9dM8CJ2IZFiHcyE=
github.com/nats-io/nats.go v1.29.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc=
github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA=
github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64=
github.com/nats-io/nkeys v0.4.5 h1:Zdz2BUlFm4fJlierwvGK+yl20IAKUm7eV6AAZXEhkPk=
github.com/nats-io/nkeys v0.4.5/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64=
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
Expand All @@ -292,8 +268,6 @@ github.com/overmindtech/api-client v0.14.0 h1:zXyjJsIeawNqoWv7FqOjwcqgFpLrDYz7l9
github.com/overmindtech/api-client v0.14.0/go.mod h1:msdkTAQFlvDGOU4tQk2adk2P8j23uaMWkJ9YRX4wGWI=
github.com/overmindtech/discovery v0.24.0 h1:TlALbpl76gcR2eG5NQK+eH+7x7pm0zBNRF+BaK5akFE=
github.com/overmindtech/discovery v0.24.0/go.mod h1:SV0lAeunspCtJ/HIFRTo66Zl7/hWqZruIcRO0oLEW/0=
github.com/overmindtech/sdp-go v0.49.0 h1:m2NoNdodPM5xrcfaBP+Df67JCmEbWcwh60SWq2joiWQ=
github.com/overmindtech/sdp-go v0.49.0/go.mod h1:Eg/OSql8z1N7kZej0i0AHYMoApMJHmjMBE2gWUsTsN8=
github.com/overmindtech/sdp-go v0.49.5 h1:mvmUvnSM6q3PtUaLb+vJxLbq60uQiXGPB2caPaRBQMk=
github.com/overmindtech/sdp-go v0.49.5/go.mod h1:q2RBDqmPidIQsYa9g/6nqOeJAyM6j3zgxn94GPCJcF8=
github.com/overmindtech/sdpcache v1.5.0 h1:QzHWQm1KGN9rNHPb/VZvz7WDCsyKOuVLlNUGF2CIFGc=
Expand Down
2 changes: 1 addition & 1 deletion sources/cloudfront/cache_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func NewCachePolicySource(config aws.Config, accountID string) *sources.GetListS
ItemType: "cloudfront-cache-policy",
Client: cloudfront.NewFromConfig(config),
AccountID: accountID,
Region: "global",
Region: "", // Cloudfront resources aren't tied to a region
SupportGlobalResources: true, // Some policies are global
GetFunc: func(ctx context.Context, client CloudFrontClient, scope, query string) (*types.CachePolicy, error) {
out, err := client.GetCachePolicy(ctx, &cloudfront.GetCachePolicyInput{
Expand Down
2 changes: 1 addition & 1 deletion sources/cloudfront/continuous_deployment_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func NewContinuousDeploymentPolicySource(config aws.Config, accountID string) *s
ItemType: "cloudfront-continuous-deployment-policy",
Client: cloudfront.NewFromConfig(config),
AccountID: accountID,
Region: "global",
Region: "", // Cloudfront resources aren't tied to a region
SupportGlobalResources: true, // Some policies are global
GetFunc: func(ctx context.Context, client *cloudfront.Client, scope, query string) (*types.ContinuousDeploymentPolicy, error) {
out, err := client.GetContinuousDeploymentPolicy(ctx, &cloudfront.GetContinuousDeploymentPolicyInput{
Expand Down
2 changes: 1 addition & 1 deletion sources/cloudfront/distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ func NewDistributionSource(config aws.Config, accountID string) *sources.AlwaysG
ItemType: "cloudfront-distribution",
Client: cloudfront.NewFromConfig(config),
AccountID: accountID,
Region: "global",
Region: "", // Cloudfront resources aren't tied to a region
ListInput: &cloudfront.ListDistributionsInput{},
ListFuncPaginatorBuilder: func(client CloudFrontClient, input *cloudfront.ListDistributionsInput) sources.Paginator[*cloudfront.ListDistributionsOutput, *cloudfront.Options] {
return cloudfront.NewListDistributionsPaginator(client, input)
Expand Down
2 changes: 1 addition & 1 deletion sources/cloudfront/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func NewFunctionSource(config aws.Config, accountID string) *sources.GetListSour
ItemType: "cloudfront-function",
Client: cloudfront.NewFromConfig(config),
AccountID: accountID,
Region: "global",
Region: "", // Cloudfront resources aren't tied to a region
GetFunc: func(ctx context.Context, client *cloudfront.Client, scope, query string) (*types.FunctionSummary, error) {
out, err := client.DescribeFunction(ctx, &cloudfront.DescribeFunctionInput{
Name: &query,
Expand Down
2 changes: 1 addition & 1 deletion sources/cloudfront/key_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func NewKeyGroupSource(config aws.Config, accountID string) *sources.GetListSour
ItemType: "cloudfront-key-group",
Client: cloudfront.NewFromConfig(config),
AccountID: accountID,
Region: "global",
Region: "", // Cloudfront resources aren't tied to a region
GetFunc: func(ctx context.Context, client *cloudfront.Client, scope, query string) (*types.KeyGroup, error) {
out, err := client.GetKeyGroup(ctx, &cloudfront.GetKeyGroupInput{
Id: &query,
Expand Down
2 changes: 1 addition & 1 deletion sources/cloudfront/origin_access_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func NewOriginAccessControlSource(config aws.Config, accountID string) *sources.
ItemType: "cloudfront-origin-access-control",
Client: cloudfront.NewFromConfig(config),
AccountID: accountID,
Region: "global",
Region: "", // Cloudfront resources aren't tied to a region
GetFunc: func(ctx context.Context, client *cloudfront.Client, scope, query string) (*types.OriginAccessControl, error) {
out, err := client.GetOriginAccessControl(ctx, &cloudfront.GetOriginAccessControlInput{
Id: &query,
Expand Down
2 changes: 1 addition & 1 deletion sources/cloudfront/origin_request_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func NewOriginRequestPolicySource(config aws.Config, accountID string) *sources.
ItemType: "cloudfront-origin-request-policy",
Client: cloudfront.NewFromConfig(config),
AccountID: accountID,
Region: "global",
Region: "", // Cloudfront resources aren't tied to a region
GetFunc: func(ctx context.Context, client *cloudfront.Client, scope, query string) (*types.OriginRequestPolicy, error) {
out, err := client.GetOriginRequestPolicy(ctx, &cloudfront.GetOriginRequestPolicyInput{
Id: &query,
Expand Down
2 changes: 1 addition & 1 deletion sources/cloudfront/realtime_log_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func NewRealtimeLogConfigsSource(config aws.Config, accountID string) *sources.G
ItemType: "cloudfront-realtime-log-config",
Client: cloudfront.NewFromConfig(config),
AccountID: accountID,
Region: "global",
Region: "", // Cloudfront resources aren't tied to a region
GetFunc: func(ctx context.Context, client *cloudfront.Client, scope, query string) (*types.RealtimeLogConfig, error) {
out, err := client.GetRealtimeLogConfig(ctx, &cloudfront.GetRealtimeLogConfigInput{
Name: &query,
Expand Down
2 changes: 1 addition & 1 deletion sources/cloudfront/response_headers_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func NewResponseHeadersPolicySource(config aws.Config, accountID string) *source
ItemType: "cloudfront-response-headers-policy",
Client: cloudfront.NewFromConfig(config),
AccountID: accountID,
Region: "global",
Region: "", // Cloudfront resources aren't tied to a region
GetFunc: func(ctx context.Context, client *cloudfront.Client, scope, query string) (*types.ResponseHeadersPolicy, error) {
out, err := client.GetResponseHeadersPolicy(ctx, &cloudfront.GetResponseHeadersPolicyInput{
Id: &query,
Expand Down
2 changes: 1 addition & 1 deletion sources/cloudfront/streaming_distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func NewStreamingDistributionSource(config aws.Config, accountID string) *source
ItemType: "cloudfront-streaming-distribution",
Client: cloudfront.NewFromConfig(config),
AccountID: accountID,
Region: "global",
Region: "", // Cloudfront resources aren't tied to a region
ListInput: &cloudfront.ListStreamingDistributionsInput{},
ListFuncPaginatorBuilder: func(client CloudFrontClient, input *cloudfront.ListStreamingDistributionsInput) sources.Paginator[*cloudfront.ListStreamingDistributionsOutput, *cloudfront.Options] {
return cloudfront.NewListStreamingDistributionsPaginator(client, input)
Expand Down

0 comments on commit 46fe9fb

Please sign in to comment.