Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nithyatsu committed Dec 6, 2024
1 parent a37e670 commit 08de415
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/functional-test-cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -550,14 +550,14 @@ jobs:
with:
version: ${{ env.HELM_VER }}

# this step is to configure the aws credentials for github actions.
# The role-to-assume is the role that the github action will assume to execute aws commands.
# - name: configure aws credentials using assumed role
# uses: aws-actions/[email protected]
# with:
# role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/radius_func_test #TODO: change to reflect ARN of the role to assume craeted in functional test account
# role-session-name: GitHub_to_AWS_via_FederatedOIDC
# aws-region: ${{ env.AWS_REGION }}
#this step is to configure the aws credentials for github actions.
#The role-to-assume is the role that the github action will assume to execute aws commands.
- name: configure aws credentials using assumed role
uses: aws-actions/[email protected]
with:
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/radius_func_test #TODO: change to reflect ARN of the role to assume craeted in functional test account
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ env.AWS_REGION }}

# create kind cluster with OIDC provider.

Expand Down
6 changes: 2 additions & 4 deletions test/functional-portable/ucp/cloud/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ import (

awsgo "github.com/aws/aws-sdk-go-v2/aws"
awsconfig "github.com/aws/aws-sdk-go-v2/config"
"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"
"github.com/google/uuid"
"github.com/radius-project/radius/pkg/ucp/api/v20231001preview"
"github.com/radius-project/radius/pkg/ucp/aws"
Expand Down Expand Up @@ -152,12 +150,12 @@ func setupTestAWSResource(t *testing.T, ctx context.Context, resourceName string
// Test setup - Create AWS resource using AWS APIs
cfg, err := awsconfig.LoadDefaultConfig(ctx)
require.NoError(t, err)
//var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg)
/* var awsClient ucp_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 = awsgo.NewCredentialsCache(creds)
cfg.Credentials = awsgo.NewCredentialsCache(creds)*/
var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg)

desiredState := map[string]any{
Expand Down
7 changes: 2 additions & 5 deletions test/rp/rptest.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ 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"
Expand Down Expand Up @@ -188,12 +185,12 @@ func NewRPTestOptions(t *testing.T) RPTestOptions {

cfg, err := awsconfig.LoadDefaultConfig(ctx)
require.NoError(t, err)
//var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg)
/*var awsClient ucp_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)
cfg.Credentials = aws.NewCredentialsCache(creds)*/
var awsClient ucp_aws.AWSCloudControlClient = cloudcontrol.NewFromConfig(cfg)

return RPTestOptions{
Expand Down

0 comments on commit 08de415

Please sign in to comment.