created shell script & placed it at both places (.platform/confighooks/prebuild/test.sh) & (.platform/hooks/prebuild/test.sh) just to make sure that environment variable is available in both config & deploy stages . Note : config stage hooks .platform/confighooks/prebuild
gets executed when there are eb config changes , which doesn't require any deployment, while deploy stage hooks .platform/hooks/prebuild
gets executed post config stage , mostly in case of uploading new app version , changing few eb configs which requires deployment
can you share the script that works with .platform/hooks/prebuild/test.sh
the following script `# .ebextensions/setup-env.config container_commands: 01-extract-env: env: AWS_SECRET_ID: "Fn::GetOptionSetting": Namespace: "aws:elasticbeanstalk:application:environment" OptionName: AWS_SECRET_ID AWS_REGION: {"Ref" : "AWS::Region"} ENVFILE: .env
command: >
aws secretsmanager get-secret-value --secret-id $AWS_SECRET_ID --region $AWS_REGION |
jq -r '.SecretString' |
jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' > $ENVFILE`gives error `format error`