Added command to load test SSM parameters
This commit is contained in:
parent
71acd75685
commit
d48263e43f
5 changed files with 53 additions and 6 deletions
30
test/cmd/load-test-ssm/main.go
Normal file
30
test/cmd/load-test-ssm/main.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/config"
|
||||
"github.com/aws/aws-sdk-go-v2/service/ssm"
|
||||
"github.com/aws/aws-sdk-go-v2/service/ssm/types"
|
||||
"github.com/lmika/gopkgs/cli"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
cfg, err := config.LoadDefaultConfig(ctx)
|
||||
if err != nil {
|
||||
cli.Fatalf("cannot load AWS config: %v", err)
|
||||
}
|
||||
|
||||
ssmClient := ssm.NewFromConfig(cfg,
|
||||
ssm.WithEndpointResolver(ssm.EndpointResolverFromURL("http://localhost:4566")))
|
||||
|
||||
if _, err := ssmClient.PutParameter(ctx, &ssm.PutParameterInput{
|
||||
Name: aws.String("/alpha/bravo"),
|
||||
Type: types.ParameterTypeString,
|
||||
Value: aws.String("This is a parameter value"),
|
||||
}); err != nil {
|
||||
cli.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ func main() {
|
|||
}
|
||||
|
||||
dynamoClient := dynamodb.NewFromConfig(cfg,
|
||||
dynamodb.WithEndpointResolver(dynamodb.EndpointResolverFromURL("http://localhost:8000")))
|
||||
dynamodb.WithEndpointResolver(dynamodb.EndpointResolverFromURL("http://localhost:4566")))
|
||||
|
||||
if _, err = dynamoClient.DeleteTable(ctx, &dynamodb.DeleteTableInput{
|
||||
TableName: aws.String(tableName),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue