Documentation
¶
Overview ¶
Package s3 provides the data structures and logic necessary to enumerate and integrate AWS S3 resources.
Index ¶
- func EnumerateS3(ctx context.Context, cfg aws.Config, regions []string) methodaws.S3Report
- func EnumerateS3ForRegion(ctx context.Context, cfg aws.Config, region string) methodaws.S3Report
- func ExternalEnumerateS3(ctx context.Context, cfg aws.Config, bucketName string, regions []string) methodaws.ExternalS3Report
- func ExternalEnumerateS3Region(ctx context.Context, report methodaws.ExternalS3Report, bucketName string, ...) methodaws.ExternalS3Report
- type BucketObject
- type LsResourceReport
- type LsResources
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnumerateS3 ¶
func EnumerateS3ForRegion ¶ added in v0.0.18
EnumerateS3ForRegion retrieves all S3 buckets available to the caller and returns an EnumerateResourceReport struct. Non-fatal errors that occur during the execution of the `methodaws s3 enumerate` subcommand are included in the report, but the function will not return an error unless there is an issue retrieving the account ID.
func ExternalEnumerateS3 ¶ added in v0.0.13
func ExternalEnumerateS3(ctx context.Context, cfg aws.Config, bucketName string, regions []string) methodaws.ExternalS3Report
ExternalEnumerateS3 attempts to enumerate a public facing S3 bucket with no credentials. If the bucket does not exist, it will return an empty report.
func ExternalEnumerateS3Region ¶ added in v0.0.18
func ExternalEnumerateS3Region(ctx context.Context, report methodaws.ExternalS3Report, bucketName string, region string) methodaws.ExternalS3Report
ExternalEnumerateS3Region enumerates a single public facing S3 bucket in a specific region. If the bucket does not exist, it will return an unmodified report (with potential new errors).
Types ¶
type BucketObject ¶
type BucketObject struct {
Name string `json:"name" yaml:"name"`
Size int64 `json:"size" yaml:"size"`
}
BucketObject contains the name and size (in bytes) of an object stored in an S3 bucket.
type LsResourceReport ¶
type LsResourceReport struct {
Resources LsResources `json:"resources" yaml:"resources"`
Errors []string `json:"errors" yaml:"errors"`
}
LsResourceReport contains the resources discovered in an S3 bucket and any non-fatal errors that occurred during the execution of the `methodaws s3 ls` subcommand.
func LsS3Bucket ¶
LsS3Bucket retrieves the objects stored in an S3 bucket and returns an LsResourceReport struct
type LsResources ¶
type LsResources struct {
S3BucketName *string `json:"name" yaml:"name"`
BucketObjects []BucketObject `json:"objects" yaml:"objects"`
}
LsResources contains the S3 bucket name and the objects stored in the bucket.