diff --git a/pkg/storage/awsecret/arieskmsstore/aries_kms_store.go b/pkg/storage/awsecret/arieskmsstore/aries_kms_store.go index 9d345174c..1819eb09d 100644 --- a/pkg/storage/awsecret/arieskmsstore/aries_kms_store.go +++ b/pkg/storage/awsecret/arieskmsstore/aries_kms_store.go @@ -57,8 +57,8 @@ func (s *Store) Put(keysetID string, key []byte) error { return err } - _, err = s.client.PutSecretValue(context.Background(), &secretsmanager.PutSecretValueInput{ - SecretId: lo.ToPtr(s.GetPath(keysetID)), + _, err = s.client.CreateSecret(context.Background(), &secretsmanager.CreateSecretInput{ + Name: lo.ToPtr(s.GetPath(keysetID)), SecretBinary: data, SecretString: nil, }) diff --git a/pkg/storage/awsecret/arieskmsstore/aries_kms_store_test.go b/pkg/storage/awsecret/arieskmsstore/aries_kms_store_test.go index 817ed3ebc..47de5081d 100644 --- a/pkg/storage/awsecret/arieskmsstore/aries_kms_store_test.go +++ b/pkg/storage/awsecret/arieskmsstore/aries_kms_store_test.go @@ -22,13 +22,13 @@ func TestPut(t *testing.T) { prefix, ) - cl.EXPECT().PutSecretValue(gomock.Any(), gomock.Any()). + cl.EXPECT().CreateSecret(gomock.Any(), gomock.Any()). DoAndReturn(func( ctx context.Context, - input *secretsmanager.PutSecretValueInput, + input *secretsmanager.CreateSecretInput, f ...func(*secretsmanager.Options), - ) (*secretsmanager.PutSecretValueOutput, error) { - assert.EqualValues(t, prefix+"someId", *input.SecretId) + ) (*secretsmanager.CreateSecretOutput, error) { + assert.EqualValues(t, prefix+"someId", *input.Name) var parsed arieskmsstore.DataWrapper if err := json.Unmarshal(input.SecretBinary, &parsed); err != nil { @@ -37,7 +37,7 @@ func TestPut(t *testing.T) { assert.EqualValues(t, []byte{0x1, 0x2}, parsed.Bin) - return &secretsmanager.PutSecretValueOutput{}, nil + return &secretsmanager.CreateSecretOutput{}, nil }) assert.NoError(t, store.Put("someId", []byte{0x1, 0x2})) diff --git a/pkg/storage/awsecret/arieskmsstore/interfaces.go b/pkg/storage/awsecret/arieskmsstore/interfaces.go index 5aa649570..8420edbb5 100644 --- a/pkg/storage/awsecret/arieskmsstore/interfaces.go +++ b/pkg/storage/awsecret/arieskmsstore/interfaces.go @@ -15,17 +15,18 @@ import ( ) type Client interface { - PutSecretValue( + CreateSecret( ctx context.Context, - params *secretsmanager.PutSecretValueInput, + params *secretsmanager.CreateSecretInput, optFns ...func(*secretsmanager.Options), - ) (*secretsmanager.PutSecretValueOutput, error) + ) (*secretsmanager.CreateSecretOutput, error) GetSecretValue( ctx context.Context, params *secretsmanager.GetSecretValueInput, optFns ...func(*secretsmanager.Options), ) (*secretsmanager.GetSecretValueOutput, error) + DeleteSecret( ctx context.Context, params *secretsmanager.DeleteSecretInput,