Skip to content

Commit

Permalink
Merge pull request #74 from jameszwang/ocm-11486
Browse files Browse the repository at this point in the history
OCM-11486 | test: Add prepare resource share function
  • Loading branch information
xueli181114 authored Sep 27, 2024
2 parents cb285ed + 3529244 commit c064d6c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/aws/aws_client/ram.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,16 @@ func (awsClient AWSClient) DeleteResourceShare(resourceShareArn string) error {
_, err := awsClient.RamClient.DeleteResourceShare(context.TODO(), input)
return err
}

func (awsClient AWSClient) PrepareResourceShare(resourceShareName string, resourceArns []string, accountID string) (string, error) {
var principles []string
principles = append(principles, accountID)

sharedResourceOutput, err := awsClient.CreateResourceShare(resourceShareName, resourceArns, principles)
if err != nil {
return "", err
}
resourceShareArn := *sharedResourceOutput.ResourceShare.ResourceShareArn

return resourceShareArn, err
}

0 comments on commit c064d6c

Please sign in to comment.