handler

package
v0.0.0-...-17eb7e2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountID     = "724178030834"
	LambdaBucket  = "acuris-lambdas"
	ReleaseBucket = "acuris-releases"
	TFStateBucket = "acuris-tfstate"
	ReleaseFolder = "/release"
	Region        = "eu-west-1"
)
View Source
const ECR_REPO_POLICY = `` /* 483-byte string literal not displayed */

Variables

This section is empty.

Functions

func AddAdditionalEnvironment

func AddAdditionalEnvironment(requestEnv map[string]string, responseEnv map[string]string)

AddAdditionalEnvironment variables sends in env variables

func GetRoleSessionName

func GetRoleSessionName(env map[string]string) (string, error)

GetRoleSessionName returns a suitable role session name from the environment.

Types

type AssumeRoleProviderFactory

type AssumeRoleProviderFactory func(session client.ConfigProvider, roleARN, roleSessionName string) credentials.Provider

AssumeRoleProviderFactory is a function that returns an assume role provider.

type ECRClientFactory

type ECRClientFactory func(client.ConfigProvider) ecriface.ECRAPI

ECRClientFactory is a function that returns an ECR client.

type ECRLifecyclePolicy

type ECRLifecyclePolicy struct {
	Rules []*ECRLifecyclePolicyRule `json:"rules"`
}

ECRLifecyclePolicy represents a lifecycle policy in ECR.

type ECRLifecyclePolicyRule

type ECRLifecyclePolicyRule struct {
	RulePriority int                              `json:"rulePriority"`
	Selection    *ECRLifecyclePolicyRuleSelection `json:"selection"`
	Action       *ECRLifecyclePolicyRuleAction    `json:"action"`
}

ECRLifecyclePolicyRule represents a rule in a lifecycle policy in ECR.

type ECRLifecyclePolicyRuleAction

type ECRLifecyclePolicyRuleAction struct {
	Type string `json:"type"`
}

ECRLifecyclePolicyRuleAction represents an action within an ECR lifecycle policy rule.

type ECRLifecyclePolicyRuleSelection

type ECRLifecyclePolicyRuleSelection struct {
	TagStatus     string   `json:"tagStatus"`
	TagPrefixList []string `json:"tagPrefixList"`
	CountType     string   `json:"countType"`
	CountNumber   int      `json:"countNumber"`
}

ECRLifecyclePolicyRuleSelection represents a selection within an ECR lifecycle policy rule.

type Handler

type Handler struct {
	RootAccountSession          *session.Session
	AssumeRoleProviderFactory   AssumeRoleProviderFactory
	ReleaseAccountCredentials   *credentials.Credentials
	ErrorStream                 io.Writer
	ReleaseFolder               string
	ECRClientFactory            ECRClientFactory
	S3ClientFactory             S3ClientFactory
	S3UploaderFactory           S3UploaderFactory
	STSClientFactory            STSClientFactory
	OrganizationsClientFactory  OrganizationsClientFactory
	SecretsManagerClientFactory SecretsManagerClientFactory
	ReleaseLoader               common.ReleaseLoader
	ReleaseSaver                common.ReleaseSaver
}

Handler handles config requests.

func New

func New() *Handler

New returns a new handler.

func (*Handler) AddDeployAccountCredentialsValue

func (h *Handler) AddDeployAccountCredentialsValue(request *common.PrepareTerraformRequest, team string, responseEnv map[string]string, monitoringData map[string]string) error

AddDeployAccountCredentialsValue assumes a role in the right account and returns credentials.

func (*Handler) ConfigureRelease

func (h *Handler) ConfigureRelease(request *common.ConfigureReleaseRequest, response *common.ConfigureReleaseResponse) error

ConfigureRelease runs before release to configure it.

func (*Handler) GetRootAccountSession

func (h *Handler) GetRootAccountSession(env map[string]string) (*session.Session, error)

GetRootAccountSession gets an AWS session in the root account.

func (*Handler) InitReleaseAccountCredentials

func (h *Handler) InitReleaseAccountCredentials(env map[string]string, team string) error

InitReleaseAccountCredentials initialises the release account credentials.

func (*Handler) PrepareTerraform

func (h *Handler) PrepareTerraform(request *common.PrepareTerraformRequest, response *common.PrepareTerraformResponse, releaseDir string) error

PrepareTerraform runs before terraform to configure.

func (*Handler) Setup

func (h *Handler) Setup(request *common.SetupRequest, response *common.SetupResponse) error

Setup sets up the project.

func (*Handler) UploadRelease

func (h *Handler) UploadRelease(request *common.UploadReleaseRequest, response *common.UploadReleaseResponse, configureReleaseRequest *common.ConfigureReleaseRequest, releaseDir string) error

UploadRelease runs after release to upload the release., releaseReader io.ReadSeeker

func (*Handler) WithAssumeRoleProviderFactory

func (h *Handler) WithAssumeRoleProviderFactory(factory AssumeRoleProviderFactory) *Handler

WithAssumeRoleProviderFactory overrides the function used to create an assume role provider.

func (*Handler) WithECRClientFactory

func (h *Handler) WithECRClientFactory(factory ECRClientFactory) *Handler

WithECRClientFactory overrides the function used to create an ECR client.

func (*Handler) WithErrorStream

func (h *Handler) WithErrorStream(errorStream io.Writer) *Handler

WithErrorStream overrides the stream where errors are written.

func (*Handler) WithOrganizationsClientFactory

func (h *Handler) WithOrganizationsClientFactory(factory OrganizationsClientFactory) *Handler

WithOrganizationsClientFactory overrides the function used to create an Organizations client.

func (*Handler) WithReleaseFolder

func (h *Handler) WithReleaseFolder(folder string) *Handler

WithReleaseFolder overrides the release folder.

func (*Handler) WithReleaseLoader

func (h *Handler) WithReleaseLoader(loader common.ReleaseLoader) *Handler

WithReleaseLoader overrides the release loader.

func (*Handler) WithReleaseSaver

func (h *Handler) WithReleaseSaver(saver common.ReleaseSaver) *Handler

WithReleaseSaver overrides the release saver.

func (*Handler) WithS3ClientFactory

func (h *Handler) WithS3ClientFactory(factory S3ClientFactory) *Handler

WithS3ClientFactory overrides the function used to create an S3 client.

func (*Handler) WithS3UploaderFactory

func (h *Handler) WithS3UploaderFactory(factory S3UploaderFactory) *Handler

WithS3UploaderFactory overrides the function used to create an S3 uploader.

func (*Handler) WithSTSClientFactory

func (h *Handler) WithSTSClientFactory(factory STSClientFactory) *Handler

WithSTSClientFactory overrides the function used to create an STS client.

func (*Handler) WithSecretsManagerClientFactory

func (h *Handler) WithSecretsManagerClientFactory(factory SecretsManagerClientFactory) *Handler

WithSecretsManagerClientFactory overrides the function used to create a SecretsManagerClient client.

type OrganizationsClientFactory

type OrganizationsClientFactory func(client.ConfigProvider) organizationsiface.OrganizationsAPI

OrganizationsClientFactory is a function that returns an organizations client.

type S3ClientFactory

type S3ClientFactory func(client.ConfigProvider) s3iface.S3API

S3ClientFactory is a function that returns an S3 client.

type S3UploaderFactory

type S3UploaderFactory func(client.ConfigProvider) s3manageriface.UploaderAPI

S3UploaderFactory is a function that returns an s3manager uploader.

type STSClientFactory

type STSClientFactory func(client.ConfigProvider) stsiface.STSAPI

STSClientFactory is a function that returns an STS client.

type SecretsManagerClientFactory

type SecretsManagerClientFactory func(client.ConfigProvider) secretsmanageriface.SecretsManagerAPI

SecretsManagerClientFactory is a function that returns a secrets manager client.

Jump to

Keyboard shortcuts

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