File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -21,21 +21,14 @@ import (
2121 "time"
2222
2323 "github.com/aws/aws-sdk-go/aws"
24- "github.com/aws/aws-sdk-go/aws/session"
2524 "github.com/aws/aws-sdk-go/service/cloudfront"
25+ gcaws "gocloud.dev/aws"
2626)
2727
2828// InvalidateCloudFront invalidates the CloudFront cache for distributionID.
2929// It uses the default AWS credentials from the environment.
3030func InvalidateCloudFront (ctx context.Context , distributionID string ) error {
31- // SharedConfigEnable enables loading "shared config (~/.aws/config) and
32- // shared credentials (~/.aws/credentials) files".
33- // See https://docs.aws.amazon.com/sdk-for-go/api/aws/session/ for more
34- // details.
35- // This is the same codepath used by Go CDK when creating an s3 URL.
36- // TODO: Update this to a Go CDK helper once available
37- // (https://github.com/google/go-cloud/issues/2003).
38- sess , err := session .NewSessionWithOptions (session.Options {SharedConfigState : session .SharedConfigEnable })
31+ sess , err := gcaws .NewDefaultSession ()
3932 if err != nil {
4033 return err
4134 }
You can’t perform that action at this time.
0 commit comments