@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,16 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { ZeroTrustAccessCustomPage } from '@cdktf/provider-cloudflare/lib/zero-trust-access-custom-page/index.js'
|
|
4
|
-
import { ZeroTrustAccessGroup } from '@cdktf/provider-cloudflare/lib/zero-trust-access-group/index.js'
|
|
5
|
-
import { ZeroTrustAccessIdentityProvider } from '@cdktf/provider-cloudflare/lib/zero-trust-access-identity-provider/index.js'
|
|
6
|
-
import { ZeroTrustAccessMtlsCertificate } from '@cdktf/provider-cloudflare/lib/zero-trust-access-mtls-certificate/index.js'
|
|
7
|
-
import { ZeroTrustAccessPolicy } from '@cdktf/provider-cloudflare/lib/zero-trust-access-policy/index.js'
|
|
8
|
-
import { ZeroTrustAccessServiceToken } from '@cdktf/provider-cloudflare/lib/zero-trust-access-service-token/index.js'
|
|
9
|
-
import { ZeroTrustAccessShortLivedCertificate } from '@cdktf/provider-cloudflare/lib/zero-trust-access-short-lived-certificate/index.js'
|
|
10
|
-
import { ZeroTrustAccessTag } from '@cdktf/provider-cloudflare/lib/zero-trust-access-tag/index.js'
|
|
11
|
-
import { ZeroTrustOrganization } from '@cdktf/provider-cloudflare/lib/zero-trust-organization/index.js'
|
|
12
|
-
import { CommonCloudflareConstruct } from '../../common/index.js'
|
|
13
|
-
import { createCloudflareTfOutput } from '../../utils/index.js'
|
|
1
|
+
import * as cloudflare from '@pulumi/cloudflare'
|
|
2
|
+
import { CommonCloudflareConstruct } from '../../common/construct.js'
|
|
14
3
|
import {
|
|
15
4
|
AccessRuleProps,
|
|
16
5
|
ZeroTrustAccessApplicationProps,
|
|
@@ -27,17 +16,16 @@ import {
|
|
|
27
16
|
|
|
28
17
|
/**
|
|
29
18
|
* @classdesc Provides operations on Cloudflare Access
|
|
30
|
-
* - A new instance of this class is injected into {@link
|
|
31
|
-
* - If a custom
|
|
19
|
+
* - A new instance of this class is injected into {@link CommonCloudflareComponent} constructor.
|
|
20
|
+
* - If a custom component extends {@link CommonCloudflareComponent}, an instance is available within the context.
|
|
32
21
|
* @example
|
|
33
22
|
* ```
|
|
34
|
-
* import {
|
|
23
|
+
* import { CommonCloudflareComponent, CloudflareAccessManager } from '@gradientedge/cdk-utils'
|
|
35
24
|
*
|
|
36
|
-
* class
|
|
37
|
-
* constructor(
|
|
38
|
-
* super(
|
|
39
|
-
* this.
|
|
40
|
-
* this.accessManager.createApiShield('MyAppAccess', this, props)
|
|
25
|
+
* class CustomComponent extends CommonCloudflareComponent {
|
|
26
|
+
* constructor(name: string, args: any, opts?: pulumi.ComponentResourceOptions) {
|
|
27
|
+
* super(name, args, opts)
|
|
28
|
+
* this.accessManager.createAccessApplication('MyAppAccess', this, props)
|
|
41
29
|
* }
|
|
42
30
|
* }
|
|
43
31
|
* ```
|
|
@@ -48,34 +36,31 @@ export class CloudflareAccessManager {
|
|
|
48
36
|
* @param id scoped id of the resource
|
|
49
37
|
* @param scope scope in which this resource is defined
|
|
50
38
|
* @param props access application properties
|
|
51
|
-
* @see [
|
|
39
|
+
* @see [Pulumi Cloudflare Access Application]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/zerotrustaccessapplication/}
|
|
52
40
|
*/
|
|
53
41
|
public createAccessApplication(id: string, scope: CommonCloudflareConstruct, props: ZeroTrustAccessApplicationProps) {
|
|
54
42
|
if (!props) throw `Props undefined for ${id}`
|
|
55
43
|
|
|
56
44
|
const zoneId = props.zoneId
|
|
57
45
|
? props.zoneId
|
|
58
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
46
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
47
|
+
filter: { name: scope.props.domainName },
|
|
48
|
+
})?.id
|
|
59
49
|
|
|
60
|
-
|
|
50
|
+
return new cloudflare.ZeroTrustAccessApplication(`${id}`, {
|
|
61
51
|
...props,
|
|
62
52
|
domain: `${props.domain}-${scope.props.domainName}`,
|
|
63
53
|
name: `${props.name}-${scope.props.stage}`,
|
|
64
54
|
zoneId,
|
|
65
55
|
})
|
|
66
|
-
|
|
67
|
-
createCloudflareTfOutput(`${id}-accessApplicationFriendlyUniqueId`, scope, accessApplication.friendlyUniqueId)
|
|
68
|
-
createCloudflareTfOutput(`${id}-accessApplicationId`, scope, accessApplication.id)
|
|
69
|
-
|
|
70
|
-
return accessApplication
|
|
71
56
|
}
|
|
72
57
|
|
|
73
58
|
/**
|
|
74
59
|
* @summary Method to create a new Cloudflare Application Access Short Lived Certificate
|
|
75
60
|
* @param id scoped id of the resource
|
|
76
61
|
* @param scope scope in which this resource is defined
|
|
77
|
-
* @param props access short lived
|
|
78
|
-
* @see [
|
|
62
|
+
* @param props access short lived certificate properties
|
|
63
|
+
* @see [Pulumi Cloudflare Access Short Lived Certificate]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/zerotrustaccessshortlivedcertificate/}
|
|
79
64
|
*/
|
|
80
65
|
public createAccessShortLivedCertificate(
|
|
81
66
|
id: string,
|
|
@@ -86,21 +71,14 @@ export class CloudflareAccessManager {
|
|
|
86
71
|
|
|
87
72
|
const zoneId = props.zoneId
|
|
88
73
|
? props.zoneId
|
|
89
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
74
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
75
|
+
filter: { name: scope.props.domainName },
|
|
76
|
+
})?.id
|
|
90
77
|
|
|
91
|
-
|
|
78
|
+
return new cloudflare.ZeroTrustAccessShortLivedCertificate(`${id}`, {
|
|
92
79
|
...props,
|
|
93
80
|
zoneId,
|
|
94
81
|
})
|
|
95
|
-
|
|
96
|
-
createCloudflareTfOutput(
|
|
97
|
-
`${id}-accessShortLivedCertificateFriendlyUniqueId`,
|
|
98
|
-
scope,
|
|
99
|
-
accessShortLivedCertificate.friendlyUniqueId
|
|
100
|
-
)
|
|
101
|
-
createCloudflareTfOutput(`${id}-accessShortLivedCertificateId`, scope, accessShortLivedCertificate.id)
|
|
102
|
-
|
|
103
|
-
return accessShortLivedCertificate
|
|
104
82
|
}
|
|
105
83
|
|
|
106
84
|
/**
|
|
@@ -108,21 +86,16 @@ export class CloudflareAccessManager {
|
|
|
108
86
|
* @param id scoped id of the resource
|
|
109
87
|
* @param scope scope in which this resource is defined
|
|
110
88
|
* @param props access custom page properties
|
|
111
|
-
* @see [
|
|
89
|
+
* @see [Pulumi Cloudflare Access Custom Page]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/zerotrustaccesscustompage/}
|
|
112
90
|
*/
|
|
113
91
|
public createAccessCustomPage(id: string, scope: CommonCloudflareConstruct, props: ZeroTrustAccessCustomPageProps) {
|
|
114
92
|
if (!props) throw `Props undefined for ${id}`
|
|
115
93
|
|
|
116
|
-
|
|
94
|
+
return new cloudflare.ZeroTrustAccessCustomPage(`${id}`, {
|
|
117
95
|
...props,
|
|
118
96
|
accountId: props.accountId ?? scope.props.accountId,
|
|
119
97
|
name: `${props.name}-${scope.props.stage}`,
|
|
120
98
|
})
|
|
121
|
-
|
|
122
|
-
createCloudflareTfOutput(`${id}-accessCustomPageFriendlyUniqueId`, scope, accessCustomPage.friendlyUniqueId)
|
|
123
|
-
createCloudflareTfOutput(`${id}-accessCustomPageId`, scope, accessCustomPage.id)
|
|
124
|
-
|
|
125
|
-
return accessCustomPage
|
|
126
99
|
}
|
|
127
100
|
|
|
128
101
|
/**
|
|
@@ -130,25 +103,22 @@ export class CloudflareAccessManager {
|
|
|
130
103
|
* @param id scoped id of the resource
|
|
131
104
|
* @param scope scope in which this resource is defined
|
|
132
105
|
* @param props access group properties
|
|
133
|
-
* @see [
|
|
106
|
+
* @see [Pulumi Cloudflare Access Group]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/zerotrustaccessgroup/}
|
|
134
107
|
*/
|
|
135
108
|
public createAccessGroup(id: string, scope: CommonCloudflareConstruct, props: ZeroTrustAccessGroupProps) {
|
|
136
109
|
if (!props) throw `Props undefined for ${id}`
|
|
137
110
|
|
|
138
111
|
const zoneId = props.zoneId
|
|
139
112
|
? props.zoneId
|
|
140
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
113
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
114
|
+
filter: { name: scope.props.domainName },
|
|
115
|
+
})?.id
|
|
141
116
|
|
|
142
|
-
|
|
117
|
+
return new cloudflare.ZeroTrustAccessGroup(`${id}`, {
|
|
143
118
|
...props,
|
|
144
119
|
name: `${props.name} - ${scope.props.stage.toUpperCase()}`,
|
|
145
120
|
zoneId,
|
|
146
121
|
})
|
|
147
|
-
|
|
148
|
-
createCloudflareTfOutput(`${id}-accessGroupFriendlyUniqueId`, scope, accessGroup.friendlyUniqueId)
|
|
149
|
-
createCloudflareTfOutput(`${id}-accessGroupId`, scope, accessGroup.id)
|
|
150
|
-
|
|
151
|
-
return accessGroup
|
|
152
122
|
}
|
|
153
123
|
|
|
154
124
|
/**
|
|
@@ -156,7 +126,7 @@ export class CloudflareAccessManager {
|
|
|
156
126
|
* @param id scoped id of the resource
|
|
157
127
|
* @param scope scope in which this resource is defined
|
|
158
128
|
* @param props access identity provider properties
|
|
159
|
-
* @see [
|
|
129
|
+
* @see [Pulumi Cloudflare Access Identity Provider]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/zerotrustaccessidentityprovider/}
|
|
160
130
|
*/
|
|
161
131
|
public createAccessIdentityProvider(
|
|
162
132
|
id: string,
|
|
@@ -167,22 +137,16 @@ export class CloudflareAccessManager {
|
|
|
167
137
|
|
|
168
138
|
const zoneId = props.zoneId
|
|
169
139
|
? props.zoneId
|
|
170
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
140
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
141
|
+
filter: { name: scope.props.domainName },
|
|
142
|
+
})?.id
|
|
171
143
|
|
|
172
|
-
|
|
144
|
+
return new cloudflare.ZeroTrustAccessIdentityProvider(`${id}`, {
|
|
173
145
|
...props,
|
|
146
|
+
config: props.config ?? {},
|
|
174
147
|
name: `${props.name}-${scope.props.stage}`,
|
|
175
148
|
zoneId,
|
|
176
149
|
})
|
|
177
|
-
|
|
178
|
-
createCloudflareTfOutput(
|
|
179
|
-
`${id}-accessIdentityProviderFriendlyUniqueId`,
|
|
180
|
-
scope,
|
|
181
|
-
accessIdentityProvider.friendlyUniqueId
|
|
182
|
-
)
|
|
183
|
-
createCloudflareTfOutput(`${id}-accessIdentityProviderId`, scope, accessIdentityProvider.id)
|
|
184
|
-
|
|
185
|
-
return accessIdentityProvider
|
|
186
150
|
}
|
|
187
151
|
|
|
188
152
|
/**
|
|
@@ -190,7 +154,7 @@ export class CloudflareAccessManager {
|
|
|
190
154
|
* @param id scoped id of the resource
|
|
191
155
|
* @param scope scope in which this resource is defined
|
|
192
156
|
* @param props access mutual tls certificate properties
|
|
193
|
-
* @see [
|
|
157
|
+
* @see [Pulumi Cloudflare Access Mutual Tls Certificate]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/zerotrustaccessmtlscertificate/}
|
|
194
158
|
*/
|
|
195
159
|
public createAccessMutualTlsCertificate(
|
|
196
160
|
id: string,
|
|
@@ -201,22 +165,15 @@ export class CloudflareAccessManager {
|
|
|
201
165
|
|
|
202
166
|
const zoneId = props.zoneId
|
|
203
167
|
? props.zoneId
|
|
204
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
168
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
169
|
+
filter: { name: scope.props.domainName },
|
|
170
|
+
})?.id
|
|
205
171
|
|
|
206
|
-
|
|
172
|
+
return new cloudflare.ZeroTrustAccessMtlsCertificate(`${id}`, {
|
|
207
173
|
...props,
|
|
208
174
|
name: `${props.name}-${scope.props.stage}`,
|
|
209
175
|
zoneId,
|
|
210
176
|
})
|
|
211
|
-
|
|
212
|
-
createCloudflareTfOutput(
|
|
213
|
-
`${id}-accessMutualTlsCertificateFriendlyUniqueId`,
|
|
214
|
-
scope,
|
|
215
|
-
accessMutualTlsCertificate.friendlyUniqueId
|
|
216
|
-
)
|
|
217
|
-
createCloudflareTfOutput(`${id}-accessMutualTlsCertificateId`, scope, accessMutualTlsCertificate.id)
|
|
218
|
-
|
|
219
|
-
return accessMutualTlsCertificate
|
|
220
177
|
}
|
|
221
178
|
|
|
222
179
|
/**
|
|
@@ -224,24 +181,22 @@ export class CloudflareAccessManager {
|
|
|
224
181
|
* @param id scoped id of the resource
|
|
225
182
|
* @param scope scope in which this resource is defined
|
|
226
183
|
* @param props access organisation properties
|
|
227
|
-
* @see [
|
|
184
|
+
* @see [Pulumi Cloudflare Zero Trust Organization]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/zerotrustorganization/}
|
|
228
185
|
*/
|
|
229
186
|
public createAccessOrganization(id: string, scope: CommonCloudflareConstruct, props: ZeroTrustOrganizationProps) {
|
|
230
187
|
if (!props) throw `Props undefined for ${id}`
|
|
231
188
|
|
|
232
189
|
const zoneId = props.zoneId
|
|
233
190
|
? props.zoneId
|
|
234
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
191
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
192
|
+
filter: { name: scope.props.domainName },
|
|
193
|
+
})?.id
|
|
235
194
|
|
|
236
|
-
|
|
195
|
+
return new cloudflare.ZeroTrustOrganization(`${id}`, {
|
|
237
196
|
...props,
|
|
238
197
|
name: `${props.name}-${scope.props.stage}`,
|
|
239
198
|
zoneId,
|
|
240
199
|
})
|
|
241
|
-
|
|
242
|
-
createCloudflareTfOutput(`${id}-accessOrganizationFriendlyUniqueId`, scope, accessOrganization.friendlyUniqueId)
|
|
243
|
-
|
|
244
|
-
return accessOrganization
|
|
245
200
|
}
|
|
246
201
|
|
|
247
202
|
/**
|
|
@@ -249,21 +204,16 @@ export class CloudflareAccessManager {
|
|
|
249
204
|
* @param id scoped id of the resource
|
|
250
205
|
* @param scope scope in which this resource is defined
|
|
251
206
|
* @param props access policy properties
|
|
252
|
-
* @see [
|
|
207
|
+
* @see [Pulumi Cloudflare Access Policy]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/zerotrustaccesspolicy/}
|
|
253
208
|
*/
|
|
254
209
|
public createAccessPolicy(id: string, scope: CommonCloudflareConstruct, props: ZeroTrustAccessPolicyProps) {
|
|
255
210
|
if (!props) throw `Props undefined for ${id}`
|
|
256
211
|
|
|
257
|
-
|
|
212
|
+
return new cloudflare.ZeroTrustAccessPolicy(`${id}`, {
|
|
258
213
|
...props,
|
|
259
214
|
name: `${props.name}-${scope.props.stage}`,
|
|
260
215
|
accountId: props.accountId ?? scope.props.accountId,
|
|
261
216
|
})
|
|
262
|
-
|
|
263
|
-
createCloudflareTfOutput(`${id}-accessPolicyFriendlyUniqueId`, scope, accessPolicy.friendlyUniqueId)
|
|
264
|
-
createCloudflareTfOutput(`${id}-accessPolicyId`, scope, accessPolicy.id)
|
|
265
|
-
|
|
266
|
-
return accessPolicy
|
|
267
217
|
}
|
|
268
218
|
|
|
269
219
|
/**
|
|
@@ -271,25 +221,22 @@ export class CloudflareAccessManager {
|
|
|
271
221
|
* @param id scoped id of the resource
|
|
272
222
|
* @param scope scope in which this resource is defined
|
|
273
223
|
* @param props access rule properties
|
|
274
|
-
* @see [
|
|
224
|
+
* @see [Pulumi Cloudflare Access Rule]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/accessrule/}
|
|
275
225
|
*/
|
|
276
226
|
public createAccessRule(id: string, scope: CommonCloudflareConstruct, props: AccessRuleProps) {
|
|
277
227
|
if (!props) throw `Props undefined for ${id}`
|
|
278
228
|
|
|
279
229
|
const zoneId = props.zoneId
|
|
280
230
|
? props.zoneId
|
|
281
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
231
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
232
|
+
filter: { name: scope.props.domainName },
|
|
233
|
+
})?.id
|
|
282
234
|
|
|
283
|
-
|
|
235
|
+
return new cloudflare.AccessRule(`${id}`, {
|
|
284
236
|
...props,
|
|
285
237
|
zoneId,
|
|
286
238
|
accountId: props.accountId ?? scope.props.accountId,
|
|
287
239
|
})
|
|
288
|
-
|
|
289
|
-
createCloudflareTfOutput(`${id}-accessRuleFriendlyUniqueId`, scope, accessRule.friendlyUniqueId)
|
|
290
|
-
createCloudflareTfOutput(`${id}-accessRuleId`, scope, accessRule.id)
|
|
291
|
-
|
|
292
|
-
return accessRule
|
|
293
240
|
}
|
|
294
241
|
|
|
295
242
|
/**
|
|
@@ -297,7 +244,7 @@ export class CloudflareAccessManager {
|
|
|
297
244
|
* @param id scoped id of the resource
|
|
298
245
|
* @param scope scope in which this resource is defined
|
|
299
246
|
* @param props access service token properties
|
|
300
|
-
* @see [
|
|
247
|
+
* @see [Pulumi Cloudflare Access Service Token]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/zerotrustaccessservicetoken/}
|
|
301
248
|
*/
|
|
302
249
|
public createAccessServiceToken(
|
|
303
250
|
id: string,
|
|
@@ -308,19 +255,16 @@ export class CloudflareAccessManager {
|
|
|
308
255
|
|
|
309
256
|
const zoneId = props.zoneId
|
|
310
257
|
? props.zoneId
|
|
311
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
258
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
|
|
259
|
+
filter: { name: scope.props.domainName },
|
|
260
|
+
})?.id
|
|
312
261
|
|
|
313
|
-
|
|
262
|
+
return new cloudflare.ZeroTrustAccessServiceToken(`${id}`, {
|
|
314
263
|
...props,
|
|
315
264
|
name: `${props.name}-${scope.props.stage}`,
|
|
316
265
|
accountId: props.accountId ?? scope.props.accountId,
|
|
317
266
|
zoneId,
|
|
318
267
|
})
|
|
319
|
-
|
|
320
|
-
createCloudflareTfOutput(`${id}-accessServiceTokenFriendlyUniqueId`, scope, accessServiceToken.friendlyUniqueId)
|
|
321
|
-
createCloudflareTfOutput(`${id}-accessServiceTokenId`, scope, accessServiceToken.id)
|
|
322
|
-
|
|
323
|
-
return accessServiceToken
|
|
324
268
|
}
|
|
325
269
|
|
|
326
270
|
/**
|
|
@@ -328,20 +272,15 @@ export class CloudflareAccessManager {
|
|
|
328
272
|
* @param id scoped id of the resource
|
|
329
273
|
* @param scope scope in which this resource is defined
|
|
330
274
|
* @param props access tag properties
|
|
331
|
-
* @see [
|
|
275
|
+
* @see [Pulumi Cloudflare Access Tag]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/zerotrustaccesstag/}
|
|
332
276
|
*/
|
|
333
277
|
public createAccessTag(id: string, scope: CommonCloudflareConstruct, props: ZeroTrustAccessTagProps) {
|
|
334
278
|
if (!props) throw `Props undefined for ${id}`
|
|
335
279
|
|
|
336
|
-
|
|
280
|
+
return new cloudflare.ZeroTrustAccessTag(`${id}`, {
|
|
337
281
|
...props,
|
|
338
282
|
name: `${props.name}-${scope.props.stage}`,
|
|
339
283
|
accountId: props.accountId ?? scope.props.accountId,
|
|
340
284
|
})
|
|
341
|
-
|
|
342
|
-
createCloudflareTfOutput(`${id}-accessTagFriendlyUniqueId`, scope, accessTag.friendlyUniqueId)
|
|
343
|
-
createCloudflareTfOutput(`${id}-accessTagId`, scope, accessTag.id)
|
|
344
|
-
|
|
345
|
-
return accessTag
|
|
346
285
|
}
|
|
347
286
|
}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import {
|
|
2
|
+
AccessRuleArgs,
|
|
3
|
+
ZeroTrustAccessApplicationArgs,
|
|
4
|
+
ZeroTrustAccessCustomPageArgs,
|
|
5
|
+
ZeroTrustAccessGroupArgs,
|
|
6
|
+
ZeroTrustAccessIdentityProviderArgs,
|
|
7
|
+
ZeroTrustAccessMtlsCertificateArgs,
|
|
8
|
+
ZeroTrustAccessPolicyArgs,
|
|
9
|
+
ZeroTrustAccessServiceTokenArgs,
|
|
10
|
+
ZeroTrustAccessShortLivedCertificateArgs,
|
|
11
|
+
ZeroTrustAccessTagArgs,
|
|
12
|
+
ZeroTrustOrganizationArgs,
|
|
13
|
+
} from '@pulumi/cloudflare'
|
|
12
14
|
|
|
13
|
-
export interface ZeroTrustAccessApplicationProps extends
|
|
14
|
-
export interface ZeroTrustAccessShortLivedCertificateProps extends
|
|
15
|
-
export interface ZeroTrustAccessCustomPageProps extends
|
|
16
|
-
export interface ZeroTrustAccessGroupProps extends
|
|
17
|
-
export interface ZeroTrustAccessIdentityProviderProps extends
|
|
18
|
-
export interface ZeroTrustAccessMtlsCertificateProps extends
|
|
19
|
-
export interface ZeroTrustOrganizationProps extends
|
|
20
|
-
export interface ZeroTrustAccessPolicyProps extends
|
|
21
|
-
export interface AccessRuleProps extends
|
|
22
|
-
export interface ZeroTrustAccessServiceTokenProps extends
|
|
23
|
-
export interface ZeroTrustAccessTagProps extends
|
|
15
|
+
export interface ZeroTrustAccessApplicationProps extends ZeroTrustAccessApplicationArgs {}
|
|
16
|
+
export interface ZeroTrustAccessShortLivedCertificateProps extends ZeroTrustAccessShortLivedCertificateArgs {}
|
|
17
|
+
export interface ZeroTrustAccessCustomPageProps extends ZeroTrustAccessCustomPageArgs {}
|
|
18
|
+
export interface ZeroTrustAccessGroupProps extends ZeroTrustAccessGroupArgs {}
|
|
19
|
+
export interface ZeroTrustAccessIdentityProviderProps extends ZeroTrustAccessIdentityProviderArgs {}
|
|
20
|
+
export interface ZeroTrustAccessMtlsCertificateProps extends ZeroTrustAccessMtlsCertificateArgs {}
|
|
21
|
+
export interface ZeroTrustOrganizationProps extends ZeroTrustOrganizationArgs {}
|
|
22
|
+
export interface ZeroTrustAccessPolicyProps extends ZeroTrustAccessPolicyArgs {}
|
|
23
|
+
export interface AccessRuleProps extends AccessRuleArgs {}
|
|
24
|
+
export interface ZeroTrustAccessServiceTokenProps extends ZeroTrustAccessServiceTokenArgs {}
|
|
25
|
+
export interface ZeroTrustAccessTagProps extends ZeroTrustAccessTagArgs {}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ApiShieldOperation } from '@cdktf/provider-cloudflare/lib/api-shield-operation/index.js'
|
|
3
|
-
import { ApiShieldSchemaValidationSettings } from '@cdktf/provider-cloudflare/lib/api-shield-schema-validation-settings/index.js'
|
|
4
|
-
import { ApiShieldSchema } from '@cdktf/provider-cloudflare/lib/api-shield-schema/index.js'
|
|
5
|
-
import { ApiShield } from '@cdktf/provider-cloudflare/lib/api-shield/index.js'
|
|
1
|
+
import * as cloudflare from '@pulumi/cloudflare'
|
|
6
2
|
import { CommonCloudflareConstruct } from '../../common/index.js'
|
|
7
|
-
import { createCloudflareTfOutput } from '../../utils/index.js'
|
|
8
3
|
import {
|
|
9
4
|
ApiShieldOperationProps,
|
|
10
5
|
ApiShieldOperationSchemaValidationSettingsProps,
|
|
@@ -36,24 +31,18 @@ export class CloudflareApiShieldManager {
|
|
|
36
31
|
* @param id scoped id of the resource
|
|
37
32
|
* @param scope scope in which this resource is defined
|
|
38
33
|
* @param props api shield properties
|
|
39
|
-
* @see [
|
|
34
|
+
* @see [Pulumi API Shield]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/apishield/}
|
|
40
35
|
*/
|
|
41
36
|
public createApiShield(id: string, scope: CommonCloudflareConstruct, props: ApiShieldProps) {
|
|
42
37
|
if (!props) throw `Props undefined for ${id}`
|
|
43
38
|
|
|
44
39
|
const zoneId = props.zoneId
|
|
45
40
|
? props.zoneId
|
|
46
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.
|
|
47
|
-
|
|
48
|
-
const apiShield = new ApiShield(scope, `${id}`, {
|
|
41
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { filter: { name: scope.props.domainName } })?.id
|
|
42
|
+
return new cloudflare.ApiShield(`${id}`, {
|
|
49
43
|
...props,
|
|
50
44
|
zoneId,
|
|
51
45
|
})
|
|
52
|
-
|
|
53
|
-
createCloudflareTfOutput(`${id}-apiShieldFriendlyUniqueId`, scope, apiShield.friendlyUniqueId)
|
|
54
|
-
createCloudflareTfOutput(`${id}-apiShieldId`, scope, apiShield.id)
|
|
55
|
-
|
|
56
|
-
return apiShield
|
|
57
46
|
}
|
|
58
47
|
|
|
59
48
|
/**
|
|
@@ -61,25 +50,19 @@ export class CloudflareApiShieldManager {
|
|
|
61
50
|
* @param id scoped id of the resource
|
|
62
51
|
* @param scope scope in which this resource is defined
|
|
63
52
|
* @param props api shield schema properties
|
|
64
|
-
* @see [
|
|
53
|
+
* @see [Pulumi API Shield Schema]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/apishieldschema/}
|
|
65
54
|
*/
|
|
66
55
|
public createApiShieldSchema(id: string, scope: CommonCloudflareConstruct, props: ApiShieldSchemaProps) {
|
|
67
56
|
if (!props) throw `Props undefined for ${id}`
|
|
68
57
|
|
|
69
58
|
const zoneId = props.zoneId
|
|
70
59
|
? props.zoneId
|
|
71
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.
|
|
72
|
-
|
|
73
|
-
const apiShieldSchema = new ApiShieldSchema(scope, `${id}`, {
|
|
60
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { filter: { name: scope.props.domainName } })?.id
|
|
61
|
+
return new cloudflare.ApiShieldSchema(`${id}`, {
|
|
74
62
|
...props,
|
|
75
63
|
name: `${props.name}-${scope.props.stage}`,
|
|
76
64
|
zoneId,
|
|
77
65
|
})
|
|
78
|
-
|
|
79
|
-
createCloudflareTfOutput(`${id}-apiShieldSchemaFriendlyUniqueId`, scope, apiShieldSchema.friendlyUniqueId)
|
|
80
|
-
createCloudflareTfOutput(`${id}-apiShieldSchemaId`, scope, apiShieldSchema.schemaId)
|
|
81
|
-
|
|
82
|
-
return apiShieldSchema
|
|
83
66
|
}
|
|
84
67
|
|
|
85
68
|
/**
|
|
@@ -87,7 +70,7 @@ export class CloudflareApiShieldManager {
|
|
|
87
70
|
* @param id scoped id of the resource
|
|
88
71
|
* @param scope scope in which this resource is defined
|
|
89
72
|
* @param props api shield schema validation settings properties
|
|
90
|
-
* @see [
|
|
73
|
+
* @see [Pulumi API Shield Schema Validation Settings]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/apishieldschemavalidationsettings/}
|
|
91
74
|
*/
|
|
92
75
|
public createApiShieldSchemaValidationSettings(
|
|
93
76
|
id: string,
|
|
@@ -98,21 +81,11 @@ export class CloudflareApiShieldManager {
|
|
|
98
81
|
|
|
99
82
|
const zoneId = props.zoneId
|
|
100
83
|
? props.zoneId
|
|
101
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.
|
|
102
|
-
|
|
103
|
-
const apiShieldSchemaValidationSettings = new ApiShieldSchemaValidationSettings(scope, `${id}`, {
|
|
84
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { filter: { name: scope.props.domainName } })?.id
|
|
85
|
+
return new cloudflare.ApiShieldSchemaValidationSettings(`${id}`, {
|
|
104
86
|
...props,
|
|
105
87
|
zoneId,
|
|
106
88
|
})
|
|
107
|
-
|
|
108
|
-
createCloudflareTfOutput(
|
|
109
|
-
`${id}-apiShieldSchemaValidationSettingsFriendlyUniqueId`,
|
|
110
|
-
scope,
|
|
111
|
-
apiShieldSchemaValidationSettings.friendlyUniqueId
|
|
112
|
-
)
|
|
113
|
-
createCloudflareTfOutput(`${id}-apiShieldSchemaValidationSettingsId`, scope, apiShieldSchemaValidationSettings.id)
|
|
114
|
-
|
|
115
|
-
return apiShieldSchemaValidationSettings
|
|
116
89
|
}
|
|
117
90
|
|
|
118
91
|
/**
|
|
@@ -120,24 +93,18 @@ export class CloudflareApiShieldManager {
|
|
|
120
93
|
* @param id scoped id of the resource
|
|
121
94
|
* @param scope scope in which this resource is defined
|
|
122
95
|
* @param props api shield operation properties
|
|
123
|
-
* @see [
|
|
96
|
+
* @see [Pulumi API Shield Operation]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/apishieldoperation/}
|
|
124
97
|
*/
|
|
125
98
|
public createApiShieldOperation(id: string, scope: CommonCloudflareConstruct, props: ApiShieldOperationProps) {
|
|
126
99
|
if (!props) throw `Props undefined for ${id}`
|
|
127
100
|
|
|
128
101
|
const zoneId = props.zoneId
|
|
129
102
|
? props.zoneId
|
|
130
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.
|
|
131
|
-
|
|
132
|
-
const apiShieldOperation = new ApiShieldOperation(scope, `${id}`, {
|
|
103
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { filter: { name: scope.props.domainName } })?.id
|
|
104
|
+
return new cloudflare.ApiShieldOperation(`${id}`, {
|
|
133
105
|
...props,
|
|
134
106
|
zoneId,
|
|
135
107
|
})
|
|
136
|
-
|
|
137
|
-
createCloudflareTfOutput(`${id}-apiShieldOperationFriendlyUniqueId`, scope, apiShieldOperation.friendlyUniqueId)
|
|
138
|
-
createCloudflareTfOutput(`${id}-apiShieldOperationId`, scope, apiShieldOperation.id)
|
|
139
|
-
|
|
140
|
-
return apiShieldOperation
|
|
141
108
|
}
|
|
142
109
|
|
|
143
110
|
/**
|
|
@@ -145,7 +112,7 @@ export class CloudflareApiShieldManager {
|
|
|
145
112
|
* @param id scoped id of the resource
|
|
146
113
|
* @param scope scope in which this resource is defined
|
|
147
114
|
* @param props api shield operation schema validation settings properties
|
|
148
|
-
* @see [
|
|
115
|
+
* @see [Pulumi API Shield Operation Schema Validation Settings]{@link https://www.pulumi.com/registry/packages/cloudflare/api-docs/apishieldoperationschemavalidationsettings/}
|
|
149
116
|
*/
|
|
150
117
|
public createApiShieldOperationSchemaValidationSettings(
|
|
151
118
|
id: string,
|
|
@@ -156,24 +123,10 @@ export class CloudflareApiShieldManager {
|
|
|
156
123
|
|
|
157
124
|
const zoneId = props.zoneId
|
|
158
125
|
? props.zoneId
|
|
159
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.
|
|
160
|
-
|
|
161
|
-
const apiShieldOperationSchemaValidationSettings = new ApiShieldOperationSchemaValidationSettings(scope, `${id}`, {
|
|
126
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { filter: { name: scope.props.domainName } })?.id
|
|
127
|
+
return new cloudflare.ApiShieldOperationSchemaValidationSettings(`${id}`, {
|
|
162
128
|
...props,
|
|
163
129
|
zoneId,
|
|
164
130
|
})
|
|
165
|
-
|
|
166
|
-
createCloudflareTfOutput(
|
|
167
|
-
`${id}-apiShieldOperationSchemaValidationSettingsFriendlyUniqueId`,
|
|
168
|
-
scope,
|
|
169
|
-
apiShieldOperationSchemaValidationSettings.friendlyUniqueId
|
|
170
|
-
)
|
|
171
|
-
createCloudflareTfOutput(
|
|
172
|
-
`${id}-apiShieldOperationSchemaValidationSettingsId`,
|
|
173
|
-
scope,
|
|
174
|
-
apiShieldOperationSchemaValidationSettings.id
|
|
175
|
-
)
|
|
176
|
-
|
|
177
|
-
return apiShieldOperationSchemaValidationSettings
|
|
178
131
|
}
|
|
179
132
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import {
|
|
2
|
+
ApiShieldArgs,
|
|
3
|
+
ApiShieldOperationArgs,
|
|
4
|
+
ApiShieldOperationSchemaValidationSettingsArgs,
|
|
5
|
+
ApiShieldSchemaArgs,
|
|
6
|
+
ApiShieldSchemaValidationSettingsArgs,
|
|
7
|
+
} from '@pulumi/cloudflare'
|
|
6
8
|
|
|
7
|
-
export interface ApiShieldProps extends
|
|
8
|
-
export interface ApiShieldSchemaProps extends
|
|
9
|
-
export interface ApiShieldSchemaValidationSettingsProps extends
|
|
10
|
-
export interface ApiShieldOperationProps extends
|
|
11
|
-
export interface ApiShieldOperationSchemaValidationSettingsProps extends
|
|
9
|
+
export interface ApiShieldProps extends ApiShieldArgs {}
|
|
10
|
+
export interface ApiShieldSchemaProps extends ApiShieldSchemaArgs {}
|
|
11
|
+
export interface ApiShieldSchemaValidationSettingsProps extends ApiShieldSchemaValidationSettingsArgs {}
|
|
12
|
+
export interface ApiShieldOperationProps extends ApiShieldOperationArgs {}
|
|
13
|
+
export interface ApiShieldOperationSchemaValidationSettingsProps extends ApiShieldOperationSchemaValidationSettingsArgs {}
|