Comments (2)
This approach certainly works if you do intend to use a different region. I planned to have learners just use the regions I was specifying to reduce complexity, but this will work for anyone wanting to do something different.
from ps-serverless-app.
This is a fix that I came up with - not an experienced TS dev so pls forgive any non-idiomatic code!
It just substitutes the default region in effect during the CDK build:
`
const useDefaultRegion = (resource_arn:string): string => {
const components: ArnComponents = cdk.Arn.split(resource_arn, cdk.ArnFormat.COLON_RESOURCE_NAME);
const new_components: ArnComponents = {
...components,
region: process.env.CDK_DEFAULT_REGION
};
return cdk.Arn.format(new_components);
}
// and so, where originally there was the hardcoded resource, can now use
const createThumbnail = new NodejsServiceFunction(this, 'ThumbnailLambda', {
entry: path.join(__dirname, '../../../services/processing/thumbnail.js'),
timeout: cdk.Duration.seconds(120),
layers: [
lambda.LayerVersion.fromLayerVersionAttributes(this, 'GhostscriptLayerVersion', {
layerVersionArn: useDefaultRegion('arn:aws:lambda:us-east-2:764866452798:layer:ghostscript:8'),
compatibleRuntimes: [lambda.Runtime.NODEJS_14_X],
}),
],
});
`
from ps-serverless-app.
Related Issues (20)
- npx cdk deploy on p3 gives Could not Resolve 'lambda-micro' and 'ksuid' HOT 2
- List of tuck.cc links anywhere HOT 1
- Cannot create initial build, app policy AdministratorAccess not valid HOT 4
- Suggestion: Check for required installed apps etc, issue newbie-friendly message HOT 1
- p3: Cannot find 'path' HOT 2
- Suggestion/research: Security - "Prevent requests from accessing API directly" HOT 1
- Suggestion/research: Security - Help manage security by adding response headers to CloudFront HOT 1
- P1 Final Building and Deploying the React Web App fails
- Unable to deploy - npx cdk deploy HOT 5
- WebApp Deployment Failed HOT 4
- TypeError: Cannot read properties of undefined (reading 'apiEndpoint') HOT 2
- Summary of tools setup/install in Readme file
- Some issues encountered: Tools and runtime error
- Typo in
- Expected params.Destination.ToAddresses to be an Array
- EACCES Permissions issue on initial deploy. HOT 1
- Issue deploying the p2 branch: `EACCES: permission denied, unlink '/asset-input/webapp/build/favicon.ico'`
- Unable to bootstrap CDK [p1]
- npx cdk deploy gives this error: can't cd to webapp
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ps-serverless-app.