-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37831 from aristosvo/sdkv2/grafana
Grafana: migrate to AWS SDK v2
- Loading branch information
Showing
28 changed files
with
1,402 additions
and
1,305 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,29 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package grafana | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
|
||
"github.com/aws/aws-sdk-go-v2/aws" | ||
awstypes "github.com/aws/aws-sdk-go-v2/service/grafana/types" | ||
tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" | ||
) | ||
|
||
func updatesError(apiObjects []awstypes.UpdateError) error { | ||
errs := tfslices.ApplyToAll(apiObjects, func(v awstypes.UpdateError) error { | ||
return updateError(&v) | ||
}) | ||
|
||
return errors.Join(errs...) | ||
} | ||
|
||
func updateError(apiObject *awstypes.UpdateError) error { | ||
if apiObject == nil { | ||
return nil | ||
} | ||
|
||
return fmt.Errorf("%d: %s", aws.ToInt32(apiObject.Code), aws.ToString(apiObject.Message)) | ||
} |
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,18 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package grafana | ||
|
||
// Exports for use in tests only. | ||
var ( | ||
ResourceLicenseAssociation = resourceLicenseAssociation | ||
ResourceRoleAssociation = resourceRoleAssociation | ||
ResourceWorkspace = resourceWorkspace | ||
ResourceWorkspaceAPIKey = resourceWorkspaceAPIKey | ||
ResourceWorkspaceSAMLConfiguration = resourceWorkspaceSAMLConfiguration | ||
|
||
FindLicensedWorkspaceByID = findLicensedWorkspaceByID | ||
FindRoleAssociationsByTwoPartKey = findRoleAssociationsByTwoPartKey | ||
FindSAMLConfigurationByID = findSAMLConfigurationByID | ||
FindWorkspaceByID = findWorkspaceByID | ||
) |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.