fleet/server/datastore/s3/bootstrap_package.go
Lucas Manuel Rodriguez 404f0d3ac0
Migrate from aws-sdk-go v1 to v2 (#30308)
#29482

[Migrate to the AWS SDK for Go
v2](https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/migrate-gosdk.html)
documents how to migrate codebases.

QA on features that use AWS SDK Go:
- Bootstrap package:
  - upload:  
  - download: 
  - cleanup: 
- Software (upload, download, installation, etc.) 
  - Cloudfront: Luckly, this feature was already using aws-sdk-go-v2.
- Carves 
- Logging:
	- Firehose 
	- Kinesis 
- Lambda  (tested result logs to a lambda function on our AWS Dogfood
account)
- Email:
	- Amazon SES TODO ⚠️ (this is what Dogfood uses and a few customers)
- We cannot easily test locally, we can use dogfood or load testing
(AWS) environments.

---

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.
- [ ] Manual QA for all new/changed functionality
2025-06-30 17:45:39 -03:00

25 lines
682 B
Go

package s3
import "github.com/fleetdm/fleet/v4/server/config"
const bootstrapPackagePrefix = "bootstrap-packages"
type BootstrapPackageStore struct {
*commonFileStore
}
// NewBootstrapPackageStore creates a new instance with the given S3 config.
func NewBootstrapPackageStore(config config.S3Config) (*BootstrapPackageStore, error) {
// bootstrap packages use the same S3 config as software installers
s3store, err := newS3Store(config.SoftwareInstallersToInternalCfg())
if err != nil {
return nil, err
}
return &BootstrapPackageStore{
&commonFileStore{
s3store: s3store,
pathPrefix: bootstrapPackagePrefix,
fileLabel: "bootstrap package",
},
}, nil
}