@gradientedge/cdk-utils 9.88.0 → 10.0.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.
Files changed (87) hide show
  1. package/dist/src/lib/azure/services/api-management/main.d.ts +2 -2
  2. package/dist/src/lib/azure/services/api-management/main.js +1 -1
  3. package/dist/src/lib/azure/services/redis/main.d.ts +5 -5
  4. package/dist/src/lib/azure/services/redis/main.js +10 -10
  5. package/dist/src/lib/azure/services/redis/types.d.ts +2 -2
  6. package/dist/src/lib/cloudflare/common/construct.d.ts +7 -19
  7. package/dist/src/lib/cloudflare/common/construct.js +12 -66
  8. package/dist/src/lib/cloudflare/common/index.d.ts +0 -1
  9. package/dist/src/lib/cloudflare/common/index.js +0 -1
  10. package/dist/src/lib/cloudflare/common/stack.d.ts +11 -21
  11. package/dist/src/lib/cloudflare/common/stack.js +55 -62
  12. package/dist/src/lib/cloudflare/common/types.d.ts +2 -14
  13. package/dist/src/lib/cloudflare/construct/pages-static-site/main.d.ts +8 -10
  14. package/dist/src/lib/cloudflare/construct/pages-static-site/main.js +18 -25
  15. package/dist/src/lib/cloudflare/construct/worker-site/main.d.ts +13 -10
  16. package/dist/src/lib/cloudflare/construct/worker-site/main.js +29 -41
  17. package/dist/src/lib/cloudflare/index.d.ts +0 -1
  18. package/dist/src/lib/cloudflare/index.js +0 -1
  19. package/dist/src/lib/cloudflare/services/access/main.d.ts +31 -43
  20. package/dist/src/lib/cloudflare/services/access/main.js +56 -83
  21. package/dist/src/lib/cloudflare/services/access/types.d.ts +12 -22
  22. package/dist/src/lib/cloudflare/services/api-shield/main.d.ts +10 -15
  23. package/dist/src/lib/cloudflare/services/api-shield/main.js +16 -36
  24. package/dist/src/lib/cloudflare/services/api-shield/types.d.ts +6 -10
  25. package/dist/src/lib/cloudflare/services/argo/main.d.ts +6 -8
  26. package/dist/src/lib/cloudflare/services/argo/main.js +9 -17
  27. package/dist/src/lib/cloudflare/services/argo/types.d.ts +3 -4
  28. package/dist/src/lib/cloudflare/services/filter/main.d.ts +3 -4
  29. package/dist/src/lib/cloudflare/services/filter/main.js +6 -10
  30. package/dist/src/lib/cloudflare/services/filter/types.d.ts +2 -2
  31. package/dist/src/lib/cloudflare/services/firewall/main.d.ts +2 -3
  32. package/dist/src/lib/cloudflare/services/firewall/main.js +4 -8
  33. package/dist/src/lib/cloudflare/services/firewall/types.d.ts +2 -2
  34. package/dist/src/lib/cloudflare/services/page/main.d.ts +7 -11
  35. package/dist/src/lib/cloudflare/services/page/main.js +13 -26
  36. package/dist/src/lib/cloudflare/services/page/types.d.ts +4 -6
  37. package/dist/src/lib/cloudflare/services/record/main.d.ts +2 -3
  38. package/dist/src/lib/cloudflare/services/record/main.js +4 -8
  39. package/dist/src/lib/cloudflare/services/record/types.d.ts +2 -2
  40. package/dist/src/lib/cloudflare/services/rule-set/main.d.ts +5 -6
  41. package/dist/src/lib/cloudflare/services/rule-set/main.js +7 -10
  42. package/dist/src/lib/cloudflare/services/rule-set/types.d.ts +2 -2
  43. package/dist/src/lib/cloudflare/services/worker/main.d.ts +12 -18
  44. package/dist/src/lib/cloudflare/services/worker/main.js +15 -39
  45. package/dist/src/lib/cloudflare/services/worker/types.d.ts +7 -12
  46. package/dist/src/lib/cloudflare/services/zone/main.d.ts +13 -30
  47. package/dist/src/lib/cloudflare/services/zone/main.js +31 -84
  48. package/dist/src/lib/cloudflare/services/zone/types.d.ts +10 -20
  49. package/dist/src/lib/common/types.d.ts +4 -0
  50. package/package.json +7 -1
  51. package/src/lib/azure/services/api-management/main.ts +3 -3
  52. package/src/lib/azure/services/redis/main.ts +11 -11
  53. package/src/lib/azure/services/redis/types.ts +2 -2
  54. package/src/lib/cloudflare/common/construct.ts +13 -70
  55. package/src/lib/cloudflare/common/index.ts +0 -1
  56. package/src/lib/cloudflare/common/stack.ts +58 -69
  57. package/src/lib/cloudflare/common/types.ts +2 -15
  58. package/src/lib/cloudflare/construct/pages-static-site/main.ts +22 -42
  59. package/src/lib/cloudflare/construct/worker-site/main.ts +38 -62
  60. package/src/lib/cloudflare/index.ts +0 -1
  61. package/src/lib/cloudflare/services/access/main.ts +57 -118
  62. package/src/lib/cloudflare/services/access/types.ts +24 -22
  63. package/src/lib/cloudflare/services/api-shield/main.ts +16 -63
  64. package/src/lib/cloudflare/services/api-shield/types.ts +12 -10
  65. package/src/lib/cloudflare/services/argo/main.ts +9 -23
  66. package/src/lib/cloudflare/services/argo/types.ts +3 -4
  67. package/src/lib/cloudflare/services/filter/main.ts +6 -13
  68. package/src/lib/cloudflare/services/filter/types.ts +2 -2
  69. package/src/lib/cloudflare/services/firewall/main.ts +4 -11
  70. package/src/lib/cloudflare/services/firewall/types.ts +2 -2
  71. package/src/lib/cloudflare/services/page/main.ts +19 -36
  72. package/src/lib/cloudflare/services/page/types.ts +4 -6
  73. package/src/lib/cloudflare/services/record/main.ts +4 -11
  74. package/src/lib/cloudflare/services/record/types.ts +2 -2
  75. package/src/lib/cloudflare/services/rule-set/main.ts +7 -12
  76. package/src/lib/cloudflare/services/rule-set/types.ts +2 -2
  77. package/src/lib/cloudflare/services/worker/main.ts +15 -52
  78. package/src/lib/cloudflare/services/worker/types.ts +14 -12
  79. package/src/lib/cloudflare/services/zone/main.ts +40 -103
  80. package/src/lib/cloudflare/services/zone/types.ts +20 -21
  81. package/src/lib/common/types.ts +5 -0
  82. package/dist/src/lib/cloudflare/common/constants.d.ts +0 -5
  83. package/dist/src/lib/cloudflare/common/constants.js +0 -6
  84. package/dist/src/lib/cloudflare/utils/index.d.ts +0 -3
  85. package/dist/src/lib/cloudflare/utils/index.js +0 -13
  86. package/src/lib/cloudflare/common/constants.ts +0 -5
  87. package/src/lib/cloudflare/utils/index.ts +0 -23
