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
4 changed files
with
1,115 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
__pycache__ | ||
.DS_Store |
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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# ACME Fitness Shop on AWS Fargate | ||
|
||
***WARNING** You will be billed for the AWS resources used if you create a stack from this template.* | ||
|
||
## Pre-requisites | ||
|
||
To run this CloudFormation stack, you'll need to have an AWS account. With permission to create: | ||
|
||
* Log groups | ||
* ECS Clusters | ||
* Cloud Maps | ||
* Execution Roles | ||
* ECS Task Definitions | ||
* ECS Services | ||
* EC2 Security Groups | ||
|
||
## Deploy stack | ||
|
||
You can deploy a new CloudFormation stack using | ||
|
||
```bash | ||
aws cloudformation create-stack \ | ||
--capabilities CAPABILITY_NAMED_IAM \ | ||
--stack-name mystack \ | ||
--parameters ParameterKey=User,ParameterValue=<your name> \ | ||
ParameterKey=Team,ParameterValue=<your team> \ | ||
ParameterKey=SourceSecurityGroup,ParameterValue=<your security group> \ | ||
ParameterKey=Subnets,ParameterValue=<your subnet> \ | ||
ParameterKey=VPC,ParameterValue=<your vpc> \ | ||
--template-body file:///<path>/<to>/acme-fitness-shop.yaml | ||
``` | ||
|
||
## End result | ||
|
||
This CloudFormation template will create 44 resources. The _Resource ID_ in the table below is how it is listed in the YAML file. The _Type_ is what is created in your AWS account | ||
|
||
| Resource ID | Type | | ||
|-------------------------------|--------------------------------------------| | ||
| ACMELogGroup | AWS::Logs::LogGroup | | ||
| CartService | AWS::ECS::Service | | ||
| CartServiceDiscovery | AWS::ServiceDiscovery::Service | | ||
| CartServiceSecurityGroup | AWS::EC2::SecurityGroup | | ||
| CartTaskDefinition | AWS::ECS::TaskDefinition | | ||
| CatalogDbService | AWS::ECS::Service | | ||
| CatalogDbServiceDiscovery | AWS::ServiceDiscovery::Service | | ||
| CatalogDbServiceSecurityGroup | AWS::EC2::SecurityGroup | | ||
| CatalogDbTaskDefinition | AWS::ECS::TaskDefinition | | ||
| CatalogService | AWS::ECS::Service | | ||
| CatalogServiceDiscovery | AWS::ServiceDiscovery::Service | | ||
| CatalogServiceSecurityGroup | AWS::EC2::SecurityGroup | | ||
| CatalogTaskDefinition | AWS::ECS::TaskDefinition | | ||
| Cluster | AWS::ECS::Cluster | | ||
| FrontEndService | AWS::ECS::Service | | ||
| FrontEndServiceDiscovery | AWS::ServiceDiscovery::Service | | ||
| FrontEndServiceSecurityGroup | AWS::EC2::SecurityGroup | | ||
| FrontEndTaskDefinition | AWS::ECS::TaskDefinition | | ||
| OrderDbService | AWS::ECS::Service | | ||
| OrderDbServiceDiscovery | AWS::ServiceDiscovery::Service | | ||
| OrderDbServiceSecurityGroup | AWS::EC2::SecurityGroup | | ||
| OrderDbTaskDefinition | AWS::ECS::TaskDefinition | | ||
| OrderService | AWS::ECS::Service | | ||
| OrderServiceDiscovery | AWS::ServiceDiscovery::Service | | ||
| OrderServiceSecurityGroup | AWS::EC2::SecurityGroup | | ||
| OrderTaskDefinition | AWS::ECS::TaskDefinition | | ||
| PaymentService | AWS::ECS::Service | | ||
| PaymentServiceDiscovery | AWS::ServiceDiscovery::Service | | ||
| PaymentServiceSecurityGroup | AWS::EC2::SecurityGroup | | ||
| PaymentTaskDefinition | AWS::ECS::TaskDefinition | | ||
| RedisDbService | AWS::ECS::Service | | ||
| RedisDbServiceDiscovery | AWS::ServiceDiscovery::Service | | ||
| RedisDbServiceSecurityGroup | AWS::EC2::SecurityGroup | | ||
| RedisDbTaskDefinition | AWS::ECS::TaskDefinition | | ||
| ServiceDiscovery | AWS::ServiceDiscovery::PrivateDnsNamespace | | ||
| TaskExecutionRole | AWS::IAM::Role | | ||
| UserDbService | AWS::ECS::Service | | ||
| UserDbServiceDiscovery | AWS::ServiceDiscovery::Service | | ||
| UserDbServiceSecurityGroup | AWS::EC2::SecurityGroup | | ||
| UserDbTaskDefinition | AWS::ECS::TaskDefinition | | ||
| UserService | AWS::ECS::Service | | ||
| UserServiceDiscovery | AWS::ServiceDiscovery::Service | | ||
| UserServiceSecurityGroup | AWS::EC2::SecurityGroup | | ||
| UserTaskDefinition | AWS::ECS::TaskDefinition | | ||
|
||
![chart](./cf-template.png) | ||
|
||
## Delete stack | ||
|
||
To delete a stack you've built, run | ||
|
||
```bash | ||
aws cloudformation delete-stack \ | ||
--stack-name mystack | ||
``` |
Oops, something went wrong.