Skip to content

Commit

Permalink
use latest terraform 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ianic committed Oct 2, 2022
1 parent 043fef5 commit 42e067d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli/controller/setup_stack_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Resources:
MemorySize: 1769
Architectures: ['arm64']
Layers:
- arn:aws:lambda:{{.Region}}:477361877445:layer:terraform-layer:1
- arn:aws:lambda:{{.Region}}:477361877445:layer:terraform-1-3-1:1
Code:
S3Bucket: {{.Bucket}}
S3Key: {{.S3Key}}
Expand Down
2 changes: 1 addition & 1 deletion cli/controller/testdata/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Resources:
MemorySize: 1769
Architectures: ['arm64']
Layers:
- arn:aws:lambda:region:477361877445:layer:terraform-layer:1
- arn:aws:lambda:region:477361877445:layer:terraform-1-3-1:1
Code:
S3Bucket: bucket
S3Key: bucket-key
Expand Down
4 changes: 2 additions & 2 deletions node/terraform/modules/functions-node/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ locals {
memory_size = 1769
timeout = 900
architecture = "arm64"
layers = ["arn:aws:lambda:${var.region}:477361877445:layer:terraform-layer:1"]
layers = ["arn:aws:lambda:${var.region}:477361877445:layer:terraform-1-3-1:1"]
policy = data.aws_iam_policy_document.deploy.json
},
"security" = {
Expand All @@ -23,7 +23,7 @@ locals {
memory_size = 1769
timeout = 900
architecture = "arm64"
layers = ["arn:aws:lambda:${var.region}:477361877445:layer:terraform-layer:1"]
layers = ["arn:aws:lambda:${var.region}:477361877445:layer:terraform-1-3-1:1"]
policy = data.aws_iam_policy_document.destroy.json
}
"auth" = {
Expand Down
28 changes: 28 additions & 0 deletions scripts/create_terraform_layer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash -ex

version="1.3.1"

tmp=$(mktemp -d)

cd $tmp

wget https://releases.hashicorp.com/terraform/"$version"/terraform_"$version"_linux_arm64.zip
unzip terraform_"$version"_linux_arm64.zip
rm terraform_"$version"_linux_arm64.zip

mkdir bin
mv terraform bin

cd $tmp
zip -r layer.zip bin/
unzip -l $tmp/layer.zip

layer_name=terraform-"${version//./-}"

aws lambda publish-layer-version \
--layer-name "$layer_name" \
--zip-file "fileb://$tmp/layer.zip" \
--compatible-architectures "arm64" \
--compatible-runtimes "provided.al2" \
--description "terraform $version" \
--no-cli-pager

0 comments on commit 42e067d

Please sign in to comment.