1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-07-15 01:34:32 +02:00

Merge branch 'master' of gitlab.com:geeks-accelerator/oss/saas-starter-kit into issue8/datadog-lambda-func

This commit is contained in:
Lee Brown
2019-08-12 13:03:49 -08:00
25 changed files with 152 additions and 3589 deletions

View File

@ -105,10 +105,10 @@ instance will be a dedicated host since we need it always up and running, thus i
Advanced Details: none
```
4. Add Storage. Increase the volume size for the root device to 100 GiB.
4. Add Storage. Increase the volume size for the root device to 30 GiB.
```
Volume Type | Device | Size (GiB) | Volume Type
Root | /dev/xvda | 100 | General Purpose SSD (gp2)
Root | /dev/xvda | 30 | General Purpose SSD (gp2)
```
5. Add Tags.
@ -127,7 +127,7 @@ instance will be a dedicated host since we need it always up and running, thus i
7. Review and Launch instance. Select an existing key pair or create a new one. This will be used to SSH into the
instance for additional configuration.
8. Update the security group to reference itself. The instances need to be able to communicate between each other.
Navigate to edit the security group and add the following two rules where `SECURITY_GROUP_ID` is replaced with the

View File

@ -66,7 +66,7 @@ type ServiceDeployFlags struct {
DockerFile string `validate:"omitempty" example:"./cmd/web-api/Dockerfile"`
EnableLambdaVPC bool `validate:"omitempty" example:"false"`
EnableEcsElb bool `validate:"omitempty" example:"false"`
IsLambda bool `validate:"omitempty" example:"false"`
IsLambda bool `validate:"omitempty" example:"false"`
StaticFilesS3Enable bool `validate:"omitempty" example:"false"`
StaticFilesImgResizeEnable bool `validate:"omitempty" example:"false"`
@ -130,6 +130,8 @@ type deployEcsServiceRequest struct {
VpcPublic *ec2.CreateVpcInput
VpcPublicSubnets []*ec2.CreateSubnetInput
EnableLambdaVPC bool `validate:"omitempty"`
IsLambda bool `validate:"omitempty"`
RecreateService bool `validate:"omitempty"`
SDNamepsace *servicediscovery.CreatePrivateDnsNamespaceInput
@ -189,7 +191,7 @@ func NewServiceDeployRequest(log *log.Logger, flags ServiceDeployFlags) (*servic
S3BucketPrivateName: flags.S3BucketPrivateName,
S3BucketPublicName: flags.S3BucketPublicName,
IsLambda: flags.IsLambda,
IsLambda: flags.IsLambda,
EnableLambdaVPC: flags.EnableLambdaVPC,
EnableEcsElb: flags.EnableEcsElb,
RecreateService: flags.RecreateService,
@ -436,7 +438,7 @@ func NewServiceDeployRequest(log *log.Logger, flags ServiceDeployFlags) (*servic
if req.IsLambda {
} else {
} else {
}
@ -856,12 +858,30 @@ func NewServiceDeployRequest(log *log.Logger, flags ServiceDeployFlags) (*servic
log.Printf("\t%s\tDefaults set.", tests.Success)
}
r, err := regexp.Compile(`^(\d+)`)
if err != nil {
return nil, errors.WithStack(err)
}
// Workaround for domains that start with a numeric value like 8north.com
// Validation fails with error: failed on the 'fqdn' tag
origServiceHostPrimary := req.ServiceHostPrimary
matches := r.FindAllString(req.ServiceHostPrimary, -1)
if len(matches) > 0 {
for _, m := range matches {
req.ServiceHostPrimary = strings.Replace(req.ServiceHostPrimary, m, "X", -1)
}
}
log.Println("\tValidate request.")
errs := validator.New().Struct(req)
if errs != nil {
return nil, errs
}
// Reset the primary domain after validation is completed.
req.ServiceHostPrimary = origServiceHostPrimary
log.Printf("\t%s\tNew request generated.", tests.Success)
}