Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mlabouardy/alexa-swarm
Deploy a Docker Swarm cluster on AWS :cloud: using Amazon Echo
https://github.com/mlabouardy/alexa-swarm
alexa alexa-skill aws containers docker echo faas lambda serverless swarm
Last synced: 9 days ago
JSON representation
Deploy a Docker Swarm cluster on AWS :cloud: using Amazon Echo
- Host: GitHub
- URL: https://github.com/mlabouardy/alexa-swarm
- Owner: mlabouardy
- Created: 2017-11-25T17:04:50.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-22T15:47:33.000Z (over 6 years ago)
- Last Synced: 2024-02-19T16:39:09.132Z (9 months ago)
- Topics: alexa, alexa-skill, aws, containers, docker, echo, faas, lambda, serverless, swarm
- Language: Go
- Homepage:
- Size: 2.92 MB
- Stars: 15
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Deploy a Production-Ready Docker Swarm Cluster on AWS with Alexa.
# How it works
# Lambda Functions
## Infrastructure Lambda Function
### IAM Role
```
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "1",
"Effect": "Allow",
"Action": [
"iam:PassRole",
"dynamodb:PutItem",
"sqs:SendMessage",
"sqs:SetQueueAttributes"
],
"Resource": [
"arn:aws:sqs:AWS_REGION:ACCOUNT_ID:QUEUE_NAME",
"arn:aws:iam::ACCOUNT_ID:role/SSM_ROLE_NAME",
"arn:aws:dynamodb:AWS_REGION:ACCOUNT_ID:table/TABLE_NAME"
]
},
{
"Sid": "2",
"Effect": "Allow",
"Action": [
"logs:CreateLogStream",
"ec2:CreateTags",
"ec2:RunInstances",
"logs:CreateLogGroup",
"logs:PutLogEvents"
],
"Resource": "*"
}
]
}
```### Environment Variables
| Name | Description |
| ---- | ----------- |
| AMI | Amazon Machine Image ID with Docker CE pre-installed |
| KEYPAIR | AWS SSH KeyPair |
| SSM_ROLE_NAME | IAM Role with SSM permissions for EC2 instances |
| SECURITY_GROUP | Security Group ID that allows inbound traffic on 2377/tcp and 22/tcp |
| SQS_URL | SQS URL |
| TABLE_NAME | DynamoDB Table name |## Swarm Lambda Function
### IAM Role
```
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "1",
"Effect": "Allow",
"Action": [
"sqs:DeleteMessage",
"sqs:ReceiveMessage",
"dynamodb:UpdateItem"
],
"Resource": [
"arn:aws:sqs:AWS_REGION:ACCOUNT_ID:QUEUE_NAME",
"arn:aws:dynamodb:AWS_REGION:ACCOUNT_ID:table/TABLE_NAME"
]
},
{
"Sid": "2",
"Effect": "Allow",
"Action": [
"ssm:SendCommand",
"logs:CreateLogStream",
"logs:CreateLogGroup",
"logs:PutLogEvents",
"ssm:GetCommandInvocation"
],
"Resource": "*"
}
]
}
```### Environment Variables
| Name | Description |
| ---- | ----------- |
| SQS_URL | SQS URL |
| TABLE_NAME | DynamoDB Table name |# Going further
* Cleanup a Swarm Cluster
* Deploy Docker Containers
* Deploy Swarm in private VPC
* Change Instance Type
* Deploy with multiple Swarm managers
* etc# Licence
MIT
# Maintainers
* Mohamed Labouardy
# Tutorial
* [Deploy a Swarm Cluster with Alexa](http://www.blog.labouardy.com/deploy-a-swarm-cluster-with-alexa/)
[![Deploy a Swarm Cluster with Alexa](https://img.youtube.com/vi/Bd63NFmjLAo/0.jpg)](https://www.youtube.com/watch?v=Bd63NFmjLAo)