-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for AWS account onboarding without CloudFormation (#128) * Support relative paths for the credentials file (#130) * Support reading credentials from current environment (#132) * Add support for bootstrapping Rubrik clusters (#127) * Improve error messages (#133) * Check if vars exist when reading credentials from env (#134) * Change ID type from uuid.UUID to string (#129) * Add support for AWS shared exocompute (#136) * Add support for AWS private container registry (#137) * Add support for AWS cloud archival location (#138) * Add aws exocompute update (#140) (#143) * Update aws exocompute config fields (#144) * Do not populate non-existing aws exo config subnets (#145) * Add support for reading PCR (#146) * Add support for permission groups to AWS features (#147) * Add support for reading deployment IP addresses (#148) * Add missing private container registry comments (#142) * Cleanup now removes all AWS features (#149) * Fix shared exocompute (#150) * Fix AWS account list functionality (#151) * Add support for BYOK clusters (#152) * Fix feature permission group updates (#154) * Fix BYOK connect cluster query (#155) * Update AWS PCR documentation (#156) * Add support for BYOK8s cluster disconnect (#157) * Update dependencies and bump compiler version (#159)
- Loading branch information
1 parent
783f717
commit 51cab53
Showing
71 changed files
with
4,504 additions
and
651 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
/access_roles | ||
/appliance | ||
/aws_account | ||
/aws_cross_account_role | ||
/aws_exocompute | ||
/aws_shared_exocompute | ||
/aws_storage_setting | ||
/azure_exocompute | ||
/azure_permissions | ||
/azure_subscription | ||
/gcp_permissions | ||
/gcp_project | ||
/gcp_project_with_set_sa | ||
/roles | ||
/examples/access_roles/access_roles | ||
/examples/appliance/appliance | ||
/examples/aws_account/aws_account | ||
/examples/aws_cross_account_role/aws_cross_account_role | ||
/examples/aws_exocompute/aws_exocompute | ||
/examples/aws_shared_exocompute/aws_shared_exocompute | ||
/examples/aws_storage_setting/aws_storage_setting | ||
/examples/azure_exocompute/azure_exocompute | ||
/examples/azure_permissions/azure_permissions | ||
/examples/azure_subscription/azure_subscription | ||
/examples/gcp_project/gcp_permissions | ||
/examples/gcp_project/gcp_project | ||
/examples/gcp_project/gcp_project_with_set_sa | ||
/examples/roles/roles |
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,86 @@ | ||
// Copyright 2024 Rubrik, Inc. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to | ||
// deal in the Software without restriction, including without limitation the | ||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
// sell copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
// DEALINGS IN THE SOFTWARE. | ||
|
||
package main | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"log" | ||
|
||
"github.com/rubrikinc/rubrik-polaris-sdk-for-go/pkg/polaris" | ||
"github.com/rubrikinc/rubrik-polaris-sdk-for-go/pkg/polaris/aws" | ||
"github.com/rubrikinc/rubrik-polaris-sdk-for-go/pkg/polaris/graphql/core" | ||
polaris_log "github.com/rubrikinc/rubrik-polaris-sdk-for-go/pkg/polaris/log" | ||
) | ||
|
||
// Example showing how to manage an AWS account with the Polaris Go SDK. | ||
// | ||
// The Polaris service account key file identifying the Polaris account should | ||
// either be placed at ~/.rubrik/polaris-service-account.json or pointed out by | ||
// the RUBRIK_POLARIS_SERVICEACCOUNT_FILE environment variable. | ||
func main() { | ||
ctx := context.Background() | ||
|
||
// Load configuration and create client. | ||
polAccount, err := polaris.DefaultServiceAccount(true) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
logger := polaris_log.NewStandardLogger() | ||
polaris.SetLogLevelFromEnv(logger) | ||
client, err := polaris.NewClientWithLogger(polAccount, logger) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
awsClient := aws.Wrap(client) | ||
|
||
// RSC features and their permission groups. | ||
features := []core.Feature{ | ||
core.FeatureCloudNativeProtection.WithPermissionGroups(core.PermissionGroupBasic), | ||
core.FeatureExocompute.WithPermissionGroups(core.PermissionGroupBasic, core.PermissionGroupRSCManagedCluster), | ||
} | ||
|
||
// Add the AWS default account to Polaris. Usually resolved using the | ||
// environment variables AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and | ||
// AWS_DEFAULT_REGION. | ||
id, err := awsClient.AddAccount(ctx, aws.Default(), features, aws.Regions("us-east-2")) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
// List the AWS accounts added to Polaris. | ||
account, err := awsClient.Account(ctx, aws.CloudAccountID(id), core.FeatureAll) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
fmt.Printf("ID: %v, Name: %v, NativeID: %v\n", account.ID, account.Name, account.NativeID) | ||
for _, feature := range account.Features { | ||
fmt.Printf("Feature: %v, Regions: %v, Status: %v\n", feature.Feature, feature.Regions, feature.Status) | ||
} | ||
|
||
// Remove the AWS account from Polaris. | ||
err = awsClient.RemoveAccount(ctx, aws.Default(), features, false) | ||
if err != nil { | ||
log.Fatal(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Copyright 2023 Rubrik, Inc. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to | ||
// deal in the Software without restriction, including without limitation the | ||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
// sell copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
// DEALINGS IN THE SOFTWARE. | ||
|
||
package main | ||
|
||
import ( | ||
"context" | ||
"log" | ||
|
||
"github.com/rubrikinc/rubrik-polaris-sdk-for-go/pkg/polaris" | ||
"github.com/rubrikinc/rubrik-polaris-sdk-for-go/pkg/polaris/aws" | ||
"github.com/rubrikinc/rubrik-polaris-sdk-for-go/pkg/polaris/graphql/core" | ||
polaris_log "github.com/rubrikinc/rubrik-polaris-sdk-for-go/pkg/polaris/log" | ||
) | ||
|
||
// Example showing how to set a private container registry with the RSC Go SDK. | ||
func main() { | ||
ctx := context.Background() | ||
|
||
// Load configuration and create client. | ||
polAccount, err := polaris.DefaultServiceAccount(true) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
logger := polaris_log.NewStandardLogger() | ||
polaris.SetLogLevelFromEnv(logger) | ||
client, err := polaris.NewClientWithLogger(polAccount, logger) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
awsClient := aws.Wrap(client) | ||
|
||
// Add the AWS default account to Polaris. Usually resolved using the | ||
// environment variables AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and | ||
// AWS_DEFAULT_REGION. | ||
id, err := awsClient.AddAccount(ctx, aws.Default(), | ||
[]core.Feature{core.FeatureCloudNativeProtection}, aws.Regions("us-east-2")) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
// Set the private container registry for the AWS account. | ||
err = awsClient.SetPrivateContainerRegistry(ctx, aws.CloudAccountID(id), | ||
"123456789012.dkr.ecr.us-east-2.amazonaws.com", "123456789012") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
// Remove the AWS account from Polaris. | ||
err = awsClient.RemoveAccount(ctx, aws.Default(), []core.Feature{core.FeatureCloudNativeProtection}, false) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
} |
Oops, something went wrong.