Skip to content

Commit ff9a530

Browse files
authored
Merge branch 'main' into signing-params
2 parents 8d46a74 + 00832ee commit ff9a530

File tree

6 files changed

+133
-9
lines changed

6 files changed

+133
-9
lines changed

.buildkite/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3'
22

33
services:
44
fixperms-tests:
5-
image: golang:1.24
5+
image: golang:1.25
66
working_dir: /code
77
environment:
88
CGO_ENABLED: 0

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66

7+
## [v6.42.0](https://github.com/buildkite/elastic-ci-stack-for-aws/compare/v6.41.6...v6.42.0) (2025-10-07)
8+
9+
### Changed
10+
11+
- Cleanup base AMI build logic by @scadu in https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1597
12+
- Fix missing refresh_authorized_keys.timer by @scadu in https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1604
13+
- Allow ECR Credential Helper to be disabled by @petetomasik in https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1600
14+
- Support cross-account SSM Parameter Store paths by @petetomasik in https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1605
15+
- Allow configurable Docker default bridge networks by @petetomasik in https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1608
16+
- Support arm64 arch for Lambda functions by @petetomasik in https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1606
17+
18+
### Internal
19+
20+
- Update golang Docker tag to v1.25 by @renovate[bot] in https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1610
21+
- Updates to clarify `BootstrapScriptUrl` and `AgentEnvFileUrl` Stack params by @petetomasik in https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1611
22+
- Update changelog for v6.41.6 release [#1602](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1602) ([scadu](https://github.com/scadu))
23+
24+
[Full Changelog](https://github.com/buildkite/elastic-ci-stack-for-aws/compare/v6.41.6...v6.42.0)
25+
726
## [v6.41.6](https://github.com/buildkite/elastic-ci-stack-for-aws/compare/v6.41.5...v6.41.6) (2025-09-24)
827

928
### Changed

packer/linux/stack/conf/bin/bk-configure-docker.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,26 @@ elif [[ "${DOCKER_NETWORKING_PROTOCOL}" == "dualstack" ]]; then
7171
--arg pool1 "${DOCKER_IPV4_ADDRESS_POOL_1:-172.17.0.0/12}" \
7272
--arg pool2 "${DOCKER_IPV4_ADDRESS_POOL_2:-192.168.0.0/16}" \
7373
--arg pool6 "${DOCKER_IPV6_ADDRESS_POOL:-2001:db8:2::/104}" \
74-
'.ipv6=true | ."fixed-cidr-v6"="2001:db8:1::/64" | .ip6tables=true | ."default-address-pools"=[{"base":$pool1,"size":20},{"base":$pool2,"size":24},{"base":$pool6,"size":112}]' \
74+
--arg cidrv6 "${DOCKER_FIXED_CIDR_V6:-2001:db8:1::/64}" \
75+
'.ipv6=true | ."fixed-cidr-v6"=$cidrv6 | .ip6tables=true | ."default-address-pools"=[{"base":$pool1,"size":20},{"base":$pool2,"size":24},{"base":$pool6,"size":112}]' \
7576
/etc/docker/daemon.json
7677
)" >/etc/docker/daemon.json
7778
else
7879
# docker 25.0 doesn't support ipv6 only, so we don't support it either
7980
true
8081
fi
8182

83+
# Configure fixed-cidr for IPv4 if provided (applies to both ipv4 and dualstack modes)
84+
if [[ -n "${DOCKER_FIXED_CIDR_V4:-}" ]]; then
85+
echo "Configuring Docker fixed-cidr (IPv4): ${DOCKER_FIXED_CIDR_V4}"
86+
cat <<<"$(
87+
jq \
88+
--arg cidr "${DOCKER_FIXED_CIDR_V4}" \
89+
'."fixed-cidr"=$cidr' \
90+
/etc/docker/daemon.json
91+
)" >/etc/docker/daemon.json
92+
fi
93+
8294
if [[ "${DOCKER_EXPERIMENTAL:-false}" == "true" ]]; then
8395
echo Configuring experiment flag for docker daemon...
8496
cat <<<"$(jq '.experimental=true' /etc/docker/daemon.json)" >/etc/docker/daemon.json

