sst / ion

SST v3
https://sst.dev
MIT License
1.88k stars 221 forks source link

Feat: Referencing Email across stages #516

Closed jriquelme closed 2 months ago

jriquelme commented 3 months ago

version 0.0.403.

How can I use an already verified SES identity domain? (it's already in use by other applications)

const email = new sst.aws.Email("PMEmail", {
      sender: "predictablemedia.com",
      dns: false,
    });

Fails with:

|  Creating    PMEmail sst:aws:Email → PMEmailIdentity aws:sesv2:EmailIdentity
|  Error       PMEmail sst:aws:Email → PMEmailIdentity aws:sesv2:EmailIdentity StatusCode: 400, RequestID: 664eb45b-996e-4c9d-a143-bf1e0773a93b, AlreadyExistsException: Email identity predictablemedia.com already exist.

×  Failed
   PMEmail sst:aws:Email → PMEmailIdentity aws:sesv2:EmailIdentity
   StatusCode: 400, RequestID: 664eb45b-996e-4c9d-a143-bf1e0773a93b, AlreadyExistsException: Email identity predictablemedia.com already exist.

Thank you, awesome project!

jayair commented 3 months ago

Usually you would use a separate identity (or email) for a different stage because you don't want to be sending out debug emails out from the same domain or prod domain.

Is there a reason you don't want to do that in this case?

jriquelme commented 3 months ago

Yes, but I'd expect to take that decision by myself :)

I'm just doing a rapid test, and the idea of having to wait for the verification (up to 72 hours according to the docs) isn't appealing. Indeed I had to do that, and now I'm waiting for some-email@mydomain.com to be ready.

jayair commented 3 months ago

Yeah so the default behaviour with resources is to recreated them per stage. But there are some resources that teams like to share. We are adding support for referencing these resources across stages.