Skip to content

Commit

Permalink
Go: Add FromCloudFormationParams initializer function
Browse files Browse the repository at this point in the history
  • Loading branch information
kahlstrm committed Nov 25, 2023
1 parent 26b7be6 commit 9176b42
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion go/nvault/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,17 @@ func LoadVault(stackNameOpt ...string) (Vault, error) {

return res, nil
}

func FromCloudFormationParams(params CloudFormationParams) (*Vault, error) {
cfg, err := config.LoadDefaultConfig(context.TODO())
if err != nil {
return nil, fmt.Errorf("error creating config: %v", err)
}
return &Vault{
cloudformationParams: params,
s3Client: *s3.NewFromConfig(cfg),
kmsClient: *kms.NewFromConfig(cfg),
}, nil
}
func getCloudformationParams(cfg *aws.Config, stackName string) (CloudFormationParams, error) {
res := CloudFormationParams{}
cfnClient := cloudformation.NewFromConfig(*cfg)
Expand Down

0 comments on commit 9176b42

Please sign in to comment.