Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nithyatsu committed Dec 5, 2024
1 parent 64c720e commit 403ec32
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/rp/rptest.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ import (
"testing"
"time"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/credentials/stscreds"
"github.com/aws/aws-sdk-go-v2/service/cloudcontrol"
"github.com/aws/aws-sdk-go-v2/service/sts"
ucp_aws "github.com/radius-project/radius/pkg/ucp/aws"
"github.com/stretchr/testify/require"
apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -43,7 +47,6 @@ import (
"github.com/radius-project/radius/pkg/cli/kubernetes"
"github.com/radius-project/radius/pkg/cli/workspaces"
"github.com/radius-project/radius/pkg/sdk"
"github.com/radius-project/radius/pkg/ucp/aws"
"github.com/radius-project/radius/test"
"github.com/radius-project/radius/test/radcli"
"github.com/radius-project/radius/test/step"
Expand Down Expand Up @@ -105,7 +108,7 @@ type RPTestOptions struct {

CustomAction *clientv2.CustomActionClient
ManagementClient clients.ApplicationsManagementClient
AWSClient aws.AWSCloudControlClient
AWSClient ucp_aws.AWSCloudControlClient

// Connection gets access to the Radius connection which can be used to create API clients.
Connection sdk.Connection
Expand Down Expand Up @@ -185,7 +188,12 @@ func NewRPTestOptions(t *testing.T) RPTestOptions {

cfg, err := awsconfig.LoadDefaultConfig(ctx)
require.NoError(t, err)
var awsClient aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg)

stsClient := sts.NewFromConfig(cfg)
roleARN := "arn:aws:iam::179022619019:role/radius_func_test"
creds := stscreds.NewAssumeRoleProvider(stsClient, roleARN)
cfg.Credentials = aws.NewCredentialsCache(creds)
var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg)

return RPTestOptions{
TestOptions: test.NewTestOptions(t),
Expand Down

0 comments on commit 403ec32

Please sign in to comment.