Skip to content

Commit a552a9d

Browse files
authored
Support the latest versions of Logstash and the AWS SDK for Ruby. (#260)
Support the latest versions of Logstash and the AWS SDK for Ruby. Adds the account_id configuration to the AWSIAMCredential struct to work with the latest versions of the AWS SDK for Ruby. Test against the latest versions of Logstash during the integration testing to also test against these versions of the AWS SDK. Use docker compose instead of docker-compose. Resolves #258 Signed-off-by: David Venable <dlv@amazon.com>
1 parent ccd571f commit a552a9d

File tree

9 files changed

+21
-19
lines changed

9 files changed

+21
-19
lines changed

.github/workflows/CI.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
Unit-test:
1212
strategy:
1313
matrix:
14-
logstash: [ "7.16.3", "7.17.1", "8.3.2", "8.12.1" ]
14+
logstash: [ "7.16.3", "7.17.24", "8.3.2", "8.12.1", "8.15.3" ]
1515
name: Unit Test logstash-output-opensearch
1616
runs-on: ubuntu-latest
1717
env:
@@ -33,8 +33,8 @@ jobs:
3333
Integration-Test-OpenSearch:
3434
strategy:
3535
matrix:
36-
logstash: [ "7.16.3", "7.17.1", "8.3.2", "8.12.1" ]
37-
opensearch: [ "1.3.4", "2.1.0", "2.12.0" ]
36+
logstash: [ "7.16.3", "7.17.24", "8.3.2", "8.12.1", "8.15.3" ]
37+
opensearch: [ "1.3.4", "2.1.0", "2.17.1" ]
3838
secure: [ true, false ]
3939

4040
name: Integration Test logstash-output-opensearch against OpenSearch
@@ -58,7 +58,7 @@ jobs:
5858
Integration-Test-OpenDistro:
5959
strategy:
6060
matrix:
61-
logstash: [ "7.16.3", "7.17.1", "8.12.1" ]
61+
logstash: [ "7.16.3", "7.17.24", "8.3.2", "8.12.1", "8.15.3" ]
6262
opendistro: [ "1.13.3" ]
6363
secure: [ true, false ]
6464

lib/logstash/outputs/opensearch/http_client/manticore_adapter.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ module LogStash; module Outputs; class OpenSearch; class HttpClient;
3333
:profile,
3434
:instance_profile_credentials_retries,
3535
:instance_profile_credentials_timeout,
36-
:region)
36+
:region,
37+
:account_id)
3738

3839
class ManticoreAdapter
3940
attr_reader :manticore, :logger
@@ -78,10 +79,11 @@ def aws_iam_auth_initialization(options)
7879
instance_cred_retries = options[:auth_type]["instance_profile_credentials_retries"] || AWS_DEFAULT_PROFILE_CREDENTIAL_RETRY
7980
instance_cred_timeout = options[:auth_type]["instance_profile_credentials_timeout"] || AWS_DEFAULT_PROFILE_CREDENTIAL_TIMEOUT
8081
region = options[:auth_type]["region"] || AWS_DEFAULT_REGION
82+
account_id = nil
8183
set_aws_region(region)
8284
set_service_name(options[:auth_type]["service_name"] || AWS_SERVICE)
8385

84-
credential_config = AWSIAMCredential.new(aws_access_key_id, aws_secret_access_key, session_token, profile, instance_cred_retries, instance_cred_timeout, region)
86+
credential_config = AWSIAMCredential.new(aws_access_key_id, aws_secret_access_key, session_token, profile, instance_cred_retries, instance_cred_timeout, region, account_id)
8587
@credentials = Aws::CredentialProviderChain.new(credential_config).resolve
8688
end
8789

scripts/opendistro/docker-run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

3-
# This is intended to be run inside the docker container as the command of the docker-compose.
3+
# This is intended to be run inside the docker container as the command of the docker compose.
44
set -ex
55

66
cd scripts/opendistro
77

8-
docker-compose up --exit-code-from logstash
8+
docker compose up --exit-code-from logstash

scripts/opendistro/docker-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ if [ -f Gemfile.lock ]; then
99
fi
1010
cd scripts/opendistro;
1111

12-
docker-compose down
13-
docker-compose build
12+
docker compose down
13+
docker compose build

scripts/opensearch/docker-run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

3-
# This is intended to be run inside the docker container as the command of the docker-compose.
3+
# This is intended to be run inside the docker container as the command of the docker compose.
44
set -ex
55

66
cd scripts/opensearch
77

8-
docker-compose up --exit-code-from logstash
8+
docker compose up --exit-code-from logstash

scripts/opensearch/docker-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ if [ -f Gemfile.lock ]; then
99
fi
1010
cd scripts/opensearch;
1111

12-
docker-compose down
13-
docker-compose build
12+
docker compose down
13+
docker compose build

scripts/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# This is intended to be run inside the docker container as the command of the docker-compose.
2+
# This is intended to be run inside the docker container as the command of the docker compose.
33

44
env
55

scripts/unit-test/docker-run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

3-
# This is intended to be run inside the docker container as the command of the docker-compose.
3+
# This is intended to be run inside the docker container as the command of the docker compose.
44
set -ex
55

66
cd scripts/unit-test;
7-
docker-compose up --exit-code-from logstash logstash
7+
docker compose up --exit-code-from logstash logstash

scripts/unit-test/docker-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ if [ -f Gemfile.lock ]; then
99
fi
1010

1111
cd scripts/unit-test;
12-
docker-compose down
13-
docker-compose build logstash
12+
docker compose down
13+
docker compose build logstash

0 commit comments

Comments
 (0)