Skip to content

Commit

Permalink
Update aws-ts-lambda-thumbnailer to use latest awsx (#1424)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnunciato committed May 16, 2023
1 parent c6b4c8e commit f3dc070
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 10 additions & 3 deletions aws-ts-lambda-thumbnailer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,27 @@ import * as awsx from "@pulumi/awsx";
// A bucket to store videos and thumbnails.
const bucket = new aws.s3.Bucket("bucket");

const image = awsx.ecr.buildAndPushImage("sampleapp", {
context: "./docker-ffmpeg-thumb",
const repo = new awsx.ecr.Repository("repo", {
forceDelete: true,
});

const image = new awsx.ecr.Image("image", {
repositoryUrl: repo.url,
path: "./app",
});

const role = new aws.iam.Role("thumbnailerRole", {
assumeRolePolicy: aws.iam.assumeRolePolicyForPrincipal({ Service: "lambda.amazonaws.com" }),
});

const lambdaS3Access = new aws.iam.RolePolicyAttachment("lambdaFullAccess", {
role: role.name,
policyArn: aws.iam.ManagedPolicy.AWSLambdaExecute,
});

const thumbnailer = new aws.lambda.Function("thumbnailer", {
packageType: "Image",
imageUri: image.imageValue,
imageUri: image.imageUri,
role: role.arn,
timeout: 900,
});
Expand Down
2 changes: 1 addition & 1 deletion aws-ts-lambda-thumbnailer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "index.js",
"dependencies": {
"@pulumi/aws": "^5.0.0",
"@pulumi/awsx": "^0.40.0",
"@pulumi/awsx": "^1.0.0",
"@pulumi/pulumi": "^3.0.0"
}
}

0 comments on commit f3dc070

Please sign in to comment.