@infoxchange/make-it-so 2.12.0-internal-testing-add-ix-ses-idenity.3 → 2.12.0-internal-testing-add-ix-ses-idenity.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -271,23 +271,16 @@ new IxSESIdentity(scope, "IxSESIdentity", {
|
|
|
271
271
|
// Email identity domain will be: example.dev.ixapps.org
|
|
272
272
|
// Custom mail from domain will be: info.example.dev.ixapps.org
|
|
273
273
|
domain: "example.dev.ixapps.org",
|
|
274
|
-
mailFromSubdomain: "info",
|
|
275
|
-
});
|
|
276
|
-
// or
|
|
277
|
-
new IxSESIdentity(scope, "IxSESIdentity", {
|
|
278
|
-
// Email identity domain will be: example.dev.ixapps.org
|
|
279
|
-
// Custom mail from domain will be: info.example.dev.ixapps.org
|
|
280
|
-
from: "anything@info.example.dev.ixapps.org",
|
|
274
|
+
mailFromSubdomain: "info", // optional, "mail" will be used otherwise
|
|
281
275
|
});
|
|
282
276
|
```
|
|
283
277
|
|
|
284
278
|
#### Options:
|
|
285
279
|
|
|
286
|
-
| Prop | Type | Description
|
|
287
|
-
| ----------------- | ------ |
|
|
288
|
-
| domain | string | The domain of the identity.
|
|
289
|
-
| mailFromSubdomain | string | (optional) by default the custom mail from domain will be `mail.${domain}`. This lets you change that. It should be given as just the subdomain part, not the fully qualified domain.
|
|
290
|
-
| from | string | An email address from get domain of the identity. Either this for `domain` must be specified. |
|
|
280
|
+
| Prop | Type | Description |
|
|
281
|
+
| ----------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
282
|
+
| domain | string | The domain of the identity. An email address can also be provided in which case the domain will be extracted from the email. |
|
|
283
|
+
| mailFromSubdomain | string | (optional) by default the custom mail from domain will be `mail.${domain}`. This lets you change that. It should be given as just the subdomain part, not the fully qualified domain. |
|
|
291
284
|
|
|
292
285
|
</details>
|
|
293
286
|
|
|
@@ -4,8 +4,6 @@ type ConstructId = ConstructorParameters<typeof Construct>[1];
|
|
|
4
4
|
type Props = {
|
|
5
5
|
domain: string;
|
|
6
6
|
mailFromSubdomain?: string;
|
|
7
|
-
} | {
|
|
8
|
-
from: string;
|
|
9
7
|
};
|
|
10
8
|
export declare class IxSESIdentity extends Construct {
|
|
11
9
|
constructor(scope: ConstructScope, id: ConstructId, props: Props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IxSESIdentity.d.ts","sourceRoot":"","sources":["../../src/cdk-constructs/IxSESIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAKvC,KAAK,cAAc,GAAG,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACjE,KAAK,WAAW,GAAG,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9D,KAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"IxSESIdentity.d.ts","sourceRoot":"","sources":["../../src/cdk-constructs/IxSESIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAKvC,KAAK,cAAc,GAAG,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACjE,KAAK,WAAW,GAAG,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9D,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,qBAAa,aAAc,SAAQ,SAAS;gBAC9B,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK;CAuDjE"}
|
|
@@ -4,12 +4,10 @@ import * as ses from "aws-cdk-lib/aws-ses";
|
|
|
4
4
|
import * as cdk from "aws-cdk-lib";
|
|
5
5
|
export class IxSESIdentity extends Construct {
|
|
6
6
|
constructor(scope, id, props) {
|
|
7
|
-
const
|
|
8
|
-
? props.
|
|
9
|
-
: `${props.mailFromSubdomain ?? "mail"}.${props.domain}`;
|
|
10
|
-
const domain = "from" in props
|
|
11
|
-
? mailFromDomain.split(".").slice(1).join(".")
|
|
7
|
+
const domain = props.domain.includes("@")
|
|
8
|
+
? props.domain.split("@")[1]
|
|
12
9
|
: props.domain;
|
|
10
|
+
const mailFromDomain = `${props.mailFromSubdomain ?? "mail"}.${domain}`;
|
|
13
11
|
super(scope, id);
|
|
14
12
|
const identity = new ses.EmailIdentity(scope, `${id}EmailIdentity`, {
|
|
15
13
|
identity: ses.Identity.domain(domain),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infoxchange/make-it-so",
|
|
3
|
-
"version": "2.12.0-internal-testing-add-ix-ses-idenity.
|
|
3
|
+
"version": "2.12.0-internal-testing-add-ix-ses-idenity.5",
|
|
4
4
|
"description": "Makes deploying services to IX infra easy",
|
|
5
5
|
"repository": "github:infoxchange/make-it-so",
|
|
6
6
|
"type": "module",
|
|
@@ -6,25 +6,17 @@ import * as cdk from "aws-cdk-lib";
|
|
|
6
6
|
type ConstructScope = ConstructorParameters<typeof Construct>[0];
|
|
7
7
|
type ConstructId = ConstructorParameters<typeof Construct>[1];
|
|
8
8
|
|
|
9
|
-
type Props =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
| {
|
|
15
|
-
from: string;
|
|
16
|
-
};
|
|
9
|
+
type Props = {
|
|
10
|
+
domain: string;
|
|
11
|
+
mailFromSubdomain?: string;
|
|
12
|
+
};
|
|
17
13
|
|
|
18
14
|
export class IxSESIdentity extends Construct {
|
|
19
15
|
constructor(scope: ConstructScope, id: ConstructId, props: Props) {
|
|
20
|
-
const
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const domain =
|
|
25
|
-
"from" in props
|
|
26
|
-
? mailFromDomain.split(".").slice(1).join(".")
|
|
27
|
-
: props.domain;
|
|
16
|
+
const domain = props.domain.includes("@")
|
|
17
|
+
? props.domain.split("@")[1]
|
|
18
|
+
: props.domain;
|
|
19
|
+
const mailFromDomain = `${props.mailFromSubdomain ?? "mail"}.${domain}`;
|
|
28
20
|
|
|
29
21
|
super(scope, id);
|
|
30
22
|
|