Skip to content

Commit

Permalink
Remove AWS Secrets Manager client (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjohnsonpint authored Oct 11, 2024
1 parent 7ea5cb0 commit 2043a9e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 258 deletions.
23 changes: 17 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "0.2.0",
"configurations": [
{
"name": "Modus Runtime (local)",
"name": "Modus Runtime",
"type": "go",
"request": "launch",
"mode": "auto",
Expand All @@ -16,7 +16,7 @@
"args": ["--refresh=1s"]
},
{
"name": "Modus Runtime (AWS)",
"name": "Modus Runtime (AWS Storage)",
"type": "go",
"request": "launch",
"mode": "auto",
Expand All @@ -25,13 +25,12 @@
"env": {
"MODUS_ENV": "dev",
"MODUS_DEBUG": "true",
"AWS_REGION": "us-west-2",
"AWS_PROFILE": "sandbox",
"AWS_REGION": "${input:awsRegion}",
"AWS_PROFILE": "${input:awsProfile}",
"AWS_SDK_LOAD_CONFIG": "true",
"MODUS_DB": "postgresql://postgres:postgres@localhost:5433/my-runtime-db?sslmode=disable"
},
"args": [
"--useAwsSecrets",
"--useAwsStorage",
"--s3bucket=${input:s3bucket}",
"--s3path=${input:s3folder}",
Expand All @@ -50,7 +49,7 @@
}
},
{
"name": "hypbumodus-go-buildild http example",
"name": "modus-go-build http example",
"type": "go",
"request": "launch",
"mode": "auto",
Expand All @@ -62,6 +61,18 @@
}
],
"inputs": [
{
"id": "awsProfile",
"type": "promptString",
"description": "Enter the AWS profile name",
"default": "sandbox"
},
{
"id": "awsRegion",
"type": "promptString",
"description": "Enter the AWS region",
"default": "us-west-2"
},
{
"id": "s3bucket",
"type": "promptString",
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ In previous releases, the name "Hypermode" was used for all three._
- Modularize / Rename host functions [#452](https://github.com/hypermodeinc/modus/pull/452)
- Add release pipeline for the runtime [#453](https://github.com/hypermodeinc/modus/pull/453) [#454](https://github.com/hypermodeinc/modus/pull/454)
- Remove `go generate` and fix docker build [#455](https://github.com/hypermodeinc/modus/pull/455)
- Remove AWS Secrets Manager client [#456](https://github.com/hypermodeinc/modus/pull/456)

## 2024-10-02 - Version 0.12.7

Expand Down
2 changes: 1 addition & 1 deletion runtime/aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func GetAwsConfig() aws.Config {
}

func Initialize(ctx context.Context) {
if !(hmConfig.UseAwsStorage || hmConfig.UseAwsSecrets) {
if !(hmConfig.UseAwsStorage) {
return
}

Expand Down
2 changes: 0 additions & 2 deletions runtime/config/commandline.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
var Port int
var ModelHost string
var StoragePath string
var UseAwsSecrets bool
var UseAwsStorage bool
var S3Bucket string
var S3Path string
Expand All @@ -32,7 +31,6 @@ func parseCommandLineFlags() {
flag.IntVar(&Port, "port", 8686, "The HTTP port to listen on.")
flag.StringVar(&ModelHost, "modelHost", "", "The base DNS of the host endpoint to the model server.")
flag.StringVar(&StoragePath, "storagePath", getDefaultStoragePath(), "The path to a directory used for local storage.")
flag.BoolVar(&UseAwsSecrets, "useAwsSecrets", false, "Use AWS Secrets Manager for API keys and other secrets.")
flag.BoolVar(&UseAwsStorage, "useAwsStorage", false, "Use AWS S3 for storage instead of the local filesystem.")
flag.StringVar(&S3Bucket, "s3bucket", "", "The S3 bucket to use, if using AWS storage.")
flag.StringVar(&S3Path, "s3path", "", "The path within the S3 bucket to use, if using AWS storage.")
Expand Down
1 change: 0 additions & 1 deletion runtime/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ require (
github.com/aws/aws-sdk-go-v2/config v1.27.43
github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.19.2
github.com/aws/aws-sdk-go-v2/service/s3 v1.65.2
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.2
github.com/aws/aws-sdk-go-v2/service/sts v1.32.2
github.com/buger/jsonparser v1.1.1
github.com/chewxy/math32 v1.11.1
Expand Down
2 changes: 0 additions & 2 deletions runtime/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.2 h1:t7iUP9+4wdc5lt
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.2/go.mod h1:/niFCtmuQNxqx9v8WAPq5qh7EH25U4BF6tjoyq9bObM=
github.com/aws/aws-sdk-go-v2/service/s3 v1.65.2 h1:yi8m+jepdp6foK14xXLGkYBenxnlcfJ45ka4Pg7fDSQ=
github.com/aws/aws-sdk-go-v2/service/s3 v1.65.2/go.mod h1:cB6oAuus7YXRZhWCc1wIwPywwZ1XwweNp2TVAEGYeB8=
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.2 h1:Rrqru2wYkKQCS2IM5/JrgKUQIoNTqA6y/iuxkjzxC6M=
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.2/go.mod h1:QuCURO98Sqee2AXmqDNxKXYFm2OEDAVAPApMqO0Vqnc=
github.com/aws/aws-sdk-go-v2/service/sso v1.24.2 h1:bSYXVyUzoTHoKalBmwaZxs97HU9DWWI3ehHSAMa7xOk=
github.com/aws/aws-sdk-go-v2/service/sso v1.24.2/go.mod h1:skMqY7JElusiOUjMJMOv1jJsP7YUg7DrhgqZZWuzu1U=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2 h1:AhmO1fHINP9vFYUE0LHzCWg/LfUWUF+zFPEcY9QXb7o=
Expand Down
239 changes: 0 additions & 239 deletions runtime/secrets/awssecrets.go

This file was deleted.

8 changes: 1 addition & 7 deletions runtime/secrets/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"regexp"

"github.com/hypermodeinc/modus/lib/manifest"
"github.com/hypermodeinc/modus/runtime/config"
"github.com/hypermodeinc/modus/runtime/logger"
"github.com/hypermodeinc/modus/runtime/utils"
)
Expand All @@ -33,12 +32,7 @@ type secretsProvider interface {
}

func Initialize(ctx context.Context) {
if config.UseAwsSecrets {
provider = &awsSecretsProvider{}
} else {
provider = &localSecretsProvider{}
}

provider = &localSecretsProvider{}
provider.initialize(ctx)
}

Expand Down

0 comments on commit 2043a9e

Please sign in to comment.