aws

package
v0.41.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright 2023 The Radius Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package aws is a generated GoMock package.

Package aws is a generated GoMock package.

Index

Constants

View Source
const (
	// DefaultExpireDuration is the default access key expiry duration.
	DefaultExpireDuration = time.Minute * time.Duration(15)

	// CredentialKind is IRSA
	CredentialKindIRSA = "IRSA"
	// CredentialKind is AccessKey
	CredentialKindAccessKey = "AccessKey"
	// Token file path for IRSA
	TokenFilePath = "/var/run/secrets/eks.amazonaws.com/serviceaccount/token"
)

Variables

This section is empty.

Functions

func HandleAWSError

func HandleAWSError(err error) (armrpc_rest.Response, error)

HandleAWSError takes in an error and returns an ARMResponse and an error. It checks the error type and returns an appropriate response based on the error code and message. If the error is a client fault, it returns a BadRequestARMResponse, otherwise it returns an InternalServerErrorARMResponse.

func IsAWSResourceNotFoundError

func IsAWSResourceNotFoundError(err error) bool

Checks if the given error is an AWS ResourceNotFoundException error. If so, it returns true, otherwise false.

Types

type AWSCloudControlClient

Didn't see an interface for aws-sdk-go-v2, v1 had: https://pkg.go.dev/github.com/aws/aws-sdk-go/service/cloudcontrolapi/cloudcontrolapiiface This is most likely due to using json schemas to define types rather than crafting by hand. There are significantly less functions in v2, so a small mock.

type AWSCloudFormationClient

type AWSCloudFormationClient interface {
	DescribeType(ctx context.Context, params *cloudformation.DescribeTypeInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeTypeOutput, error)
}

type AWSMissingPropertyError

type AWSMissingPropertyError struct {
	PropertyName string
}

AWSMissingPropertyError is an error type to be returned when the call to UCP CreateWithPost is missing values for one of the expected primary identifier properties

func (*AWSMissingPropertyError) Error

func (e *AWSMissingPropertyError) Error() string

Error returns a string containing the name of the missing property for an AWSMissingPropertyError.

func (*AWSMissingPropertyError) Is

func (e *AWSMissingPropertyError) Is(target error) bool

Is checks if the target error is of type AWSMissingPropertyError and returns a boolean value indicating the result.

type Clients

type Clients struct {
	// CloudControl is the AWS Cloud Control client.
	CloudControl AWSCloudControlClient

	// CloudFormation is the AWS Cloud Formation client.
	CloudFormation AWSCloudFormationClient
}

Clients contains the AWS clients.

type MockAWSCloudControlClient

type MockAWSCloudControlClient struct {
	// contains filtered or unexported fields
}

MockAWSCloudControlClient is a mock of AWSCloudControlClient interface.

func NewMockAWSCloudControlClient

func NewMockAWSCloudControlClient(ctrl *gomock.Controller) *MockAWSCloudControlClient

NewMockAWSCloudControlClient creates a new mock instance.

func (*MockAWSCloudControlClient) CancelResourceRequest

CancelResourceRequest mocks base method.

func (*MockAWSCloudControlClient) CreateResource

CreateResource mocks base method.

func (*MockAWSCloudControlClient) DeleteResource

DeleteResource mocks base method.

func (*MockAWSCloudControlClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAWSCloudControlClient) GetResource

GetResource mocks base method.

func (*MockAWSCloudControlClient) GetResourceRequestStatus

GetResourceRequestStatus mocks base method.

func (*MockAWSCloudControlClient) ListResourceRequests

ListResourceRequests mocks base method.

func (*MockAWSCloudControlClient) ListResources

ListResources mocks base method.

func (*MockAWSCloudControlClient) UpdateResource

UpdateResource mocks base method.

type MockAWSCloudControlClientCancelResourceRequestCall added in v0.35.0

type MockAWSCloudControlClientCancelResourceRequestCall struct {
	*gomock.Call
}

MockAWSCloudControlClientCancelResourceRequestCall wrap *gomock.Call

func (*MockAWSCloudControlClientCancelResourceRequestCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockAWSCloudControlClientCancelResourceRequestCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockAWSCloudControlClientCancelResourceRequestCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockAWSCloudControlClientCreateResourceCall added in v0.35.0

type MockAWSCloudControlClientCreateResourceCall struct {
	*gomock.Call
}

MockAWSCloudControlClientCreateResourceCall wrap *gomock.Call

func (*MockAWSCloudControlClientCreateResourceCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockAWSCloudControlClientCreateResourceCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockAWSCloudControlClientCreateResourceCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockAWSCloudControlClientDeleteResourceCall added in v0.35.0

type MockAWSCloudControlClientDeleteResourceCall struct {
	*gomock.Call
}

MockAWSCloudControlClientDeleteResourceCall wrap *gomock.Call

func (*MockAWSCloudControlClientDeleteResourceCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockAWSCloudControlClientDeleteResourceCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockAWSCloudControlClientDeleteResourceCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockAWSCloudControlClientGetResourceCall added in v0.35.0

type MockAWSCloudControlClientGetResourceCall struct {
	*gomock.Call
}

MockAWSCloudControlClientGetResourceCall wrap *gomock.Call

func (*MockAWSCloudControlClientGetResourceCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockAWSCloudControlClientGetResourceCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockAWSCloudControlClientGetResourceCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockAWSCloudControlClientGetResourceRequestStatusCall added in v0.35.0

type MockAWSCloudControlClientGetResourceRequestStatusCall struct {
	*gomock.Call
}

MockAWSCloudControlClientGetResourceRequestStatusCall wrap *gomock.Call

func (*MockAWSCloudControlClientGetResourceRequestStatusCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockAWSCloudControlClientGetResourceRequestStatusCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockAWSCloudControlClientGetResourceRequestStatusCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockAWSCloudControlClientListResourceRequestsCall added in v0.35.0

type MockAWSCloudControlClientListResourceRequestsCall struct {
	*gomock.Call
}

MockAWSCloudControlClientListResourceRequestsCall wrap *gomock.Call

func (*MockAWSCloudControlClientListResourceRequestsCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockAWSCloudControlClientListResourceRequestsCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockAWSCloudControlClientListResourceRequestsCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockAWSCloudControlClientListResourcesCall added in v0.35.0

type MockAWSCloudControlClientListResourcesCall struct {
	*gomock.Call
}

MockAWSCloudControlClientListResourcesCall wrap *gomock.Call

func (*MockAWSCloudControlClientListResourcesCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockAWSCloudControlClientListResourcesCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockAWSCloudControlClientListResourcesCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockAWSCloudControlClientMockRecorder

type MockAWSCloudControlClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockAWSCloudControlClientMockRecorder is the mock recorder for MockAWSCloudControlClient.

func (*MockAWSCloudControlClientMockRecorder) CancelResourceRequest

CancelResourceRequest indicates an expected call of CancelResourceRequest.

func (*MockAWSCloudControlClientMockRecorder) CreateResource

CreateResource indicates an expected call of CreateResource.

func (*MockAWSCloudControlClientMockRecorder) DeleteResource

DeleteResource indicates an expected call of DeleteResource.

func (*MockAWSCloudControlClientMockRecorder) GetResource

GetResource indicates an expected call of GetResource.

func (*MockAWSCloudControlClientMockRecorder) GetResourceRequestStatus

GetResourceRequestStatus indicates an expected call of GetResourceRequestStatus.

func (*MockAWSCloudControlClientMockRecorder) ListResourceRequests

ListResourceRequests indicates an expected call of ListResourceRequests.

func (*MockAWSCloudControlClientMockRecorder) ListResources

ListResources indicates an expected call of ListResources.

func (*MockAWSCloudControlClientMockRecorder) UpdateResource

UpdateResource indicates an expected call of UpdateResource.

type MockAWSCloudControlClientUpdateResourceCall added in v0.35.0

type MockAWSCloudControlClientUpdateResourceCall struct {
	*gomock.Call
}

MockAWSCloudControlClientUpdateResourceCall wrap *gomock.Call

func (*MockAWSCloudControlClientUpdateResourceCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockAWSCloudControlClientUpdateResourceCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockAWSCloudControlClientUpdateResourceCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockAWSCloudFormationClient

type MockAWSCloudFormationClient struct {
	// contains filtered or unexported fields
}

MockAWSCloudFormationClient is a mock of AWSCloudFormationClient interface.

func NewMockAWSCloudFormationClient

func NewMockAWSCloudFormationClient(ctrl *gomock.Controller) *MockAWSCloudFormationClient

NewMockAWSCloudFormationClient creates a new mock instance.

func (*MockAWSCloudFormationClient) DescribeType

DescribeType mocks base method.

func (*MockAWSCloudFormationClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockAWSCloudFormationClientDescribeTypeCall added in v0.35.0

type MockAWSCloudFormationClientDescribeTypeCall struct {
	*gomock.Call
}

MockAWSCloudFormationClientDescribeTypeCall wrap *gomock.Call

func (*MockAWSCloudFormationClientDescribeTypeCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockAWSCloudFormationClientDescribeTypeCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockAWSCloudFormationClientDescribeTypeCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockAWSCloudFormationClientMockRecorder

type MockAWSCloudFormationClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockAWSCloudFormationClientMockRecorder is the mock recorder for MockAWSCloudFormationClient.

func (*MockAWSCloudFormationClientMockRecorder) DescribeType

DescribeType indicates an expected call of DescribeType.

type UCPCredentialOptions

type UCPCredentialOptions struct {
	// Provider is an UCP credential provider.
	Provider sdk_cred.CredentialProvider[sdk_cred.AWSCredential]

	// Duration is the duration for the secret keys.
	Duration time.Duration
}

UCPCredentialOptions is a configuration for UCPCredentialProvider.

type UCPCredentialProvider

type UCPCredentialProvider struct {
	// contains filtered or unexported fields
}

UCPCredentialProvider is the implementation of aws.CredentialsProvider to retrieve credentials for AWS SDK via UCP credentials.

func NewUCPCredentialProvider

func NewUCPCredentialProvider(provider sdk_cred.CredentialProvider[sdk_cred.AWSCredential], expireDuration time.Duration) *UCPCredentialProvider

NewUCPCredentialProvider creates UCPCredentialProvider provider to fetch Secret Access key using UCP credential APIs.

func (*UCPCredentialProvider) Retrieve

Retrieve fetches credentials from an external provider, checks if they are valid, logs the AccessKeyID, and returns the credentials with an expiration time set. If the credentials are invalid, an error is returned.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL