Documentation
¶
Overview ¶
Package aws provides an SDK client factory that resolves credentials via the standard AWS credential chain and returns typed service clients for all AWS services the Data Releaser uses.
Index ¶
- Constants
- type APIGatewayClient
- type AthenaClient
- type ClientFactory
- func (f *ClientFactory) APIGatewayClient() APIGatewayClient
- func (f *ClientFactory) AWSConfig() aws.Config
- func (f *ClientFactory) AthenaClient() AthenaClient
- func (f *ClientFactory) DynamoDBClient() DynamoDBClient
- func (f *ClientFactory) KMSClient() KMSClient
- func (f *ClientFactory) LambdaClient() LambdaClient
- func (f *ClientFactory) RAMClient() RAMClient
- func (f *ClientFactory) S3Client() S3Client
- func (f *ClientFactory) STSClient() STSClient
- func (f *ClientFactory) StepFunctionsClient() StepFunctionsClient
- type DynamoDBClient
- type KMSClient
- type LambdaClient
- type RAMClient
- type S3Client
- type STSClient
- type StepFunctionsClient
Constants ¶
const DefaultRegion = "ap-southeast-2"
DefaultRegion is the Data Control account's region.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIGatewayClient ¶
type APIGatewayClient interface {
GetStage(ctx context.Context, params *apigateway.GetStageInput, optFns ...func(*apigateway.Options)) (*apigateway.GetStageOutput, error)
}
APIGatewayClient defines the interface for API Gateway operations used by the application.
type AthenaClient ¶
type AthenaClient interface {
StartQueryExecution(ctx context.Context, params *athena.StartQueryExecutionInput, optFns ...func(*athena.Options)) (*athena.StartQueryExecutionOutput, error)
GetQueryExecution(ctx context.Context, params *athena.GetQueryExecutionInput, optFns ...func(*athena.Options)) (*athena.GetQueryExecutionOutput, error)
GetQueryResults(ctx context.Context, params *athena.GetQueryResultsInput, optFns ...func(*athena.Options)) (*athena.GetQueryResultsOutput, error)
}
AthenaClient defines the interface for Athena operations used by the application.
type ClientFactory ¶
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory creates configured AWS SDK clients using credentials resolved via the standard AWS credential chain. It wraps config.LoadDefaultConfig and supports an optional profile override.
func NewClientFactory ¶
NewClientFactory resolves AWS credentials and returns a ClientFactory. If profile is non-empty, credentials are loaded from that named profile. If region is empty, DefaultRegion (ap-southeast-2) is used. Returns a descriptive error if credential resolution fails.
func (*ClientFactory) APIGatewayClient ¶
func (f *ClientFactory) APIGatewayClient() APIGatewayClient
APIGatewayClient returns a configured API Gateway client.
func (*ClientFactory) AWSConfig ¶
func (f *ClientFactory) AWSConfig() aws.Config
AWSConfig returns the underlying aws.Config for advanced use cases.
func (*ClientFactory) AthenaClient ¶
func (f *ClientFactory) AthenaClient() AthenaClient
AthenaClient returns a configured Athena client.
func (*ClientFactory) DynamoDBClient ¶
func (f *ClientFactory) DynamoDBClient() DynamoDBClient
DynamoDBClient returns a configured DynamoDB client.
func (*ClientFactory) KMSClient ¶
func (f *ClientFactory) KMSClient() KMSClient
KMSClient returns a configured KMS client.
func (*ClientFactory) LambdaClient ¶
func (f *ClientFactory) LambdaClient() LambdaClient
LambdaClient returns a configured Lambda client.
func (*ClientFactory) RAMClient ¶
func (f *ClientFactory) RAMClient() RAMClient
RAMClient returns a configured RAM client.
func (*ClientFactory) S3Client ¶
func (f *ClientFactory) S3Client() S3Client
S3Client returns a configured S3 client.
func (*ClientFactory) STSClient ¶
func (f *ClientFactory) STSClient() STSClient
STSClient returns a configured STS client.
func (*ClientFactory) StepFunctionsClient ¶
func (f *ClientFactory) StepFunctionsClient() StepFunctionsClient
StepFunctionsClient returns a configured Step Functions client.
type DynamoDBClient ¶
type DynamoDBClient interface {
PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
UpdateItem(ctx context.Context, params *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error)
Query(ctx context.Context, params *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)
Scan(ctx context.Context, params *dynamodb.ScanInput, optFns ...func(*dynamodb.Options)) (*dynamodb.ScanOutput, error)
DescribeTable(ctx context.Context, params *dynamodb.DescribeTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DescribeTableOutput, error)
}
DynamoDBClient defines the interface for DynamoDB operations used by the application.
type KMSClient ¶
type KMSClient interface {
DescribeKey(ctx context.Context, params *kms.DescribeKeyInput, optFns ...func(*kms.Options)) (*kms.DescribeKeyOutput, error)
GetKeyPolicy(ctx context.Context, params *kms.GetKeyPolicyInput, optFns ...func(*kms.Options)) (*kms.GetKeyPolicyOutput, error)
PutKeyPolicy(ctx context.Context, params *kms.PutKeyPolicyInput, optFns ...func(*kms.Options)) (*kms.PutKeyPolicyOutput, error)
ScheduleKeyDeletion(ctx context.Context, params *kms.ScheduleKeyDeletionInput, optFns ...func(*kms.Options)) (*kms.ScheduleKeyDeletionOutput, error)
CancelKeyDeletion(ctx context.Context, params *kms.CancelKeyDeletionInput, optFns ...func(*kms.Options)) (*kms.CancelKeyDeletionOutput, error)
DisableKey(ctx context.Context, params *kms.DisableKeyInput, optFns ...func(*kms.Options)) (*kms.DisableKeyOutput, error)
EnableKey(ctx context.Context, params *kms.EnableKeyInput, optFns ...func(*kms.Options)) (*kms.EnableKeyOutput, error)
}
KMSClient defines the interface for KMS operations used by the application.
The read operations report a key's state and its deployed policy; the write operations replace that policy, disable the key, and schedule its deletion. Scheduling deletion is what renders objects encrypted under a key permanently unreadable once the pending window elapses, so it is deliberately the only destructive operation exposed here.
Cancelling that deletion and enabling the key are the two halves of taking it back, and both are here because either alone leaves a key that decrypts nothing: a cancelled deletion returns a key to Disabled rather than to Enabled, which presents to a researcher exactly like the purge did.
type LambdaClient ¶
type LambdaClient interface {
Invoke(ctx context.Context, params *lambda.InvokeInput, optFns ...func(*lambda.Options)) (*lambda.InvokeOutput, error)
ListFunctions(ctx context.Context, params *lambda.ListFunctionsInput, optFns ...func(*lambda.Options)) (*lambda.ListFunctionsOutput, error)
}
LambdaClient defines the interface for Lambda operations used by the application.
type RAMClient ¶
type RAMClient interface {
}
RAMClient defines the interface for RAM operations used by the application.
type S3Client ¶
type S3Client interface {
PutObject(ctx context.Context, params *s3.PutObjectInput, optFns ...func(*s3.Options)) (*s3.PutObjectOutput, error)
GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
DeleteObject(ctx context.Context, params *s3.DeleteObjectInput, optFns ...func(*s3.Options)) (*s3.DeleteObjectOutput, error)
DeleteObjects(ctx context.Context, params *s3.DeleteObjectsInput, optFns ...func(*s3.Options)) (*s3.DeleteObjectsOutput, error)
HeadObject(ctx context.Context, params *s3.HeadObjectInput, optFns ...func(*s3.Options)) (*s3.HeadObjectOutput, error)
HeadBucket(ctx context.Context, params *s3.HeadBucketInput, optFns ...func(*s3.Options)) (*s3.HeadBucketOutput, error)
ListObjectsV2(ctx context.Context, params *s3.ListObjectsV2Input, optFns ...func(*s3.Options)) (*s3.ListObjectsV2Output, error)
GetBucketPolicy(ctx context.Context, params *s3.GetBucketPolicyInput, optFns ...func(*s3.Options)) (*s3.GetBucketPolicyOutput, error)
PutBucketPolicy(ctx context.Context, params *s3.PutBucketPolicyInput, optFns ...func(*s3.Options)) (*s3.PutBucketPolicyOutput, error)
DeleteBucketPolicy(ctx context.Context, params *s3.DeleteBucketPolicyInput, optFns ...func(*s3.Options)) (*s3.DeleteBucketPolicyOutput, error)
}
S3Client defines the interface for S3 operations used by the application.
Both delete operations are here because they are used for different things. A single delete removes one document this tool wrote and knows the key of, such as a researcher's manifest. The batched one empties a dataset's cache bucket, where the keys are whatever the copy delivered and there are thousands of them: a call per object would take a request per object and report a failure per object, which for the one operation that cannot be undone is both too slow to finish and too noisy to read.
type STSClient ¶
type STSClient interface {
GetCallerIdentity(ctx context.Context, params *sts.GetCallerIdentityInput, optFns ...func(*sts.Options)) (*sts.GetCallerIdentityOutput, error)
}
STSClient defines the interface for STS operations used by the application.
type StepFunctionsClient ¶
type StepFunctionsClient interface {
StartExecution(ctx context.Context, params *sfn.StartExecutionInput, optFns ...func(*sfn.Options)) (*sfn.StartExecutionOutput, error)
DescribeExecution(ctx context.Context, params *sfn.DescribeExecutionInput, optFns ...func(*sfn.Options)) (*sfn.DescribeExecutionOutput, error)
}
StepFunctionsClient defines the interface for Step Functions operations used by the application. An execution is started and then inspected on demand; nothing polls it to completion, because a copy run lasts hours to days and its terminal state arrives as an event instead.