aws

package
v0.3.68-rc89 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDynamoDBTable

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

func DeleteDynamoDBTable

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

func GetAWSConfig

func GetAWSConfig(ctx context.Context) aws.Config

func GetDynamoDBTable

func GetDynamoDBTable(client *dynamodb.Client, tableName string) (*types.TableDescription, error)

func NewAWS

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

func NewBuilder

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

func NewSSM

func NewSSM(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 {
	CreateLogGroup(logGroupName string) (string, 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(awsConfig aws.Config) CloudWatch

type CodeCommit

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

func NewCodeCommit

func NewCodeCommit(awsConfig aws.Config, repoName string, branchName string) *CodeCommit

func (*CodeCommit) CheckFolderExists

func (c *CodeCommit) CheckFolderExists(folder string) (bool, error)

func (*CodeCommit) CreateRepository

func (c *CodeCommit) CreateRepository() (bool, error)

func (*CodeCommit) Delete

func (c *CodeCommit) Delete() error

func (*CodeCommit) DeleteFile

func (c *CodeCommit) DeleteFile(file string) error

func (*CodeCommit) GetAWSRepoMetadata

func (c *CodeCommit) GetAWSRepoMetadata() (*types.RepositoryMetadata, error)

func (*CodeCommit) GetFile

func (c *CodeCommit) GetFile(file string) ([]byte, error)

func (*CodeCommit) GetRepoMetadata

func (c *CodeCommit) GetRepoMetadata() (*model.RepositoryMetadata, error)

func (*CodeCommit) ListFolderFiles

func (c *CodeCommit) ListFolderFiles(folder string) ([]string, error)

func (*CodeCommit) PutFile

func (c *CodeCommit) PutFile(file string, content []byte) error

type IAM

type IAM interface {
	AttachRolePolicy(policyArn string, roleName string) error
	DeleteRolePolicyAttachment(policyName string, roleName string) error
	CreatePolicy(policyName string, statement []PolicyStatement) *types.Policy
	DeletePolicy(policyName string, accountId string) error
	CreateRole(roleName string, statement []PolicyStatement) *types.Role
	DeleteRole(roleName string) error
	GetRole(roleName string) *types.Role
}

func NewIAM

func NewIAM(config aws.Config) 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(awsConfig aws.Config, branch string, roleArn string, bucket string, cloudWatch CloudWatch, logGroup string, logStream string) *Pipeline

func (*Pipeline) CreateAgentPipeline

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

func (*Pipeline) CreateApplyPipeline

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

func (*Pipeline) CreateDestroyPipeline

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

func (*Pipeline) CreatePipeline

func (p *Pipeline) CreatePipeline(projectName string, stepName string, step model.Step, repo string) (*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, stepName string, step model.Step, customRepo string) (*string, error)

func (*Pipeline) UpdatePipeline

func (p *Pipeline) UpdatePipeline(pipelineName string, stepName string, step model.Step, _ 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, repoArn string, dynamodbArn string) []PolicyStatement

func CodeBuildRepoPolicy

func CodeBuildRepoPolicy(repoArn string) PolicyStatement

func CodePipelinePolicy

func CodePipelinePolicy(s3Arn string, repoArn string) []PolicyStatement

func CodePipelineRepoPolicy

func CodePipelineRepoPolicy(repoArn 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 interface {
	CreateBucket(bucketName string) (string, error)
	DeleteBucket(bucketName string) error
}

func NewS3

func NewS3(awsConfig aws.Config) S3

Jump to

Keyboard shortcuts

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