@gradientedge/cdk-utils 9.52.3 → 9.53.1
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/construct/pages-static-site/main.d.ts +7 -7
- package/dist/src/lib/cloudflare/construct/pages-static-site/main.js +9 -6
- package/dist/src/lib/cloudflare/construct/pages-static-site/types.d.ts +2 -2
- package/dist/src/lib/cloudflare/construct/worker-site/main.d.ts +5 -5
- package/dist/src/lib/cloudflare/construct/worker-site/main.js +8 -9
- package/dist/src/lib/cloudflare/construct/worker-site/types.d.ts +2 -2
- package/dist/src/lib/cloudflare/services/access/main.d.ts +34 -34
- package/dist/src/lib/cloudflare/services/access/main.js +42 -50
- package/dist/src/lib/cloudflare/services/access/types.d.ts +20 -20
- package/dist/src/lib/cloudflare/services/api-shield/main.js +1 -1
- package/dist/src/lib/cloudflare/services/argo/main.d.ts +13 -4
- package/dist/src/lib/cloudflare/services/argo/main.js +29 -7
- package/dist/src/lib/cloudflare/services/argo/types.d.ts +5 -2
- package/dist/src/lib/cloudflare/services/page/main.js +1 -1
- package/dist/src/lib/cloudflare/services/record/main.d.ts +4 -4
- package/dist/src/lib/cloudflare/services/record/main.js +3 -3
- package/dist/src/lib/cloudflare/services/record/types.d.ts +2 -2
- package/dist/src/lib/cloudflare/services/worker/main.d.ts +12 -12
- package/dist/src/lib/cloudflare/services/worker/main.js +14 -14
- package/dist/src/lib/cloudflare/services/worker/types.d.ts +8 -8
- package/dist/src/lib/cloudflare/services/zone/main.d.ts +15 -6
- package/dist/src/lib/cloudflare/services/zone/main.js +39 -15
- package/dist/src/lib/cloudflare/services/zone/types.d.ts +7 -3
- package/package.json +2 -2
- package/src/lib/cloudflare/construct/pages-static-site/main.ts +20 -13
- package/src/lib/cloudflare/construct/pages-static-site/types.ts +2 -2
- package/src/lib/cloudflare/construct/worker-site/main.ts +12 -19
- package/src/lib/cloudflare/construct/worker-site/types.ts +2 -8
- package/src/lib/cloudflare/services/access/main.ts +73 -72
- package/src/lib/cloudflare/services/access/types.ts +20 -20
- package/src/lib/cloudflare/services/api-shield/main.ts +1 -1
- package/src/lib/cloudflare/services/argo/main.ts +35 -8
- package/src/lib/cloudflare/services/argo/types.ts +4 -2
- package/src/lib/cloudflare/services/page/main.ts +1 -1
- package/src/lib/cloudflare/services/record/main.ts +5 -5
- package/src/lib/cloudflare/services/record/types.ts +2 -2
- package/src/lib/cloudflare/services/worker/main.ts +14 -14
- package/src/lib/cloudflare/services/worker/types.ts +8 -8
- package/src/lib/cloudflare/services/zone/main.ts +43 -16
- package/src/lib/cloudflare/services/zone/types.ts +6 -3
|
@@ -4,8 +4,12 @@ import { DataAzurermKeyVault } from '@cdktf/provider-azurerm/lib/data-azurerm-ke
|
|
|
4
4
|
import { DataAzurermKeyVaultSecret } from '@cdktf/provider-azurerm/lib/data-azurerm-key-vault-secret'
|
|
5
5
|
import { DataCloudflareZone } from '@cdktf/provider-cloudflare/lib/data-cloudflare-zone'
|
|
6
6
|
import { PagesDomain } from '@cdktf/provider-cloudflare/lib/pages-domain'
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import {
|
|
8
|
+
PagesProject,
|
|
9
|
+
PagesProjectDeploymentConfigsPreviewEnvVars,
|
|
10
|
+
PagesProjectDeploymentConfigsProductionEnvVars,
|
|
11
|
+
} from '@cdktf/provider-cloudflare/lib/pages-project'
|
|
12
|
+
import { DnsRecord } from '@cdktf/provider-cloudflare/lib/dns-record'
|
|
9
13
|
import { Zone } from '@cdktf/provider-cloudflare/lib/zone'
|
|
10
14
|
import { Fn } from 'cdktf'
|
|
11
15
|
import { Construct } from 'constructs'
|
|
@@ -31,14 +35,14 @@ export class CloudflarePagesStaticSite extends CommonCloudflareConstruct {
|
|
|
31
35
|
declare props: CloudflarePagesStaticSiteProps
|
|
32
36
|
|
|
33
37
|
/* static site resources */
|
|
34
|
-
sitePagesCnameRecord:
|
|
38
|
+
sitePagesCnameRecord: DnsRecord
|
|
35
39
|
sitePagesDomain: PagesDomain
|
|
36
40
|
sitePagesProject: PagesProject
|
|
37
41
|
siteZone: DataCloudflareZone | Zone
|
|
38
|
-
sitePagesEnvironmentVariables: { [key: string]:
|
|
39
|
-
sitePagesPreviewEnvironmentVariables: { [key: string]:
|
|
40
|
-
sitePagesSecrets: { [key: string]:
|
|
41
|
-
sitePagesPreviewSecrets: { [key: string]:
|
|
42
|
+
sitePagesEnvironmentVariables: { [key: string]: PagesProjectDeploymentConfigsProductionEnvVars }
|
|
43
|
+
sitePagesPreviewEnvironmentVariables: { [key: string]: PagesProjectDeploymentConfigsPreviewEnvVars }
|
|
44
|
+
sitePagesSecrets: { [key: string]: PagesProjectDeploymentConfigsProductionEnvVars }
|
|
45
|
+
sitePagesPreviewSecrets: { [key: string]: PagesProjectDeploymentConfigsPreviewEnvVars }
|
|
42
46
|
siteDeploymentDependsOn: any
|
|
43
47
|
|
|
44
48
|
constructor(parent: Construct, id: string, props: CloudflarePagesStaticSiteProps) {
|
|
@@ -79,10 +83,10 @@ export class CloudflarePagesStaticSite extends CommonCloudflareConstruct {
|
|
|
79
83
|
...this.props.sitePagesProject,
|
|
80
84
|
deploymentConfigs: {
|
|
81
85
|
preview: {
|
|
82
|
-
|
|
86
|
+
envVars: this.sitePagesPreviewSecrets,
|
|
83
87
|
},
|
|
84
88
|
production: {
|
|
85
|
-
|
|
89
|
+
envVars: this.sitePagesSecrets,
|
|
86
90
|
},
|
|
87
91
|
},
|
|
88
92
|
}
|
|
@@ -96,10 +100,10 @@ export class CloudflarePagesStaticSite extends CommonCloudflareConstruct {
|
|
|
96
100
|
...this.props.sitePagesProject,
|
|
97
101
|
deploymentConfigs: {
|
|
98
102
|
preview: {
|
|
99
|
-
|
|
103
|
+
envVars: this.sitePagesPreviewEnvironmentVariables,
|
|
100
104
|
},
|
|
101
105
|
production: {
|
|
102
|
-
|
|
106
|
+
envVars: this.sitePagesEnvironmentVariables,
|
|
103
107
|
},
|
|
104
108
|
},
|
|
105
109
|
}
|
|
@@ -170,7 +174,7 @@ export class CloudflarePagesStaticSite extends CommonCloudflareConstruct {
|
|
|
170
174
|
protected createDomain() {
|
|
171
175
|
this.sitePagesDomain = this.pageManager.createPagesDomain(`${this.id}-site-domain`, this, {
|
|
172
176
|
accountId: this.props.accountId,
|
|
173
|
-
|
|
177
|
+
name: `${this.props.siteSubDomain}.${this.props.domainName}`,
|
|
174
178
|
projectName: this.sitePagesProject.name,
|
|
175
179
|
})
|
|
176
180
|
}
|
|
@@ -182,7 +186,10 @@ export class CloudflarePagesStaticSite extends CommonCloudflareConstruct {
|
|
|
182
186
|
this.sitePagesCnameRecord = this.recordManager.createRecord(`${this.id}-site-record`, this, {
|
|
183
187
|
...this.props.siteCnameRecord,
|
|
184
188
|
name: this.props.siteSubDomain,
|
|
185
|
-
|
|
189
|
+
data: {
|
|
190
|
+
...this.props.siteCnameRecord.data,
|
|
191
|
+
value: `${this.sitePagesProject.name}.pages.dev`,
|
|
192
|
+
},
|
|
186
193
|
})
|
|
187
194
|
}
|
|
188
195
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CommonCloudflareStackProps } from '../../common'
|
|
2
|
-
import { PagesProjectProps,
|
|
2
|
+
import { PagesProjectProps, DnsRecordProps, ZoneProps } from '../../services'
|
|
3
3
|
|
|
4
4
|
export interface CloudflarePagesStaticSiteProps extends CommonCloudflareStackProps {
|
|
5
5
|
siteAssetDir: string
|
|
6
6
|
siteBranch?: string
|
|
7
|
-
siteCnameRecord:
|
|
7
|
+
siteCnameRecord: DnsRecordProps
|
|
8
8
|
siteDeployMessage: string
|
|
9
9
|
sitePagesProject: PagesProjectProps
|
|
10
10
|
siteSubDomain: string
|
|
@@ -3,11 +3,7 @@ import { DataAwsSecretsmanagerSecretVersion } from '@cdktf/provider-aws/lib/data
|
|
|
3
3
|
import { DataAzurermKeyVault } from '@cdktf/provider-azurerm/lib/data-azurerm-key-vault'
|
|
4
4
|
import { DataAzurermKeyVaultSecret } from '@cdktf/provider-azurerm/lib/data-azurerm-key-vault-secret'
|
|
5
5
|
import { DataCloudflareZone } from '@cdktf/provider-cloudflare/lib/data-cloudflare-zone'
|
|
6
|
-
import {
|
|
7
|
-
WorkerScript,
|
|
8
|
-
WorkerScriptPlainTextBinding,
|
|
9
|
-
WorkerScriptSecretTextBinding,
|
|
10
|
-
} from '@cdktf/provider-cloudflare/lib/worker-script'
|
|
6
|
+
import { WorkersScript, WorkersScriptBindings } from '@cdktf/provider-cloudflare/lib/workers-script'
|
|
11
7
|
import { Zone } from '@cdktf/provider-cloudflare/lib/zone'
|
|
12
8
|
import { Fn, TerraformAsset, AssetType } from 'cdktf'
|
|
13
9
|
import { Construct } from 'constructs'
|
|
@@ -34,9 +30,9 @@ export class CloudflareWorkerSite extends CommonCloudflareConstruct {
|
|
|
34
30
|
|
|
35
31
|
/* worker site resources */
|
|
36
32
|
siteZone: DataCloudflareZone | Zone
|
|
37
|
-
siteWorkerScript:
|
|
38
|
-
workerPlainTextBindingEnvironmentVariables:
|
|
39
|
-
workerSecretTextBindingEnvironmentVariables:
|
|
33
|
+
siteWorkerScript: WorkersScript
|
|
34
|
+
workerPlainTextBindingEnvironmentVariables: WorkersScriptBindings[] = []
|
|
35
|
+
workerSecretTextBindingEnvironmentVariables: WorkersScriptBindings[] = []
|
|
40
36
|
|
|
41
37
|
constructor(parent: Construct, id: string, props: CloudflareWorkerSiteProps) {
|
|
42
38
|
super(parent, id, props)
|
|
@@ -53,7 +49,7 @@ export class CloudflareWorkerSite extends CommonCloudflareConstruct {
|
|
|
53
49
|
this.createWorker()
|
|
54
50
|
this.createWorkerDomain()
|
|
55
51
|
this.createRuleset()
|
|
56
|
-
this.
|
|
52
|
+
this.createZoneSetting()
|
|
57
53
|
}
|
|
58
54
|
|
|
59
55
|
/**
|
|
@@ -73,8 +69,9 @@ export class CloudflareWorkerSite extends CommonCloudflareConstruct {
|
|
|
73
69
|
protected resolveEnvironmentVariables() {
|
|
74
70
|
this.props.siteWorkerScript = {
|
|
75
71
|
...this.props.siteWorkerScript,
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
bindings: this.workerPlainTextBindingEnvironmentVariables.concat(
|
|
73
|
+
this.workerSecretTextBindingEnvironmentVariables
|
|
74
|
+
),
|
|
78
75
|
}
|
|
79
76
|
}
|
|
80
77
|
|
|
@@ -100,7 +97,7 @@ export class CloudflareWorkerSite extends CommonCloudflareConstruct {
|
|
|
100
97
|
this.workerManager.createWorkerDomain(`${this.id}-worker-domain`, this, {
|
|
101
98
|
...this.props.siteWorkerDomain,
|
|
102
99
|
hostname: `${this.props.siteSubDomain}.${this.props.domainName}`,
|
|
103
|
-
service: this.siteWorkerScript.
|
|
100
|
+
service: this.siteWorkerScript.scriptName,
|
|
104
101
|
})
|
|
105
102
|
}
|
|
106
103
|
|
|
@@ -168,12 +165,8 @@ export class CloudflareWorkerSite extends CommonCloudflareConstruct {
|
|
|
168
165
|
/**
|
|
169
166
|
* @summary Create zone settings override
|
|
170
167
|
*/
|
|
171
|
-
protected
|
|
172
|
-
if (!this.props.
|
|
173
|
-
this.zoneManager.
|
|
174
|
-
`${this.id}-zone-settings-override`,
|
|
175
|
-
this,
|
|
176
|
-
this.props.siteZoneSettingsOverride
|
|
177
|
-
)
|
|
168
|
+
protected createZoneSetting() {
|
|
169
|
+
if (!this.props.siteZoneSetting) return
|
|
170
|
+
this.zoneManager.createZoneSetting(`${this.id}-zone-setting`, this, this.props.siteZoneSetting)
|
|
178
171
|
}
|
|
179
172
|
}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { CommonCloudflareStackProps } from '../../common'
|
|
2
|
-
import {
|
|
3
|
-
WorkerDomainProps,
|
|
4
|
-
WorkerScriptProps,
|
|
5
|
-
RulesetProps,
|
|
6
|
-
ZoneProps,
|
|
7
|
-
ZoneSettingsOverrideProps,
|
|
8
|
-
} from '../../services'
|
|
2
|
+
import { WorkerDomainProps, WorkerScriptProps, RulesetProps, ZoneProps, ZoneSettingProps } from '../../services'
|
|
9
3
|
|
|
10
4
|
export interface CloudflareWorkerSiteProps extends CommonCloudflareStackProps {
|
|
11
5
|
siteSubDomain: string
|
|
@@ -14,5 +8,5 @@ export interface CloudflareWorkerSiteProps extends CommonCloudflareStackProps {
|
|
|
14
8
|
siteWorkerDomain: WorkerDomainProps
|
|
15
9
|
siteWorkerAsset: string
|
|
16
10
|
siteRuleSet: RulesetProps
|
|
17
|
-
|
|
11
|
+
siteZoneSetting: ZoneSettingProps
|
|
18
12
|
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { ZeroTrustAccessApplication } from '@cdktf/provider-cloudflare/lib/zero-trust-access-application'
|
|
2
|
+
import { ZeroTrustAccessShortLivedCertificate } from '@cdktf/provider-cloudflare/lib/zero-trust-access-short-lived-certificate'
|
|
3
|
+
import { ZeroTrustAccessCustomPage } from '@cdktf/provider-cloudflare/lib/zero-trust-access-custom-page'
|
|
4
|
+
import { ZeroTrustAccessGroup } from '@cdktf/provider-cloudflare/lib/zero-trust-access-group'
|
|
5
|
+
import { ZeroTrustAccessIdentityProvider } from '@cdktf/provider-cloudflare/lib/zero-trust-access-identity-provider'
|
|
6
|
+
import { ZeroTrustAccessMtlsCertificate } from '@cdktf/provider-cloudflare/lib/zero-trust-access-mtls-certificate'
|
|
7
|
+
import { ZeroTrustOrganization } from '@cdktf/provider-cloudflare/lib/zero-trust-organization'
|
|
8
|
+
import { ZeroTrustAccessPolicy } from '@cdktf/provider-cloudflare/lib/zero-trust-access-policy'
|
|
9
|
+
import { AccessRule } from '@cdktf/provider-cloudflare/lib/access-rule'
|
|
10
|
+
import { ZeroTrustAccessServiceToken } from '@cdktf/provider-cloudflare/lib/zero-trust-access-service-token'
|
|
11
|
+
import { ZeroTrustAccessTag } from '@cdktf/provider-cloudflare/lib/zero-trust-access-tag'
|
|
7
12
|
import { CommonCloudflareConstruct } from '../../common'
|
|
8
13
|
import { createCloudflareTfOutput } from '../../utils'
|
|
9
14
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
ZeroTrustAccessApplicationProps,
|
|
16
|
+
ZeroTrustAccessShortLivedCertificateProps,
|
|
17
|
+
ZeroTrustAccessCustomPageProps,
|
|
18
|
+
ZeroTrustAccessGroupProps,
|
|
19
|
+
ZeroTrustAccessIdentityProviderProps,
|
|
20
|
+
ZeroTrustAccessMtlsCertificateProps,
|
|
21
|
+
ZeroTrustOrganizationProps,
|
|
22
|
+
ZeroTrustAccessPolicyProps,
|
|
18
23
|
AccessRuleProps,
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
ZeroTrustAccessServiceTokenProps,
|
|
25
|
+
ZeroTrustAccessTagProps,
|
|
21
26
|
} from './types'
|
|
22
|
-
import { AccessOrganization } from '@cdktf/provider-cloudflare/lib/access-organization'
|
|
23
|
-
import { AccessPolicy } from '@cdktf/provider-cloudflare/lib/access-policy'
|
|
24
|
-
import { AccessRule } from '@cdktf/provider-cloudflare/lib/access-rule'
|
|
25
|
-
import { AccessServiceToken } from '@cdktf/provider-cloudflare/lib/access-service-token'
|
|
26
|
-
import { AccessTag } from '@cdktf/provider-cloudflare/lib/access-tag'
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* @classdesc Provides operations on Cloudflare Access
|
|
@@ -48,16 +48,16 @@ export class CloudflareAccessManager {
|
|
|
48
48
|
* @param id scoped id of the resource
|
|
49
49
|
* @param scope scope in which this resource is defined
|
|
50
50
|
* @param props access application properties
|
|
51
|
-
* @see [CDKTF Access Application Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/
|
|
51
|
+
* @see [CDKTF Access Application Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessApplication.typescript.md}
|
|
52
52
|
*/
|
|
53
|
-
public createAccessApplication(id: string, scope: CommonCloudflareConstruct, props:
|
|
53
|
+
public createAccessApplication(id: string, scope: CommonCloudflareConstruct, props: ZeroTrustAccessApplicationProps) {
|
|
54
54
|
if (!props) throw `Props undefined for ${id}`
|
|
55
55
|
|
|
56
56
|
const zoneId = props.zoneId
|
|
57
57
|
? props.zoneId
|
|
58
58
|
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
59
59
|
|
|
60
|
-
const accessApplication = new
|
|
60
|
+
const accessApplication = new ZeroTrustAccessApplication(scope, `${id}`, {
|
|
61
61
|
...props,
|
|
62
62
|
domain: `${props.domain}-${scope.props.domainName}`,
|
|
63
63
|
name: `${props.name}-${scope.props.stage}`,
|
|
@@ -71,28 +71,36 @@ export class CloudflareAccessManager {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
|
-
* @summary Method to create a new Cloudflare Application Access
|
|
74
|
+
* @summary Method to create a new Cloudflare Application Access Short Lived Certificate
|
|
75
75
|
* @param id scoped id of the resource
|
|
76
76
|
* @param scope scope in which this resource is defined
|
|
77
|
-
* @param props access
|
|
78
|
-
* @see [CDKTF Access
|
|
77
|
+
* @param props access short lived certificate properties
|
|
78
|
+
* @see [CDKTF Access Short Lived Certificate Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessShortLivedCertificate.typescript.md}
|
|
79
79
|
*/
|
|
80
|
-
public
|
|
80
|
+
public createAccessShortLivedCertificate(
|
|
81
|
+
id: string,
|
|
82
|
+
scope: CommonCloudflareConstruct,
|
|
83
|
+
props: ZeroTrustAccessShortLivedCertificateProps
|
|
84
|
+
) {
|
|
81
85
|
if (!props) throw `Props undefined for ${id}`
|
|
82
86
|
|
|
83
87
|
const zoneId = props.zoneId
|
|
84
88
|
? props.zoneId
|
|
85
89
|
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
86
90
|
|
|
87
|
-
const
|
|
91
|
+
const accessShortLivedCertificate = new ZeroTrustAccessShortLivedCertificate(scope, `${id}`, {
|
|
88
92
|
...props,
|
|
89
93
|
zoneId,
|
|
90
94
|
})
|
|
91
95
|
|
|
92
|
-
createCloudflareTfOutput(
|
|
93
|
-
|
|
96
|
+
createCloudflareTfOutput(
|
|
97
|
+
`${id}-accessShortLivedCertificateFriendlyUniqueId`,
|
|
98
|
+
scope,
|
|
99
|
+
accessShortLivedCertificate.friendlyUniqueId
|
|
100
|
+
)
|
|
101
|
+
createCloudflareTfOutput(`${id}-accessShortLivedCertificateId`, scope, accessShortLivedCertificate.id)
|
|
94
102
|
|
|
95
|
-
return
|
|
103
|
+
return accessShortLivedCertificate
|
|
96
104
|
}
|
|
97
105
|
|
|
98
106
|
/**
|
|
@@ -100,19 +108,15 @@ export class CloudflareAccessManager {
|
|
|
100
108
|
* @param id scoped id of the resource
|
|
101
109
|
* @param scope scope in which this resource is defined
|
|
102
110
|
* @param props access custom page properties
|
|
103
|
-
* @see [CDKTF Access Custom Page Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/
|
|
111
|
+
* @see [CDKTF Access Custom Page Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessCustomPage.typescript.md}
|
|
104
112
|
*/
|
|
105
|
-
public createAccessCustomPage(id: string, scope: CommonCloudflareConstruct, props:
|
|
113
|
+
public createAccessCustomPage(id: string, scope: CommonCloudflareConstruct, props: ZeroTrustAccessCustomPageProps) {
|
|
106
114
|
if (!props) throw `Props undefined for ${id}`
|
|
107
115
|
|
|
108
|
-
const
|
|
109
|
-
? props.zoneId
|
|
110
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
111
|
-
|
|
112
|
-
const accessCustomPage = new AccessCustomPage(scope, `${id}`, {
|
|
116
|
+
const accessCustomPage = new ZeroTrustAccessCustomPage(scope, `${id}`, {
|
|
113
117
|
...props,
|
|
118
|
+
accountId: props.accountId ?? scope.props.accountId,
|
|
114
119
|
name: `${props.name}-${scope.props.stage}`,
|
|
115
|
-
zoneId,
|
|
116
120
|
})
|
|
117
121
|
|
|
118
122
|
createCloudflareTfOutput(`${id}-accessCustomPageFriendlyUniqueId`, scope, accessCustomPage.friendlyUniqueId)
|
|
@@ -126,16 +130,16 @@ export class CloudflareAccessManager {
|
|
|
126
130
|
* @param id scoped id of the resource
|
|
127
131
|
* @param scope scope in which this resource is defined
|
|
128
132
|
* @param props access group properties
|
|
129
|
-
* @see [CDKTF Access Group Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/
|
|
133
|
+
* @see [CDKTF Access Group Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessGroup.typescript.md}
|
|
130
134
|
*/
|
|
131
|
-
public createAccessGroup(id: string, scope: CommonCloudflareConstruct, props:
|
|
135
|
+
public createAccessGroup(id: string, scope: CommonCloudflareConstruct, props: ZeroTrustAccessGroupProps) {
|
|
132
136
|
if (!props) throw `Props undefined for ${id}`
|
|
133
137
|
|
|
134
138
|
const zoneId = props.zoneId
|
|
135
139
|
? props.zoneId
|
|
136
140
|
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
137
141
|
|
|
138
|
-
const accessGroup = new
|
|
142
|
+
const accessGroup = new ZeroTrustAccessGroup(scope, `${id}`, {
|
|
139
143
|
...props,
|
|
140
144
|
name: `${props.name}-${scope.props.stage}`,
|
|
141
145
|
zoneId,
|
|
@@ -152,12 +156,12 @@ export class CloudflareAccessManager {
|
|
|
152
156
|
* @param id scoped id of the resource
|
|
153
157
|
* @param scope scope in which this resource is defined
|
|
154
158
|
* @param props access identity provider properties
|
|
155
|
-
* @see [CDKTF Access Identity Provider Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/
|
|
159
|
+
* @see [CDKTF Access Identity Provider Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessIdentityProvider.typescript.md}
|
|
156
160
|
*/
|
|
157
161
|
public createAccessIdentityProvider(
|
|
158
162
|
id: string,
|
|
159
163
|
scope: CommonCloudflareConstruct,
|
|
160
|
-
props:
|
|
164
|
+
props: ZeroTrustAccessIdentityProviderProps
|
|
161
165
|
) {
|
|
162
166
|
if (!props) throw `Props undefined for ${id}`
|
|
163
167
|
|
|
@@ -165,7 +169,7 @@ export class CloudflareAccessManager {
|
|
|
165
169
|
? props.zoneId
|
|
166
170
|
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
167
171
|
|
|
168
|
-
const accessIdentityProvider = new
|
|
172
|
+
const accessIdentityProvider = new ZeroTrustAccessIdentityProvider(scope, `${id}`, {
|
|
169
173
|
...props,
|
|
170
174
|
name: `${props.name}-${scope.props.stage}`,
|
|
171
175
|
zoneId,
|
|
@@ -186,12 +190,12 @@ export class CloudflareAccessManager {
|
|
|
186
190
|
* @param id scoped id of the resource
|
|
187
191
|
* @param scope scope in which this resource is defined
|
|
188
192
|
* @param props access mutual tls certificate properties
|
|
189
|
-
* @see [CDKTF Access Mutual Tls Certificate Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/
|
|
193
|
+
* @see [CDKTF Access Mutual Tls Certificate Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessMtlsCertificate.typescript.md}
|
|
190
194
|
*/
|
|
191
195
|
public createAccessMutualTlsCertificate(
|
|
192
196
|
id: string,
|
|
193
197
|
scope: CommonCloudflareConstruct,
|
|
194
|
-
props:
|
|
198
|
+
props: ZeroTrustAccessMtlsCertificateProps
|
|
195
199
|
) {
|
|
196
200
|
if (!props) throw `Props undefined for ${id}`
|
|
197
201
|
|
|
@@ -199,7 +203,7 @@ export class CloudflareAccessManager {
|
|
|
199
203
|
? props.zoneId
|
|
200
204
|
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
201
205
|
|
|
202
|
-
const accessMutualTlsCertificate = new
|
|
206
|
+
const accessMutualTlsCertificate = new ZeroTrustAccessMtlsCertificate(scope, `${id}`, {
|
|
203
207
|
...props,
|
|
204
208
|
name: `${props.name}-${scope.props.stage}`,
|
|
205
209
|
zoneId,
|
|
@@ -220,23 +224,22 @@ export class CloudflareAccessManager {
|
|
|
220
224
|
* @param id scoped id of the resource
|
|
221
225
|
* @param scope scope in which this resource is defined
|
|
222
226
|
* @param props access organisation properties
|
|
223
|
-
* @see [CDKTF Access Organisation Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/
|
|
227
|
+
* @see [CDKTF Access Organisation Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessOrganization.typescript.md}
|
|
224
228
|
*/
|
|
225
|
-
public createAccessOrganization(id: string, scope: CommonCloudflareConstruct, props:
|
|
229
|
+
public createAccessOrganization(id: string, scope: CommonCloudflareConstruct, props: ZeroTrustOrganizationProps) {
|
|
226
230
|
if (!props) throw `Props undefined for ${id}`
|
|
227
231
|
|
|
228
232
|
const zoneId = props.zoneId
|
|
229
233
|
? props.zoneId
|
|
230
234
|
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
231
235
|
|
|
232
|
-
const accessOrganization = new
|
|
236
|
+
const accessOrganization = new ZeroTrustOrganization(scope, `${id}`, {
|
|
233
237
|
...props,
|
|
234
238
|
name: `${props.name}-${scope.props.stage}`,
|
|
235
239
|
zoneId,
|
|
236
240
|
})
|
|
237
241
|
|
|
238
242
|
createCloudflareTfOutput(`${id}-accessOrganizationFriendlyUniqueId`, scope, accessOrganization.friendlyUniqueId)
|
|
239
|
-
createCloudflareTfOutput(`${id}-accessOrganizationId`, scope, accessOrganization.id)
|
|
240
243
|
|
|
241
244
|
return accessOrganization
|
|
242
245
|
}
|
|
@@ -246,19 +249,15 @@ export class CloudflareAccessManager {
|
|
|
246
249
|
* @param id scoped id of the resource
|
|
247
250
|
* @param scope scope in which this resource is defined
|
|
248
251
|
* @param props access policy properties
|
|
249
|
-
* @see [CDKTF Access Policy Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/
|
|
252
|
+
* @see [CDKTF Access Policy Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessPolicy.typescript.md}
|
|
250
253
|
*/
|
|
251
|
-
public createAccessPolicy(id: string, scope: CommonCloudflareConstruct, props:
|
|
254
|
+
public createAccessPolicy(id: string, scope: CommonCloudflareConstruct, props: ZeroTrustAccessPolicyProps) {
|
|
252
255
|
if (!props) throw `Props undefined for ${id}`
|
|
253
256
|
|
|
254
|
-
const
|
|
255
|
-
? props.zoneId
|
|
256
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
257
|
-
|
|
258
|
-
const accessPolicy = new AccessPolicy(scope, `${id}`, {
|
|
257
|
+
const accessPolicy = new ZeroTrustAccessPolicy(scope, `${id}`, {
|
|
259
258
|
...props,
|
|
260
259
|
name: `${props.name}-${scope.props.stage}`,
|
|
261
|
-
|
|
260
|
+
accountId: props.accountId ?? scope.props.accountId,
|
|
262
261
|
})
|
|
263
262
|
|
|
264
263
|
createCloudflareTfOutput(`${id}-accessPolicyFriendlyUniqueId`, scope, accessPolicy.friendlyUniqueId)
|
|
@@ -284,6 +283,7 @@ export class CloudflareAccessManager {
|
|
|
284
283
|
const accessRule = new AccessRule(scope, `${id}`, {
|
|
285
284
|
...props,
|
|
286
285
|
zoneId,
|
|
286
|
+
accountId: props.accountId ?? scope.props.accountId,
|
|
287
287
|
})
|
|
288
288
|
|
|
289
289
|
createCloudflareTfOutput(`${id}-accessRuleFriendlyUniqueId`, scope, accessRule.friendlyUniqueId)
|
|
@@ -297,18 +297,23 @@ export class CloudflareAccessManager {
|
|
|
297
297
|
* @param id scoped id of the resource
|
|
298
298
|
* @param scope scope in which this resource is defined
|
|
299
299
|
* @param props access service token properties
|
|
300
|
-
* @see [CDKTF Access Service Token Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/
|
|
300
|
+
* @see [CDKTF Access Service Token Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessServiceToken.typescript.md}
|
|
301
301
|
*/
|
|
302
|
-
public createAccessServiceToken(
|
|
302
|
+
public createAccessServiceToken(
|
|
303
|
+
id: string,
|
|
304
|
+
scope: CommonCloudflareConstruct,
|
|
305
|
+
props: ZeroTrustAccessServiceTokenProps
|
|
306
|
+
) {
|
|
303
307
|
if (!props) throw `Props undefined for ${id}`
|
|
304
308
|
|
|
305
309
|
const zoneId = props.zoneId
|
|
306
310
|
? props.zoneId
|
|
307
311
|
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
308
312
|
|
|
309
|
-
const accessServiceToken = new
|
|
313
|
+
const accessServiceToken = new ZeroTrustAccessServiceToken(scope, `${id}`, {
|
|
310
314
|
...props,
|
|
311
315
|
name: `${props.name}-${scope.props.stage}`,
|
|
316
|
+
accountId: props.accountId ?? scope.props.accountId,
|
|
312
317
|
zoneId,
|
|
313
318
|
})
|
|
314
319
|
|
|
@@ -323,19 +328,15 @@ export class CloudflareAccessManager {
|
|
|
323
328
|
* @param id scoped id of the resource
|
|
324
329
|
* @param scope scope in which this resource is defined
|
|
325
330
|
* @param props access tag properties
|
|
326
|
-
* @see [CDKTF Access Tag Token Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/
|
|
331
|
+
* @see [CDKTF Access Tag Token Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessTag.typescript.md}
|
|
327
332
|
*/
|
|
328
|
-
public createAccessTag(id: string, scope: CommonCloudflareConstruct, props:
|
|
333
|
+
public createAccessTag(id: string, scope: CommonCloudflareConstruct, props: ZeroTrustAccessTagProps) {
|
|
329
334
|
if (!props) throw `Props undefined for ${id}`
|
|
330
335
|
|
|
331
|
-
const
|
|
332
|
-
? props.zoneId
|
|
333
|
-
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
334
|
-
|
|
335
|
-
const accessTag = new AccessTag(scope, `${id}`, {
|
|
336
|
+
const accessTag = new ZeroTrustAccessTag(scope, `${id}`, {
|
|
336
337
|
...props,
|
|
337
338
|
name: `${props.name}-${scope.props.stage}`,
|
|
338
|
-
|
|
339
|
+
accountId: props.accountId ?? scope.props.accountId,
|
|
339
340
|
})
|
|
340
341
|
|
|
341
342
|
createCloudflareTfOutput(`${id}-accessTagFriendlyUniqueId`, scope, accessTag.friendlyUniqueId)
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { ZeroTrustAccessApplicationConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-application'
|
|
2
|
+
import { ZeroTrustAccessShortLivedCertificateConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-short-lived-certificate'
|
|
3
|
+
import { ZeroTrustAccessCustomPageConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-custom-page'
|
|
4
|
+
import { ZeroTrustAccessGroupConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-group'
|
|
5
|
+
import { ZeroTrustAccessIdentityProviderConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-identity-provider'
|
|
6
|
+
import { ZeroTrustAccessMtlsCertificateConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-mtls-certificate'
|
|
7
|
+
import { ZeroTrustOrganizationConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-organization'
|
|
8
|
+
import { ZeroTrustAccessPolicyConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-policy'
|
|
9
9
|
import { AccessRuleConfig } from '@cdktf/provider-cloudflare/lib/access-rule'
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { ZeroTrustAccessServiceTokenConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-service-token'
|
|
11
|
+
import { ZeroTrustAccessTagConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-tag'
|
|
12
12
|
|
|
13
|
-
export interface
|
|
14
|
-
export interface
|
|
15
|
-
export interface
|
|
16
|
-
export interface
|
|
17
|
-
export interface
|
|
18
|
-
export interface
|
|
19
|
-
export interface
|
|
20
|
-
export interface
|
|
13
|
+
export interface ZeroTrustAccessApplicationProps extends ZeroTrustAccessApplicationConfig {}
|
|
14
|
+
export interface ZeroTrustAccessShortLivedCertificateProps extends ZeroTrustAccessShortLivedCertificateConfig {}
|
|
15
|
+
export interface ZeroTrustAccessCustomPageProps extends ZeroTrustAccessCustomPageConfig {}
|
|
16
|
+
export interface ZeroTrustAccessGroupProps extends ZeroTrustAccessGroupConfig {}
|
|
17
|
+
export interface ZeroTrustAccessIdentityProviderProps extends ZeroTrustAccessIdentityProviderConfig {}
|
|
18
|
+
export interface ZeroTrustAccessMtlsCertificateProps extends ZeroTrustAccessMtlsCertificateConfig {}
|
|
19
|
+
export interface ZeroTrustOrganizationProps extends ZeroTrustOrganizationConfig {}
|
|
20
|
+
export interface ZeroTrustAccessPolicyProps extends ZeroTrustAccessPolicyConfig {}
|
|
21
21
|
export interface AccessRuleProps extends AccessRuleConfig {}
|
|
22
|
-
export interface
|
|
23
|
-
export interface
|
|
22
|
+
export interface ZeroTrustAccessServiceTokenProps extends ZeroTrustAccessServiceTokenConfig {}
|
|
23
|
+
export interface ZeroTrustAccessTagProps extends ZeroTrustAccessTagConfig {}
|
|
@@ -77,7 +77,7 @@ export class CloudflareApiShieldManager {
|
|
|
77
77
|
})
|
|
78
78
|
|
|
79
79
|
createCloudflareTfOutput(`${id}-apiShieldSchemaFriendlyUniqueId`, scope, apiShieldSchema.friendlyUniqueId)
|
|
80
|
-
createCloudflareTfOutput(`${id}-apiShieldSchemaId`, scope, apiShieldSchema.
|
|
80
|
+
createCloudflareTfOutput(`${id}-apiShieldSchemaId`, scope, apiShieldSchema.schemaId)
|
|
81
81
|
|
|
82
82
|
return apiShieldSchema
|
|
83
83
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArgoSmartRouting } from '@cdktf/provider-cloudflare/lib/argo-smart-routing'
|
|
2
|
+
import { ArgoTieredCaching } from '@cdktf/provider-cloudflare/lib/argo-tiered-caching'
|
|
2
3
|
import { CommonCloudflareConstruct } from '../../common'
|
|
3
4
|
import { createCloudflareTfOutput } from '../../utils'
|
|
4
|
-
import {
|
|
5
|
+
import { ArgoSmartRoutingProps, ArgoTieredCachingProps } from './types'
|
|
6
|
+
import { argoTieredCaching } from '@cdktf/provider-cloudflare'
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* @classdesc Provides operations on Cloudflare Argo
|
|
@@ -26,23 +28,48 @@ export class CloudflareArgoManager {
|
|
|
26
28
|
* @param id scoped id of the resource
|
|
27
29
|
* @param scope scope in which this resource is defined
|
|
28
30
|
* @param props argo properties
|
|
29
|
-
* @see [CDKTF Argo Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/
|
|
31
|
+
* @see [CDKTF Argo Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/argoSmartRouting.typescript.md}
|
|
30
32
|
*/
|
|
31
|
-
public
|
|
33
|
+
public createArgoSmartRouting(id: string, scope: CommonCloudflareConstruct, props: ArgoSmartRoutingProps) {
|
|
32
34
|
if (!props) throw `Props undefined for ${id}`
|
|
33
35
|
|
|
34
36
|
const zoneId = props.zoneId
|
|
35
37
|
? props.zoneId
|
|
36
38
|
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
37
39
|
|
|
38
|
-
const
|
|
40
|
+
const argoSmartRouting = new ArgoSmartRouting(scope, `${id}`, {
|
|
39
41
|
...props,
|
|
40
42
|
zoneId,
|
|
41
43
|
})
|
|
42
44
|
|
|
43
|
-
createCloudflareTfOutput(`${id}-
|
|
44
|
-
createCloudflareTfOutput(`${id}-
|
|
45
|
+
createCloudflareTfOutput(`${id}-argoSmartRoutingFriendlyUniqueId`, scope, argoSmartRouting.friendlyUniqueId)
|
|
46
|
+
createCloudflareTfOutput(`${id}-argoSmartRoutingId`, scope, argoSmartRouting.id)
|
|
45
47
|
|
|
46
|
-
return
|
|
48
|
+
return argoSmartRouting
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @summary Method to create a new Cloudflare Argo
|
|
53
|
+
* @param id scoped id of the resource
|
|
54
|
+
* @param scope scope in which this resource is defined
|
|
55
|
+
* @param props argo properties
|
|
56
|
+
* @see [CDKTF Argo Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/argoTieredCaching.typescript.md}
|
|
57
|
+
*/
|
|
58
|
+
public createArgoTieredCaching(id: string, scope: CommonCloudflareConstruct, props: ArgoTieredCachingProps) {
|
|
59
|
+
if (!props) throw `Props undefined for ${id}`
|
|
60
|
+
|
|
61
|
+
const zoneId = props.zoneId
|
|
62
|
+
? props.zoneId
|
|
63
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
64
|
+
|
|
65
|
+
const argoTieredCaching = new ArgoTieredCaching(scope, `${id}`, {
|
|
66
|
+
...props,
|
|
67
|
+
zoneId,
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
createCloudflareTfOutput(`${id}-argoTieredCachingFriendlyUniqueId`, scope, argoTieredCaching.friendlyUniqueId)
|
|
71
|
+
createCloudflareTfOutput(`${id}-argoTieredCachingId`, scope, argoTieredCaching.id)
|
|
72
|
+
|
|
73
|
+
return argoTieredCaching
|
|
47
74
|
}
|
|
48
75
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArgoSmartRoutingConfig } from '@cdktf/provider-cloudflare/lib/argo-smart-routing'
|
|
2
|
+
import { ArgoTieredCachingConfig } from '@cdktf/provider-cloudflare/lib/argo-tiered-caching'
|
|
2
3
|
|
|
3
|
-
export interface
|
|
4
|
+
export interface ArgoSmartRoutingProps extends ArgoSmartRoutingConfig {}
|
|
5
|
+
export interface ArgoTieredCachingProps extends ArgoTieredCachingConfig {}
|
|
@@ -59,7 +59,7 @@ export class CloudflarePageManager {
|
|
|
59
59
|
const pagesDomain = new PagesDomain(scope, `${id}`, {
|
|
60
60
|
...props,
|
|
61
61
|
accountId: props.accountId ?? scope.props.accountId,
|
|
62
|
-
|
|
62
|
+
name: props.name ?? scope.props.domainName,
|
|
63
63
|
})
|
|
64
64
|
|
|
65
65
|
createCloudflareTfOutput(`${id}-pagesDomainFriendlyUniqueId`, scope, pagesDomain.friendlyUniqueId)
|