Documentation
¶
Index ¶
- Variables
- func SanitizeS3BucketName(appName string) string
- type AWS
- func (a *AWS) GenerateCloudfrontDistributions(data *TemplateData, result *core.CompilationResult)
- func (a *AWS) GetDefaultConfig() config.Defaults
- func (a *AWS) GetKindTypeMappings(kind string) ([]string, bool)
- func (c *AWS) Name() string
- func (a *AWS) Transform(result *core.CompilationResult, deps *core.Dependencies) error
- type GatewayType
- type TemplateConfig
- type TemplateData
Constants ¶
This section is empty.
Variables ¶
var AwsTemplateDataKind = "aws_template_data"
Functions ¶
func SanitizeS3BucketName ¶
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 (*AWS) GetKindTypeMappings ¶
GetKindTypeMappings returns a list of valid types for the aws provider based on the kind passed in
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