-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
2,006 additions
and
1,887 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,54 @@ | ||
AWSTemplateFormatVersion: 2010-09-09 | ||
Description: An ECS with launchType EC2 frontend stack | ||
AWSTemplateFormatVersion: "2010-09-09" | ||
Transform: | ||
- AWS::LanguageExtensions | ||
- AWS::Serverless-2016-10-31 | ||
|
||
Description: Canopas website microservices using AWS Lambda. | ||
|
||
Parameters: | ||
EnvName: | ||
Type: String | ||
Description: Name of an environment. 'dev', 'staging', 'prod' and any name. | ||
Description: Name of an environment. | ||
AllowedPattern: ^.*[^0-9]$ | ||
ConstraintDescription: Must end with non-numeric character. | ||
ClusterName: | ||
Type: String | ||
Description: Name of ECS cluster | ||
ImageTag: | ||
Type: String | ||
Description: Website Docker frontend image tag | ||
NginxImageTag: | ||
AllowedValues: | ||
- dev | ||
- prod | ||
ZipFileName: | ||
Type: String | ||
Description: NGINX Docker image tag | ||
BlogImageTag: | ||
Type: String | ||
Description: Blog Docker image tag | ||
Description: Name of the zip file. | ||
|
||
Resources: | ||
TaskDefinition: | ||
Type: AWS::ECS::TaskDefinition | ||
HttpApi: | ||
Type: AWS::Serverless::HttpApi | ||
Properties: | ||
Family: | ||
Fn::Sub: canopas-website-${EnvName}-full-stack-task-definition | ||
ExecutionRoleArn: | ||
Fn::Sub: arn:aws:iam::${AWS::AccountId}:role/ecsTaskExecutionRole | ||
NetworkMode: "bridge" | ||
ContainerDefinitions: | ||
- Name: "canopas-website-nginx" | ||
Hostname: "canopas-website-nginx" | ||
Memory: 128 | ||
Cpu: 128 | ||
Essential: true | ||
Image: | ||
Fn::Sub: ${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/canopas-website-nginx:${NginxImageTag} | ||
PortMappings: | ||
- ContainerPort: 80 | ||
HostPort: 80 | ||
Protocol: tcp | ||
Links: | ||
- canopas-website-frontend | ||
- canopas-blog | ||
|
||
- Name: "canopas-website-frontend" | ||
Memory: 256 | ||
Cpu: 256 | ||
Essential: true | ||
Image: | ||
Fn::Sub: ${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/canopas-website-frontend:${ImageTag} | ||
PortMappings: | ||
- ContainerPort: 3080 | ||
HostPort: 3080 | ||
Protocol: tcp | ||
|
||
- Name: "canopas-blog" | ||
Memory: 256 | ||
Cpu: 256 | ||
Essential: true | ||
Image: | ||
Fn::Sub: ${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/canopas-blog:${BlogImageTag} | ||
PortMappings: | ||
- ContainerPort: 3000 | ||
HostPort: 3000 | ||
Protocol: tcp | ||
StageName: $default | ||
Name: | ||
Fn::Sub: canopas-website-ssr-frontend-${EnvName} | ||
Description: | ||
Fn::Sub: Canopas Website SSR Frontend API ${EnvName} | ||
|
||
ECSService: | ||
Type: AWS::ECS::Service | ||
HttpApiFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
ServiceName: "canopas-website-full-stack" | ||
LaunchType: EC2 | ||
Cluster: | ||
Fn::Sub: ${ClusterName} | ||
DesiredCount: 1 | ||
TaskDefinition: | ||
Ref: "TaskDefinition" | ||
DeploymentConfiguration: | ||
MaximumPercent: 100 | ||
MinimumHealthyPercent: 0 | ||
PackageType: Zip | ||
CodeUri: | ||
Fn::Sub: s3://canopas-lambda-handlers/${ZipFileName} | ||
Handler: index.handler | ||
Runtime: nodejs20.x | ||
Architectures: | ||
- x86_64 | ||
MemorySize: 256 | ||
Timeout: 30 | ||
FunctionName: | ||
Fn::Sub: canopas-website-ssr-frontend-${EnvName} | ||
Description: | ||
Fn::Sub: Canopas Website SSR Frontend Lambda ${EnvName} | ||
Events: | ||
ProxyResource: | ||
Type: HttpApi | ||
Properties: | ||
ApiId: | ||
Ref: HttpApi | ||
Path: $default | ||
Method: any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.