@gradientedge/cdk-utils 9.89.0 → 10.1.0
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/dist/src/lib/cloudflare/common/construct.d.ts +7 -19
- package/dist/src/lib/cloudflare/common/construct.js +12 -66
- package/dist/src/lib/cloudflare/common/index.d.ts +0 -1
- package/dist/src/lib/cloudflare/common/index.js +0 -1
- package/dist/src/lib/cloudflare/common/stack.d.ts +11 -21
- package/dist/src/lib/cloudflare/common/stack.js +55 -62
- package/dist/src/lib/cloudflare/common/types.d.ts +2 -14
- package/dist/src/lib/cloudflare/construct/pages-static-site/main.d.ts +8 -10
- package/dist/src/lib/cloudflare/construct/pages-static-site/main.js +18 -25
- package/dist/src/lib/cloudflare/construct/worker-site/main.d.ts +13 -10
- package/dist/src/lib/cloudflare/construct/worker-site/main.js +29 -41
- package/dist/src/lib/cloudflare/index.d.ts +0 -1
- package/dist/src/lib/cloudflare/index.js +0 -1
- package/dist/src/lib/cloudflare/services/access/main.d.ts +31 -43
- package/dist/src/lib/cloudflare/services/access/main.js +56 -83
- package/dist/src/lib/cloudflare/services/access/types.d.ts +12 -22
- package/dist/src/lib/cloudflare/services/api-shield/main.d.ts +10 -15
- package/dist/src/lib/cloudflare/services/api-shield/main.js +16 -36
- package/dist/src/lib/cloudflare/services/api-shield/types.d.ts +6 -10
- package/dist/src/lib/cloudflare/services/argo/main.d.ts +6 -8
- package/dist/src/lib/cloudflare/services/argo/main.js +9 -17
- package/dist/src/lib/cloudflare/services/argo/types.d.ts +3 -4
- package/dist/src/lib/cloudflare/services/filter/main.d.ts +3 -4
- package/dist/src/lib/cloudflare/services/filter/main.js +6 -10
- package/dist/src/lib/cloudflare/services/filter/types.d.ts +2 -2
- package/dist/src/lib/cloudflare/services/firewall/main.d.ts +2 -3
- package/dist/src/lib/cloudflare/services/firewall/main.js +4 -8
- package/dist/src/lib/cloudflare/services/firewall/types.d.ts +2 -2
- package/dist/src/lib/cloudflare/services/page/main.d.ts +7 -11
- package/dist/src/lib/cloudflare/services/page/main.js +13 -26
- package/dist/src/lib/cloudflare/services/page/types.d.ts +4 -6
- package/dist/src/lib/cloudflare/services/record/main.d.ts +2 -3
- package/dist/src/lib/cloudflare/services/record/main.js +4 -8
- package/dist/src/lib/cloudflare/services/record/types.d.ts +2 -2
- package/dist/src/lib/cloudflare/services/rule-set/main.d.ts +5 -6
- package/dist/src/lib/cloudflare/services/rule-set/main.js +7 -10
- package/dist/src/lib/cloudflare/services/rule-set/types.d.ts +2 -2
- package/dist/src/lib/cloudflare/services/worker/main.d.ts +12 -18
- package/dist/src/lib/cloudflare/services/worker/main.js +15 -39
- package/dist/src/lib/cloudflare/services/worker/types.d.ts +7 -12
- package/dist/src/lib/cloudflare/services/zone/main.d.ts +13 -30
- package/dist/src/lib/cloudflare/services/zone/main.js +31 -84
- package/dist/src/lib/cloudflare/services/zone/types.d.ts +10 -20
- package/dist/src/lib/common/types.d.ts +4 -0
- package/package.json +29 -23
- package/src/lib/cloudflare/common/construct.ts +13 -70
- package/src/lib/cloudflare/common/index.ts +0 -1
- package/src/lib/cloudflare/common/stack.ts +58 -69
- package/src/lib/cloudflare/common/types.ts +2 -15
- package/src/lib/cloudflare/construct/pages-static-site/main.ts +22 -42
- package/src/lib/cloudflare/construct/worker-site/main.ts +38 -62
- package/src/lib/cloudflare/index.ts +0 -1
- package/src/lib/cloudflare/services/access/main.ts +57 -118
- package/src/lib/cloudflare/services/access/types.ts +24 -22
- package/src/lib/cloudflare/services/api-shield/main.ts +16 -63
- package/src/lib/cloudflare/services/api-shield/types.ts +12 -10
- package/src/lib/cloudflare/services/argo/main.ts +9 -23
- package/src/lib/cloudflare/services/argo/types.ts +3 -4
- package/src/lib/cloudflare/services/filter/main.ts +6 -13
- package/src/lib/cloudflare/services/filter/types.ts +2 -2
- package/src/lib/cloudflare/services/firewall/main.ts +4 -11
- package/src/lib/cloudflare/services/firewall/types.ts +2 -2
- package/src/lib/cloudflare/services/page/main.ts +19 -36
- package/src/lib/cloudflare/services/page/types.ts +4 -6
- package/src/lib/cloudflare/services/record/main.ts +4 -11
- package/src/lib/cloudflare/services/record/types.ts +2 -2
- package/src/lib/cloudflare/services/rule-set/main.ts +7 -12
- package/src/lib/cloudflare/services/rule-set/types.ts +2 -2
- package/src/lib/cloudflare/services/worker/main.ts +15 -52
- package/src/lib/cloudflare/services/worker/types.ts +14 -12
- package/src/lib/cloudflare/services/zone/main.ts +40 -103
- package/src/lib/cloudflare/services/zone/types.ts +20 -21
- package/src/lib/common/types.ts +5 -0
- package/dist/src/lib/cloudflare/common/constants.d.ts +0 -5
- package/dist/src/lib/cloudflare/common/constants.js +0 -6
- package/dist/src/lib/cloudflare/utils/index.d.ts +0 -3
- package/dist/src/lib/cloudflare/utils/index.js +0 -13
- package/src/lib/cloudflare/common/constants.ts +0 -5
- package/src/lib/cloudflare/utils/index.ts +0 -23
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ArgoTieredCaching } from '@cdktf/provider-cloudflare/lib/argo-tiered-caching/index.js'
|
|
1
|
+
import * as cloudflare from '@pulumi/cloudflare'
|
|
3
2
|
import { CommonCloudflareConstruct } from '../../common/index.js'
|
|
4
|
-
import { createCloudflareTfOutput } from '../../utils/index.js'
|
|
5
3
|
import { ArgoSmartRoutingProps, ArgoTieredCachingProps } from './types.js'
|
|
6
4
|
|
|
7
5
|
/**
|
|
@@ -23,52 +21,40 @@ import { ArgoSmartRoutingProps, ArgoTieredCachingProps } from './types.js'
|
|
|
23
21
|
*/
|
|
24
22
|
export class CloudflareArgoManager {
|
|
25
23
|
/**
|
|
26
|
-
* @summary Method to create a new Cloudflare Argo
|
|
24
|
+
* @summary Method to create a new Cloudflare Argo Smart Routing
|
|
27
25
|
* @param id scoped id of the resource
|
|
28
26
|
* @param scope scope in which this resource is defined
|
|
29
27
|
* @param props argo properties
|
|
30
|
-
* @see [
|
|
28
|
+
* @see [Pulumi Cloudflare ArgoSmartRouting]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/argosmartrouting/}
|
|
31
29
|
*/
|
|
32
30
|
public createArgoSmartRouting(id: string, scope: CommonCloudflareConstruct, props: ArgoSmartRoutingProps) {
|
|
33
31
|
if (!props) throw `Props undefined for ${id}`
|
|
34
32
|
|
|
35
33
|
const zoneId = props.zoneId
|
|
36
34
|
? props.zoneId
|
|
37
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.
|
|
38
|
-
|
|
39
|
-
const argoSmartRouting = new ArgoSmartRouting(scope, `${id}`, {
|
|
35
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { filter: { name: scope.props.domainName } })?.id
|
|
36
|
+
return new cloudflare.ArgoSmartRouting(`${id}`, {
|
|
40
37
|
...props,
|
|
41
38
|
zoneId,
|
|
42
39
|
})
|
|
43
|
-
|
|
44
|
-
createCloudflareTfOutput(`${id}-argoSmartRoutingFriendlyUniqueId`, scope, argoSmartRouting.friendlyUniqueId)
|
|
45
|
-
createCloudflareTfOutput(`${id}-argoSmartRoutingId`, scope, argoSmartRouting.id)
|
|
46
|
-
|
|
47
|
-
return argoSmartRouting
|
|
48
40
|
}
|
|
49
41
|
|
|
50
42
|
/**
|
|
51
|
-
* @summary Method to create a new Cloudflare Argo
|
|
43
|
+
* @summary Method to create a new Cloudflare Argo Tiered Caching
|
|
52
44
|
* @param id scoped id of the resource
|
|
53
45
|
* @param scope scope in which this resource is defined
|
|
54
46
|
* @param props argo properties
|
|
55
|
-
* @see [
|
|
47
|
+
* @see [Pulumi Cloudflare ArgoTieredCaching]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/argotieredcaching/}
|
|
56
48
|
*/
|
|
57
49
|
public createArgoTieredCaching(id: string, scope: CommonCloudflareConstruct, props: ArgoTieredCachingProps) {
|
|
58
50
|
if (!props) throw `Props undefined for ${id}`
|
|
59
51
|
|
|
60
52
|
const zoneId = props.zoneId
|
|
61
53
|
? props.zoneId
|
|
62
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.
|
|
63
|
-
|
|
64
|
-
const argoTieredCaching = new ArgoTieredCaching(scope, `${id}`, {
|
|
54
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { filter: { name: scope.props.domainName } })?.id
|
|
55
|
+
return new cloudflare.ArgoTieredCaching(`${id}`, {
|
|
65
56
|
...props,
|
|
66
57
|
zoneId,
|
|
67
58
|
})
|
|
68
|
-
|
|
69
|
-
createCloudflareTfOutput(`${id}-argoTieredCachingFriendlyUniqueId`, scope, argoTieredCaching.friendlyUniqueId)
|
|
70
|
-
createCloudflareTfOutput(`${id}-argoTieredCachingId`, scope, argoTieredCaching.id)
|
|
71
|
-
|
|
72
|
-
return argoTieredCaching
|
|
73
59
|
}
|
|
74
60
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ArgoTieredCachingConfig } from '@cdktf/provider-cloudflare/lib/argo-tiered-caching/index.js'
|
|
1
|
+
import { ArgoSmartRoutingArgs, ArgoTieredCachingArgs } from '@pulumi/cloudflare'
|
|
3
2
|
|
|
4
|
-
export interface ArgoSmartRoutingProps extends
|
|
5
|
-
export interface ArgoTieredCachingProps extends
|
|
3
|
+
export interface ArgoSmartRoutingProps extends ArgoSmartRoutingArgs {}
|
|
4
|
+
export interface ArgoTieredCachingProps extends ArgoTieredCachingArgs {}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as cloudflare from '@pulumi/cloudflare'
|
|
2
2
|
import { CommonCloudflareConstruct } from '../../common/index.js'
|
|
3
|
-
import { createCloudflareTfOutput } from '../../utils/index.js'
|
|
4
3
|
import { FilterProps } from './types.js'
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -15,7 +14,7 @@ import { FilterProps } from './types.js'
|
|
|
15
14
|
* constructor(parent: Construct, id: string, props: CommonCloudflareStackProps) {
|
|
16
15
|
* super(parent, id, props)
|
|
17
16
|
* this.props = props
|
|
18
|
-
* this.filterManager.
|
|
17
|
+
* this.filterManager.createFilter('MyFilter', this, props)
|
|
19
18
|
* }
|
|
20
19
|
* }
|
|
21
20
|
* ```
|
|
@@ -26,23 +25,17 @@ export class CloudflareFilterManager {
|
|
|
26
25
|
* @param id scoped id of the resource
|
|
27
26
|
* @param scope scope in which this resource is defined
|
|
28
27
|
* @param props filter properties
|
|
29
|
-
* @see [
|
|
28
|
+
* @see [Pulumi Cloudflare Filter]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/filter/}
|
|
30
29
|
*/
|
|
31
|
-
public
|
|
30
|
+
public createFilter(id: string, scope: CommonCloudflareConstruct, props: FilterProps) {
|
|
32
31
|
if (!props) throw `Props undefined for ${id}`
|
|
33
32
|
|
|
34
33
|
const zoneId = props.zoneId
|
|
35
34
|
? props.zoneId
|
|
36
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.
|
|
37
|
-
|
|
38
|
-
const filter = new Filter(scope, `${id}`, {
|
|
35
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { filter: { name: scope.props.domainName } })?.id
|
|
36
|
+
return new cloudflare.Filter(`${id}`, {
|
|
39
37
|
...props,
|
|
40
38
|
zoneId,
|
|
41
39
|
})
|
|
42
|
-
|
|
43
|
-
createCloudflareTfOutput(`${id}-filterFriendlyUniqueId`, scope, filter.friendlyUniqueId)
|
|
44
|
-
createCloudflareTfOutput(`${id}-filterId`, scope, filter.id)
|
|
45
|
-
|
|
46
|
-
return filter
|
|
47
40
|
}
|
|
48
41
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FilterArgs } from '@pulumi/cloudflare'
|
|
2
2
|
|
|
3
|
-
export interface FilterProps extends
|
|
3
|
+
export interface FilterProps extends FilterArgs {}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as cloudflare from '@pulumi/cloudflare'
|
|
2
2
|
import { CommonCloudflareConstruct } from '../../common/index.js'
|
|
3
|
-
import { createCloudflareTfOutput } from '../../utils/index.js'
|
|
4
3
|
import { FirewallRuleProps } from './types.js'
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -26,23 +25,17 @@ export class CloudflareFirewallManager {
|
|
|
26
25
|
* @param id scoped id of the resource
|
|
27
26
|
* @param scope scope in which this resource is defined
|
|
28
27
|
* @param props firewall rule properties
|
|
29
|
-
* @see [
|
|
28
|
+
* @see [Pulumi Cloudflare Firewall Rule]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/firewallrule/}
|
|
30
29
|
*/
|
|
31
30
|
public createFirewallRule(id: string, scope: CommonCloudflareConstruct, props: FirewallRuleProps) {
|
|
32
31
|
if (!props) throw `Props undefined for ${id}`
|
|
33
32
|
|
|
34
33
|
const zoneId = props.zoneId
|
|
35
34
|
? props.zoneId
|
|
36
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.
|
|
37
|
-
|
|
38
|
-
const firewallRule = new FirewallRule(scope, `${id}`, {
|
|
35
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { filter: { name: scope.props.domainName } })?.id
|
|
36
|
+
return new cloudflare.FirewallRule(`${id}`, {
|
|
39
37
|
...props,
|
|
40
38
|
zoneId,
|
|
41
39
|
})
|
|
42
|
-
|
|
43
|
-
createCloudflareTfOutput(`${id}-firewallRuleFriendlyUniqueId`, scope, firewallRule.friendlyUniqueId)
|
|
44
|
-
createCloudflareTfOutput(`${id}-firewallRuleId`, scope, firewallRule.id)
|
|
45
|
-
|
|
46
|
-
return firewallRule
|
|
47
40
|
}
|
|
48
41
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FirewallRuleArgs } from '@pulumi/cloudflare'
|
|
2
2
|
|
|
3
|
-
export interface FirewallRuleProps extends
|
|
3
|
+
export interface FirewallRuleProps extends FirewallRuleArgs {}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { PagesProject } from '@cdktf/provider-cloudflare/lib/pages-project/index.js'
|
|
4
|
-
import { LocalExec, Provider } from 'cdktf-local-exec'
|
|
1
|
+
import * as cloudflare from '@pulumi/cloudflare'
|
|
2
|
+
import { local } from '@pulumi/command'
|
|
5
3
|
import { CommonCloudflareConstruct } from '../../common/index.js'
|
|
6
|
-
import { createCloudflareTfOutput } from '../../utils/index.js'
|
|
7
4
|
import { PageRuleProps, PagesDomainProps, PagesProjectDeployProps, PagesProjectProps } from './types.js'
|
|
8
5
|
|
|
9
6
|
/**
|
|
@@ -29,21 +26,16 @@ export class CloudflarePageManager {
|
|
|
29
26
|
* @param id scoped id of the resource
|
|
30
27
|
* @param scope scope in which this resource is defined
|
|
31
28
|
* @param props pages project properties
|
|
32
|
-
* @see [
|
|
29
|
+
* @see [Pulumi Cloudflare Pages Project]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/pagesproject/}
|
|
33
30
|
*/
|
|
34
31
|
public createPagesProject(id: string, scope: CommonCloudflareConstruct, props: PagesProjectProps) {
|
|
35
32
|
if (!props) throw `Props undefined for ${id}`
|
|
36
33
|
|
|
37
|
-
|
|
34
|
+
return new cloudflare.PagesProject(`${id}`, {
|
|
38
35
|
...props,
|
|
39
36
|
accountId: props.accountId ?? scope.props.accountId,
|
|
40
37
|
name: `${props.name}-${scope.props.stage}`,
|
|
41
38
|
})
|
|
42
|
-
|
|
43
|
-
createCloudflareTfOutput(`${id}-pagesProjectFriendlyUniqueId`, scope, pagesProject.friendlyUniqueId)
|
|
44
|
-
createCloudflareTfOutput(`${id}-pagesProjectId`, scope, pagesProject.id)
|
|
45
|
-
|
|
46
|
-
return pagesProject
|
|
47
39
|
}
|
|
48
40
|
|
|
49
41
|
/**
|
|
@@ -51,21 +43,16 @@ export class CloudflarePageManager {
|
|
|
51
43
|
* @param id scoped id of the resource
|
|
52
44
|
* @param scope scope in which this resource is defined
|
|
53
45
|
* @param props pages domain properties
|
|
54
|
-
* @see [
|
|
46
|
+
* @see [Pulumi Cloudflare Pages Domain]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/pagesdomain/}
|
|
55
47
|
*/
|
|
56
48
|
public createPagesDomain(id: string, scope: CommonCloudflareConstruct, props: PagesDomainProps) {
|
|
57
49
|
if (!props) throw `Props undefined for ${id}`
|
|
58
50
|
|
|
59
|
-
|
|
51
|
+
return new cloudflare.PagesDomain(`${id}`, {
|
|
60
52
|
...props,
|
|
61
53
|
accountId: props.accountId ?? scope.props.accountId,
|
|
62
54
|
name: props.name ?? scope.props.domainName,
|
|
63
55
|
})
|
|
64
|
-
|
|
65
|
-
createCloudflareTfOutput(`${id}-pagesDomainFriendlyUniqueId`, scope, pagesDomain.friendlyUniqueId)
|
|
66
|
-
createCloudflareTfOutput(`${id}-pagesDomainId`, scope, pagesDomain.id)
|
|
67
|
-
|
|
68
|
-
return pagesDomain
|
|
69
56
|
}
|
|
70
57
|
|
|
71
58
|
/**
|
|
@@ -73,37 +60,33 @@ export class CloudflarePageManager {
|
|
|
73
60
|
* @param id scoped id of the resource
|
|
74
61
|
* @param scope scope in which this resource is defined
|
|
75
62
|
* @param props page rule properties
|
|
76
|
-
* @see [
|
|
63
|
+
* @see [Pulumi Cloudflare Page Rule]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/pagerule/}
|
|
77
64
|
*/
|
|
78
65
|
public createPageRule(id: string, scope: CommonCloudflareConstruct, props: PageRuleProps) {
|
|
79
66
|
if (!props) throw `Props undefined for ${id}`
|
|
80
67
|
|
|
81
68
|
const zoneId = props.zoneId
|
|
82
69
|
? props.zoneId
|
|
83
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.
|
|
84
|
-
|
|
85
|
-
const pageRule = new PageRule(scope, `${id}`, {
|
|
70
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { filter: { name: scope.props.domainName } })?.id
|
|
71
|
+
return new cloudflare.PageRule(`${id}`, {
|
|
86
72
|
...props,
|
|
87
73
|
zoneId,
|
|
88
74
|
})
|
|
89
|
-
|
|
90
|
-
createCloudflareTfOutput(`${id}-pageRuleFriendlyUniqueId`, scope, pageRule.friendlyUniqueId)
|
|
91
|
-
createCloudflareTfOutput(`${id}-pageRuleId`, scope, pageRule.id)
|
|
92
|
-
|
|
93
|
-
return pageRule
|
|
94
75
|
}
|
|
95
76
|
|
|
96
77
|
public deployPagesProject(id: string, scope: CommonCloudflareConstruct, props: PagesProjectDeployProps) {
|
|
97
78
|
if (!props) throw `Props undefined for ${id}`
|
|
98
79
|
|
|
99
|
-
new Provider(scope, `${id}`)
|
|
100
80
|
const message = process.env.BUILD_NUMBER ?? props.message
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
81
|
+
return new local.Command(
|
|
82
|
+
`${id}-deploy-${new Date().toISOString()}`,
|
|
83
|
+
{
|
|
84
|
+
create: `CLOUDFLARE_ACCOUNT_ID=${scope.props.accountId} CLOUDFLARE_API_TOKEN=${scope.props.apiToken} npx wrangler pages deploy ${props.directory} --project-name=${props.projectName} --branch=${props.branch} --commit-message=${message}`,
|
|
85
|
+
dir: '',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
dependsOn: props.dependsOn,
|
|
89
|
+
}
|
|
90
|
+
)
|
|
108
91
|
}
|
|
109
92
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PagesDomainConfig } from '@cdktf/provider-cloudflare/lib/pages-domain/index.js'
|
|
3
|
-
import { PagesProjectConfig } from '@cdktf/provider-cloudflare/lib/pages-project/index.js'
|
|
1
|
+
import { PageRuleArgs, PagesDomainArgs, PagesProjectArgs } from '@pulumi/cloudflare'
|
|
4
2
|
|
|
5
|
-
export interface PagesProjectProps extends
|
|
6
|
-
export interface PagesDomainProps extends
|
|
7
|
-
export interface PageRuleProps extends
|
|
3
|
+
export interface PagesProjectProps extends PagesProjectArgs {}
|
|
4
|
+
export interface PagesDomainProps extends PagesDomainArgs {}
|
|
5
|
+
export interface PageRuleProps extends PageRuleArgs {}
|
|
8
6
|
export interface PagesProjectDeployProps {
|
|
9
7
|
branch: string
|
|
10
8
|
directory: string
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as cloudflare from '@pulumi/cloudflare'
|
|
2
2
|
import { CommonCloudflareConstruct } from '../../common/index.js'
|
|
3
|
-
import { createCloudflareTfOutput } from '../../utils/index.js'
|
|
4
3
|
import { DnsRecordProps } from './types.js'
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -26,23 +25,17 @@ export class CloudflareRecordManager {
|
|
|
26
25
|
* @param id scoped id of the resource
|
|
27
26
|
* @param scope scope in which this resource is defined
|
|
28
27
|
* @param props record properties
|
|
29
|
-
* @see [
|
|
28
|
+
* @see [Pulumi Cloudflare Record]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/record/}
|
|
30
29
|
*/
|
|
31
30
|
public createRecord(id: string, scope: CommonCloudflareConstruct, props: DnsRecordProps) {
|
|
32
31
|
if (!props) throw `Props undefined for ${id}`
|
|
33
32
|
|
|
34
33
|
const zoneId = props.zoneId
|
|
35
34
|
? props.zoneId
|
|
36
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.
|
|
37
|
-
|
|
38
|
-
const record = new DnsRecord(scope, `${id}`, {
|
|
35
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { filter: { name: scope.props.domainName } })?.id
|
|
36
|
+
return new cloudflare.DnsRecord(id, {
|
|
39
37
|
...props,
|
|
40
38
|
zoneId,
|
|
41
39
|
})
|
|
42
|
-
|
|
43
|
-
createCloudflareTfOutput(`${id}-recordFriendlyUniqueId`, scope, record.friendlyUniqueId)
|
|
44
|
-
createCloudflareTfOutput(`${id}-recordId`, scope, record.id)
|
|
45
|
-
|
|
46
|
-
return record
|
|
47
40
|
}
|
|
48
41
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DnsRecordArgs } from '@pulumi/cloudflare'
|
|
2
2
|
|
|
3
|
-
export interface DnsRecordProps extends
|
|
3
|
+
export interface DnsRecordProps extends DnsRecordArgs {}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as cloudflare from '@pulumi/cloudflare'
|
|
2
2
|
import { CommonCloudflareConstruct } from '../../common/index.js'
|
|
3
|
-
import { createCloudflareTfOutput } from '../../utils/index.js'
|
|
4
3
|
import { RulesetProps } from './types.js'
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -9,11 +8,11 @@ import { RulesetProps } from './types.js'
|
|
|
9
8
|
* - If a custom construct extends {@link CommonCloudflareConstruct}, an instance is available within the context.
|
|
10
9
|
* @example
|
|
11
10
|
* ```
|
|
12
|
-
* import { CommonCloudflareConstruct
|
|
11
|
+
* import { CommonCloudflareConstruct } from '@gradientedge/cdk-utils'
|
|
13
12
|
*
|
|
14
13
|
* class CustomConstruct extends CommonCloudflareConstruct {
|
|
15
|
-
* constructor(parent:
|
|
16
|
-
* super(parent,
|
|
14
|
+
* constructor(parent: pulumi.ComponentResource, name: string, props: CommonCloudflareStackProps) {
|
|
15
|
+
* super(parent, name, props)
|
|
17
16
|
* this.props = props
|
|
18
17
|
* this.ruleSetManager.createRuleSet('MyRule', this, props)
|
|
19
18
|
* }
|
|
@@ -26,23 +25,19 @@ export class CloudflareRuleSetManager {
|
|
|
26
25
|
* @param id scoped id of the resource
|
|
27
26
|
* @param scope scope in which this resource is defined
|
|
28
27
|
* @param props rule set properties
|
|
29
|
-
* @see [
|
|
28
|
+
* @see [Pulumi Cloudflare Ruleset]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/ruleset/}
|
|
30
29
|
*/
|
|
31
30
|
public createRuleSet(id: string, scope: CommonCloudflareConstruct, props: RulesetProps) {
|
|
32
31
|
if (!props) throw `Props undefined for ${id}`
|
|
33
32
|
|
|
34
33
|
const zoneId = props.zoneId
|
|
35
34
|
? props.zoneId
|
|
36
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.
|
|
37
|
-
|
|
38
|
-
const ruleSet = new Ruleset(scope, `${id}`, {
|
|
35
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { filter: { name: scope.props.domainName } })?.id
|
|
36
|
+
const ruleSet = new cloudflare.Ruleset(`${id}`, {
|
|
39
37
|
...props,
|
|
40
38
|
zoneId,
|
|
41
39
|
})
|
|
42
40
|
|
|
43
|
-
createCloudflareTfOutput(`${id}-ruleSetFriendlyUniqueId`, scope, ruleSet.friendlyUniqueId)
|
|
44
|
-
createCloudflareTfOutput(`${id}-ruleSetId`, scope, ruleSet.id)
|
|
45
|
-
|
|
46
41
|
return ruleSet
|
|
47
42
|
}
|
|
48
43
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as cloudflare from '@pulumi/cloudflare'
|
|
2
2
|
|
|
3
|
-
export interface RulesetProps extends
|
|
3
|
+
export interface RulesetProps extends cloudflare.RulesetArgs {}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { WorkersCustomDomain } from '@cdktf/provider-cloudflare/lib/workers-custom-domain/index.js'
|
|
3
|
-
import { WorkersKvNamespace } from '@cdktf/provider-cloudflare/lib/workers-kv-namespace/index.js'
|
|
4
|
-
import { WorkersKv } from '@cdktf/provider-cloudflare/lib/workers-kv/index.js'
|
|
5
|
-
import { WorkersRoute } from '@cdktf/provider-cloudflare/lib/workers-route/index.js'
|
|
6
|
-
import { WorkersScript } from '@cdktf/provider-cloudflare/lib/workers-script/index.js'
|
|
1
|
+
import * as cloudflare from '@pulumi/cloudflare'
|
|
7
2
|
import { CommonCloudflareConstruct } from '../../common/index.js'
|
|
8
|
-
import { createCloudflareTfOutput } from '../../utils/index.js'
|
|
9
3
|
import {
|
|
10
4
|
WorkerCronTriggerProps,
|
|
11
5
|
WorkerDomainProps,
|
|
@@ -38,25 +32,19 @@ export class CloudflareWorkerManager {
|
|
|
38
32
|
* @param id scoped id of the resource
|
|
39
33
|
* @param scope scope in which this resource is defined
|
|
40
34
|
* @param props worker domain properties
|
|
41
|
-
* @see [
|
|
35
|
+
* @see [Pulumi Worker Domain]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/workercustomdomain/}
|
|
42
36
|
*/
|
|
43
37
|
public createWorkerDomain(id: string, scope: CommonCloudflareConstruct, props: WorkerDomainProps) {
|
|
44
38
|
if (!props) throw `Props undefined for ${id}`
|
|
45
39
|
|
|
46
40
|
const zoneId = props.zoneId
|
|
47
41
|
? props.zoneId
|
|
48
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.
|
|
49
|
-
|
|
50
|
-
const workerDomain = new WorkersCustomDomain(scope, `${id}`, {
|
|
42
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { filter: { name: scope.props.domainName } })?.id
|
|
43
|
+
return new cloudflare.WorkersCustomDomain(id, {
|
|
51
44
|
...props,
|
|
52
45
|
accountId: props.accountId ?? scope.props.accountId,
|
|
53
46
|
zoneId,
|
|
54
47
|
})
|
|
55
|
-
|
|
56
|
-
createCloudflareTfOutput(`${id}-workerDomainFriendlyUniqueId`, scope, workerDomain.friendlyUniqueId)
|
|
57
|
-
createCloudflareTfOutput(`${id}-workerDomainId`, scope, workerDomain.id)
|
|
58
|
-
|
|
59
|
-
return workerDomain
|
|
60
48
|
}
|
|
61
49
|
|
|
62
50
|
/**
|
|
@@ -64,25 +52,20 @@ export class CloudflareWorkerManager {
|
|
|
64
52
|
* @param id scoped id of the resource
|
|
65
53
|
* @param scope scope in which this resource is defined
|
|
66
54
|
* @param props worker route properties
|
|
67
|
-
* @see [
|
|
55
|
+
* @see [Pulumi Worker Route]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/workerroute/}
|
|
68
56
|
*/
|
|
69
57
|
public createWorkerRoute(id: string, scope: CommonCloudflareConstruct, props: WorkerRouteProps) {
|
|
70
58
|
if (!props) throw `Props undefined for ${id}`
|
|
71
59
|
|
|
72
60
|
const zoneId = props.zoneId
|
|
73
61
|
? props.zoneId
|
|
74
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.
|
|
62
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { filter: { name: scope.props.domainName } })?.id
|
|
75
63
|
|
|
76
|
-
|
|
64
|
+
return new cloudflare.WorkersRoute(id, {
|
|
77
65
|
...props,
|
|
78
66
|
script: `${props.script}-${scope.props.stage}`,
|
|
79
67
|
zoneId,
|
|
80
68
|
})
|
|
81
|
-
|
|
82
|
-
createCloudflareTfOutput(`${id}-workerRouteFriendlyUniqueId`, scope, workerRoute.friendlyUniqueId)
|
|
83
|
-
createCloudflareTfOutput(`${id}-workerRouteId`, scope, workerRoute.id)
|
|
84
|
-
|
|
85
|
-
return workerRoute
|
|
86
69
|
}
|
|
87
70
|
|
|
88
71
|
/**
|
|
@@ -90,21 +73,16 @@ export class CloudflareWorkerManager {
|
|
|
90
73
|
* @param id scoped id of the resource
|
|
91
74
|
* @param scope scope in which this resource is defined
|
|
92
75
|
* @param props worker script properties
|
|
93
|
-
* @see [
|
|
76
|
+
* @see [Pulumi Worker Script]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/workerscript/}
|
|
94
77
|
*/
|
|
95
78
|
public createWorkerScript(id: string, scope: CommonCloudflareConstruct, props: WorkerScriptProps) {
|
|
96
79
|
if (!props) throw `Props undefined for ${id}`
|
|
97
80
|
|
|
98
|
-
|
|
81
|
+
return new cloudflare.WorkersScript(id, {
|
|
99
82
|
...props,
|
|
100
83
|
accountId: props.accountId ?? scope.props.accountId,
|
|
101
84
|
scriptName: `${props.scriptName}-${scope.props.stage}`,
|
|
102
85
|
})
|
|
103
|
-
|
|
104
|
-
createCloudflareTfOutput(`${id}-workerScriptFriendlyUniqueId`, scope, workerScript.friendlyUniqueId)
|
|
105
|
-
createCloudflareTfOutput(`${id}-workerScriptId`, scope, workerScript.id)
|
|
106
|
-
|
|
107
|
-
return workerScript
|
|
108
86
|
}
|
|
109
87
|
|
|
110
88
|
/**
|
|
@@ -112,21 +90,16 @@ export class CloudflareWorkerManager {
|
|
|
112
90
|
* @param id scoped id of the resource
|
|
113
91
|
* @param scope scope in which this resource is defined
|
|
114
92
|
* @param props workers kv namespace properties
|
|
115
|
-
* @see [
|
|
93
|
+
* @see [Pulumi Workers KV Namespace]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/workerskvnamespace/}
|
|
116
94
|
*/
|
|
117
95
|
public createWorkersKvNamespace(id: string, scope: CommonCloudflareConstruct, props: WorkersKvNamespaceProps) {
|
|
118
96
|
if (!props) throw `Props undefined for ${id}`
|
|
119
97
|
|
|
120
|
-
|
|
98
|
+
return new cloudflare.WorkersKvNamespace(id, {
|
|
121
99
|
...props,
|
|
122
100
|
accountId: props.accountId ?? scope.props.accountId,
|
|
123
101
|
title: scope.isProductionStage() ? props.title : `${props.title}-${scope.props.stage}`,
|
|
124
102
|
})
|
|
125
|
-
|
|
126
|
-
createCloudflareTfOutput(`${id}-workersKvNamespaceFriendlyUniqueId`, scope, workersKvNamespace.friendlyUniqueId)
|
|
127
|
-
createCloudflareTfOutput(`${id}-workersKvNamespaceId`, scope, workersKvNamespace.id)
|
|
128
|
-
|
|
129
|
-
return workersKvNamespace
|
|
130
103
|
}
|
|
131
104
|
|
|
132
105
|
/**
|
|
@@ -134,20 +107,15 @@ export class CloudflareWorkerManager {
|
|
|
134
107
|
* @param id scoped id of the resource
|
|
135
108
|
* @param scope scope in which this resource is defined
|
|
136
109
|
* @param props workers kv properties
|
|
137
|
-
* @see [
|
|
110
|
+
* @see [Pulumi Workers KV]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/workerskv/}
|
|
138
111
|
*/
|
|
139
112
|
public createWorkersKv(id: string, scope: CommonCloudflareConstruct, props: WorkersKvProps) {
|
|
140
113
|
if (!props) throw `Props undefined for ${id}`
|
|
141
114
|
|
|
142
|
-
|
|
115
|
+
return new cloudflare.WorkersKv(id, {
|
|
143
116
|
...props,
|
|
144
117
|
accountId: props.accountId ?? scope.props.accountId,
|
|
145
118
|
})
|
|
146
|
-
|
|
147
|
-
createCloudflareTfOutput(`${id}-workersKvFriendlyUniqueId`, scope, workersKv.friendlyUniqueId)
|
|
148
|
-
createCloudflareTfOutput(`${id}-workersKvId`, scope, workersKv.id)
|
|
149
|
-
|
|
150
|
-
return workersKv
|
|
151
119
|
}
|
|
152
120
|
|
|
153
121
|
/**
|
|
@@ -155,19 +123,14 @@ export class CloudflareWorkerManager {
|
|
|
155
123
|
* @param id scoped id of the resource
|
|
156
124
|
* @param scope scope in which this resource is defined
|
|
157
125
|
* @param props workers cron trigger properties
|
|
158
|
-
* @see [
|
|
126
|
+
* @see [Pulumi Workers Cron Trigger]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/workercrontrigger/}
|
|
159
127
|
*/
|
|
160
128
|
public createWorkerCronTrigger(id: string, scope: CommonCloudflareConstruct, props: WorkerCronTriggerProps) {
|
|
161
129
|
if (!props) throw `Props undefined for ${id}`
|
|
162
130
|
|
|
163
|
-
|
|
131
|
+
return new cloudflare.WorkersCronTrigger(id, {
|
|
164
132
|
...props,
|
|
165
133
|
accountId: props.accountId ?? scope.props.accountId,
|
|
166
134
|
})
|
|
167
|
-
|
|
168
|
-
createCloudflareTfOutput(`${id}-workerCronTriggerFriendlyUniqueId`, scope, workerCronTrigger.friendlyUniqueId)
|
|
169
|
-
createCloudflareTfOutput(`${id}-workerCronTriggerId`, scope, workerCronTrigger.id)
|
|
170
|
-
|
|
171
|
-
return workerCronTrigger
|
|
172
135
|
}
|
|
173
136
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import {
|
|
2
|
+
WorkersCronTriggerArgs,
|
|
3
|
+
WorkersCustomDomainArgs,
|
|
4
|
+
WorkersKvArgs,
|
|
5
|
+
WorkersKvNamespaceArgs,
|
|
6
|
+
WorkersRouteArgs,
|
|
7
|
+
WorkersScriptArgs,
|
|
8
|
+
} from '@pulumi/cloudflare'
|
|
7
9
|
|
|
8
|
-
export interface WorkerDomainProps extends
|
|
9
|
-
export interface WorkerRouteProps extends
|
|
10
|
-
export interface WorkerScriptProps extends
|
|
11
|
-
export interface WorkersKvNamespaceProps extends
|
|
12
|
-
export interface WorkersKvProps extends
|
|
13
|
-
export interface WorkerCronTriggerProps extends
|
|
10
|
+
export interface WorkerDomainProps extends WorkersCustomDomainArgs {}
|
|
11
|
+
export interface WorkerRouteProps extends WorkersRouteArgs {}
|
|
12
|
+
export interface WorkerScriptProps extends WorkersScriptArgs {}
|
|
13
|
+
export interface WorkersKvNamespaceProps extends WorkersKvNamespaceArgs {}
|
|
14
|
+
export interface WorkersKvProps extends WorkersKvArgs {}
|
|
15
|
+
export interface WorkerCronTriggerProps extends WorkersCronTriggerArgs {}
|