Unverified Commit f1329022 authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Allow the canary runner to log metrics (#1035)

* Allow the canary runner to log metrics

* Add instructions on adding a new canary

* Add note about deployment to readme
parent a05e9680
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ deployed SDK is functioning correctly. Similarly, it can be used to verify
the previous version of the SDK continues to work after the deployment
of the new version.


Building locally for Lambda
---------------------------

@@ -30,3 +31,17 @@ $ ./build-bundle.sh

This will place a zip file in `smithy-rs/target/x86_64-unknown-linux-musl/release` that can be
uploaded and tested against Lambda.


How to add a new canary
----------------------

The canary Lambda runs a list of canaries in parallel asynchronously. To add a new canary,
do the following:

1. If new permissions are required, grant them to the OIDC role that is used to
   run the canary Lambda using the CDK in the `tools/ci-cdk/` directory. Be sure
   to deploy these changes to the canary AWS account.
2. Add a new module to this `canary-lambda/` project to hold the canary code. This
   should be implemented as an async function that returns an empty result.
3. Wire up the new canary in the `get_canaries_to_run` function in the `canary` module.
+9 −0
Original line number Diff line number Diff line
@@ -52,6 +52,15 @@ export class CanaryStack extends Stack {
            }),
        );

        // Grant permission to put metric data to CloudWatch
        this.awsSdkRustOidcRole.oidcRole.addToPolicy(
            new PolicyStatement({
                actions: ["cloudwatch:PutMetricData"],
                effect: Effect.ALLOW,
                resources: ["*"],
            }),
        );

        // Create S3 bucket to upload canary Lambda code into
        this.canaryCodeBucket = new Bucket(this, "canary-code-bucket", {
            blockPublicAccess: BlockPublicAccess.BLOCK_ALL,