Fork of hashicorp/boundary-plugin-aws (MPL-2.0). Module path and Boundary SDK imports now point at repo.anhonesthost.net/CyberCoveLLC. Adds NOTICE and an About this fork section to the README. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
40 lines
974 B
Go
40 lines
974 B
Go
// Copyright IBM Corp. 2021, 2026
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package host
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold-plugin-aws/internal/credential"
|
|
"github.com/hashicorp/go-secure-stdlib/awsutil/v2"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestAwsCatalogPersistedStateEC2Client(t *testing.T) {
|
|
require := require.New(t)
|
|
cred, err := credential.NewAwsCredentialPersistedState(
|
|
credential.WithCredentialsConfig(&awsutil.CredentialsConfig{
|
|
Region: "us-west-2",
|
|
AccessKey: "foobar",
|
|
SecretKey: "barfoo",
|
|
}),
|
|
)
|
|
require.NoError(err)
|
|
|
|
state, err := newAwsCatalogPersistedState(
|
|
withCredentials(cred),
|
|
withTestEC2APIFunc(newTestMockEC2(nil)),
|
|
)
|
|
require.NoError(err)
|
|
|
|
clientRaw, err := state.EC2Client(context.Background())
|
|
require.NoError(err)
|
|
require.NotNil(clientRaw)
|
|
client, ok := clientRaw.(*testMockEC2)
|
|
require.True(ok)
|
|
require.NotNil(client)
|
|
require.Equal("us-west-2", client.Region)
|
|
}
|