packer/linux/stack/conf/bin/bk-fetch.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@ fetch_ssm_parameters() {
2121
# trim off ssm: prefix
2222
ssm_path="${ssm_path//ssm:/}"
2323

24-
#
25-
# NOTE: The maximum number of parameters that can be retrieved is 25 to avoid throttling
26-
# in the case of misconfigured SSM path with a large number of child parameters
2724
aws ssm get-parameters-by-path \
2825
--path "${ssm_path}" \
2926
--recursive \
30-
--max-items 25 \
3127
--with-decryption \
3228
--query 'Parameters[*].{Name: Name, Value: Value}' --output json \
3329
| jq -r '.[] | [(.Name | split("/")[-1] | ascii_upcase), (["\"", .Value, "\""] | join(""))] | join("=")' \
@@ -37,14 +33,23 @@ fetch_ssm_parameters() {
3733
FROM="$1"
3834
TO="$2"
3935

36+
# Fetch content from various URI schemes:
37+
# - s3://bucket/key: S3 object URI (uses AWS S3 API)
38+
# - ssm:/path/to/param: SSM parameter path (uses AWS SSM API)
39+
# - https://example.com/file: HTTPS URL (uses curl)
40+
# - file:///path/to/file: Local file path (uses curl)
41+
# - http://example.com/file: HTTP URL (uses curl)
4042
case "$FROM" in
4143
s3://*)
44+
# S3 object URI - use AWS CLI to fetch
4245
exec aws s3 cp "$FROM" "$TO"
4346
;;
4447
ssm:*)
48+
# SSM parameter path - fetch parameters recursively
4549
fetch_ssm_parameters "${FROM}" "${TO}"
4650
;;
4751
*)
52+
# All other URIs (HTTPS, HTTP, file://) - use curl
4853
exec curl -Lfs -o "$TO" "$FROM"
4954
;;
5055
esac

