From b9fa73ae5088985c7d9625943b9ba01da298c013 Mon Sep 17 00:00:00 2001 From: Lee Brown Date: Sun, 14 Jul 2019 21:26:19 -0800 Subject: [PATCH 1/3] fix deploy static file sync --- .gitlab-ci.yml | 2 +- cmd/web-app/main.go | 2 - tools/devops/cmd/cicd/s3_batch_upload.go | 3 + tools/devops/cmd/cicd/service_deploy.go | 160 +++++++++++++++-------- 4 files changed, 112 insertions(+), 55 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8dda117..9a6c0ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -85,7 +85,7 @@ webapp:deploy:dev: ENABLE_HTTPS: 1 ENABLE_ELB: 0 PRIMARY_HOST: 'eproc.tech' - HOST_NAMES: 'www.eproc.tech, dev.eproc.tech' + HOST_NAMES: 'www.eproc.tech,dev.eproc.tech' S3_BUCKET_PRIVATE: 'saas-starter-kit-private' S3_BUCKET_PUBLIC: 'saas-starter-kit-public' S3_BUCKET_PUBLIC_CLOUDFRONT: 'false' diff --git a/cmd/web-app/main.go b/cmd/web-app/main.go index c213f31..c4d6a78 100644 --- a/cmd/web-app/main.go +++ b/cmd/web-app/main.go @@ -348,8 +348,6 @@ func main() { // Init redirect middleware to ensure all requests go to the primary domain contained in the base URL. if primaryServiceHost != "127.0.0.1" && primaryServiceHost != "localhost" { - panic(primaryServiceHost) - redirect := mid.DomainNameRedirect(mid.DomainNameRedirectConfig{ RedirectConfig: mid.RedirectConfig{ Code: http.StatusMovedPermanently, diff --git a/tools/devops/cmd/cicd/s3_batch_upload.go b/tools/devops/cmd/cicd/s3_batch_upload.go index 248efd5..a5ec10f 100644 --- a/tools/devops/cmd/cicd/s3_batch_upload.go +++ b/tools/devops/cmd/cicd/s3_batch_upload.go @@ -39,6 +39,9 @@ func NewDirectoryIterator(bucket, keyPrefix, dir, acl string) s3manager.BatchUpl var paths []string filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { if !info.IsDir() { + + path, _ = filepath.Rel(dir, path) + paths = append(paths, path) } return nil diff --git a/tools/devops/cmd/cicd/service_deploy.go b/tools/devops/cmd/cicd/service_deploy.go index 8d8f4ff..9665ba3 100644 --- a/tools/devops/cmd/cicd/service_deploy.go +++ b/tools/devops/cmd/cicd/service_deploy.go @@ -283,69 +283,125 @@ func NewServiceDeployRequest(log *log.Logger, flags ServiceDeployFlags) (*servic }) /*if flags.S3BucketPublicCloudfront { + + allowedMethods:= &cloudfront.AllowedMethods{} + allowedMethods.SetItems(aws.StringSlice([]string{ "HEAD", "GET"})) + allowedMethods.SetCachedMethods(cloudfront.CachedMethods{}.SetItems(aws.StringSlice([]string{ "HEAD", "GET"}))) + + origins := &cloudfront.Origins{} + origins.SetItems([]*cloudfront.Origin{ + &cloudfront.Origin{ + // A complex type that contains names and values for the custom headers that + // you want. + CustomHeaders *CustomHeaders `type:"structure"` + + // A complex type that contains information about a custom origin. If the origin + // is an Amazon S3 bucket, use the S3OriginConfig element instead. + CustomOriginConfig *CustomOriginConfig `type:"structure"` + + // Amazon S3 origins: The DNS name of the Amazon S3 bucket from which you want + // CloudFront to get objects for this origin, for example, myawsbucket.s3.amazonaws.com. + // If you set up your bucket to be configured as a website endpoint, enter the + // Amazon S3 static website hosting endpoint for the bucket. + // + // For more information about specifying this value for different types of origins, + // see Origin Domain Name (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesDomainName) + // in the Amazon CloudFront Developer Guide. + // + // Constraints for Amazon S3 origins: + // + // * If you configured Amazon S3 Transfer Acceleration for your bucket, don't + // specify the s3-accelerate endpoint for DomainName. + // + // * The bucket name must be between 3 and 63 characters long (inclusive). + // + // * The bucket name must contain only lowercase characters, numbers, periods, + // underscores, and dashes. + // + // * The bucket name must not contain adjacent periods. + // + // Custom Origins: The DNS domain name for the HTTP server from which you want + // CloudFront to get objects for this origin, for example, www.example.com. + // + // Constraints for custom origins: + // + // * DomainName must be a valid DNS name that contains only a-z, A-Z, 0-9, + // dot (.), hyphen (-), or underscore (_) characters. + // + // * The name cannot exceed 128 characters. + // + // DomainName is a required field + DomainName *string `type:"string" required:"true"` + + // A unique identifier for the origin or origin group. The value of Id must + // be unique within the distribution. + // + // When you specify the value of TargetOriginId for the default cache behavior + // or for another cache behavior, you indicate the origin to which you want + // the cache behavior to route requests by specifying the value of the Id element + // for that origin. When a request matches the path pattern for that cache behavior, + // CloudFront routes the request to the specified origin. For more information, + // see Cache Behavior Settings (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesCacheBehavior) + // in the Amazon CloudFront Developer Guide. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // An optional element that causes CloudFront to request your content from a + // directory in your Amazon S3 bucket or your custom origin. When you include + // the OriginPath element, specify the directory name, beginning with a /. CloudFront + // appends the directory name to the value of DomainName, for example, example.com/production. + // Do not include a / at the end of the directory name. + // + // For example, suppose you've specified the following values for your distribution: + // + // * DomainName: An Amazon S3 bucket named myawsbucket. + // + // * OriginPath: /production + // + // * CNAME: example.com + // + // When a user enters example.com/index.html in a browser, CloudFront sends + // a request to Amazon S3 for myawsbucket/production/index.html. + // + // When a user enters example.com/acme/index.html in a browser, CloudFront sends + // a request to Amazon S3 for myawsbucket/production/acme/index.html. + OriginPath *string `type:"string"` + + // A complex type that contains information about the Amazon S3 origin. If the + // origin is a custom origin, use the CustomOriginConfig element instead. + S3OriginConfig *S3OriginConfig `type:"structure"` + // contains filtered or unexported fields + } , + }) + req.CloudfrontPublic = &cloudfront.DistributionConfig{ Comment: aws.String(""), Enabled: aws.Bool(true), HttpVersion: aws.String( "http2"), IsIPV6Enabled: aws.Bool(true), - - // A complex type that describes the default cache behavior if you don't specify - // a CacheBehavior element or if files don't match any of the values of PathPattern - // in CacheBehavior elements. You must create exactly one default cache behavior. - // - // DefaultCacheBehavior is a required field DefaultCacheBehavior: &cloudfront.DefaultCacheBehavior{ - // ...................................... + TargetOriginId: aws.String("S3"+req.S3BucketPublicName), + AllowedMethods: allowedMethods, + Compress: aws.Bool(true), + DefaultTTL: aws.Int64(1209600), + MinTTL: aws.Int64(604800), + MaxTTL: aws.Int64(31536000), + ForwardedValues: &cloudfront.ForwardedValues{ + QueryString: aws.Bool(true), + }, }, - // A complex type that contains information about origins for this distribution. - // - // Origins is a required field - Origins: &cloudfront.Origins{ - // ...................................... - }, - - // A complex type that specifies whether you want viewers to use HTTP or HTTPS - // to request your objects, whether you're using an alternate domain name with - // HTTPS, and if so, if you're using AWS Certificate Manager (ACM) or a third-party - // certificate authority. + Origins: origins, ViewerCertificate: &cloudfront.ViewerCertificate{ - // ...................................... + CertificateSource: aws.String("cloudfront"), + MinimumProtocolVersion: aws.String("TLSv1"), + CloudFrontDefaultCertificate: aws.Bool(true), }, - - // The price class that corresponds with the maximum price that you want to - // pay for CloudFront service. If you specify PriceClass_All, CloudFront responds - // to requests for your objects from all CloudFront edge locations. - // - // If you specify a price class other than PriceClass_All, CloudFront serves - // your objects from the CloudFront edge location that has the lowest latency - // among the edge locations in your price class. Viewers who are in or near - // regions that are excluded from your specified price class may encounter slower - // performance. - // - // For more information about price classes, see Choosing the Price Class for - // a CloudFront Distribution (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PriceClass.html) - // in the Amazon CloudFront Developer Guide. For information about CloudFront - // pricing, including how price classes (such as Price Class 100) map to CloudFront - // regions, see Amazon CloudFront Pricing (http://aws.amazon.com/cloudfront/pricing/). - // For price class information, scroll down to see the table at the bottom of - // the page. PriceClass: aws.String("PriceClass_All"), - - // A unique value (for example, a date-time stamp) that ensures that the request - // can't be replayed. - // - // If the value of CallerReference is new (regardless of the content of the - // DistributionConfig object), CloudFront creates a new distribution. - // - // If CallerReference is a value that you already sent in a previous request - // to create a distribution, CloudFront returns a DistributionAlreadyExists - // error. - // - // CallerReference is a required field CallerReference: aws.String("devops-deploy"), } - }*/ + } */ } // The private S3 Bucket used to persist data for services. @@ -3277,7 +3333,7 @@ func ServiceDeploy(log *log.Logger, req *serviceDeployRequest) error { err := SyncPublicS3Files(req.awsSession(), req.S3BucketPublicName, req.StaticFilesS3Prefix, staticDir) if err != nil { - return errors.Wrapf(err, "Failed to sync static files from %s to s3://%s/%s '%s'", staticDir, req.S3BucketPublicName, req.StaticFilesS3Prefix) + return errors.Wrapf(err, "Failed to sync static files from %s to s3://%s/%s", staticDir, req.S3BucketPublicName, req.StaticFilesS3Prefix) } log.Printf("\t%s\tFiles uploaded.\n", tests.Success) @@ -3521,7 +3577,7 @@ func ServiceDeploy(log *log.Logger, req *serviceDeployRequest) error { if err := <-checkErr; err != nil { log.Printf("\t%s\tFailed to check tasks.\n%+v\n", tests.Failed, err) - return nil + return err } // Wait for one of the methods to finish and then ensure the ticker is stopped. From 5df14e516250cbe2498528072b35100203736d27 Mon Sep 17 00:00:00 2001 From: Lee Brown Date: Sun, 14 Jul 2019 22:08:14 -0800 Subject: [PATCH 2/3] fix deploy file sync using absolute paths --- tools/devops/cmd/cicd/s3_batch_upload.go | 18 ++-- tools/devops/cmd/cicd/service_deploy.go | 101 ++++------------------- 2 files changed, 19 insertions(+), 100 deletions(-) diff --git a/tools/devops/cmd/cicd/s3_batch_upload.go b/tools/devops/cmd/cicd/s3_batch_upload.go index a5ec10f..1e8682c 100644 --- a/tools/devops/cmd/cicd/s3_batch_upload.go +++ b/tools/devops/cmd/cicd/s3_batch_upload.go @@ -5,7 +5,6 @@ import ( "net/http" "os" "path/filepath" - "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3/s3manager" @@ -14,6 +13,7 @@ import ( // DirectoryIterator represents an iterator of a specified directory type DirectoryIterator struct { + dir string filePaths []string bucket string keyPrefix string @@ -28,26 +28,16 @@ type DirectoryIterator struct { // NewDirectoryIterator builds a new DirectoryIterator func NewDirectoryIterator(bucket, keyPrefix, dir, acl string) s3manager.BatchUploadIterator { - // The key prefix could end with the base directory name, - // If this is the case, drop the dirname from the key prefix - if keyPrefix != "" { - dirName := filepath.Base(dir) - keyPrefix = strings.TrimRight(keyPrefix, "/") - keyPrefix = strings.TrimRight(keyPrefix, dirName) - } - var paths []string filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { if !info.IsDir() { - - path, _ = filepath.Rel(dir, path) - paths = append(paths, path) } return nil }) return &DirectoryIterator{ + dir: dir, filePaths: paths, bucket: bucket, keyPrefix: keyPrefix, @@ -91,10 +81,12 @@ func (di *DirectoryIterator) UploadObject() s3manager.BatchUploadObject { buffer := make([]byte, size) f.Read(buffer) + nextPath, _ := filepath.Rel(di.dir, di.next.path) + return s3manager.BatchUploadObject{ Object: &s3manager.UploadInput{ Bucket: aws.String(di.bucket), - Key: aws.String(filepath.Join(di.keyPrefix, di.next.path)), + Key: aws.String(filepath.Join(di.keyPrefix,nextPath)), Body: bytes.NewReader(buffer), ContentType: aws.String(http.DetectContentType(buffer)), ACL: acl, diff --git a/tools/devops/cmd/cicd/service_deploy.go b/tools/devops/cmd/cicd/service_deploy.go index 9665ba3..add327b 100644 --- a/tools/devops/cmd/cicd/service_deploy.go +++ b/tools/devops/cmd/cicd/service_deploy.go @@ -282,97 +282,25 @@ func NewServiceDeployRequest(log *log.Logger, flags ServiceDeployFlags) (*servic }, }) - /*if flags.S3BucketPublicCloudfront { + if flags.S3BucketPublicCloudfront { allowedMethods:= &cloudfront.AllowedMethods{} allowedMethods.SetItems(aws.StringSlice([]string{ "HEAD", "GET"})) - allowedMethods.SetCachedMethods(cloudfront.CachedMethods{}.SetItems(aws.StringSlice([]string{ "HEAD", "GET"}))) + + cacheMethods := &cloudfront.CachedMethods{} + cacheMethods.SetItems(aws.StringSlice([]string{ "HEAD", "GET"})) + allowedMethods.SetCachedMethods(cacheMethods) + + domainId := "S3"+req.S3BucketPublicName + domainName := fmt.Sprintf("%s.s3.%s.amazonaws.com", req.S3BucketPublicName, req.AwsCreds.Region) origins := &cloudfront.Origins{} origins.SetItems([]*cloudfront.Origin{ &cloudfront.Origin{ - // A complex type that contains names and values for the custom headers that - // you want. - CustomHeaders *CustomHeaders `type:"structure"` - - // A complex type that contains information about a custom origin. If the origin - // is an Amazon S3 bucket, use the S3OriginConfig element instead. - CustomOriginConfig *CustomOriginConfig `type:"structure"` - - // Amazon S3 origins: The DNS name of the Amazon S3 bucket from which you want - // CloudFront to get objects for this origin, for example, myawsbucket.s3.amazonaws.com. - // If you set up your bucket to be configured as a website endpoint, enter the - // Amazon S3 static website hosting endpoint for the bucket. - // - // For more information about specifying this value for different types of origins, - // see Origin Domain Name (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesDomainName) - // in the Amazon CloudFront Developer Guide. - // - // Constraints for Amazon S3 origins: - // - // * If you configured Amazon S3 Transfer Acceleration for your bucket, don't - // specify the s3-accelerate endpoint for DomainName. - // - // * The bucket name must be between 3 and 63 characters long (inclusive). - // - // * The bucket name must contain only lowercase characters, numbers, periods, - // underscores, and dashes. - // - // * The bucket name must not contain adjacent periods. - // - // Custom Origins: The DNS domain name for the HTTP server from which you want - // CloudFront to get objects for this origin, for example, www.example.com. - // - // Constraints for custom origins: - // - // * DomainName must be a valid DNS name that contains only a-z, A-Z, 0-9, - // dot (.), hyphen (-), or underscore (_) characters. - // - // * The name cannot exceed 128 characters. - // - // DomainName is a required field - DomainName *string `type:"string" required:"true"` - - // A unique identifier for the origin or origin group. The value of Id must - // be unique within the distribution. - // - // When you specify the value of TargetOriginId for the default cache behavior - // or for another cache behavior, you indicate the origin to which you want - // the cache behavior to route requests by specifying the value of the Id element - // for that origin. When a request matches the path pattern for that cache behavior, - // CloudFront routes the request to the specified origin. For more information, - // see Cache Behavior Settings (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesCacheBehavior) - // in the Amazon CloudFront Developer Guide. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // An optional element that causes CloudFront to request your content from a - // directory in your Amazon S3 bucket or your custom origin. When you include - // the OriginPath element, specify the directory name, beginning with a /. CloudFront - // appends the directory name to the value of DomainName, for example, example.com/production. - // Do not include a / at the end of the directory name. - // - // For example, suppose you've specified the following values for your distribution: - // - // * DomainName: An Amazon S3 bucket named myawsbucket. - // - // * OriginPath: /production - // - // * CNAME: example.com - // - // When a user enters example.com/index.html in a browser, CloudFront sends - // a request to Amazon S3 for myawsbucket/production/index.html. - // - // When a user enters example.com/acme/index.html in a browser, CloudFront sends - // a request to Amazon S3 for myawsbucket/production/acme/index.html. - OriginPath *string `type:"string"` - - // A complex type that contains information about the Amazon S3 origin. If the - // origin is a custom origin, use the CustomOriginConfig element instead. - S3OriginConfig *S3OriginConfig `type:"structure"` - // contains filtered or unexported fields - } , + Id: aws.String(domainId), + DomainName: aws.String(domainName), + OriginPath: aws.String(req.S3BucketPublicKeyPrefix), + }, }) req.CloudfrontPublic = &cloudfront.DistributionConfig{ @@ -381,7 +309,7 @@ func NewServiceDeployRequest(log *log.Logger, flags ServiceDeployFlags) (*servic HttpVersion: aws.String( "http2"), IsIPV6Enabled: aws.Bool(true), DefaultCacheBehavior: &cloudfront.DefaultCacheBehavior{ - TargetOriginId: aws.String("S3"+req.S3BucketPublicName), + TargetOriginId: aws.String(domainId), AllowedMethods: allowedMethods, Compress: aws.Bool(true), DefaultTTL: aws.Int64(1209600), @@ -391,7 +319,6 @@ func NewServiceDeployRequest(log *log.Logger, flags ServiceDeployFlags) (*servic QueryString: aws.Bool(true), }, }, - Origins: origins, ViewerCertificate: &cloudfront.ViewerCertificate{ CertificateSource: aws.String("cloudfront"), @@ -401,7 +328,7 @@ func NewServiceDeployRequest(log *log.Logger, flags ServiceDeployFlags) (*servic PriceClass: aws.String("PriceClass_All"), CallerReference: aws.String("devops-deploy"), } - } */ + } } // The private S3 Bucket used to persist data for services. From cf77e9d9eb08178944c97388984a2275e550e0ee Mon Sep 17 00:00:00 2001 From: Lee Brown Date: Sun, 14 Jul 2019 23:53:31 -0800 Subject: [PATCH 3/3] fix web-app static file prefix for s3 --- cmd/web-api/main.go | 1 - tools/devops/cmd/cicd/service.go | 11 +++++++++- tools/devops/cmd/cicd/service_deploy.go | 29 ++++++++++++++++++++++--- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/cmd/web-api/main.go b/cmd/web-api/main.go index e684037..bf36035 100644 --- a/cmd/web-api/main.go +++ b/cmd/web-api/main.go @@ -535,7 +535,6 @@ func main() { log.Printf("main : Graceful shutdown did not complete in %v : %v", cfg.Service.ShutdownTimeout, err) err = api.Close() } - } // Log the status of this shutdown. diff --git a/tools/devops/cmd/cicd/service.go b/tools/devops/cmd/cicd/service.go index e681f23..84a7087 100644 --- a/tools/devops/cmd/cicd/service.go +++ b/tools/devops/cmd/cicd/service.go @@ -148,7 +148,16 @@ func releaseTag(env, serviceName string) string { // Generate tags for the release image. var releaseTag string - if v := os.Getenv("CI_COMMIT_REF_NAME"); v != "" { + if v := os.Getenv("BUILDINFO_CI_COMMIT_SHA"); v != "" { + tag2 := tag1 + "-" + v[0:8] + releaseTag = tag2 + } else if v := os.Getenv("CI_COMMIT_SHA"); v != "" { + tag2 := tag1 + "-" + v[0:8] + releaseTag = tag2 + } else if v := os.Getenv("BUILDINFO_CI_COMMIT_REF_NAME"); v != "" { + tag2 := tag1 + "-" + v + releaseTag = tag2 + } else if v := os.Getenv("CI_COMMIT_REF_NAME"); v != "" { tag2 := tag1 + "-" + v releaseTag = tag2 } else { diff --git a/tools/devops/cmd/cicd/service_deploy.go b/tools/devops/cmd/cicd/service_deploy.go index add327b..8cb50dc 100644 --- a/tools/devops/cmd/cicd/service_deploy.go +++ b/tools/devops/cmd/cicd/service_deploy.go @@ -7,7 +7,6 @@ import ( "encoding/base64" "encoding/json" "fmt" - "github.com/aws/aws-sdk-go/service/cloudfront" "io/ioutil" "log" "net/url" @@ -18,6 +17,7 @@ import ( "strings" "time" + "github.com/aws/aws-sdk-go/service/cloudfront" "geeks-accelerator/oss/saas-starter-kit/internal/platform/tests" "geeks-accelerator/oss/saas-starter-kit/internal/schema" "geeks-accelerator/oss/saas-starter-kit/tools/devops/internal/retry" @@ -328,6 +328,7 @@ func NewServiceDeployRequest(log *log.Logger, flags ServiceDeployFlags) (*servic PriceClass: aws.String("PriceClass_All"), CallerReference: aws.String("devops-deploy"), } + req.CloudfrontPublic = nil } } @@ -1067,6 +1068,28 @@ func ServiceDeploy(log *log.Logger, req *serviceDeployRequest) error { log.Printf("\t%s\tS3 buckets configured successfully.\n", tests.Success) } + if req.CloudfrontPublic != nil { + log.Println("Cloudfront - Setup Distribution") + + svc := cloudfront.New(req.awsSession()) + + _, err := svc.CreateDistribution(&cloudfront.CreateDistributionInput{ + DistributionConfig: req.CloudfrontPublic, + } ) + if err != nil { + if aerr, ok := err.(awserr.Error); !ok || (aerr.Code() != cloudfront.ErrCodeDistributionAlreadyExists) { + return errors.Wrapf(err, "Failed to create cloudfront distribution '%s'", *req.CloudfrontPublic.DefaultCacheBehavior.TargetOriginId) + } + + // If bucket found during create, returns it. + log.Printf("\t\tFound: %s.", *req.CloudfrontPublic.DefaultCacheBehavior.TargetOriginId) + } else { + + // If no bucket found during create, create new one. + log.Printf("\t\tCreated: %s.", *req.CloudfrontPublic.DefaultCacheBehavior.TargetOriginId) + } + } + // Find the default VPC and associated subnets. // Custom subnets outside of the default VPC are not currently supported. var projectSubnetsIDs []string @@ -3254,7 +3277,7 @@ func ServiceDeploy(log *log.Logger, req *serviceDeployRequest) error { // When static files are enabled to be to stored on S3, we need to upload all of them. if req.StaticFilesS3Enable { - log.Println("\tSync static files to public S3 bucket") + log.Println("\tUpload static files to public S3 bucket") staticDir := filepath.Join(req.ServiceDir, "static") @@ -3263,7 +3286,7 @@ func ServiceDeploy(log *log.Logger, req *serviceDeployRequest) error { return errors.Wrapf(err, "Failed to sync static files from %s to s3://%s/%s", staticDir, req.S3BucketPublicName, req.StaticFilesS3Prefix) } - log.Printf("\t%s\tFiles uploaded.\n", tests.Success) + log.Printf("\t%s\tFiles uploaded to s3://%s/%s.\n", tests.Success, req.S3BucketPublicName, req.StaticFilesS3Prefix) } // Wait for the updated or created service to enter a stable state.