Skip to content

Commit

Permalink
content: notes
Browse files Browse the repository at this point in the history
  • Loading branch information
daniele-salvagni committed Jan 28, 2025
1 parent d17f6c2 commit e18f29b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/content/notes/aws-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,22 @@ Create a new invalidation
aws cloudfront create-invalidation <distribution-id>
```

Test a CloudFront Function

```sh
aws cloudfront describe-function --name s3-replace-view-path-staging | jq -r '.ETag'
aws cloudfront test-function --if-match <my-etag> --name s3-replace-view-path-staging --event-object fileb://events/event.json | jq -r '.TestResult.FunctionOutput | fromjson'
```

## ECR

Pull an image from ECR

```sh
aws ecr get-login-password --region eu-north-1 | docker login --username AWS --password-stdin <account>.dkr.ecr.eu-west-1.amazonaws.com
docker pull <account>.dkr.ecr.eu-north-1.amazonaws.com/<image>:<tag>
```

## EC2

List available EC2 Images
Expand Down
14 changes: 14 additions & 0 deletions src/content/notes/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,17 @@ export const handler = async (
console.log('event: ', JSON.stringify(event, null, 2));
};
```
## CloudFront Functions
CloudFront Functions' JavaScript runtime does not support exports, here is a
simple workaround:

```js
async function handler(event) {
// ...
}
var module = module || {};
module.exports = { handler };
```
6 changes: 6 additions & 0 deletions src/content/notes/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ git add forgotten_file
git commit --amend --no-edit
```

Trigger a Pipeline by empty commit

```bash
git commit --allow-empty -m "chore: trigger pipeline"
```

## Advanced commands

### Backup untracked files
Expand Down

0 comments on commit e18f29b

Please sign in to comment.