aws

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 6 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.

Index

Constants

View Source
const (
	// ProviderDisplayName is the text used in display for AWS.
	ProviderDisplayName        = "AWS"
	AWSCredentialKindAccessKey = "AccessKey"
	AWSCredentialKindIRSA      = "IRSA"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSCredentialKind added in v0.37.0

type AWSCredentialKind string

AWSCredentialKind - AWS credential kinds supported.

type AccessKeyCredential added in v0.37.0

type AccessKeyCredential struct {
	// AccessKeyID is the access key id for the AWS account.
	AccessKeyID string

	// SecretAccessKey is the secret access key for the AWS account.
	SecretAccessKey string
}

type Client

type Client interface {
	// GetCallerIdentity gets information about the provided credentials.
	GetCallerIdentity(ctx context.Context) (*sts.GetCallerIdentityOutput, error)
	// ListRegions lists the AWS regions available (fetched from EC2.DescribeRegions API).
	ListRegions(ctx context.Context) (*ec2.DescribeRegionsOutput, error)
}

Client is an interface that abstracts `rad init`'s interactions with AWS. This is for testing purposes. This is only exported because mockgen requires it.

func NewClient

func NewClient() Client

NewClient returns a new Client.

type IRSACredential added in v0.37.0

type IRSACredential struct {
	// RoleARN for AWS IRSA identity
	RoleARN string
}

type MockClient

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

MockClient is a mock of Client interface.

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

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

func (*MockClient) GetCallerIdentity

func (m *MockClient) GetCallerIdentity(arg0 context.Context) (*sts.GetCallerIdentityOutput, error)

GetCallerIdentity mocks base method.

func (*MockClient) ListRegions

func (m *MockClient) ListRegions(arg0 context.Context) (*ec2.DescribeRegionsOutput, error)

ListRegions mocks base method.

type MockClientGetCallerIdentityCall added in v0.35.0

type MockClientGetCallerIdentityCall struct {
	*gomock.Call
}

MockClientGetCallerIdentityCall wrap *gomock.Call

func (*MockClientGetCallerIdentityCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockClientGetCallerIdentityCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockClientGetCallerIdentityCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockClientListRegionsCall added in v0.35.0

type MockClientListRegionsCall struct {
	*gomock.Call
}

MockClientListRegionsCall wrap *gomock.Call

func (*MockClientListRegionsCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockClientListRegionsCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockClientListRegionsCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) GetCallerIdentity

func (mr *MockClientMockRecorder) GetCallerIdentity(arg0 any) *MockClientGetCallerIdentityCall

GetCallerIdentity indicates an expected call of GetCallerIdentity.

func (*MockClientMockRecorder) ListRegions

func (mr *MockClientMockRecorder) ListRegions(arg0 any) *MockClientListRegionsCall

ListRegions indicates an expected call of ListRegions.

type Provider

type Provider struct {

	// Region is the AWS region to use.
	Region string

	// AccountID is the AWS account id.
	AccountID string

	// CredentialKind represents ucp credential kind for aws provider.
	CredentialKind AWSCredentialKind

	// AccessKey represents ucp credential kind for aws access key credentials.
	AccessKey *AccessKeyCredential

	// IRSA represents ucp credential kind for aws irsa credentials.
	IRSA *IRSACredential
}

Provider specifies the properties required to configure AWS provider for cloud resources.

Jump to

Keyboard shortcuts

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