s3site

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: MIT Imports: 105 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccountID

func GetAccountID(iamconn *iam.IAM, stsconn *sts.STS, authProviderName string) (string, error)

func GetCredentials

func GetCredentials(c *Config) (*awsCredentials.Credentials, error)

This function is responsible for reading credentials from the environment in the case that they're not explicitly specified in the Terraform configuration.

func GetSupportedEC2Platforms

func GetSupportedEC2Platforms(conn *ec2.EC2) ([]string, error)

func Provider

func Provider() terraform.ResourceProvider

Types

type AWSClient

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

func (*AWSClient) DynamoDB

func (c *AWSClient) DynamoDB() *dynamodb.DynamoDB

func (*AWSClient) IsChinaCloud

func (c *AWSClient) IsChinaCloud() bool

func (*AWSClient) IsGovCloud

func (c *AWSClient) IsGovCloud() bool

func (*AWSClient) S3

func (c *AWSClient) S3() *s3.S3

type Config

type Config struct {
	AccessKey     string
	SecretKey     string
	CredsFilename string
	Profile       string
	Token         string
	Region        string
	MaxRetries    int

	AssumeRoleARN         string
	AssumeRoleExternalID  string
	AssumeRoleSessionName string
	AssumeRolePolicy      string

	AllowedAccountIds   []interface{}
	ForbiddenAccountIds []interface{}

	AcmEndpoint              string
	ApigatewayEndpoint       string
	CloudFormationEndpoint   string
	CloudWatchEndpoint       string
	CloudWatchEventsEndpoint string
	CloudWatchLogsEndpoint   string
	DynamoDBEndpoint         string
	DeviceFarmEndpoint       string
	Ec2Endpoint              string
	EcsEndpoint              string
	EcrEndpoint              string
	ElbEndpoint              string
	IamEndpoint              string
	KinesisEndpoint          string
	KmsEndpoint              string
	LambdaEndpoint           string
	RdsEndpoint              string
	R53Endpoint              string
	S3Endpoint               string
	SnsEndpoint              string
	SqsEndpoint              string
	StsEndpoint              string
	Insecure                 bool

	SkipCredsValidation     bool
	SkipGetEC2Platforms     bool
	SkipRegionValidation    bool
	SkipRequestingAccountId bool
	SkipMetadataApiCheck    bool
	S3ForcePathStyle        bool
}

func (*Config) Client

func (c *Config) Client() (interface{}, error)

Client configures and returns a fully initialized AWSClient

func (*Config) ValidateAccountId

func (c *Config) ValidateAccountId(accountId string) error

ValidateAccountId returns a context-specific error if the configured account id is explicitly forbidden or not authorised; and nil if it is authorised.

func (*Config) ValidateCredentials

func (c *Config) ValidateCredentials(stsconn *sts.STS) error

Validate credentials early and fail before we do any graph walking.

func (*Config) ValidateRegion

func (c *Config) ValidateRegion() error

ValidateRegion returns an error if the configured region is not a valid aws region and nil otherwise.

type Meta

type Meta struct {
	Session  *session.Session
	S3Helper *S3Helper
}

type S3Helper

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

func NewS3Helper

func NewS3Helper(session *session.Session) *S3Helper

func (S3Helper) BulkUploadS3Objects

func (s3Helper S3Helper) BulkUploadS3Objects(fileMap map[string]fileInfo, bucket string) error

func (S3Helper) DeleteAllObjects

func (s3Helper S3Helper) DeleteAllObjects(bucket string) error

func (S3Helper) DeleteObjects

func (s3Helper S3Helper) DeleteObjects(bucket string, keys []string) error

func (S3Helper) ListS3Objects

func (s3Helper S3Helper) ListS3Objects(bucket string) (*s3.ListObjectsV2Output, error)

func (S3Helper) PutFile

func (s3Helper S3Helper) PutFile(fi fileInfo, bucket string) error

Jump to

Keyboard shortcuts

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