Skip to content

Commit 62c543d

Browse files
committed
Update dependencies
1 parent d5b96a6 commit 62c543d

File tree

13 files changed

+1847
-1828
lines changed

13 files changed

+1847
-1828
lines changed

README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Testing is crucial in any software project. When shifting to a serverless world, we need to accept and embrace multiple paradigm shifts, which also affect how we can test our applications. By doing so on multiple layers, we can drastically increase our confidence of releasing code and having minimal impact on the service availability and stability of the software we develop.
44

5-
This workshop consists of multiple independent modules which can be done in any order. The modules are
5+
This workshop consists of multiple independent modules which can be done in any order. The modules are:
66

77
- [Unit Tests](#unit-tests)
88
- [Local Testing](#local-testing)
@@ -50,7 +50,10 @@ In Node.js, [Express](https://expressjs.com/) is a popular framework for buildin
5050
1. Read up on [`serverless-http`](https://github.com/dougmoscrop/serverless-http) and understand how it works
5151
1. Check out the example application in [local-testing](./local-testing) and investigate how it uses the serverless-http framework
5252
1. Run the application locally by running `npm install` and then `npm start`
53-
1. Send an HTTP request to the app (e.g. using `curl localhost:8080`)
53+
1. Send an HTTP request to the app
54+
```shell
55+
curl -X GET localhost:8080 -H 'Content-Type:application/json' -d '{"name":"Alice"}'
56+
```
5457
1. Deploy the app to AWS Lambda and hook it up with API Gateway.
5558
1. Research how you could do something similar with the web framework and programming language of your choice
5659

@@ -63,12 +66,12 @@ Integration testing is crucial to being confident that your application behaves
6366
> Requirements: You need to have either [Docker](https://www.docker.com/) (including [docker-compose](https://github.com/docker/compose)) or [Podman](https://podman.io/) (including [podman-compose](https://github.com/containers/podman-compose)) installed.
6467
6568
1. Take a look at the introduction to LocalStack by reading their [overview documentation](https://docs.localstack.cloud/overview/).
66-
1. Investigate the `docker-compose.yml` file in the [`integration-tests`](./integration-tests) directory and understand how it sets up
67-
1. Run `docker compose up -d` or (`PODMAN_COMPOSE_PROVIDER=podman-compose podman compose up -d` for Podman) and visit [localhost:4566/\_localstack/health](http://localhost:4566/_localstack/health) to verify all services are available.
69+
1. Investigate the `docker-compose.yml` file in the [`integration-tests`](./integration-tests) directory and understand how it's set up
70+
1. Run `docker compose up -d` or (`podman compose up -d` for Podman) and visit [localhost:4566/\_localstack/health](http://localhost:4566/_localstack/health) to verify all services are available.
6871
1. Run `aws --endpoint-url http://localhost:4566 dynamodb create-table --table-name jokes --attribute-definitions AttributeName=ID,AttributeType=S --key-schema AttributeName=ID,KeyType=HASH --provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1` to create the `jokes` table locally.
6972
1. Run `aws --endpoint-url http://localhost:4566 dynamodb list-tables` to verify it has been created.
7073
1. Run `aws --endpoint-url http://localhost:4566 dynamodb put-item --table-name jokes --item '{"ID":{"S":"1"},"Text":{"S":"Hello funny world"}}'` to insert a joke into the newly created table.
71-
1. Run `aws --endpoint-url http://locahlost:4566 dynamodb scan --table-name jokes` to verify it has been inserted.
74+
1. Run `aws --endpoint-url http://localhost:4566 dynamodb scan --table-name jokes` to verify it has been inserted.
7275

7376
## E2E Tests
7477

@@ -114,7 +117,7 @@ Many FaaS platforms allow performing canary deployments. By doing so, we don't r
114117
1. Change something about the function code and apply again to publish a new version (notice the `publish: true` flag in `function.tf`)
115118
1. Visit the [CodeDeploy UI](https://console.aws.amazon.com/codesuite/codedeploy/applications)
116119
1. Choose your application
117-
1. Click "Create deployment" and choose "Use AppSpec editor" with "YAML"
120+
1. Click "Create deployment" and pick "Use AppSpec editor" with "YAML"
118121
1. Enter the following code into the text field (replacing `RESOURCE_SUFFIX` with the suffix you chose):
119122

120123
```yml

e2e-tests/.terraform.lock.hcl

+27-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e-tests/function.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
resource "aws_lambda_function" "jokester" {
22
function_name = "${local.application}${var.resource_suffix}"
33
filename = data.archive_file.jokester_code.output_path
4-
runtime = "nodejs18.x"
4+
runtime = "nodejs20.x"
55
handler = "index.handler"
66
source_code_hash = data.archive_file.jokester_code.output_base64sha256
77
role = aws_iam_role.lambda_exec.arn
88

99
environment {
1010
variables = {
11-
JOKE_TABLE_SUFFIX = "${var.resource_suffix}"
11+
JOKE_TABLE_SUFFIX = var.resource_suffix
1212
}
1313
}
1414

e2e-tests/test/go.mod

+38-37
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,70 @@
11
module github.com/cloudlena/terraform-aws-spa
22

3-
go 1.21.5
3+
go 1.22.2
44

5-
require github.com/gruntwork-io/terratest v0.46.8
5+
require github.com/gruntwork-io/terratest v0.46.14
66

77
require (
8-
cloud.google.com/go v0.111.0 // indirect
9-
cloud.google.com/go/compute v1.23.3 // indirect
10-
cloud.google.com/go/compute/metadata v0.2.3 // indirect
11-
cloud.google.com/go/iam v1.1.5 // indirect
12-
cloud.google.com/go/storage v1.36.0 // indirect
8+
cloud.google.com/go v0.112.2 // indirect
9+
cloud.google.com/go/auth v0.3.0 // indirect
10+
cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect
11+
cloud.google.com/go/compute/metadata v0.3.0 // indirect
12+
cloud.google.com/go/iam v1.1.7 // indirect
13+
cloud.google.com/go/storage v1.40.0 // indirect
1314
github.com/agext/levenshtein v1.2.3 // indirect
1415
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
15-
github.com/aws/aws-sdk-go v1.49.10 // indirect
16+
github.com/aws/aws-sdk-go v1.51.32 // indirect
1617
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
1718
github.com/davecgh/go-spew v1.1.1 // indirect
1819
github.com/felixge/httpsnoop v1.0.4 // indirect
1920
github.com/go-logr/logr v1.4.1 // indirect
2021
github.com/go-logr/stdr v1.2.2 // indirect
2122
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
22-
github.com/golang/protobuf v1.5.3 // indirect
23+
github.com/golang/protobuf v1.5.4 // indirect
2324
github.com/google/s2a-go v0.1.7 // indirect
24-
github.com/google/uuid v1.5.0 // indirect
25+
github.com/google/uuid v1.6.0 // indirect
2526
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
26-
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
27+
github.com/googleapis/gax-go/v2 v2.12.3 // indirect
2728
github.com/hashicorp/errwrap v1.1.0 // indirect
2829
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
29-
github.com/hashicorp/go-getter v1.7.3 // indirect
30+
github.com/hashicorp/go-getter v1.7.4 // indirect
3031
github.com/hashicorp/go-multierror v1.1.1 // indirect
3132
github.com/hashicorp/go-safetemp v1.0.0 // indirect
3233
github.com/hashicorp/go-version v1.6.0 // indirect
33-
github.com/hashicorp/hcl/v2 v2.19.1 // indirect
34-
github.com/hashicorp/terraform-json v0.20.0 // indirect
34+
github.com/hashicorp/hcl/v2 v2.20.1 // indirect
35+
github.com/hashicorp/terraform-json v0.21.0 // indirect
3536
github.com/jinzhu/copier v0.4.0 // indirect
3637
github.com/jmespath/go-jmespath v0.4.0 // indirect
37-
github.com/klauspost/compress v1.17.4 // indirect
38+
github.com/klauspost/compress v1.17.8 // indirect
3839
github.com/mattn/go-zglob v0.0.4 // indirect
3940
github.com/mitchellh/go-homedir v1.1.0 // indirect
4041
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
4142
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
4243
github.com/pmezard/go-difflib v1.0.0 // indirect
43-
github.com/stretchr/testify v1.8.4 // indirect
44-
github.com/tmccombs/hcl2json v0.6.0 // indirect
45-
github.com/ulikunitz/xz v0.5.11 // indirect
46-
github.com/zclconf/go-cty v1.14.1 // indirect
44+
github.com/stretchr/testify v1.9.0 // indirect
45+
github.com/tmccombs/hcl2json v0.6.2 // indirect
46+
github.com/ulikunitz/xz v0.5.12 // indirect
47+
github.com/zclconf/go-cty v1.14.4 // indirect
4748
go.opencensus.io v0.24.0 // indirect
48-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
49-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect
50-
go.opentelemetry.io/otel v1.21.0 // indirect
51-
go.opentelemetry.io/otel/metric v1.21.0 // indirect
52-
go.opentelemetry.io/otel/trace v1.21.0 // indirect
53-
golang.org/x/crypto v0.17.0 // indirect
54-
golang.org/x/net v0.19.0 // indirect
55-
golang.org/x/oauth2 v0.15.0 // indirect
56-
golang.org/x/sync v0.5.0 // indirect
57-
golang.org/x/sys v0.15.0 // indirect
49+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 // indirect
50+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 // indirect
51+
go.opentelemetry.io/otel v1.26.0 // indirect
52+
go.opentelemetry.io/otel/metric v1.26.0 // indirect
53+
go.opentelemetry.io/otel/trace v1.26.0 // indirect
54+
golang.org/x/crypto v0.22.0 // indirect
55+
golang.org/x/mod v0.17.0 // indirect
56+
golang.org/x/net v0.24.0 // indirect
57+
golang.org/x/oauth2 v0.19.0 // indirect
58+
golang.org/x/sync v0.7.0 // indirect
59+
golang.org/x/sys v0.19.0 // indirect
5860
golang.org/x/text v0.14.0 // indirect
5961
golang.org/x/time v0.5.0 // indirect
60-
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
61-
google.golang.org/api v0.154.0 // indirect
62-
google.golang.org/appengine v1.6.8 // indirect
63-
google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 // indirect
64-
google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 // indirect
65-
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect
66-
google.golang.org/grpc v1.60.1 // indirect
67-
google.golang.org/protobuf v1.32.0 // indirect
62+
golang.org/x/tools v0.20.0 // indirect
63+
google.golang.org/api v0.177.0 // indirect
64+
google.golang.org/genproto v0.0.0-20240429193739-8cf5692501f6 // indirect
65+
google.golang.org/genproto/googleapis/api v0.0.0-20240429193739-8cf5692501f6 // indirect
66+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240429193739-8cf5692501f6 // indirect
67+
google.golang.org/grpc v1.63.2 // indirect
68+
google.golang.org/protobuf v1.34.0 // indirect
6869
gopkg.in/yaml.v3 v3.0.1 // indirect
6970
)

0 commit comments

Comments
 (0)