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

orderedCacheBehaviors transformation not resolved #560

Open
creaux opened this issue Jun 14, 2024 · 2 comments
Open

orderedCacheBehaviors transformation not resolved #560

creaux opened this issue Jun 14, 2024 · 2 comments
Assignees

Comments

@creaux
Copy link

creaux commented Jun 14, 2024

I'm trying to update orderedCacheBehaviors while keeping existing one.

However following solution never leads to expected result. I have tried to use .apply instead, and as well go deeper to cdn -> transform -> distribution callback and tried update args there but still not success.

    const router = new sst.aws.Router("Router", {
      domain: {
        name: domain,
      },
      routes: {
        "/*": astro.url,
      },
      transform: {
        cdn(cdnArgs) {
          $concat(cdnArgs.orderedCacheBehaviors, {
            pathPattern: "/api/*",
            targetOriginId: "/*",
            compress: true,
            viewerProtocolPolicy: "redirect-to-https",
            allowedMethods: [
              "GET",
              "HEAD",
              "OPTIONS",
              "PUT",
              "PATCH",
              "POST",
              "DELETE",
            ],
            cachedMethods: ["HEAD", "GET", "OPTIONS"],
            cachePolicyId: "xyz,
            originRequestPolicyId: "abc",
          });
        },
      },
    });
@ryanleecode
Copy link
Contributor

Whats the error? I have it working

@jayair
Copy link
Contributor

jayair commented Jun 25, 2024

Ping @creaux

@jayair jayair self-assigned this Jun 25, 2024
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

3 participants