ion icon indicating copy to clipboard operation
ion copied to clipboard

SST not using provided ACM for redirect hostname

Open AlissonRS opened this issue 1 year ago • 0 comments

My setup looks like this:

export default $config({
  app(input) {
    return {
      name: "myapp-landing",
      removal: input?.stage === "prod" ? "retain" : "remove",
      home: "aws",
    };
  },
  async run() {
    new sst.aws.StaticSite("MyApp", {
      path: "out",
      domain: {
        name: "example.com",
        redirects: ["www.example.com"],
        dns: sst.aws.dns({
          zone: 'Z999999999999999999U',
        }),
        cert: "<my existing cert ARN>", // ACM certificate ARN for *.example.com
      },
    });
  },
});

The setup tries creating a new ACM for www.example.com instead of using the existing certificate ARN I provided, SST only uses the existing certificate for example.com.

This existing certificate supports wildcard *.example.com so I don't need an extra certificate.

How can I setup the config such that it reuses the same certificate for both the main distribution and the redirect distribution?

AlissonRS avatar Aug 14 '24 15:08 AlissonRS