aws

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AwsTemplateDataKind = "aws_template_data"

Functions

func SanitizeS3BucketName

func SanitizeS3BucketName(appName string) string

SanitizeS3BucketName returns a valid S3 bucket name for a given app name. In addition to any sanitization, this will append a suffix of "-payloads". When we actually use these bucket names, we'll prefix them with the 12-digit AWS account id; this method assumes that for its checks.

The rules we're checking for ar at https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html.

Some of those (especially the ones to do with prefixes and suffixes) we get for free because of the AWS account id and "-payloads" suffix. Besides those, we also do not check for the following:

  • "Bucket names must be unique across all AWS accounts in all the AWS Regions within a partition": it's impossible to check this without connecting to AWS, which we don't want to here.
  • "A bucket name cannot be used by another AWS account in the same partition until the bucket is deleted": isn't this the same as the previous rule?

Types

type AWS

type AWS struct {
	Config *config.Application
}

func (*AWS) GenerateCloudfrontDistributions

func (a *AWS) GenerateCloudfrontDistributions(data *TemplateData, result *core.CompilationResult)

func (*AWS) GetDefaultConfig

func (a *AWS) GetDefaultConfig() config.Defaults

func (*AWS) GetKindTypeMappings

func (a *AWS) GetKindTypeMappings(kind string) ([]string, bool)

GetKindTypeMappings returns a list of valid types for the aws provider based on the kind passed in

func (*AWS) Name

func (c *AWS) Name() string

func (*AWS) Transform

func (a *AWS) Transform(result *core.CompilationResult, deps *core.Dependencies) error

type GatewayType added in v0.6.2

type GatewayType string
const (
	ApiGateway GatewayType = "apigateway"
	Alb        GatewayType = "alb"
)

Enums for the types we allow in the aws provider so that we can reuse the same string within the provider

type TemplateConfig

type TemplateConfig struct {
	provider.TemplateConfig
	PayloadsBucketName string
}

type TemplateData

type TemplateData struct {
	provider.TemplateData
	TemplateConfig
	UseVPC                  bool
	CloudfrontDistributions []*resources.CloudfrontDistribution
	APIGateways             []provider.Gateway
	ALBs                    []provider.Gateway
}

func NewTemplateData

func NewTemplateData(config *config.Application) *TemplateData

func (*TemplateData) Key

func (t *TemplateData) Key() core.ResourceKey

func (*TemplateData) Type

func (*TemplateData) Type() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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