Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration path to SST v3 for stacks using CDK constructs #3771

Open
adolfogc opened this issue May 22, 2024 · 2 comments
Open

Migration path to SST v3 for stacks using CDK constructs #3771

adolfogc opened this issue May 22, 2024 · 2 comments

Comments

@adolfogc
Copy link
Contributor

Hi,

We currently use SST v2 in combination with some CDK constructs to deploy various lambda functions developed in C++.

For example:

// ...

const myApiKeySecret = new Config.Secret(stack, "MY_API_KEY");

const myApiKeyParameterName = `/sst/${app.name}/${app.stage}/Secret/${myApiKeySecret.name}/value`;

const myApiKeyParameter =
  StringParameter.fromSecureStringParameterAttributes(
    stack,
    "MY_API_KEY_PARAMETER",
    { parameterName: myApiKeyParameterName, version: 1 }
  );

const myLambdaFunction = new Function(stack, "FoobarLambda", {
  runtime: Runtime.PROVIDED_AL2023,
  architecture: Architecture.ARM_64,
  memorySize: 512,
  timeout: Duration.seconds(10),
  handler: "foobar", // not actually used
  code: Code.fromBucket(myLambdaCodeZip.bucket, myLambdaCodeZip.s3ObjectKey),
  layers: [myLambdaLayer],
  environment: {
    LD_PRELOAD: "libmimalloc.so",
    API_KEY_PARAMETER_NAME: myApiKeyParameterName,
  },
});

myApiKeyParameter.grantRead(myLambdaFunction);

We understand that Ion/SST v3 (https://ion.sst.dev/docs/) will drop CDK support, so we were wondering if this setup will be possible with the newer SST.

@jayair
Copy link
Contributor

jayair commented May 23, 2024

It supports https://ion.sst.dev/docs/component/aws/function/#runtime provided.al2023.

Is that what you are looking for?

@adolfogc
Copy link
Contributor Author

adolfogc commented Jun 7, 2024

Hi @jayair, thank you for your reply, yes, that is required, but it is not clear to me how to specify the function and the layer using existing ZIP files (as with Code.fromBucked in the example above).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants