Skip to content

Commit 3057430

Browse files
committed
Modified 5 nodes:
Added objectStore node rg-stackery-video-files Added objectStore node rg-stackery-thumbnails Added dockerTask node stackery-video-to-thumb-task-def Added function node triggerOnUploadVideoStackery Added function node triggerOnThumbnailCreationStackery
1 parent 54aa56b commit 3057430

7 files changed

Lines changed: 179 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
This Stackery function node was generated by [Stackery.io](https://www.stackery.io).
3+
4+
We recommend updating this readme with your own function specific documentation.
5+
6+
# Dependencies
7+
You can add dependencies on other files and packages.
8+
Within this directory, local dependencies can be added as individual files and
9+
package dependencies can be added to [package.json](https://docs.npmjs.com/files/package.json).
10+
Package dependencies will be installed when the stack is deployed.
11+
12+
# Stackery Documentation
13+
Documentation for Stackery function nodes can be found at [https://docs.stackery.io/nodes/Function/](https://docs.stackery.io/nodes/Function/).
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
exports.handler = async message => {
2+
console.log(message);
3+
4+
return {};
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"private": true,
3+
"dependencies": {
4+
"aws-sdk": "~2"
5+
}
6+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
This Stackery function node was generated by [Stackery.io](https://www.stackery.io).
3+
4+
We recommend updating this readme with your own function specific documentation.
5+
6+
# Dependencies
7+
You can add dependencies on other files and packages.
8+
Within this directory, local dependencies can be added as individual files and
9+
package dependencies can be added to [package.json](https://docs.npmjs.com/files/package.json).
10+
Package dependencies will be installed when the stack is deployed.
11+
12+
# Stackery Documentation
13+
Documentation for Stackery function nodes can be found at [https://docs.stackery.io/nodes/Function/](https://docs.stackery.io/nodes/Function/).
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
exports.handler = async message => {
2+
console.log(message);
3+
4+
return {};
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"private": true,
3+
"dependencies": {
4+
"aws-sdk": "~2"
5+
}
6+
}

template.yaml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,134 @@
11
AWSTemplateFormatVersion: 2010-09-09
22
Transform: AWS::Serverless-2016-10-31
33
Description: Video processing app with AWS Fargate using Stackery
4+
Resources:
5+
objectStore6A12D98C:
6+
Type: AWS::S3::Bucket
7+
Properties:
8+
BucketName: !Sub ${AWS::StackName}-objectstore6a12d98c
9+
Metadata:
10+
StackeryName: rg-stackery-video-files
11+
objectStore3B0DC7B6:
12+
Type: AWS::S3::Bucket
13+
Properties:
14+
BucketName: !Sub ${AWS::StackName}-objectstore3b0dc7b6
15+
Metadata:
16+
StackeryName: rg-stackery-thumbnails
17+
dockerTask4259BAF6:
18+
Type: AWS::ECS::TaskDefinition
19+
Properties:
20+
ContainerDefinitions:
21+
- Image: rupakg/docker-ffmpeg-thumb:latest
22+
LogConfiguration:
23+
LogDriver: awslogs
24+
Options:
25+
awslogs-group: !Ref dockerTask4259BAF6LogGroup
26+
awslogs-region: !Ref AWS::Region
27+
awslogs-stream-prefix: rupakg-docker-ffmpeg-thumb-latest
28+
Name: 0
29+
Environment:
30+
- Name: AWS_REGION
31+
Value: us-east-1
32+
- Name: INPUT_VIDEO_FILE_URL
33+
Value: https://s3.amazonaws.com/your-s3-bucket-name/test.mp4
34+
- Name: OUTPUT_S3_PATH
35+
Value: your-s3-bucket-name/your-thumbnail-folder-name
36+
- Name: OUTPUT_THUMBS_FILE_NAME
37+
Value: test.png
38+
- Name: POSITION_TIME_DURATION
39+
Value: 00:01
40+
Cpu: 256
41+
ExecutionRoleArn: !GetAtt dockerTask4259BAF6ExecutionRole.Arn
42+
Memory: 512
43+
NetworkMode: awsvpc
44+
RequiresCompatibilities:
45+
- FARGATE
46+
TaskRoleArn: !GetAtt dockerTask4259BAF6TaskRole.Arn
47+
Volumes: []
48+
DependsOn: dockerTask4259BAF6LogGroup
49+
Metadata:
50+
StackeryName: stackery-video-to-thumb-task-def
51+
dockerTask4259BAF6LogGroup:
52+
Type: AWS::Logs::LogGroup
53+
Properties:
54+
LogGroupName: !Sub /stackery/task/${AWS::StackName}-dockerTask4259BAF6/rupakg-docker-ffmpeg-thumb-latest
55+
dockerTask4259BAF6ExecutionRole:
56+
Type: AWS::IAM::Role
57+
Properties:
58+
RoleName: !Sub ${AWS::StackName}-DockerTaskExecutionRole
59+
AssumeRolePolicyDocument:
60+
Version: 2012-10-17
61+
Statement:
62+
Effect: Allow
63+
Principal:
64+
Service: ecs-tasks.amazonaws.com
65+
Action: sts:AssumeRole
66+
Policies:
67+
- PolicyName: DownloadDockerImagesFromECR
68+
PolicyDocument:
69+
Version: 2012-10-17
70+
Statement:
71+
- Effect: Allow
72+
Action:
73+
- logs:CreateLogStream
74+
- logs:PutLogEvents
75+
Resource: !Sub arn:aws:logs:*:*:log-group:/stackery/task/${AWS::StackName}-*
76+
- Effect: Allow
77+
Action:
78+
- ecr:GetAuthorizationToken
79+
- ecr:BatchCheckLayerAvailability
80+
- ecr:GetDownloadUrlForLayer
81+
- ecr:BatchGetImage
82+
Resource: '*'
83+
dockerTask4259BAF6TaskRole:
84+
Type: AWS::IAM::Role
85+
Properties:
86+
RoleName: !Sub ${AWS::StackName}-DockerTaskTaskRole
87+
AssumeRolePolicyDocument:
88+
Version: 2012-10-17
89+
Statement:
90+
Effect: Allow
91+
Principal:
92+
Service: ecs-tasks.amazonaws.com
93+
Action: sts:AssumeRole
94+
function17279F64:
95+
Type: AWS::Serverless::Function
96+
Properties:
97+
FunctionName: !Sub ${AWS::StackName}-function17279F64
98+
Description: !Sub
99+
- Stackery Stack ${StackeryStackTagName} Environment ${StackeryEnvironmentTagName} Function ${ResourceName}
100+
- ResourceName: triggerOnUploadVideoStackery
101+
CodeUri: src/triggerOnUploadVideoStackery
102+
Handler: index.handler
103+
Runtime: nodejs8.10
104+
MemorySize: 512
105+
Timeout: 30
106+
Tracing: Active
107+
Policies:
108+
- AWSXrayWriteOnlyAccess
109+
Metadata:
110+
StackeryName: triggerOnUploadVideoStackery
111+
functionF9A32476:
112+
Type: AWS::Serverless::Function
113+
Properties:
114+
FunctionName: !Sub ${AWS::StackName}-functionF9A32476
115+
Description: !Sub
116+
- Stackery Stack ${StackeryStackTagName} Environment ${StackeryEnvironmentTagName} Function ${ResourceName}
117+
- ResourceName: triggerOnThumbnailCreationStackery
118+
CodeUri: src/triggerOnThumbnailCreationStackery
119+
Handler: index.handler
120+
Runtime: nodejs8.10
121+
MemorySize: 512
122+
Timeout: 30
123+
Tracing: Active
124+
Policies:
125+
- AWSXrayWriteOnlyAccess
126+
Metadata:
127+
StackeryName: triggerOnThumbnailCreationStackery
128+
Parameters:
129+
StackeryStackTagName:
130+
Type: String
131+
Description: Stack Name (injected by Stackery at deployment time)
132+
StackeryEnvironmentTagName:
133+
Type: String
134+
Description: Environment Name (injected by Stackery at deployment time)

0 commit comments

Comments
 (0)