ion
ion copied to clipboard
SST not using provided ACM for redirect hostname
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?