Repository navigation
Add CI that deploys and tests every Pulumi example - #15
Merged
Merged
Conversation
Each example gets a test.sh and a matrix job that deploys it with pulumilocal and checks it works. Moves the examples to Pulumi AWS v6, current Lambda runtimes and the AWS SDK v3 the Node.js runtimes ship. Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
pulumilocal sets aws:skipRequestingAccountId, so the provider built the SNS topic ARN with an empty account ID and LocalStack rejected it. awsx maps the ACCESS_DENIED gateway response to 404, so the auth0 test expects 404. Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The repo had no CI and no tests. Several examples could no longer deploy or did not work once deployed.
Tests
A new
Makefiledeploys one example withpulumilocaland a local Pulumi backend, then runs itstest.sh:make install deploy test EXAMPLE=<example>. CI runs all 10 examples as a matrix.test.shcheckstest_appsync.py(API exists,addTenantmutation, item in DynamoDB)/helloreturns 200 forBearer goodToken, 404 for another token (awsx mapsACCESS_DENIEDto 404), 401 without a token or withoutBearer"Hello world!"lastEvent.jsonby the subscribed Lambdaindex.htmlandfavicon.pngFixes
@pulumi/aws/pulumi-awsv6.aws-apigateway-auth0was on Pulumi 2, AWS 3 and awsx 0.24, andserverless-rest-apion awsx 0.40. Both now use awsx v2 through@pulumi/awsx/classic. TypeScript examples addtypescript5 as a dev dependency, so Pulumi stops falling back to its vendored TypeScript 3.8.s3-sqs-queuesandserverless-rest-apicallaws-sdkv2 inside callback functions. Pulumi's default runtime is nownodejs20.x, which ships only SDK v3, and Pulumi excludesaws-sdkfrom the bundle, so both functions failed at runtime. They now use@aws-sdk/client-s3and@aws-sdk/lib-dynamodb.aws-apigateway-auth0authorizer readevent.headers, which a TOKEN authorizer does not receive, so every request was denied. It now checks the bearer token with the file's existinggetTokenhelper. The unusedjsonwebtokenandjwks-rsadependencies are removed.sns-sqs-subscription-lambda-triggerandlambda-kinesis-firehose-esnow packagelambda.pydirectly. The README's manual zip step is gone. The committedlambda.zipin the Kinesis example held an older copy of the handler that usedLOCALSTACK_HOSTNAME/EDGE_PORT.s3Configurationmoves intoelasticsearchConfiguration, as AWS provider v6 requires.make deploysetsaws:skipRequestingAccountIdtofalse.pulumilocalsets it totrueby default, so the provider built the SNS topic ARN with an empty account ID and LocalStack rejectedGetTopicAttributeswith'' is not a valid AWS account ID.topicArn,resultQueueUrl,functionUrl,esEndpoint.receive-messagecommand was malformedawswithout an endpointVerified by CI only. Locally I only ran
npm installandtsc --noEmiton the TypeScript examples.https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM