Skip to content

Commit 15cdebb

Browse files
aahelcthainreskin89dependabot[bot]sanon-dev
authored
Aahel/release beta5 (#94)
* bump version of setup-terraform and remove gotestsum retries * Update SSM Set to allow for Advanced Tier Parameters (#78) * Bump github.com/hashicorp/consul from 1.15.2 to 1.15.3 in /consul-lambda (#75) Bumps [github.com/hashicorp/consul](https://github.com/hashicorp/consul) from 1.15.2 to 1.15.3. - [Release notes](https://github.com/hashicorp/consul/releases) - [Changelog](https://github.com/hashicorp/consul/blob/main/CHANGELOG.md) - [Commits](hashicorp/consul@v1.15.2...v1.15.3) --- updated-dependencies: - dependency-name: github.com/hashicorp/consul dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump google.golang.org/grpc from 1.50.1 to 1.53.0 in /test/acceptance (#79) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.50.1 to 1.53.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](grpc/grpc-go@v1.50.1...v1.53.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Ajsanon/ux updates (#80) * Lambda Reg UX changes to simplify for users * - added pull through cache - removed all provisioners and used providers * bumped lambda_registrator_image tag * fixed terraform fmt * moved providers to examples/lambda providers.tf * fixed provider and other minor fixes * added pull_through var in examples * fixed terraform lint * fix minor fmt issues * review fixes * minor name change * fix tf lint * variable name changes * added changelog --------- Co-authored-by: AJ Sanon <[email protected]> * Revert "Ajsanon/ux updates (#80)" (#81) This reverts commit db2b43a. * Add support for pushing `consul-lambda-registrator` public image to p… (#82) * Add support for pushing `consul-lambda-registrator` public image to private ecr repo through terraform * fmt tf * minor readme fix * addressed review comments * added fixes and fixed acceptance test * updated aws provider version * updated aws provider version * added force_delete to aws_ecr_repository in test * fmt tf * Update modules/lambda-registrator/main.tf Co-authored-by: Chris Thain <[email protected]> * Update modules/lambda-registrator/main.tf Co-authored-by: Chris Thain <[email protected]> * Update modules/lambda-registrator/variables.tf Co-authored-by: Chris Thain <[email protected]> * grouped data sources together * added review changes * add some fixes * test fixes * minor test fix * added default "" to test ecr_image_uri * fmt tf * Update modules/lambda-registrator/main.tf Co-authored-by: Chris Thain <[email protected]> * added validation test * fixed tf fmt and made validation test parallel * removed validation test from basic test * added test case to validate when privateEcrReponame is set * updated enable_auto_publish_ecr_image var description * fixed tf fmt * Update modules/lambda-registrator/variables.tf Co-authored-by: Chris Thain <[email protected]> * changed consul_image version in basic_test --------- Co-authored-by: Chris Thain <[email protected]> * Update to use CRT prepare workflow This update, moves consul-dataplane to use the prepare workflow. This workflow encapsulates several previous workflows, running jobs in parallel to reduce the artifact processing time. See https://hashicorp.atlassian.net/wiki/spaces/RELENG/pages/2489712686/Dec+7th+2022+-+Introducing+the+new+Prepare+workflow for more info. * [COMPLIANCE] Add Copyright and License Headers (#83) Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> * Bump golang.org/x/net from 0.7.0 to 0.17.0 in /test/acceptance (#85) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.7.0 to 0.17.0. - [Commits](golang/net@v0.7.0...v0.17.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * NET-7753 - Support for arm64 builds (#90) * support for arm64 init * fix runs on * fix runs on * fix lint-consul-retry * removed arch * add self hosted machine * fix os * fix platform * fix -race * session manager fix * unzip with overwrite flag * fix vpc issue * arm self hosted * remvoed -override * using docker/setup-qemu-action (#91) * using docker/setup-qemu-action * minor fix * minor fix * minor fix * refactor * added emulation to terrafrom-ci * remveod unused env variable * changed working directory for unit tests * not pushing arm image to hashicorpdev * building arm and amd binaries for extension and lambda for acc test * minor workflow fix * temp change * passing arch to lambda funcs * fmt tf * passing arch through preexisting lambda * fix tf * changed lambda runtime * changed lambda binary name bootstrap * fix go build * reverted extension build changes * increased lambda timeout * removed timeout from lambda func * fmt tf * changed lambda handler * updated aws -lambda-go lib * minor refactor * removed unused step matrix strategy and added some comments * setting unique name for private ecr repo * setting arch for buildig registrator image * temp fix * building arm * docker buildx setup * fixed docker build * fix makefile * fix makefile * bumped aws-lambda-go lib version * temp fix * makefile change * test * modifief registrator tf to support arch * added back other tc * increased timeout * changhed timeout * adjusted timeout * increased timeout * bumped consul image version * removed emulation from acc test * fix tf ci * fix tf ci * increased lambda timeout * increade timeout * making registrator amd64 * temp removed arm regist * readded emulation * reverted some changes * restored eralier version of consul * added arm reg * passed arch to reg * tf fmt * removed arch in ecr tf * removed arch * only amd * add max paralle 1 * fix arch * fix makefile * added buildx * added back emulation * max p 1 * only arm * increase timeout * dummy commit to trigger CI * using different docker tga * fix arch in docker tag * docker push correct arch * fix output * fix image tag * fixed arch var * added multiarch build * fmt tf * fix docker build * build fix * increased timeout * skipped test * removed arch unit tests * removed specifying arch in registrator module * removed passing arch to registrator * readded reg arch * fixed p[assing arch * reenabled arm test for autopublish * fmt tf * fixed validation --------- Co-authored-by: aahel <[email protected]> * prerelease version change * updated changelog --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Chris Thain <[email protected]> Co-authored-by: Ryan Eskin <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: AJ Sanon <[email protected]> Co-authored-by: Chris Thain <[email protected]> Co-authored-by: Sarah Thompson <[email protected]> Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Co-authored-by: Ashesh Vidyut <[email protected]>
1 parent 62e0fdb commit 15cdebb

File tree

39 files changed

+639
-301
lines changed

39 files changed

+639
-301
lines changed

.github/workflows/bin-ci.yml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,13 @@ jobs:
1313
- name: Lint workflow
1414
uses: docker://docker.mirror.hashicorp.services/rhysd/actionlint:latest
1515
get-go-version:
16-
name: "Determine Go toolchain version"
17-
defaults:
18-
run:
19-
working-directory: ./consul-lambda
20-
runs-on: ubuntu-latest
21-
needs:
22-
- action-lint
23-
outputs:
24-
go-version: ${{ steps.get-go-version.outputs.go-version }}
25-
steps:
26-
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
27-
- name: Determine Go version
28-
id: get-go-version
29-
run: |
30-
echo "Building with Go $(cat .go-version)"
31-
echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
16+
needs: action-lint
17+
uses: ./.github/workflows/reusable-get-go-version.yml
3218
lint:
3319
defaults:
3420
run:
35-
working-directory: ./consul-lambda/consul-lambda-registrator
21+
# run lint inside ./consul-lambda
22+
working-directory: ./consul-lambda
3623
runs-on: ubuntu-latest
3724
needs:
3825
- get-go-version
@@ -51,7 +38,8 @@ jobs:
5138
only-new-issues: false
5239
skip-pkg-cache: true
5340
skip-build-cache: true
54-
working-directory: ./consul-lambda/consul-lambda-registrator
41+
# run lint inside ./consul-lambda
42+
working-directory: ./consul-lambda
5543

5644
test:
5745
name: unit test (consul-version=${{ matrix.consul-version }})
@@ -64,7 +52,8 @@ jobs:
6452
- get-go-version
6553
defaults:
6654
run:
67-
working-directory: ./consul-lambda/consul-lambda-registrator
55+
# run all tests inside ./consul-lambda
56+
working-directory: ./consul-lambda
6857
env:
6958
TEST_RESULTS_DIR: /tmp/test-results
7059
GOTESTSUM_VERSION: 1.8.0
@@ -110,4 +99,4 @@ jobs:
11099
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
111100
with:
112101
name: test-results
113-
path: ${{ env.TEST_RESULTS_DIR }}/${{ matrix.consul-version }}
102+
path: ${{ env.TEST_RESULTS_DIR }}/${{ matrix.consul-version }}

.github/workflows/build.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,8 @@ jobs:
1414
- name: Lint workflow
1515
uses: docker://docker.mirror.hashicorp.services/rhysd/actionlint:latest
1616
get-go-version:
17-
name: "Determine Go toolchain version"
18-
defaults:
19-
run:
20-
working-directory: ./consul-lambda
21-
runs-on: ubuntu-latest
2217
needs: action-lint
23-
outputs:
24-
go-version: ${{ steps.get-go-version.outputs.go-version }}
25-
steps:
26-
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
27-
- name: Determine Go version
28-
id: get-go-version
29-
run: |
30-
echo "Building with Go $(cat .go-version)"
31-
echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
32-
18+
uses: ./.github/workflows/reusable-get-go-version.yml
3319
get-product-version:
3420
defaults:
3521
run:
@@ -75,12 +61,19 @@ jobs:
7561
path: ${{ steps.generate-metadata-file.outputs.filepath }}
7662

7763
build-linux:
64+
strategy:
65+
matrix:
66+
goos:
67+
- linux
68+
goarch:
69+
- amd64
70+
- arm64
7871
defaults:
7972
run:
8073
working-directory: ./consul-lambda
8174
env:
82-
GOOS: linux
83-
GOARCH: amd64
75+
GOOS: ${{ matrix.goos }}
76+
GOARCH: ${{ matrix.goarch }}
8477
LDFLAGS: ${{ needs.get-product-version.outputs.ldflags }}
8578
CGO_ENABLED: 0
8679
needs:
@@ -122,6 +115,11 @@ jobs:
122115
path: ./consul-lambda/out/${{ env.EXT_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ env.GOOS }}_${{ env.GOARCH }}.zip
123116

124117
build-docker-default:
118+
strategy:
119+
matrix:
120+
goarch:
121+
- amd64
122+
- arm64
125123
defaults:
126124
run:
127125
working-directory: ./consul-lambda/consul-lambda-registrator
@@ -132,7 +130,7 @@ jobs:
132130
runs-on: ubuntu-latest
133131
env:
134132
version: ${{ needs.get-product-version.outputs.product-version }}
135-
arch: amd64
133+
arch: ${{ matrix.goarch }}
136134

137135
steps:
138136
- name: Checkout
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: get-go-version
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
go-version:
7+
description: "The Go version detected by this workflow"
8+
value: ${{ jobs.get-go-version.outputs.go-version }}
9+
10+
jobs:
11+
get-go-version:
12+
name: "Determine Go toolchain version"
13+
defaults:
14+
run:
15+
working-directory: ./consul-lambda
16+
runs-on: ubuntu-latest
17+
outputs:
18+
go-version: ${{ steps.get-go-version.outputs.go-version }}
19+
steps:
20+
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
21+
- name: Determine Go version
22+
id: get-go-version
23+
run: |
24+
echo "Building with Go $(cat .go-version)"
25+
echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT"

.github/workflows/terraform-ci.yml

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,13 @@ jobs:
2424
- name: Checkout
2525
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2626
- name: Setup Terraform
27-
uses: hashicorp/setup-terraform@v1
27+
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
2828
with:
2929
terraform_version: v1.3.1
3030
- name: Validate
3131
run: terraform fmt -check -recursive .
3232
get-go-version:
33-
name: "Determine Go toolchain version"
34-
defaults:
35-
run:
36-
working-directory: ./consul-lambda
37-
runs-on: ubuntu-latest
38-
outputs:
39-
go-version: ${{ steps.get-go-version.outputs.go-version }}
40-
steps:
41-
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
42-
- name: Determine Go version
43-
id: get-go-version
44-
run: |
45-
echo "Building with Go $(cat .go-version)"
46-
echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
33+
uses: ./.github/workflows/reusable-get-go-version.yml
4734
go-test-lint:
4835
runs-on: ubuntu-latest
4936
defaults:
@@ -73,13 +60,21 @@ jobs:
7360
skip-build-cache: true
7461
working-directory: ./test/acceptance
7562
acceptance:
63+
strategy:
64+
matrix:
65+
platform:
66+
- {goos: "linux", goarch: "amd64"}
67+
- {goos: "linux", goarch: "arm64"}
7668
runs-on: ubuntu-latest
7769
defaults:
7870
run:
7971
working-directory: ./test/acceptance
8072
env:
8173
TEST_RESULTS: /tmp/test-results
8274
GOTESTSUM_VERSION: 1.8.0
75+
OS: ${{ matrix.platform.goos }}
76+
ARCH: ${{ matrix.platform.goarch }}
77+
SESSION_MANAGER: ubuntu_64bit
8378
needs:
8479
- action-lint
8580
- go-test-lint
@@ -92,6 +87,8 @@ jobs:
9287
with:
9388
go-version: ${{ needs.get-go-version.outputs.go-version }}
9489
cache-dependency-path: ./test/acceptance/go.sum
90+
- name: Set up Docker Buildx
91+
uses: docker/setup-buildx-action@2a1a44ac4aa01993040736bd95bb470da1a38365 # v2.9.0
9592
- name: Setup gotestsum
9693
shell: bash
9794
run: |
@@ -101,7 +98,7 @@ jobs:
10198
- name: Install dependencies
10299
run: |
103100
sudo apt-get install -y expect
104-
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "session-manager-plugin.deb"
101+
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/${{ env.SESSION_MANAGER }}/session-manager-plugin.deb" -o "session-manager-plugin.deb"
105102
sudo dpkg -i session-manager-plugin.deb
106103
- name: Configure AWS
107104
# Environment variables for IAM roles are unsupported: https://github.com/aws/aws-cli/issues/5639
@@ -115,14 +112,11 @@ jobs:
115112
run: |
116113
cd setup-terraform
117114
terraform init
118-
terraform apply -auto-approve
115+
terraform apply -var arch="${{matrix.platform.goarch}}" -auto-approve
119116
- name: Run acceptance tests
120117
run: |
121118
mkdir -p "$TEST_RESULTS"
122119
gotestsum \
123-
--rerun-fails=2 \
124-
--rerun-fails-max-failures=2 \
125-
--rerun-fails-report "$TEST_RESULTS/gotestsum-rerun-fails" \
126120
--packages "./..." \
127121
--junitfile "$TEST_RESULTS/gotestsum-report.xml" \
128122
--format standard-verbose -- \
@@ -132,13 +126,8 @@ jobs:
132126
with:
133127
name: acceptance-test-results
134128
path: ${{ env.TEST_RESULTS }}/gotestsum-report.xml
135-
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
136-
if: always()
137-
with:
138-
name: acceptance-test-flakes
139-
path: ${{ env.TEST_RESULTS }}/gotestsum-rerun-fails
140129
- name: terraform destroy
141130
if: always()
142131
run: |
143132
cd setup-terraform
144-
terraform destroy -auto-approve
133+
terraform destroy -auto-approve

.release/ci.hcl

Lines changed: 5 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -33,97 +33,20 @@ event "build" {
3333
}
3434
}
3535

36-
event "upload-dev" {
36+
event "prepare" {
3737
depends = ["build"]
38-
action "upload-dev" {
38+
action "prepare" {
3939
organization = "hashicorp"
40-
repository = "crt-workflows-common"
41-
workflow = "upload-dev"
42-
depends = ["build"]
43-
}
44-
45-
notification {
46-
on = "fail"
47-
}
48-
}
49-
50-
event "security-scan-binaries" {
51-
depends = ["upload-dev"]
52-
action "security-scan-binaries" {
53-
organization = "hashicorp"
54-
repository = "crt-workflows-common"
55-
workflow = "security-scan-binaries"
56-
config = "security-scan.hcl"
57-
}
58-
59-
notification {
60-
on = "fail"
61-
}
62-
}
63-
64-
event "security-scan-containers" {
65-
depends = ["security-scan-binaries"]
66-
action "security-scan-containers" {
67-
organization = "hashicorp"
68-
repository = "crt-workflows-common"
69-
workflow = "security-scan-containers"
70-
config = "security-scan.hcl"
40+
repository = "crt-workflows-common"
41+
workflow = "prepare"
42+
depends = ["build"]
7143
}
7244

7345
notification {
7446
on = "fail"
7547
}
7648
}
7749

78-
event "sign" {
79-
depends = ["security-scan-containers"]
80-
action "sign" {
81-
organization = "hashicorp"
82-
repository = "crt-workflows-common"
83-
workflow = "sign"
84-
}
85-
86-
notification {
87-
on = "fail"
88-
}
89-
}
90-
91-
event "verify" {
92-
depends = ["sign"]
93-
action "verify" {
94-
organization = "hashicorp"
95-
repository = "crt-workflows-common"
96-
workflow = "verify"
97-
}
98-
99-
notification {
100-
on = "fail"
101-
}
102-
}
103-
104-
event "promote-dev-docker" {
105-
depends = ["verify"]
106-
action "promote-dev-docker" {
107-
organization = "hashicorp"
108-
repository = "crt-workflows-common"
109-
workflow = "promote-dev-docker"
110-
depends = ["verify"]
111-
}
112-
113-
notification {
114-
on = "fail"
115-
}
116-
}
117-
118-
event "fossa-scan" {
119-
depends = ["promote-dev-docker"]
120-
action "fossa-scan" {
121-
organization = "hashicorp"
122-
repository = "crt-workflows-common"
123-
workflow = "fossa-scan"
124-
}
125-
}
126-
12750
## These are promotion and post-publish events
12851
## they should be added to the end of the file after the verify event stanza.
12952

CHANGELOG.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1+
## 0.1.0-beta5 (Mar 04, 2024)
2+
3+
FEATURES
4+
* Add support for storing parameter values greater than 4 KB. The `lambda-registrator` module and source code have been updated to accept a configurable value for the [SSM parameter tier](https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-advanced-parameters.html). This allows users to choose if they want to use the `Advanced` tier feature. Charges apply for the `Advanved` tier so if the tier is not expressly set to `Advanced`, then the `Standard` tier will be used. Using the `Advanced` tier allows for parameter values up to 8 KB. The Lambda-registrator Terraform module can be configured using the new `consul_extension_data_tier` variable.
5+
[[GH-78]](https://github.com/hashicorp/terraform-aws-consul-lambda/pull/78)
6+
7+
* Add support for pushing `consul-lambda-registrator` public image to private ecr repo through terraform.
8+
[[GH-82]](https://github.com/hashicorp/terraform-aws-consul-lambda/pull/82)
9+
10+
* Add arm64 support to `consul-lambda-registrator` and `consul-lambda-extension`.
11+
[[GH-90]](https://github.com/hashicorp/terraform-aws-consul-lambda/pull/90)
12+
113
## 0.1.0-beta4 (Apr 28, 2023)
214

3-
IMPROVEMENTS:
15+
IMPROVEMENTS
416
* Pin the version of the `terraform-aws-modules/eventbridge/aws` module to v1.17.3. This ensures the selection of the eventbridge module is deterministic when using the `lambda-registrator` Terraform module.
517
[[GH-70]](https://github.com/hashicorp/terraform-aws-consul-lambda/pull/70)
618

7-
BUG FIXES:
19+
BUG FIXES
820
* Disable Cgo compilation for Lambda registrator and extension. Compiling without `CGO_ENABLED=0` on Go 1.20 [causes an issue](https://github.com/hashicorp/terraform-aws-consul-lambda/issues/57) that does not allow Lambda registrator or the Lambda extension to execute within the AWS Lambda runtime.
921
[[GH-68]](https://github.com/hashicorp/terraform-aws-consul-lambda/pull/68)
1022

@@ -19,7 +31,7 @@ BREAKING CHANGES
1931
FEATURES
2032
* Update minimum go version for project to 1.20 [[GH-1908]](https://github.com/hashicorp/terraform-aws-consul-lambda/pull/54)
2133

22-
BUG FIXES:
34+
BUG FIXES
2335
* Security:
2436
* Upgrade to use Go 1.20.1 This resolves vulnerabilities [CVE-2022-41724](https://go.dev/issue/58001) in `crypto/tls` and [CVE-2022-41723](https://go.dev/issue/57855) in `net/http`. [[GH-1908]](https://github.com/hashicorp/terraform-aws-consul-lambda/pull/54)
2537

0 commit comments

Comments
 (0)