Giter Club home page Giter Club logo

Comments (6)

alextwoods avatar alextwoods commented on July 3, 2024

Sorry you're running into this. Can you provide a bit more information about how you are configuring your lambda and deploying that file?

I was not able to reproduce when I created a Lambda with Ruby 3.2 runtime (with both x86_64 and arm) in the console - it is able to load aws-sdk-secretsmanager (and aws-eventstreams).

from aws-sdk-ruby.

cnorthwood avatar cnorthwood commented on July 3, 2024

ah, that's interesting... hmm. This is the CDK for this function if that helps

from aws_cdk.aws_lambda import Code, Function, Runtime, LayerVersion

[...]

            Function(
                self,
                "CorporateWebhooksAuthorizerFunction",
                runtime=Runtime.RUBY_3_2,
                handler="authorizer.Authorizer::lambda_handler",
                code=Code.from_asset(
                    os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')),
                    bundling={
                        "image": Runtime.RUBY_3_2.bundling_image,
                        "command": [
                            'bash', '-c',
                            ' && '.join([
                                'bundle config set path /asset-output/vendor/bundle',
                                'bundle install --without test development',
                                'cp -au functions/* /asset-output'
                            ])
                        ],
                    }
                ),
                environment={
                    "AUTHORISER_API_KEY_SECRET_ID": api_key_secret.secret_name
                },
                layers=[
                    LayerVersion.from_layer_version_arn(
                        self,
                        "DatadogGemLayer",
                        f"arn:aws:lambda:{Stack.of(self).region}:464622532012:layer:Datadog-Ruby3-2:22"
                    ),
                    LayerVersion.from_layer_version_arn(
                        self,
                        "DatadogExtensionLayer",
                        f"arn:aws:lambda:{Stack.of(self).region}:464622532012:layer:Datadog-Extension:56"
                    )
                ]
            )

from aws-sdk-ruby.

alextwoods avatar alextwoods commented on July 3, 2024

Hmm - I did confirm the locations/versions of core and aws-eventstream on the Ruby 3.2 lambda env:

/var/runtime/ruby/3.2.0/gems/aws-sdk-core-3.191.2/lib/aws-sdk-core.rb
/var/runtime/ruby/3.2.0/gems/aws-eventstream-1.3.0/lib/aws-eventstream.rb

From the stack trace it does look like our code is loading aws-sdk-core from the same location, so I'm not certain why it wouldn't be able to find aws-eventstream. My best guess is that it could be related to the CDK code from asset or the lambda layers.

What is in the Gemfile you are using and does it include the SDK dependencies?

from aws-sdk-ruby.

cnorthwood avatar cnorthwood commented on July 3, 2024

it looks like this, I put the SDK dependencies into the development dependencies so they're available locally (for unit tests) but not installed in the bundle because it can rely on them in the environment for that. It could be something in the Datadog layers as they're 3rd parties...

source "https://rubygems.org"

group :development do
  gem "aws-sdk-core"
  gem "aws-sdk-secretsmanager"
  gem "datadog-lambda"
  gem "ddtrace"
end

group :test do
  gem "bundler-audit"
  gem "citizens-advice-style", github: "citizensadvice/citizens-advice-style-ruby", tag: "v11.0.0"
  gem "climate_control"
  gem "license_finder"
  gem "rspec"
  gem "rubocop", require: false
end

from aws-sdk-ruby.

alextwoods avatar alextwoods commented on July 3, 2024

Can you try adding the gem "aws-sdk-secretsmanager" line to your Gemfile outside of the :development group?

from aws-sdk-ruby.

cnorthwood avatar cnorthwood commented on July 3, 2024

that does seem to work (as I'd expect, but I was surprised it didn't work in just the runtime! the Datadog layers might be interfering interestingly and I can dig into that)

from aws-sdk-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.