aws

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 16 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)
)

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 MockAWSCloudControlClientMockRecorder

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

MockAWSCloudControlClientMockRecorder is the mock recorder for MockAWSCloudControlClient.

func (*MockAWSCloudControlClientMockRecorder) CancelResourceRequest

func (mr *MockAWSCloudControlClientMockRecorder) CancelResourceRequest(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

CancelResourceRequest indicates an expected call of CancelResourceRequest.

func (*MockAWSCloudControlClientMockRecorder) CreateResource

func (mr *MockAWSCloudControlClientMockRecorder) CreateResource(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

CreateResource indicates an expected call of CreateResource.

func (*MockAWSCloudControlClientMockRecorder) DeleteResource

func (mr *MockAWSCloudControlClientMockRecorder) DeleteResource(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

DeleteResource indicates an expected call of DeleteResource.

func (*MockAWSCloudControlClientMockRecorder) GetResource

func (mr *MockAWSCloudControlClientMockRecorder) GetResource(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

GetResource indicates an expected call of GetResource.

func (*MockAWSCloudControlClientMockRecorder) GetResourceRequestStatus

func (mr *MockAWSCloudControlClientMockRecorder) GetResourceRequestStatus(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

GetResourceRequestStatus indicates an expected call of GetResourceRequestStatus.

func (*MockAWSCloudControlClientMockRecorder) ListResourceRequests

func (mr *MockAWSCloudControlClientMockRecorder) ListResourceRequests(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

ListResourceRequests indicates an expected call of ListResourceRequests.

func (*MockAWSCloudControlClientMockRecorder) ListResources

func (mr *MockAWSCloudControlClientMockRecorder) ListResources(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

ListResources indicates an expected call of ListResources.

func (*MockAWSCloudControlClientMockRecorder) UpdateResource

func (mr *MockAWSCloudControlClientMockRecorder) UpdateResource(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

UpdateResource indicates an expected call of UpdateResource.

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 MockAWSCloudFormationClientMockRecorder

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

MockAWSCloudFormationClientMockRecorder is the mock recorder for MockAWSCloudFormationClient.

func (*MockAWSCloudFormationClientMockRecorder) DescribeType

func (mr *MockAWSCloudFormationClientMockRecorder) DescribeType(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

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