Added the clone command in SSM
This commit is contained in:
parent
ee6011bc3e
commit
306640abdb
9 changed files with 102 additions and 10 deletions
|
|
@ -7,4 +7,5 @@ import (
|
|||
|
||||
type SSMProvider interface {
|
||||
List(ctx context.Context, prefix string, maxCount int) (*models.SSMParameters, error)
|
||||
Put(ctx context.Context, param models.SSMParameter, override bool) error
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,4 +17,13 @@ func NewService(provider SSMProvider) *Service {
|
|||
|
||||
func (s *Service) List(ctx context.Context, prefix string) (*models.SSMParameters, error) {
|
||||
return s.provider.List(ctx, prefix, 100)
|
||||
}
|
||||
|
||||
func (s *Service) Clone(ctx context.Context, param models.SSMParameter, newName string) error {
|
||||
newParam := models.SSMParameter{
|
||||
Name: newName,
|
||||
Type: param.Type,
|
||||
Value: param.Value,
|
||||
}
|
||||
return s.provider.Put(ctx, newParam, false)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue