service

package
v0.3.44-rc61 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const LatestAgentImage = "latest"
View Source
const StableVersion = "stable"

Variables

This section is empty.

Functions

func CreateDynamoDBTable

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

func GetAWSConfig

func GetAWSConfig() aws.Config

func GetConfig

func GetConfig(configFile string, codeCommit CodeCommit) model.Config

func GetDynamoDBTable

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

func GetLocalConfig

func GetLocalConfig(configFile string) model.Config

func GetModuleState

func GetModuleState(stepState *model.StateStep, moduleName string) *model.StateModule

func GetRemoteConfig

func GetRemoteConfig(codeCommit CodeCommit) model.Config

func GetStepState

func GetStepState(state *model.State, step model.Step) *model.StateStep

func MergeConfig

func MergeConfig(baseConfig model.Config, patchConfig model.Config) model.Config

TODO Confusing patch and base config naming

func PutConfig

func PutConfig(codeCommit CodeCommit, config model.Config)

func ValidateConfig

func ValidateConfig(config model.Config, state *model.State)

Types

type AWS

type AWS interface {
	SetupAWSResources(branch string) AWSResources
	SetupCustomCodeCommit(branch string) CodeCommit
}

func NewAWS

func NewAWS(awsPrefix string) AWS

type AWSResources

type AWSResources struct {
	CodeCommit    CodeCommit
	CodePipeline  Pipeline
	CodeBuild     Builder
	SSM           SSM
	IAM           IAM
	AwsPrefix     string
	Bucket        string
	DynamoDBTable string
	AccountId     string
	Region        string
}

type Account

type Account interface {
	GetAccountID() string
}

func NewSTS

func NewSTS(config aws.Config) Account

type Agent

type Agent interface {
	CreatePipeline(version string) error
	UpdateProjectImage(version string) error
}

func NewAgent

func NewAgent(resources AWSResources) Agent

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 Builder

type Builder interface {
	CreateProject(projectName string, repoURL string, stepName string, workspace string, vpcConfig *types.VpcConfig) error
	CreateAgentProject(projectName string, awsPrefix string, image string) error
	GetProject(projectName string) (*types.Project, error)
	UpdateProjectImage(projectName string, image string) error
	UpdateProjectVpc(projectName string, vpcConfig *types.VpcConfig) error
}

func NewBuilder

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

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)
}

func NewCloudWatch

func NewCloudWatch(awsConfig aws.Config) CloudWatch

type CodeCommit

type CodeCommit interface {
	CreateRepository() (bool, error)
	GetLatestCommitId() (*string, error)
	GetRepoMetadata() *types.RepositoryMetadata
	PutFile(file string, content []byte)
	GetFile(file string) []byte
	DeleteFile(file string)
	CheckFolderExists(folder string) bool
	ListFolderFiles(folder string) []string
}

func NewCodeCommit

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

type IAM

type IAM interface {
	AttachRolePolicy(policyArn string, roleName string) error
	CreatePolicy(policyName string, statement []PolicyStatement) *types.Policy
	CreateRole(roleName string, statement []PolicyStatement) *types.Role
	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 interface {
	CreateTerraformPipeline(pipelineName string, projectName string, stepName string, workspace string, customRepo string) (*string, error)
	CreateTerraformDestroyPipeline(pipelineName string, projectName string, stepName string, workspace string, customRepo string) error
	CreateArgoCDPipeline(pipelineName string, projectName string, stepName string, workspace string) (*string, error)
	CreateArgoCDDestroyPipeline(pipelineName string, projectName string, stepName string, workspace string) error
	CreateAgentPipeline(pipelineName string, projectName string, bucket string) error
	StartPipelineExecution(pipelineName string) (*string, error)
	WaitPipelineExecution(pipelineName string, executionId *string, autoApprove bool, delay int, stepType model.StepType) error
}

func NewPipeline

func NewPipeline(awsConfig aws.Config, repo string, branch string, roleArn string, bucket string, cloudWatch CloudWatch, logGroup string, logStream string) Pipeline

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 S3

type S3 interface {
	CreateBucket(bucketName string) (string, error)
}

func NewS3

func NewS3(awsConfig aws.Config) S3

type SSM

type SSM interface {
	GetParameter(name string) (*ssmTypes.Parameter, error)
}

func NewSSM

func NewSSM(awsConfig aws.Config) SSM

type Updater

type Updater interface {
	ProcessSteps()
}

func NewUpdater

func NewUpdater(flags *common.Flags) Updater

Jump to

Keyboard shortcuts

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