-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OCM-8979 | test: Prepare shared VPC resources
- Loading branch information
1 parent
9d3423c
commit 7948203
Showing
7 changed files
with
149 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package aws_client | ||
|
||
import ( | ||
"context" | ||
"github.com/aws/aws-sdk-go-v2/service/ram" | ||
"github.com/openshift-online/ocm-common/pkg/log" | ||
) | ||
|
||
func (awsClient AWSClient) CreateResourceShare(resourceShareName string, resourceArns []string, principles []string) (*ram.CreateResourceShareOutput, error) { | ||
input := &ram.CreateResourceShareInput{ | ||
Name: &resourceShareName, | ||
ResourceArns: resourceArns, | ||
Principals: principles, | ||
} | ||
|
||
resp, err := awsClient.RamClient.CreateResourceShare(context.TODO(), input) | ||
if err != nil { | ||
log.LogError("Create resource share failed with name %s: %s", resourceShareName, err.Error()) | ||
} else { | ||
log.LogInfo("Create resource share succeed with name %s", resourceShareName) | ||
} | ||
return resp, err | ||
} | ||
|
||
func (awsClient AWSClient) DeleteResourceShare(resourceShareArn string) error { | ||
input := &ram.DeleteResourceShareInput{ | ||
ResourceShareArn: &resourceShareArn, | ||
} | ||
|
||
_, err := awsClient.RamClient.DeleteResourceShare(context.TODO(), input) | ||
return err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters