Skip to content

Commit 4dfb76d

Browse files
authored
Merge pull request #1395 from gruntwork-io/deps-update
Terratest build fixes
2 parents 891a37d + 2a7224f commit 4dfb76d

15 files changed

Lines changed: 92 additions & 54 deletions

File tree

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ env: &env
55
MODULE_GCP_CI_VERSION: v0.1.1
66
MODULE_CI_CIRCLECI_HELPER_VERSION: v0.56.0
77
TERRAFORM_VERSION: 1.5.7
8-
PACKER_VERSION: 1.7.4
8+
PACKER_VERSION: 1.10.0
99
TERRAGRUNT_VERSION: v0.52.0
1010
OPA_VERSION: v0.33.1
1111
GO_VERSION: 1.21.1

examples/packer-docker-example/build.pkr.hcl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ packer {
44
version = ">=v1.0.0"
55
source = "github.com/hashicorp/amazon"
66
}
7+
docker = {
8+
version = ">=v1.0.1"
9+
source = "github.com/hashicorp/docker"
10+
}
711
}
812
}
913

examples/packer-docker-example/configure-sinatra-app.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sudo apt-get update
1111
sudo apt-get install -y make zlib1g-dev build-essential ruby ruby-dev
1212

1313
echo "Installing Sinatra"
14-
sudo gem install sinatra json
14+
sudo gem install sinatra json rackup
1515

1616
echo "Moving $APP_RB_SRC to $APP_RB_DST"
1717
mkdir -p "$(dirname "$APP_RB_DST")"

examples/terraform-aws-lambda-example/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ resource "aws_lambda_function" "lambda" {
2828
source_code_hash = data.archive_file.zip.output_base64sha256
2929
function_name = var.function_name
3030
role = aws_iam_role.lambda.arn
31-
handler = "lambda"
32-
runtime = "go1.x"
31+
handler = "bootstrap"
32+
runtime = "provided.al2023"
3333
}
3434

3535
resource "aws_iam_role" "lambda" {

examples/terraform-aws-lambda-example/src/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
The lambda executable `handler` was built using
44

55
``` shell
6-
go build lambda.go
6+
go build bootstrap.go
77
```
6.12 MB
Binary file not shown.

examples/terraform-aws-lambda-example/src/lambda.go renamed to examples/terraform-aws-lambda-example/src/bootstrap.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ type Event struct {
1313
}
1414

1515
// Fails if ShouldFail is `true`, otherwise echos the input.
16-
func HandleRequest(ctx context.Context, evnt Event) (string, error) {
16+
func HandleRequest(ctx context.Context, evnt *Event) (string, error) {
17+
if evnt == nil {
18+
return "", fmt.Errorf("received nil event")
19+
}
1720
if evnt.ShouldFail {
1821
return "", fmt.Errorf("Failed to handle %#v", evnt)
1922
}
-9.5 MB
Binary file not shown.

examples/terraform-ssh-password-example/user_data.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ adduser --disabled-password --gecos "" terratest
1313
echo "terratest:${terratest_password}" | chpasswd
1414

1515
# Enable password auth on the SSH service
16-
sed -i 's/^PasswordAuthentication no$/PasswordAuthentication yes/g' /etc/ssh/sshd_config
16+
echo "PasswordAuthentication yes" > /etc/ssh/sshd_config.d/01-password-auth.conf
1717

1818
# Bounce the service to apply the config change
1919
service ssh restart

modules/aws/rds_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ func TestGetRecommendedRdsInstanceTypeHappyPath(t *testing.T) {
2323
region: "us-east-2",
2424
databaseEngine: "mysql",
2525
engineMajorVersion: "8.0",
26-
instanceTypes: []string{"db.t2.micro", "db.t3.micro", "db.t3.small"},
27-
expected: "db.t2.micro",
26+
instanceTypes: []string{"db.t4g.micro", "db.t4g.small"},
27+
expected: "db.t4g.micro",
2828
},
2929
{
3030
name: "EU region, postgres, 2nd offering available based on region",
@@ -121,7 +121,7 @@ func TestGetRecommendedRdsInstanceTypeErrors(t *testing.T) {
121121
name: "No instance type available for engine",
122122
region: "us-east-1",
123123
databaseEngine: "oracle-ee",
124-
databaseEngineVersion: "19.0.0.0.ru-2021-01.rur-2021-01.r1",
124+
databaseEngineVersion: "19.0.0.0.ru-2024-04.rur-2024-04.r1",
125125
instanceTypes: []string{"db.r5a.large"},
126126
},
127127
{

0 commit comments

Comments
 (0)