code: func CreateS3RollbackFunc(awsSession *session.Session, s3ArtifactURL string) RollbackFunction {
  	return func(logger *logrus.Logger) error {
  		logger.WithFields(logrus.Fields{
  			"URL": s3ArtifactURL,
  		}).Info("Deleting S3 object")
  		artifactURLParts, artifactURLPartsErr := url.Parse(s3ArtifactURL)
  		if nil != artifactURLPartsErr {
  			return artifactURLPartsErr
  		}
  		// Bucket is the first component
  		s3Bucket := strings.Split(artifactURLParts.Host, ".")[0]
  		s3Client := s3.New(awsSession)
  		params := &s3.DeleteObjectInput{
  			Bucket: aws.String(s3Bucket),
  			Key:    aws.String(artifactURLParts.Path),
  		}
  		versionID := artifactURLParts.Query().Get("versionId")
  		if versionID != "" {
  			params.VersionId = aws.String(versionID)
  		}
  		_, err := s3Client.DeleteObject(params)
  		if err != nil {
  			logger.WithFields(logrus.Fields{
  				"Error": err,
  			}).Warn("Failed to delete S3 item during rollback cleanup")
  		}
  		return err
  	}
  }
docs: // CreateS3RollbackFunc creates an S3 rollback function that attempts to delete a previously
  // uploaded item. Note that s3ArtifactURL may include a `versionId` query arg
  // to denote the specific version to delete.