packer/windows/stack/conf/bin/bk-fetch.ps1

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,43 @@ param ([parameter(Mandatory=$true)][string]$From, [parameter(Mandatory=$true)][s
33
# Stop script execution when a non-terminating error occurs
44
$ErrorActionPreference = "Stop"
55

6+
# Fetch content from various URI schemes:
7+
# - s3://bucket/key: S3 object URI (uses AWS CLI)
8+
# - ssm:/path/to/param: SSM parameter path (uses AWS CLI)
9+
# - https://example.com/file: HTTPS URL (uses Invoke-WebRequest)
10+
# - file:///path/to/file: Local file path (uses Invoke-WebRequest)
11+
# - http://example.com/file: HTTP URL (uses Invoke-WebRequest)
12+
613
If ($From -Like "s3://*") {
14+
# S3 object URI - use AWS CLI to fetch
715
aws s3 cp $From $To
816
If ($lastexitcode -ne 0) { Exit $lastexitcode }
917
}
18+
ElseIf ($From -Like "ssm:*") {
19+
# SSM parameter path - fetch parameters recursively
20+
$SsmPath = $From -replace "^ssm:", ""
21+
22+
# Get parameters from SSM
23+
$AwsOutput = aws ssm get-parameters-by-path `
24+
--path $SsmPath `
25+
--recursive `
26+
--with-decryption `
27+
--query 'Parameters[*].{Name: Name, Value: Value}' `
28+
--output json
29+
30+
If ($lastexitcode -ne 0) { Exit $lastexitcode }
31+
32+
$Parameters = $AwsOutput | ConvertFrom-Json
33+
34+
# Format as environment variables: KEY="value"
35+
$Parameters | ForEach-Object {
36+
$Name = ($_.Name -split "/")[-1].ToUpper()
37+
# Escape backslashes first, then quotes (order matters!)
38+
$Value = $_.Value -replace '\\', '\\' -replace '"', '\"'
39+
"$Name=`"$Value`""
40+
} | Out-File -FilePath $To -Encoding UTF8
41+
}
1042
Else {
43+
# All other URIs (HTTPS, HTTP, file://) - use Invoke-WebRequest
1144
Invoke-WebRequest -Uri $From -OutFile $To
1245
}

templates/aws-stack.yml

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Metadata:
6767
- EC2LogRetentionDays
6868
- LogRetentionDays
6969
- BuildkiteAgentEnableGracefulShutdown
70+
- LambdaArchitecture
7071

7172
- Label:
7273
default: Network Configuration
@@ -153,6 +154,16 @@ Metadata:
153154
- EnableDockerUserNamespaceRemap
154155
- EnableDockerExperimental
155156

157+
- Label:
158+
default: Docker Networking Configuration
159+
Parameters:
160+
- DockerNetworkingProtocol
161+
- DockerIPv4AddressPool1
162+
- DockerIPv4AddressPool2
163+
- DockerIPv6AddressPool
164+
- DockerFixedCidrV4
165+
- DockerFixedCidrV6
166+
156167
- Label:
157168
default: Docker Registry Configuration
158169
Parameters:
@@ -566,13 +577,18 @@ Parameters:
566577
Default: "private"
567578

568579
BootstrapScriptUrl:
569-
Description: Optional - HTTPS or S3 URL for a script to run on each instance during boot.
580+
Description: >
581+
Optional - URI for a script to run on each instance during boot.
582+
Supported URI schemes: S3 object URI (s3://bucket/key),
583+
HTTPS URL (https://example.com/script.sh), or local file path (file:///path/to/script).
570584
Type: String
571585
Default: ""
572586

573587
AgentEnvFileUrl:
574588
Description: >
575-
Optional - HTTPS or S3 URL containing environment variables for the Buildkite agent process itself (not for builds).
589+
Optional - URI containing environment variables for the Buildkite agent process itself (not for builds).
590+
Supported URI schemes: S3 object URI (s3://bucket/key), SSM parameter path (ssm:/path/to/param),
591+
HTTPS URL (https://example.com/script.sh), or local file path (file:///path/to/script).
576592
These variables configure agent behavior like proxy settings or debugging options.
577593
For build environment variables, use pipeline 'env' configuration instead.
578594
Type: String
@@ -847,16 +863,41 @@ Parameters:
847863
Type: String
848864
Description: Primary IPv4 CIDR block for Docker default address pools. Must not conflict with host network or VPC CIDR. Only applies to Linux instances, not Windows.
849865
Default: "172.17.0.0/12"
866+
AllowedPattern: "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\/(?:[0-9]|[12][0-9]|3[0-2])$"
867+
ConstraintDescription: "Must be a valid IPv4 CIDR block (e.g., 172.17.0.0/12)"
850868

851869
DockerIPv4AddressPool2:
852870
Type: String
853871
Description: Secondary IPv4 CIDR block for Docker default address pools. Only applies to Linux instances, not Windows.
854872
Default: "192.168.0.0/16"
873+
AllowedPattern: "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\/(?:[0-9]|[12][0-9]|3[0-2])$"
874+
ConstraintDescription: "Must be a valid IPv4 CIDR block (e.g., 192.168.0.0/16)"
855875

856876
DockerIPv6AddressPool:
857877
Type: String
858878
Description: IPv6 CIDR block for Docker default address pools in dualstack mode. Only applies to Linux instances, not Windows.
859879
Default: "2001:db8:2::/104"
880+
AllowedPattern: "^(?:(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,7}:|(?:[0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,5}(?::[0-9a-fA-F]{1,4}){1,2}|(?:[0-9a-fA-F]{1,4}:){1,4}(?::[0-9a-fA-F]{1,4}){1,3}|(?:[0-9a-fA-F]{1,4}:){1,3}(?::[0-9a-fA-F]{1,4}){1,4}|(?:[0-9a-fA-F]{1,4}:){1,2}(?::[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:(?::[0-9a-fA-F]{1,4}){1,6}|:(?:(?::[0-9a-fA-F]{1,4}){1,7}|:))\\/(?:[0-9]|[1-9][0-9]|1[01][0-9]|12[0-8])$"
881+
ConstraintDescription: "Must be a valid IPv6 CIDR block (e.g., 2001:db8:2::/104)"
882+
883+
DockerFixedCidrV4:
884+
Type: String
885+
Description: >
886+
Optional IPv4 CIDR block for Docker's fixed-cidr option. Restricts the IP range Docker uses for container networking on the default bridge.
887+
Must be a subset of the first pool in DockerIPv4AddressPool1 (Docker allocates docker0 from the first pool).
888+
Leave empty to disable. Useful to prevent conflicts with external services like databases. Only applies to Linux instances, not Windows.
889+
Default: ""
890+
AllowedPattern: "^$|^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\/(?:[0-9]|[12][0-9]|3[0-2])$"
891+
ConstraintDescription: "Must be empty or a valid IPv4 CIDR block (e.g., 172.17.1.0/24)"
892+
893+
DockerFixedCidrV6:
894+
Type: String
895+
Description: >
896+
IPv6 CIDR block for Docker's fixed-cidr-v6 option in dualstack mode. Restricts the IP range Docker uses for IPv6 container networking.
897+
Only applies to Linux instances in dualstack mode, not Windows.
898+
Default: "2001:db8:1::/64"
899+
AllowedPattern: "^(?:(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,7}:|(?:[0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,5}(?::[0-9a-fA-F]{1,4}){1,2}|(?:[0-9a-fA-F]{1,4}:){1,4}(?::[0-9a-fA-F]{1,4}){1,3}|(?:[0-9a-fA-F]{1,4}:){1,3}(?::[0-9a-fA-F]{1,4}){1,4}|(?:[0-9a-fA-F]{1,4}:){1,2}(?::[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:(?::[0-9a-fA-F]{1,4}){1,6}|:(?:(?::[0-9a-fA-F]{1,4}){1,7}|:))\\/(?:[0-9]|[1-9][0-9]|1[01][0-9]|12[0-8])$"
900+
ConstraintDescription: "Must be a valid IPv6 CIDR block (e.g., 2001:db8:1::/64)"
860901

861902
EnableSecretsPlugin:
862903
Type: String
@@ -996,6 +1037,14 @@ Parameters:
9961037
- "warn"
9971038
Default: "block"
9981039

1040+
LambdaArchitecture:
1041+
Type: String
1042+
Description: CPU architecture for Lambda functions (x86_64 or arm64). arm64 provides better price-performance but requires compatible dependencies.
1043+
AllowedValues:
1044+
- "x86_64"
1045+
- "arm64"
1046+
Default: "x86_64"
1047+
9991048
Rules:
10001049
HasToken:
10011050
Assertions:
@@ -1967,6 +2016,8 @@ Resources:
19672016
DOCKER_IPV4_ADDRESS_POOL_1=${DockerIPv4AddressPool1} \
19682017
DOCKER_IPV4_ADDRESS_POOL_2=${DockerIPv4AddressPool2} \
19692018
DOCKER_IPV6_ADDRESS_POOL=${DockerIPv6AddressPool} \
2019+
DOCKER_FIXED_CIDR_V4="${DockerFixedCidrV4}" \
2020+
DOCKER_FIXED_CIDR_V6="${DockerFixedCidrV6}" \
19702021
BUILDKITE_ENABLE_INSTANCE_STORAGE="${EnableInstanceStorage}" \
19712022
/usr/local/bin/bk-configure-docker.sh
19722023
--==BOUNDARY==
@@ -2257,6 +2308,8 @@ Resources:
22572308
Handler: index.handler
22582309
Role: !GetAtt AsgProcessSuspenderRole.Arn
22592310
Runtime: 'python3.13'
2311+
Architectures:
2312+
- !Ref LambdaArchitecture
22602313

22612314
AzRebalancingSuspender:
22622315
Type: AWS::CloudFormation::CustomResource
@@ -2396,7 +2449,9 @@ Resources:
23962449
logger.info(f"SSM command response: {response}")
23972450
Handler: index.handler
23982451
Role: !GetAtt StopBuildkiteAgentsRole.Arn
2399-
Runtime: "python3.12"
2452+
Runtime: "python3.13"
2453+
Architectures:
2454+
- !Ref LambdaArchitecture
24002455

24012456
StopBuildkiteAgents:
24022457
Type: AWS::CloudFormation::CustomResource

0 commit comments

Comments
 (0)