Skip to content

Commit

Permalink
update cdk instructions for existing projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt C committed May 11, 2020
1 parent 290f50d commit 9afb3f2
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,24 @@ $ pip install aws-sam-cli
$ aws configure
```

Now we can use [CDK Patterns](https://github.com/cdk-patterns/serverless) to give us a pre configured project in either TypeScript or Python:
If you already have a CDK project you can include the following to use the [sam module](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-sam-readme.html):

```typescript
import sam = require('@aws-cdk/aws-sam');

new sam.CfnApplication(this, 'powerTuner', {
location: {
applicationId: 'arn:aws:serverlessrepo:us-east-1:451282441545:applications/aws-lambda-power-tuning',
semanticVersion: '3.2.4'
},
parameters: {
"lambdaResource": "*",
"PowerValues": "128,256,512,1024,1536,3008"
}
})
```

Alternatively you can use [CDK Patterns](https://github.com/cdk-patterns/serverless) to give us a pre configured project in either TypeScript or Python:

```bash
# For the TypeScript CDK version
Expand All @@ -92,7 +109,6 @@ npm run deploy

For Python deployment, see the instructions [here](https://github.com/cdk-patterns/serverless#2-download-pattern-in-python-or-typescript-cdk)


## How to execute the state machine (programmatically)

You can customize the input event in `scripts/sample-execution-input.json` and then run the `scripts/execute.sh` script. It will start a state machine execution, wait for the execution to complete, and then show the execution results.
Expand Down

0 comments on commit 9afb3f2

Please sign in to comment.