Required Knowledge:
- TypeScript/JavaScript fundamentals
- AWS Lambda concepts and deployment
- Promise-based asynchronous programming
- Basic understanding of state machines and workflows
Transform EventBridge Events to CloudEvents using Input Transformer, incl. projecting AWS Region and Account ID from the EventBridge event to CloudEvent extended attributes.
Note
You can test whether the transformed CloudEvent is valid using this simple CloudEvent validator utility.
| import {SQSEvent, SQSHandler} from 'aws-lambda'; | |
| import {CloudEvent} from 'cloudevents'; | |
| export const handler: SQSHandler = async (events: SQSEvent) => { | |
| events.Records.forEach(e => { | |
| const ce: CloudEvent<string> = new CloudEvent<string>(JSON.parse(e.body)); | |
| console.log(ce); | |
| }); | |
| }; |
$ ./govc object.collect -json /vcqaDC/vm/vm-with-disk config.hardware.device \
| jq '.[0].Val.VirtualDevice[]|select(.Key==2000)|.StorageIOAllocation'
{
"Limit": -1,
"Shares": {
"Shares": 1000,
"Level": "normal"
},
"Reservation": 0go test -v -bench=. -gcflags '-l -N' -cpu=1,2,4 -benchmem
goos: darwin
goarch: amd64
pkg: github.com/embano1/assertbench
cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
BenchmarkEqualGeneric
BenchmarkEqualGeneric 462083778 2.392 ns/op 0 B/op 0 allocs/op
BenchmarkEqualGeneric-2 504194739 2.391 ns/op 0 B/op 0 allocs/op
BenchmarkEqualGeneric-4 513227227 2.470 ns/op 0 B/op 0 allocs/op| name: image | |
| on: | |
| push: | |
| branches: ['main'] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write |
| export KIND_CLUSTER_NAME=knative-0.24 | |
| export KO_DOCKER_REPO=kind.local | |
| ko apply -f . |