Skip to content

Commit 876e60a

Browse files
committed
Updated IAM readme & action vertion update
1 parent 1dc0cde commit 876e60a

File tree

2 files changed

+59
-3
lines changed

2 files changed

+59
-3
lines changed

.github/workflows/cdk-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Check out code
13-
uses: actions/checkout@v2
13+
uses: actions/checkoutactions/checkout@v4
1414

1515
- name: Setup Node.js environment
16-
uses: actions/setup-node@v2
16+
uses: actions/setup-node@v4
1717
with:
1818
node-version: 20
1919
cache: "npm"

README.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,86 @@ The `cdk.json` file tells the CDK Toolkit how to execute your app.
1414

1515
## Deploy the stack on AWS
1616

17+
1718
### Configure IAM
1819

1920
- Go to AWS Identity and Access Management (IAM)
20-
- Create a user and as attatch permissions policie `AWSCloudFormationFullAccess` frow AWS console.
21+
- Create a new policie from JSON
22+
```json
23+
{
24+
"Version": "2012-10-17",
25+
"Statement": [
26+
{
27+
"Effect": "Allow",
28+
"Action": [
29+
"sts:AssumeRole"
30+
],
31+
"Resource": [
32+
"arn:aws:iam::*:role/cdk-*"
33+
]
34+
},
35+
{
36+
"Effect": "Allow",
37+
"Action": [
38+
"cloudformation:*"
39+
],
40+
"Resource": "*"
41+
}
42+
]
43+
}
44+
```
45+
- Save the policie by providing a name (eg: cdk-deploy).
46+
- Create a user and as attatch permissions policie that you just created frow AWS console.
2147
- Select the newly created user and go to the `Security credentials` tab.
2248
- Now on the `Access keys` section, click on the `Create access key` button.
2349
- Now select use case `Command Line Interface (CLI)` and confirm. Click on the next button.
2450
- Click `Create access key` button.
2551
- Now store the `Access key` and `Secret access key`.
2652

53+
2754
### Configure Github Action
2855
- Go to github repo settings.
2956
- On the `Security` section click on `Secrets and variable` and then click on `action`.
3057
- Now click on `New repository secret` and two secret `AWS_ACCESS_KEY_ID` and `AWS_SECRET_KEY` and the value should be the `Access key` and `Secret access key` you got from AWS console.
3158
- (Optional) Set another secret `AWS_REGION` to specify the deployment region. Default region is `us-east-1`.
3259

60+
3361
### Manually trigger deployment
3462
- You can triger deployment manually by going to `Action` tab on github repo.
3563
- The choosing `CDK Deploy` action and clicking on `Run workflow` button.
3664

65+
3766
### Auto-deploy on code push
3867
If you set up github action then whenever a new code push happen on `master` branch, the deployment will update automatically.
3968

4069

70+
### Lambda api gatway url
71+
72+
You can find the deployment url inside github action log.
73+
Here is a sample output:
74+
```sh
75+
✅ AudioProcessingStack
76+
77+
✨ Deployment time: 42.59s
78+
79+
Outputs:
80+
AudioProcessingStack.gatewayEndpointDA8D204E = https://fivtqcifhd.execute-api.us-east-1.amazonaws.com/prod/
81+
Stack ARN:
82+
arn:aws:cloudformation:us-east-1:***:stack/AudioProcessingStack/b4cff7e0-6df8-11ef-b5ff-0ee5f6741be1
83+
84+
✨ Total time: 47.23s
85+
86+
```
87+
You can see here there is a url `https://fivtqcifhd.execute-api.us-east-1.amazonaws.com/prod/` inside log output. This is the lambda api gatway URL.
88+
89+
You can invoke lambda using this URL.
90+
91+
92+
### Setup custom domain
93+
94+
If you want to add a custom domain you can follow this guide: https://medium.com/geekculture/how-to-add-a-custom-domain-to-lambda-functions-1bc0ae639676
95+
96+
4197
### Configure lambda RAM size and timeout setting
4298

4399
You can change lambda RAM size and timeout setting inside this file: `lib/audio-processing-stack.ts`

0 commit comments

Comments
 (0)