FEAT: Installed LocalStack For Development
This commit is contained in:
+13
-1
@@ -66,8 +66,20 @@ func runServer() {
|
||||
panic(fmt.Errorf("missing required env var: MEDIACONVERT_OUTPUT_BUCKET"))
|
||||
}
|
||||
|
||||
// AWS_ENDPOINT_URL is only ever set when pointing at something other than
|
||||
// real S3 — LocalStack, in docker-compose. Virtual-host addressing would
|
||||
// resolve <bucket>.<endpoint host> there, which neither Docker's DNS nor
|
||||
// LocalStack's own wildcard domain serves from inside a container, so those
|
||||
// deployments need path-style URLs. Left off against real S3, which has
|
||||
// been steering away from path-style for new buckets.
|
||||
s3Options := func(o *s3.Options) {
|
||||
if os.Getenv("AWS_ENDPOINT_URL") != "" || os.Getenv("AWS_ENDPOINT_URL_S3") != "" {
|
||||
o.UsePathStyle = true
|
||||
}
|
||||
}
|
||||
|
||||
concreteS3Client := &services.S3Concrete{
|
||||
S3Client: s3.NewFromConfig(awsConfig),
|
||||
S3Client: s3.NewFromConfig(awsConfig, s3Options),
|
||||
Bucket: bucketName,
|
||||
}
|
||||
concreteS3Client.AssertSuccessfulConnection(context.Background())
|
||||
|
||||
Reference in New Issue
Block a user