Skip to content

Commit

Permalink
Support the latest versions of Logstash and the AWS SDK for Ruby. (#260)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dlvenable authored Oct 17, 2024
1 parent ccd571f commit a552a9d
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
Unit-test:
strategy:
matrix:
logstash: [ "7.16.3", "7.17.1", "8.3.2", "8.12.1" ]
logstash: [ "7.16.3", "7.17.24", "8.3.2", "8.12.1", "8.15.3" ]
name: Unit Test logstash-output-opensearch
runs-on: ubuntu-latest
env:
Expand All @@ -33,8 +33,8 @@ jobs:
Integration-Test-OpenSearch:
strategy:
matrix:
logstash: [ "7.16.3", "7.17.1", "8.3.2", "8.12.1" ]
opensearch: [ "1.3.4", "2.1.0", "2.12.0" ]
logstash: [ "7.16.3", "7.17.24", "8.3.2", "8.12.1", "8.15.3" ]
opensearch: [ "1.3.4", "2.1.0", "2.17.1" ]
secure: [ true, false ]

name: Integration Test logstash-output-opensearch against OpenSearch
Expand All @@ -58,7 +58,7 @@ jobs:
Integration-Test-OpenDistro:
strategy:
matrix:
logstash: [ "7.16.3", "7.17.1", "8.12.1" ]
logstash: [ "7.16.3", "7.17.24", "8.3.2", "8.12.1", "8.15.3" ]
opendistro: [ "1.13.3" ]
secure: [ true, false ]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ module LogStash; module Outputs; class OpenSearch; class HttpClient;
:profile,
:instance_profile_credentials_retries,
:instance_profile_credentials_timeout,
:region)
:region,
:account_id)

class ManticoreAdapter
attr_reader :manticore, :logger
Expand Down Expand Up @@ -78,10 +79,11 @@ def aws_iam_auth_initialization(options)
instance_cred_retries = options[:auth_type]["instance_profile_credentials_retries"] || AWS_DEFAULT_PROFILE_CREDENTIAL_RETRY
instance_cred_timeout = options[:auth_type]["instance_profile_credentials_timeout"] || AWS_DEFAULT_PROFILE_CREDENTIAL_TIMEOUT
region = options[:auth_type]["region"] || AWS_DEFAULT_REGION
account_id = nil
set_aws_region(region)
set_service_name(options[:auth_type]["service_name"] || AWS_SERVICE)

credential_config = AWSIAMCredential.new(aws_access_key_id, aws_secret_access_key, session_token, profile, instance_cred_retries, instance_cred_timeout, region)
credential_config = AWSIAMCredential.new(aws_access_key_id, aws_secret_access_key, session_token, profile, instance_cred_retries, instance_cred_timeout, region, account_id)
@credentials = Aws::CredentialProviderChain.new(credential_config).resolve
end

Expand Down
4 changes: 2 additions & 2 deletions scripts/opendistro/docker-run.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

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

cd scripts/opendistro

docker-compose up --exit-code-from logstash
docker compose up --exit-code-from logstash
4 changes: 2 additions & 2 deletions scripts/opendistro/docker-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ if [ -f Gemfile.lock ]; then
fi
cd scripts/opendistro;

docker-compose down
docker-compose build
docker compose down
docker compose build
4 changes: 2 additions & 2 deletions scripts/opensearch/docker-run.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

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

cd scripts/opensearch

docker-compose up --exit-code-from logstash
docker compose up --exit-code-from logstash
4 changes: 2 additions & 2 deletions scripts/opensearch/docker-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ if [ -f Gemfile.lock ]; then
fi
cd scripts/opensearch;

docker-compose down
docker-compose build
docker compose down
docker compose build
2 changes: 1 addition & 1 deletion scripts/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This is intended to be run inside the docker container as the command of the docker-compose.
# This is intended to be run inside the docker container as the command of the docker compose.

env

Expand Down
4 changes: 2 additions & 2 deletions scripts/unit-test/docker-run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

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

cd scripts/unit-test;
docker-compose up --exit-code-from logstash logstash
docker compose up --exit-code-from logstash logstash
4 changes: 2 additions & 2 deletions scripts/unit-test/docker-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ if [ -f Gemfile.lock ]; then
fi

cd scripts/unit-test;
docker-compose down
docker-compose build logstash
docker compose down
docker compose build logstash

0 comments on commit a552a9d

Please sign in to comment.