From 2a4192d4ad7a7af79786e37328ac013eeb8c0779 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 22 Jul 2024 22:26:43 +0000 Subject: [PATCH] make repository-s3 plugin installation default (#79) Signed-off-by: Rishabh Singh (cherry picked from commit b9665a6e2aa94d7533d722a9c6c597f7c3c0b9e9) Signed-off-by: github-actions[bot] --- lib/infra/infra-stack.ts | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/infra/infra-stack.ts b/lib/infra/infra-stack.ts index 70688a05eb6..a67e17f8dea 100644 --- a/lib/infra/infra-stack.ts +++ b/lib/infra/infra-stack.ts @@ -465,10 +465,6 @@ export class InfraStack extends Stack { cwd: '/home/ec2-user', ignoreErrors: false, })); - cfnInitConfig.push(InitCommand.shellCommand('set -ex;cd opensearch;sudo -u ec2-user bin/opensearch-plugin install repository-s3 --batch', { - cwd: '/home/ec2-user', - ignoreErrors: false, - })); } else { cfnInitConfig.push(InitCommand.shellCommand('set -ex;cd opensearch; echo "y"|sudo -u ec2-user bin/opensearch-plugin install ' + `https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${props.opensearchVersion}/latest/linux/${props.cpuArch}` @@ -476,13 +472,21 @@ export class InfraStack extends Stack { cwd: '/home/ec2-user', ignoreErrors: false, })); - cfnInitConfig.push(InitCommand.shellCommand('set -ex;cd opensearch;sudo -u ec2-user bin/opensearch-plugin install ' + } + } + + if (props.distributionUrl.includes('artifacts.opensearch.org') && !props.minDistribution) { + cfnInitConfig.push(InitCommand.shellCommand('set -ex;cd opensearch;sudo -u ec2-user bin/opensearch-plugin install repository-s3 --batch', { + cwd: '/home/ec2-user', + ignoreErrors: false, + })); + } else { + cfnInitConfig.push(InitCommand.shellCommand('set -ex;cd opensearch;sudo -u ec2-user bin/opensearch-plugin install ' + `https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${props.opensearchVersion}/latest/linux/${props.cpuArch}` + `/tar/builds/opensearch/core-plugins/repository-s3-${props.opensearchVersion}.zip --batch`, { - cwd: '/home/ec2-user', - ignoreErrors: false, - })); - } + cwd: '/home/ec2-user', + ignoreErrors: false, + })); } // add config to disable security if required