@@ -1,12 +1,10 @@
1
- import { DataAwsSecretsmanagerSecretVersion } from '@cdktf/provider-aws/lib/data-aws-secretsmanager-secret-version/index.js'
2
- import { DataAwsSecretsmanagerSecret } from '@cdktf/provider-aws/lib/data-aws-secretsmanager-secret/index.js'
3
- import { DataAzurermKeyVaultSecret } from '@cdktf/provider-azurerm/lib/data-azurerm-key-vault-secret/index.js'
4
- import { DataAzurermKeyVault } from '@cdktf/provider-azurerm/lib/data-azurerm-key-vault/index.js'
5
- import { DataCloudflareZone } from '@cdktf/provider-cloudflare/lib/data-cloudflare-zone/index.js'
6
- import { WorkersScript, WorkersScriptBindings } from '@cdktf/provider-cloudflare/lib/workers-script/index.js'
7
- import { Zone } from '@cdktf/provider-cloudflare/lib/zone/index.js'
8
- import { AssetType, Fn, TerraformAsset } from 'cdktf'
9
- import { Construct } from 'constructs'
1
+ import * as aws from '@pulumi/aws'
2
+ import * as azure from '@pulumi/azure-native'
3
+ import { Ruleset, WorkersCustomDomain, WorkersScript, Zone, ZoneSetting } from '@pulumi/cloudflare'
4
+ import { WorkersScriptBinding } from '@pulumi/cloudflare/types/input.js'
5
+ import { ComponentResourceOptions } from '@pulumi/pulumi'
6
+ import * as std from '@pulumi/std'
7
+ import fs from 'fs'
10
8
  import { CommonCloudflareConstruct } from '../../common/index.js'
