aws

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: AGPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDynamoDBTable

func CreateDynamoDBTable(ctx context.Context, awsConfig aws.Config, tableName string) (*types.TableDescription, error)

func DeleteDynamoDBTable

func DeleteDynamoDBTable(ctx context.Context, awsConfig aws.Config, tableName string) error

func GetAWSConfig

func GetAWSConfig(ctx context.Context, roleArn string) aws.Config

func GetAssumedConfig

func GetAssumedConfig(ctx context.Context, baseConfig aws.Config, roleArn string) aws.Config

func GetDynamoDBTable

func GetDynamoDBTable(ctx context.Context, awsConfig aws.Config, tableName string) (*types.TableDescription, error)

func GetExistingDynamoDBTable

func GetExistingDynamoDBTable(ctx context.Context, client *dynamodb.Client, tableName string) (*types.TableDescription, error)

func NewAWS

func NewAWS(ctx context.Context, cloudPrefix string, awsFlags common.AWS) model.CloudProvider

func NewBuilder

func NewBuilder(ctx context.Context, awsConfig aws.Config, buildRoleArn string, logGroup string, logStream string, bucketArn string) model.Builder

func NewSSM

func NewSSM(ctx context.Context, awsConfig aws.Config) model.SSM

Types

type Account

type Account interface {
	GetAccountID() (string, error)
}

func NewSTS

func NewSTS(config aws.Config) Account

type Artifacts

type Artifacts struct {
	Files []string
}

type Build

type Build struct {
	Commands []string
}

type BuildSpec

type BuildSpec struct {
	Version   string
	Phases    Phases
	Artifacts Artifacts
}

type CloudWatch

type CloudWatch interface {
	GetLogGroup(logGroupName string) (string, error)
	CreateLogGroup(logGroupName string) (string, error)
	LogStreamExists(logGroupName string, logStreamName string) (bool, error)
	CreateLogStream(logGroupName string, logStreamName string) error
	GetLogs(logGroupName string, logStreamName string, limit int32) ([]string, error)
	DeleteLogGroup(logGroupName string) error
	DeleteLogStream(logGroupName, logStreamName string) error
}

func NewCloudWatch

func NewCloudWatch(ctx context.Context, awsConfig aws.Config) CloudWatch

type IAM

type IAM interface {
	AttachRolePolicy(policyArn string, roleName string) error
	DeleteRolePolicyAttachment(policyName string, roleName string) error
	DeleteRolePolicyAttachments(roleName string) error
	CreatePolicy(policyName string, statement []PolicyStatement) *types.Policy
	DeletePolicy(policyName string, accountId string) error
	UpdatePolicy(policyName string, statement []PolicyStatement) string
	CreateRole(roleName string, statement []PolicyStatement) *types.Role
	DeleteRole(roleName string) error
	GetRole(roleName string) *types.Role
	GetUser(username string) *types.User
	CreateUser(userName string) *types.User
	DeleteUser(userName string) error
	AttachUserPolicy(policyArn string, userName string)
	DetachUserPolicy(policyArn string, userName string) error
	CreateAccessKey(userName string) *types.AccessKey
	DeleteAccessKeys(userName string) error
}

func NewIAM

func NewIAM(ctx context.Context, config aws.Config, accountId string) IAM

type Install

type Install struct {
	Commands []string
}

type Phases

type Phases struct {
	Install Install
	Build   Build
}

type Pipeline

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

func NewPipeline

func NewPipeline(ctx context.Context, awsConfig aws.Config, roleArn string, cloudWatch CloudWatch, logGroup string, logStream string) *Pipeline

func (*Pipeline) CreateAgentPipelines

func (p *Pipeline) CreateAgentPipelines(prefix string, projectName string, bucket string) error

func (*Pipeline) CreateApplyPipeline

func (p *Pipeline) CreateApplyPipeline(pipelineName string, projectName string, stepName string, step model.Step, bucket string) (*string, error)

func (*Pipeline) CreateDestroyPipeline

func (p *Pipeline) CreateDestroyPipeline(pipelineName string, projectName string, stepName string, step model.Step, bucket string) error

func (*Pipeline) CreatePipeline

func (p *Pipeline) CreatePipeline(projectName string, stepName string, step model.Step, bucket model.Bucket) (*string, error)

func (*Pipeline) DeletePipeline

func (p *Pipeline) DeletePipeline(projectName string) error

func (*Pipeline) StartAgentExecution

func (p *Pipeline) StartAgentExecution(pipelineName string) error

func (*Pipeline) StartDestroyExecution

func (p *Pipeline) StartDestroyExecution(_ string) error

func (*Pipeline) StartPipelineExecution

func (p *Pipeline) StartPipelineExecution(pipelineName string, _ string, _ model.Step, _ string) (*string, error)

func (*Pipeline) UpdatePipeline

func (p *Pipeline) UpdatePipeline(pipelineName string, stepName string, step model.Step, bucket string) error

func (*Pipeline) WaitPipelineExecution

func (p *Pipeline) WaitPipelineExecution(pipelineName string, projectName string, executionId *string, autoApprove bool, stepType model.StepType) error

type PolicyDocument

type PolicyDocument struct {
	Version   string
	Statement []PolicyStatement
}

type PolicyStatement

type PolicyStatement struct {
	Effect    string
	Action    []string
	Principal map[string]string `json:",omitempty"`
	Resource  []string          `json:",omitempty"`
}

func CodeBuildPolicy

func CodeBuildPolicy(logGroupArn string, s3Arn string, dynamodbArn string) []PolicyStatement

func CodeBuildS3Policy

func CodeBuildS3Policy(s3Arn string) PolicyStatement

func CodePipelinePolicy

func CodePipelinePolicy(s3Arn string) []PolicyStatement

func CodePipelineS3Policy

func CodePipelineS3Policy(s3Arn string) PolicyStatement

func ServiceAccountPolicy

func ServiceAccountPolicy(s3Arn, accountId, buildRoleName, pipelineRoleName string) []PolicyStatement

type Resources

type Resources struct {
	model.CloudResources
	IAM           IAM
	DynamoDBTable string
	Region        string
	AccountId     string
}

func (Resources) GetBackendConfigVars

func (r Resources) GetBackendConfigVars(key string) map[string]string

type S3

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

func NewS3

func NewS3(ctx context.Context, awsConfig aws.Config, bucket string) *S3

func (*S3) BucketExists

func (s *S3) BucketExists() (bool, error)

func (*S3) CheckFolderExists

func (s *S3) CheckFolderExists(folder string) (bool, error)

func (*S3) CreateBucket

func (s *S3) CreateBucket() (string, bool, error)

func (*S3) Delete

func (s *S3) Delete() error

func (*S3) DeleteFile

func (s *S3) DeleteFile(file string) error

func (*S3) GetFile

func (s *S3) GetFile(file string) ([]byte, error)

func (*S3) GetRepoMetadata

func (s *S3) GetRepoMetadata() (*model.RepositoryMetadata, error)

func (*S3) ListFolderFiles

func (s *S3) ListFolderFiles(folder string) ([]string, error)

func (*S3) ListFolderFilesWithExclude

func (s *S3) ListFolderFilesWithExclude(folder string, excludeFolders model.Set[string]) ([]string, error)

func (*S3) PutFile

func (s *S3) PutFile(file string, content []byte) error

Jump to

Keyboard shortcuts

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