11
9
  import { CloudflareWorkerSiteProps } from './types.js'
12
10
 
@@ -29,14 +27,18 @@ export class CloudflareWorkerSite extends CommonCloudflareConstruct {
29
27
  declare props: CloudflareWorkerSiteProps
30
28
 
31
29
  /* worker site resources */
32
- siteZone: DataCloudflareZone | Zone
30
+ siteZone: Zone
33
31
  siteWorkerScript: WorkersScript
34
- workerPlainTextBindingEnvironmentVariables: WorkersScriptBindings[] = []
35
- workerSecretTextBindingEnvironmentVariables: WorkersScriptBindings[] = []
32
+ siteWorkerDomain: WorkersCustomDomain
33
+ siteRuleSet: Ruleset
34
+ siteZoneSetting: ZoneSetting
35
+ workerPlainTextBindingEnvironmentVariables: WorkersScriptBinding[] = []
36
+ workerSecretTextBindingEnvironmentVariables: WorkersScriptBinding[] = []
36
37
 
37
- constructor(parent: Construct, id: string, props: CloudflareWorkerSiteProps) {
38
- super(parent, id, props)
38
+ constructor(id: string, props: CloudflareWorkerSiteProps, options?: ComponentResourceOptions) {
39
+ super(id, props)
39
40
  this.props = props
41
+ this.options = options
40
42
  this.id = id
41
43
  }
42
44
 
@@ -79,14 +81,10 @@ export class CloudflareWorkerSite extends CommonCloudflareConstruct {
79
81
  * @summary Create the worker
80
82
  */
81
83
  protected createWorker() {
82
- const workerContent = new TerraformAsset(this, `${this.id}-worker-content`, {
83
- path: this.props.siteWorkerAsset,
84
- type: AssetType.FILE,
85
- })
86
-
84
+ const workerContent = fs.readFileSync(this.props.siteWorkerAsset, 'utf-8')
87
85
  this.siteWorkerScript = this.workerManager.createWorkerScript(`${this.id}-worker-script`, this, {
88
86
  ...this.props.siteWorkerScript,
89
- content: Fn.file(workerContent.path),
87
+ content: workerContent,
90
88
  })
91
89
  }
92
90
 
@@ -94,7 +92,7 @@ export class CloudflareWorkerSite extends CommonCloudflareConstruct {
94
92
  * @summary Create the worker domain
95
93
  */
96
94
  protected createWorkerDomain() {
97
- this.workerManager.createWorkerDomain(`${this.id}-worker-domain`, this, {
95
+ this.siteWorkerDomain = this.workerManager.createWorkerDomain(`${this.id}-worker-domain`, this, {
98
96
  ...this.props.siteWorkerDomain,
99
97
  environment: this.props.siteWorkerDomain.environment ?? 'production',
100
98
  hostname: `${this.props.siteSubDomain}.${this.props.domainName}`,
@@ -108,23 +106,12 @@ export class CloudflareWorkerSite extends CommonCloudflareConstruct {
108
106
  * @param secretKey the secret key
109
107
  * @returns the secret value
110
108
  */
111
- protected resolveSecretFromAWS(secretName: string, secretKey: string, id?: string) {
112
- if (!this.awsProvider) {
113
- throw new Error(`Unable to resolve secret:${secretKey}. AWS provider not found`)
114
- }
115
- const secret = new DataAwsSecretsmanagerSecret(this, id ?? `${this.id}-${secretName}-${secretKey}`, {
116
- name: secretName,
117
- })
118
- const secretVersion = new DataAwsSecretsmanagerSecretVersion(
119
- this,
120
- id ? `${id}-ver` : `${this.id}-${secretName}-${secretKey}-ver`,
121
- {
122
- provider: this.awsProvider,
123
- secretId: secret.id,
124
- }
125
- )
109
+ protected resolveSecretFromAWS(secretName: string, secretKey: string) {
110
+ if (this.config.require('secretsProvider') !== 'aws') return
111
+ const secret = aws.secretsmanager.getSecretOutput({ name: secretName })
112
+ const secretVersion = aws.secretsmanager.getSecretVersionOutput({ secretId: secret.id })
126
113
  if (!secretVersion) throw new Error(`Unable to resolve secret:${secretName}`)
127
- return Fn.lookup(Fn.jsondecode(secretVersion.secretString), secretKey)
114
+ return std.jsondecodeOutput({ input: secretVersion.secretString })
128
115
  }
129
116
 
130
117
  /**
@@ -135,30 +122,15 @@ export class CloudflareWorkerSite extends CommonCloudflareConstruct {
135
122
  * @param secretKey the secret key
136
123
  * @returns the secret value
137
124
  */
138
- protected resolveSecretFromAzure(resourceGroupName: string, keyVaultName: string, secretKey: string, id?: string) {
139
- if (!this.azurermProvider) {
140
- throw new Error(`Unable to resolve secret:${secretKey}. Azurerm provider not found`)
141
- }
142
- const keyVaultData = new DataAzurermKeyVault(
143
- this,
144
- id ? `${id}-vault` : `${this.id}-${resourceGroupName}-${keyVaultName}-${secretKey}-vault`,
145
- {
146
- resourceGroupName: resourceGroupName,
147
- name: keyVaultName,
148
- provider: this.azurermProvider,
149
- }
150
- )
151
- const secretValueData = new DataAzurermKeyVaultSecret(
152
- this,
153
- id ? `${id}-secret` : `${this.id}-${resourceGroupName}-${keyVaultName}-${secretKey}-secret`,
154
- {
155
- name: secretKey,
156
- keyVaultId: keyVaultData.id,
157
- provider: this.azurermProvider,
158
- }
159
- )
125
+ protected resolveSecretFromAzure(resourceGroupName: string, keyVaultName: string, secretKey: string) {
126
+ if (this.config.require('secretsProvider') !== 'azure') return
127
+ const secretValueData = azure.keyvault.getSecretOutput({
128
+ resourceGroupName,
129
+ secretName: secretKey,
130
+ vaultName: keyVaultName,
131
+ })
160
132
  if (!secretValueData) throw new Error(`Unable to resolve secret:${secretKey}`)
161
- return secretValueData.value
133
+ return secretValueData.properties?.value
162
134
  }
163
135
 
164
136
  /**
@@ -166,7 +138,7 @@ export class CloudflareWorkerSite extends CommonCloudflareConstruct {
166
138
  */
167
139
  protected createRuleset() {
168
140
  if (!this.props.siteRuleSet) return
169
- this.ruleSetManager.createRuleSet(`${this.id}-rule`, this, this.props.siteRuleSet)
141
+ this.siteRuleSet = this.ruleSetManager.createRuleSet(`${this.id}-rule`, this, this.props.siteRuleSet)
170
142
  }
171
143
 
172
144
  /**
@@ -174,6 +146,10 @@ export class CloudflareWorkerSite extends CommonCloudflareConstruct {
174
146
  */
175
147
  protected createZoneSetting() {
176
148
  if (!this.props.siteZoneSetting) return
177
- this.zoneManager.createZoneSetting(`${this.id}-zone-setting`, this, this.props.siteZoneSetting)
149
+ this.siteZoneSetting = this.zoneManager.createZoneSetting(
150
+ `${this.id}-zone-setting`,
151
+ this,
152
+ this.props.siteZoneSetting
153
+ )
178
154
  }
179
155
  }
@@ -2,4 +2,3 @@ export * from './common/index.js'
2
2
  export * from './construct/index.js'
3
3
  export * from './services/index.js'
4
4
  export * from './types/index.js'
5
- export * from './utils/index.js'
@@ -1,16 +1,5 @@
1
- import { AccessRule } from '@cdktf/provider-cloudflare/lib/access-rule/index.js'
2
- import { ZeroTrustAccessApplication } from '@cdktf/provider-cloudflare/lib/zero-trust-access-application/index.js'
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 CommonCloudflareConstruct} constructor.
31
- * - If a custom construct extends {@link CommonCloudflareConstruct}, an instance is available within the context.
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 { CommonCloudflareConstruct, CommonCloudflareConstruct } from '@gradientedge/cdk-utils'
23
+ * import { CommonCloudflareComponent, CloudflareAccessManager } from '@gradientedge/cdk-utils'
35
24
  *
36
- * class CustomConstruct extends CommonCloudflareConstruct {
37
- * constructor(parent: Construct, id: string, props: CommonCloudflareStackProps) {
38
- * super(parent, id, props)
39
- * this.props = props
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 [CDKTF Access Application Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessApplication.typescript.md}
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, { name: scope.props.domainName })?.zoneId
46
+ : scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
47
+ filter: { name: scope.props.domainName },
48
+ })?.id
59
49
 
60
- const accessApplication = new ZeroTrustAccessApplication(scope, `${id}`, {
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 certificate properties
78
- * @see [CDKTF Access Short Lived Certificate Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessShortLivedCertificate.typescript.md}
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, { name: scope.props.domainName })?.zoneId
74
+ : scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
75
+ filter: { name: scope.props.domainName },
76
+ })?.id
90
77
 
91
- const accessShortLivedCertificate = new ZeroTrustAccessShortLivedCertificate(scope, `${id}`, {
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 [CDKTF Access Custom Page Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessCustomPage.typescript.md}
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
- const accessCustomPage = new ZeroTrustAccessCustomPage(scope, `${id}`, {
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 [CDKTF Access Group Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessGroup.typescript.md}
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, { name: scope.props.domainName })?.zoneId
113
+ : scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
114
+ filter: { name: scope.props.domainName },
115
+ })?.id
141
116
 
142
- const accessGroup = new ZeroTrustAccessGroup(scope, `${id}`, {
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 [CDKTF Access Identity Provider Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessIdentityProvider.typescript.md}
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, { name: scope.props.domainName })?.zoneId
140
+ : scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
141
+ filter: { name: scope.props.domainName },
142
+ })?.id
171
143
 
172
- const accessIdentityProvider = new ZeroTrustAccessIdentityProvider(scope, `${id}`, {
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 [CDKTF Access Mutual Tls Certificate Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessMtlsCertificate.typescript.md}
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, { name: scope.props.domainName })?.zoneId
168
+ : scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
169
+ filter: { name: scope.props.domainName },
170
+ })?.id
205
171
 
206
- const accessMutualTlsCertificate = new ZeroTrustAccessMtlsCertificate(scope, `${id}`, {
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 [CDKTF Access Organisation Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessOrganization.typescript.md}
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, { name: scope.props.domainName })?.zoneId
191
+ : scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
192
+ filter: { name: scope.props.domainName },
193
+ })?.id
235
194
 
236
- const accessOrganization = new ZeroTrustOrganization(scope, `${id}`, {
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 [CDKTF Access Policy Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessPolicy.typescript.md}
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
- const accessPolicy = new ZeroTrustAccessPolicy(scope, `${id}`, {
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 [CDKTF Access Rule Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessRule.typescript.md}
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, { name: scope.props.domainName })?.zoneId
231
+ : scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
232
+ filter: { name: scope.props.domainName },
233
+ })?.id
282
234
 
283
- const accessRule = new AccessRule(scope, `${id}`, {
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 [CDKTF Access Service Token Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessServiceToken.typescript.md}
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, { name: scope.props.domainName })?.zoneId
258
+ : scope.zoneManager.resolveZone(`${id}-data-zone`, scope, {
259
+ filter: { name: scope.props.domainName },
260
+ })?.id
312
261
 
313
- const accessServiceToken = new ZeroTrustAccessServiceToken(scope, `${id}`, {
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 [CDKTF Access Tag Token Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/zeroTrustAccessTag.typescript.md}
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
- const accessTag = new ZeroTrustAccessTag(scope, `${id}`, {
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 { AccessRuleConfig } from '@cdktf/provider-cloudflare/lib/access-rule/index.js'
2
- import { ZeroTrustAccessApplicationConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-application/index.js'
3
- import { ZeroTrustAccessCustomPageConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-custom-page/index.js'
4
- import { ZeroTrustAccessGroupConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-group/index.js'
5
- import { ZeroTrustAccessIdentityProviderConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-identity-provider/index.js'
6
- import { ZeroTrustAccessMtlsCertificateConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-mtls-certificate/index.js'
7
- import { ZeroTrustAccessPolicyConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-policy/index.js'
8
- import { ZeroTrustAccessServiceTokenConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-service-token/index.js'
9
- import { ZeroTrustAccessShortLivedCertificateConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-short-lived-certificate/index.js'
10
- import { ZeroTrustAccessTagConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-access-tag/index.js'
11
- import { ZeroTrustOrganizationConfig } from '@cdktf/provider-cloudflare/lib/zero-trust-organization/index.js'
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 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
- export interface AccessRuleProps extends AccessRuleConfig {}
22
- export interface ZeroTrustAccessServiceTokenProps extends ZeroTrustAccessServiceTokenConfig {}
23
- export interface ZeroTrustAccessTagProps extends ZeroTrustAccessTagConfig {}
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 {}