@gradientedge/cdk-utils 8.140.0 → 8.141.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 +2 -1
- package/dist/src/lib/cloudflare/common/construct.js +2 -0
- package/dist/src/lib/cloudflare/services/access/index.d.ts +2 -0
- package/dist/src/lib/cloudflare/services/access/index.js +18 -0
- package/dist/src/lib/cloudflare/services/access/main.d.ts +120 -0
- package/dist/src/lib/cloudflare/services/access/main.js +276 -0
- package/dist/src/lib/cloudflare/services/access/types.d.ts +33 -0
- package/dist/src/lib/cloudflare/services/access/types.js +2 -0
- package/dist/src/lib/cloudflare/services/index.d.ts +1 -0
- package/dist/src/lib/cloudflare/services/index.js +1 -0
- package/package.json +1 -1
- package/src/lib/cloudflare/common/construct.ts +3 -0
- package/src/lib/cloudflare/services/access/index.ts +2 -0
- package/src/lib/cloudflare/services/access/main.ts +346 -0
- package/src/lib/cloudflare/services/access/types.ts +23 -0
- package/src/lib/cloudflare/services/index.ts +1 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { TerraformStack } from 'cdktf';
|
|
2
2
|
import { Construct } from 'constructs';
|
|
3
|
-
import { CloudflareApiShieldManager, CloudflareFilterManager, CloudflareFirewallManager, CloudflareWorkerManager, CloudflareZoneManager } from '../services';
|
|
3
|
+
import { CloudflareAccessManager, CloudflareApiShieldManager, CloudflareFilterManager, CloudflareFirewallManager, CloudflareWorkerManager, CloudflareZoneManager } from '../services';
|
|
4
4
|
import { CommonCloudflareStackProps } from './types';
|
|
5
5
|
export declare class CommonCloudflareConstruct extends TerraformStack {
|
|
6
6
|
props: CommonCloudflareStackProps;
|
|
7
7
|
id: string;
|
|
8
8
|
fullyQualifiedDomainName: string;
|
|
9
|
+
accessManager: CloudflareAccessManager;
|
|
9
10
|
apiShieldManager: CloudflareApiShieldManager;
|
|
10
11
|
filterManager: CloudflareFilterManager;
|
|
11
12
|
firewallManager: CloudflareFirewallManager;
|
|
@@ -8,6 +8,7 @@ const services_1 = require("../services");
|
|
|
8
8
|
class CommonCloudflareConstruct extends cdktf_1.TerraformStack {
|
|
9
9
|
id;
|
|
10
10
|
fullyQualifiedDomainName;
|
|
11
|
+
accessManager;
|
|
11
12
|
apiShieldManager;
|
|
12
13
|
filterManager;
|
|
13
14
|
firewallManager;
|
|
@@ -17,6 +18,7 @@ class CommonCloudflareConstruct extends cdktf_1.TerraformStack {
|
|
|
17
18
|
super(scope, id);
|
|
18
19
|
this.props = props;
|
|
19
20
|
this.id = id;
|
|
21
|
+
this.accessManager = new services_1.CloudflareAccessManager();
|
|
20
22
|
this.apiShieldManager = new services_1.CloudflareApiShieldManager();
|
|
21
23
|
this.filterManager = new services_1.CloudflareFilterManager();
|
|
22
24
|
this.firewallManager = new services_1.CloudflareFirewallManager();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./main"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { AccessApplication } from '@cdktf/provider-cloudflare/lib/access-application';
|
|
2
|
+
import { AccessCaCertificate } from '@cdktf/provider-cloudflare/lib/access-ca-certificate';
|
|
3
|
+
import { AccessCustomPage } from '@cdktf/provider-cloudflare/lib/access-custom-page';
|
|
4
|
+
import { AccessGroup } from '@cdktf/provider-cloudflare/lib/access-group';
|
|
5
|
+
import { AccessIdentityProvider } from '@cdktf/provider-cloudflare/lib/access-identity-provider';
|
|
6
|
+
import { AccessMutualTlsCertificate } from '@cdktf/provider-cloudflare/lib/access-mutual-tls-certificate';
|
|
7
|
+
import { CommonCloudflareConstruct } from '../../common';
|
|
8
|
+
import { AccessApplicationProps, AccessCaCertificateProps, AccessCustomPageProps, AccessGroupProps, AccessIdentityProviderProps, AccessMutualTlsCertificateProps, AccessOrganizationProps, AccessPolicyProps, AccessRuleProps, AccessServiceTokenProps, AccessTagProps } from './types';
|
|
9
|
+
import { AccessOrganization } from '@cdktf/provider-cloudflare/lib/access-organization';
|
|
10
|
+
import { AccessPolicy } from '@cdktf/provider-cloudflare/lib/access-policy';
|
|
11
|
+
import { AccessRule } from '@cdktf/provider-cloudflare/lib/access-rule';
|
|
12
|
+
import { AccessServiceToken } from '@cdktf/provider-cloudflare/lib/access-service-token';
|
|
13
|
+
import { AccessTag } from '@cdktf/provider-cloudflare/lib/access-tag';
|
|
14
|
+
/**
|
|
15
|
+
* @classdesc Provides operations on Cloudflare Access
|
|
16
|
+
* - A new instance of this class is injected into {@link CommonCloudflareConstruct} constructor.
|
|
17
|
+
* - If a custom construct extends {@link CommonCloudflareConstruct}, an instance is available within the context.
|
|
18
|
+
* @example
|
|
19
|
+
* ```
|
|
20
|
+
* import { CommonCloudflareConstruct, CommonCloudflareConstruct } from '@gradientedge/cdk-utils'
|
|
21
|
+
*
|
|
22
|
+
* class CustomConstruct extends CommonCloudflareConstruct {
|
|
23
|
+
* constructor(parent: Construct, id: string, props: CommonCloudflareStackProps) {
|
|
24
|
+
* super(parent, id, props)
|
|
25
|
+
* this.props = props
|
|
26
|
+
* this.accessManager.createApiShield('MyAppAccess', this, props)
|
|
27
|
+
* }
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare class CloudflareAccessManager {
|
|
32
|
+
/**
|
|
33
|
+
* @summary Method to create a new Cloudflare Application Access
|
|
34
|
+
* @param id scoped id of the resource
|
|
35
|
+
* @param scope scope in which this resource is defined
|
|
36
|
+
* @param props access application properties
|
|
37
|
+
* @see [CDKTF Access Application Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessApplication.typescript.md}
|
|
38
|
+
*/
|
|
39
|
+
createAccessApplication(id: string, scope: CommonCloudflareConstruct, props: AccessApplicationProps): AccessApplication;
|
|
40
|
+
/**
|
|
41
|
+
* @summary Method to create a new Cloudflare Application Access CA Certificate
|
|
42
|
+
* @param id scoped id of the resource
|
|
43
|
+
* @param scope scope in which this resource is defined
|
|
44
|
+
* @param props access ca certificate properties
|
|
45
|
+
* @see [CDKTF Access Ca Certificate Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessCaCertificate.typescript.md}
|
|
46
|
+
*/
|
|
47
|
+
createAccessCaCertificate(id: string, scope: CommonCloudflareConstruct, props: AccessCaCertificateProps): AccessCaCertificate;
|
|
48
|
+
/**
|
|
49
|
+
* @summary Method to create a new Cloudflare Application Access Custom Page
|
|
50
|
+
* @param id scoped id of the resource
|
|
51
|
+
* @param scope scope in which this resource is defined
|
|
52
|
+
* @param props access custom page properties
|
|
53
|
+
* @see [CDKTF Access Custom Page Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessCustomPage.typescript.md}
|
|
54
|
+
*/
|
|
55
|
+
createAccessCustomPage(id: string, scope: CommonCloudflareConstruct, props: AccessCustomPageProps): AccessCustomPage;
|
|
56
|
+
/**
|
|
57
|
+
* @summary Method to create a new Cloudflare Application Access Group
|
|
58
|
+
* @param id scoped id of the resource
|
|
59
|
+
* @param scope scope in which this resource is defined
|
|
60
|
+
* @param props access group properties
|
|
61
|
+
* @see [CDKTF Access Group Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessGroup.typescript.md}
|
|
62
|
+
*/
|
|
63
|
+
createAccessGroup(id: string, scope: CommonCloudflareConstruct, props: AccessGroupProps): AccessGroup;
|
|
64
|
+
/**
|
|
65
|
+
* @summary Method to create a new Cloudflare Application Access Identity Provider
|
|
66
|
+
* @param id scoped id of the resource
|
|
67
|
+
* @param scope scope in which this resource is defined
|
|
68
|
+
* @param props access identity provider properties
|
|
69
|
+
* @see [CDKTF Access Identity Provider Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessIdentityProvider.typescript.md}
|
|
70
|
+
*/
|
|
71
|
+
createAccessIdentityProvider(id: string, scope: CommonCloudflareConstruct, props: AccessIdentityProviderProps): AccessIdentityProvider;
|
|
72
|
+
/**
|
|
73
|
+
* @summary Method to create a new Cloudflare Application Access Mutual Tls Certificate
|
|
74
|
+
* @param id scoped id of the resource
|
|
75
|
+
* @param scope scope in which this resource is defined
|
|
76
|
+
* @param props access mutual tls certificate properties
|
|
77
|
+
* @see [CDKTF Access Mutual Tls Certificate Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessMutualTlsCertificate.typescript.md}
|
|
78
|
+
*/
|
|
79
|
+
createAccessMutualTlsCertificate(id: string, scope: CommonCloudflareConstruct, props: AccessMutualTlsCertificateProps): AccessMutualTlsCertificate;
|
|
80
|
+
/**
|
|
81
|
+
* @summary Method to create a new Cloudflare Application Access Organisation
|
|
82
|
+
* @param id scoped id of the resource
|
|
83
|
+
* @param scope scope in which this resource is defined
|
|
84
|
+
* @param props access organisation properties
|
|
85
|
+
* @see [CDKTF Access Organisation Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessOrganization.typescript.md}
|
|
86
|
+
*/
|
|
87
|
+
createAccessOrganization(id: string, scope: CommonCloudflareConstruct, props: AccessOrganizationProps): AccessOrganization;
|
|
88
|
+
/**
|
|
89
|
+
* @summary Method to create a new Cloudflare Application Access Policy
|
|
90
|
+
* @param id scoped id of the resource
|
|
91
|
+
* @param scope scope in which this resource is defined
|
|
92
|
+
* @param props access policy properties
|
|
93
|
+
* @see [CDKTF Access Policy Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessPolicy.typescript.md}
|
|
94
|
+
*/
|
|
95
|
+
createAccessPolicy(id: string, scope: CommonCloudflareConstruct, props: AccessPolicyProps): AccessPolicy;
|
|
96
|
+
/**
|
|
97
|
+
* @summary Method to create a new Cloudflare Application Access Rule
|
|
98
|
+
* @param id scoped id of the resource
|
|
99
|
+
* @param scope scope in which this resource is defined
|
|
100
|
+
* @param props access rule properties
|
|
101
|
+
* @see [CDKTF Access Rule Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessRule.typescript.md}
|
|
102
|
+
*/
|
|
103
|
+
createAccessRule(id: string, scope: CommonCloudflareConstruct, props: AccessRuleProps): AccessRule;
|
|
104
|
+
/**
|
|
105
|
+
* @summary Method to create a new Cloudflare Application Access Service Token
|
|
106
|
+
* @param id scoped id of the resource
|
|
107
|
+
* @param scope scope in which this resource is defined
|
|
108
|
+
* @param props access service token properties
|
|
109
|
+
* @see [CDKTF Access Service Token Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessServiceToken.typescript.md}
|
|
110
|
+
*/
|
|
111
|
+
createAccessServiceToken(id: string, scope: CommonCloudflareConstruct, props: AccessServiceTokenProps): AccessServiceToken;
|
|
112
|
+
/**
|
|
113
|
+
* @summary Method to create a new Cloudflare Application Access Tag
|
|
114
|
+
* @param id scoped id of the resource
|
|
115
|
+
* @param scope scope in which this resource is defined
|
|
116
|
+
* @param props access tag properties
|
|
117
|
+
* @see [CDKTF Access Tag Token Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessTag.typescript.md}
|
|
118
|
+
*/
|
|
119
|
+
createAccessTag(id: string, scope: CommonCloudflareConstruct, props: AccessTagProps): AccessTag;
|
|
120
|
+
}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CloudflareAccessManager = void 0;
|
|
4
|
+
const access_application_1 = require("@cdktf/provider-cloudflare/lib/access-application");
|
|
5
|
+
const access_ca_certificate_1 = require("@cdktf/provider-cloudflare/lib/access-ca-certificate");
|
|
6
|
+
const access_custom_page_1 = require("@cdktf/provider-cloudflare/lib/access-custom-page");
|
|
7
|
+
const access_group_1 = require("@cdktf/provider-cloudflare/lib/access-group");
|
|
8
|
+
const access_identity_provider_1 = require("@cdktf/provider-cloudflare/lib/access-identity-provider");
|
|
9
|
+
const access_mutual_tls_certificate_1 = require("@cdktf/provider-cloudflare/lib/access-mutual-tls-certificate");
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
11
|
+
const access_organization_1 = require("@cdktf/provider-cloudflare/lib/access-organization");
|
|
12
|
+
const access_policy_1 = require("@cdktf/provider-cloudflare/lib/access-policy");
|
|
13
|
+
const access_rule_1 = require("@cdktf/provider-cloudflare/lib/access-rule");
|
|
14
|
+
const access_service_token_1 = require("@cdktf/provider-cloudflare/lib/access-service-token");
|
|
15
|
+
const access_tag_1 = require("@cdktf/provider-cloudflare/lib/access-tag");
|
|
16
|
+
/**
|
|
17
|
+
* @classdesc Provides operations on Cloudflare Access
|
|
18
|
+
* - A new instance of this class is injected into {@link CommonCloudflareConstruct} constructor.
|
|
19
|
+
* - If a custom construct extends {@link CommonCloudflareConstruct}, an instance is available within the context.
|
|
20
|
+
* @example
|
|
21
|
+
* ```
|
|
22
|
+
* import { CommonCloudflareConstruct, CommonCloudflareConstruct } from '@gradientedge/cdk-utils'
|
|
23
|
+
*
|
|
24
|
+
* class CustomConstruct extends CommonCloudflareConstruct {
|
|
25
|
+
* constructor(parent: Construct, id: string, props: CommonCloudflareStackProps) {
|
|
26
|
+
* super(parent, id, props)
|
|
27
|
+
* this.props = props
|
|
28
|
+
* this.accessManager.createApiShield('MyAppAccess', this, props)
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
class CloudflareAccessManager {
|
|
34
|
+
/**
|
|
35
|
+
* @summary Method to create a new Cloudflare Application Access
|
|
36
|
+
* @param id scoped id of the resource
|
|
37
|
+
* @param scope scope in which this resource is defined
|
|
38
|
+
* @param props access application properties
|
|
39
|
+
* @see [CDKTF Access Application Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessApplication.typescript.md}
|
|
40
|
+
*/
|
|
41
|
+
createAccessApplication(id, scope, props) {
|
|
42
|
+
if (!props)
|
|
43
|
+
throw `Props undefined for ${id}`;
|
|
44
|
+
const zoneId = props.zoneId
|
|
45
|
+
? props.zoneId
|
|
46
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id;
|
|
47
|
+
const accessApplication = new access_application_1.AccessApplication(scope, `${id}`, {
|
|
48
|
+
...props,
|
|
49
|
+
domain: `${props.domain}-${scope.props.domainName}`,
|
|
50
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
51
|
+
zoneId,
|
|
52
|
+
});
|
|
53
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessApplicationFriendlyUniqueId`, scope, accessApplication.friendlyUniqueId);
|
|
54
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessApplicationId`, scope, accessApplication.id);
|
|
55
|
+
return accessApplication;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @summary Method to create a new Cloudflare Application Access CA Certificate
|
|
59
|
+
* @param id scoped id of the resource
|
|
60
|
+
* @param scope scope in which this resource is defined
|
|
61
|
+
* @param props access ca certificate properties
|
|
62
|
+
* @see [CDKTF Access Ca Certificate Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessCaCertificate.typescript.md}
|
|
63
|
+
*/
|
|
64
|
+
createAccessCaCertificate(id, scope, props) {
|
|
65
|
+
if (!props)
|
|
66
|
+
throw `Props undefined for ${id}`;
|
|
67
|
+
const zoneId = props.zoneId
|
|
68
|
+
? props.zoneId
|
|
69
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id;
|
|
70
|
+
const accessCaCertificate = new access_ca_certificate_1.AccessCaCertificate(scope, `${id}`, {
|
|
71
|
+
...props,
|
|
72
|
+
zoneId,
|
|
73
|
+
});
|
|
74
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessCaCertificateFriendlyUniqueId`, scope, accessCaCertificate.friendlyUniqueId);
|
|
75
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessCaCertificateId`, scope, accessCaCertificate.id);
|
|
76
|
+
return accessCaCertificate;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @summary Method to create a new Cloudflare Application Access Custom Page
|
|
80
|
+
* @param id scoped id of the resource
|
|
81
|
+
* @param scope scope in which this resource is defined
|
|
82
|
+
* @param props access custom page properties
|
|
83
|
+
* @see [CDKTF Access Custom Page Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessCustomPage.typescript.md}
|
|
84
|
+
*/
|
|
85
|
+
createAccessCustomPage(id, scope, props) {
|
|
86
|
+
if (!props)
|
|
87
|
+
throw `Props undefined for ${id}`;
|
|
88
|
+
const zoneId = props.zoneId
|
|
89
|
+
? props.zoneId
|
|
90
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id;
|
|
91
|
+
const accessCustomPage = new access_custom_page_1.AccessCustomPage(scope, `${id}`, {
|
|
92
|
+
...props,
|
|
93
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
94
|
+
zoneId,
|
|
95
|
+
});
|
|
96
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessCustomPageFriendlyUniqueId`, scope, accessCustomPage.friendlyUniqueId);
|
|
97
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessCustomPageId`, scope, accessCustomPage.id);
|
|
98
|
+
return accessCustomPage;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* @summary Method to create a new Cloudflare Application Access Group
|
|
102
|
+
* @param id scoped id of the resource
|
|
103
|
+
* @param scope scope in which this resource is defined
|
|
104
|
+
* @param props access group properties
|
|
105
|
+
* @see [CDKTF Access Group Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessGroup.typescript.md}
|
|
106
|
+
*/
|
|
107
|
+
createAccessGroup(id, scope, props) {
|
|
108
|
+
if (!props)
|
|
109
|
+
throw `Props undefined for ${id}`;
|
|
110
|
+
const zoneId = props.zoneId
|
|
111
|
+
? props.zoneId
|
|
112
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id;
|
|
113
|
+
const accessGroup = new access_group_1.AccessGroup(scope, `${id}`, {
|
|
114
|
+
...props,
|
|
115
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
116
|
+
zoneId,
|
|
117
|
+
});
|
|
118
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessGroupFriendlyUniqueId`, scope, accessGroup.friendlyUniqueId);
|
|
119
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessGroupId`, scope, accessGroup.id);
|
|
120
|
+
return accessGroup;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @summary Method to create a new Cloudflare Application Access Identity Provider
|
|
124
|
+
* @param id scoped id of the resource
|
|
125
|
+
* @param scope scope in which this resource is defined
|
|
126
|
+
* @param props access identity provider properties
|
|
127
|
+
* @see [CDKTF Access Identity Provider Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessIdentityProvider.typescript.md}
|
|
128
|
+
*/
|
|
129
|
+
createAccessIdentityProvider(id, scope, props) {
|
|
130
|
+
if (!props)
|
|
131
|
+
throw `Props undefined for ${id}`;
|
|
132
|
+
const zoneId = props.zoneId
|
|
133
|
+
? props.zoneId
|
|
134
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id;
|
|
135
|
+
const accessIdentityProvider = new access_identity_provider_1.AccessIdentityProvider(scope, `${id}`, {
|
|
136
|
+
...props,
|
|
137
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
138
|
+
zoneId,
|
|
139
|
+
});
|
|
140
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessIdentityProviderFriendlyUniqueId`, scope, accessIdentityProvider.friendlyUniqueId);
|
|
141
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessIdentityProviderId`, scope, accessIdentityProvider.id);
|
|
142
|
+
return accessIdentityProvider;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* @summary Method to create a new Cloudflare Application Access Mutual Tls Certificate
|
|
146
|
+
* @param id scoped id of the resource
|
|
147
|
+
* @param scope scope in which this resource is defined
|
|
148
|
+
* @param props access mutual tls certificate properties
|
|
149
|
+
* @see [CDKTF Access Mutual Tls Certificate Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessMutualTlsCertificate.typescript.md}
|
|
150
|
+
*/
|
|
151
|
+
createAccessMutualTlsCertificate(id, scope, props) {
|
|
152
|
+
if (!props)
|
|
153
|
+
throw `Props undefined for ${id}`;
|
|
154
|
+
const zoneId = props.zoneId
|
|
155
|
+
? props.zoneId
|
|
156
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id;
|
|
157
|
+
const accessMutualTlsCertificate = new access_mutual_tls_certificate_1.AccessMutualTlsCertificate(scope, `${id}`, {
|
|
158
|
+
...props,
|
|
159
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
160
|
+
zoneId,
|
|
161
|
+
});
|
|
162
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessMutualTlsCertificateFriendlyUniqueId`, scope, accessMutualTlsCertificate.friendlyUniqueId);
|
|
163
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessMutualTlsCertificateId`, scope, accessMutualTlsCertificate.id);
|
|
164
|
+
return accessMutualTlsCertificate;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* @summary Method to create a new Cloudflare Application Access Organisation
|
|
168
|
+
* @param id scoped id of the resource
|
|
169
|
+
* @param scope scope in which this resource is defined
|
|
170
|
+
* @param props access organisation properties
|
|
171
|
+
* @see [CDKTF Access Organisation Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessOrganization.typescript.md}
|
|
172
|
+
*/
|
|
173
|
+
createAccessOrganization(id, scope, props) {
|
|
174
|
+
if (!props)
|
|
175
|
+
throw `Props undefined for ${id}`;
|
|
176
|
+
const zoneId = props.zoneId
|
|
177
|
+
? props.zoneId
|
|
178
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id;
|
|
179
|
+
const accessOrganization = new access_organization_1.AccessOrganization(scope, `${id}`, {
|
|
180
|
+
...props,
|
|
181
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
182
|
+
zoneId,
|
|
183
|
+
});
|
|
184
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessOrganizationFriendlyUniqueId`, scope, accessOrganization.friendlyUniqueId);
|
|
185
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessOrganizationId`, scope, accessOrganization.id);
|
|
186
|
+
return accessOrganization;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* @summary Method to create a new Cloudflare Application Access Policy
|
|
190
|
+
* @param id scoped id of the resource
|
|
191
|
+
* @param scope scope in which this resource is defined
|
|
192
|
+
* @param props access policy properties
|
|
193
|
+
* @see [CDKTF Access Policy Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessPolicy.typescript.md}
|
|
194
|
+
*/
|
|
195
|
+
createAccessPolicy(id, scope, props) {
|
|
196
|
+
if (!props)
|
|
197
|
+
throw `Props undefined for ${id}`;
|
|
198
|
+
const zoneId = props.zoneId
|
|
199
|
+
? props.zoneId
|
|
200
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id;
|
|
201
|
+
const accessPolicy = new access_policy_1.AccessPolicy(scope, `${id}`, {
|
|
202
|
+
...props,
|
|
203
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
204
|
+
zoneId,
|
|
205
|
+
});
|
|
206
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessPolicyFriendlyUniqueId`, scope, accessPolicy.friendlyUniqueId);
|
|
207
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessPolicyId`, scope, accessPolicy.id);
|
|
208
|
+
return accessPolicy;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* @summary Method to create a new Cloudflare Application Access Rule
|
|
212
|
+
* @param id scoped id of the resource
|
|
213
|
+
* @param scope scope in which this resource is defined
|
|
214
|
+
* @param props access rule properties
|
|
215
|
+
* @see [CDKTF Access Rule Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessRule.typescript.md}
|
|
216
|
+
*/
|
|
217
|
+
createAccessRule(id, scope, props) {
|
|
218
|
+
if (!props)
|
|
219
|
+
throw `Props undefined for ${id}`;
|
|
220
|
+
const zoneId = props.zoneId
|
|
221
|
+
? props.zoneId
|
|
222
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id;
|
|
223
|
+
const accessRule = new access_rule_1.AccessRule(scope, `${id}`, {
|
|
224
|
+
...props,
|
|
225
|
+
zoneId,
|
|
226
|
+
});
|
|
227
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessRuleFriendlyUniqueId`, scope, accessRule.friendlyUniqueId);
|
|
228
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessRuleId`, scope, accessRule.id);
|
|
229
|
+
return accessRule;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* @summary Method to create a new Cloudflare Application Access Service Token
|
|
233
|
+
* @param id scoped id of the resource
|
|
234
|
+
* @param scope scope in which this resource is defined
|
|
235
|
+
* @param props access service token properties
|
|
236
|
+
* @see [CDKTF Access Service Token Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessServiceToken.typescript.md}
|
|
237
|
+
*/
|
|
238
|
+
createAccessServiceToken(id, scope, props) {
|
|
239
|
+
if (!props)
|
|
240
|
+
throw `Props undefined for ${id}`;
|
|
241
|
+
const zoneId = props.zoneId
|
|
242
|
+
? props.zoneId
|
|
243
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id;
|
|
244
|
+
const accessServiceToken = new access_service_token_1.AccessServiceToken(scope, `${id}`, {
|
|
245
|
+
...props,
|
|
246
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
247
|
+
zoneId,
|
|
248
|
+
});
|
|
249
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessServiceTokenFriendlyUniqueId`, scope, accessServiceToken.friendlyUniqueId);
|
|
250
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessServiceTokenId`, scope, accessServiceToken.id);
|
|
251
|
+
return accessServiceToken;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* @summary Method to create a new Cloudflare Application Access Tag
|
|
255
|
+
* @param id scoped id of the resource
|
|
256
|
+
* @param scope scope in which this resource is defined
|
|
257
|
+
* @param props access tag properties
|
|
258
|
+
* @see [CDKTF Access Tag Token Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessTag.typescript.md}
|
|
259
|
+
*/
|
|
260
|
+
createAccessTag(id, scope, props) {
|
|
261
|
+
if (!props)
|
|
262
|
+
throw `Props undefined for ${id}`;
|
|
263
|
+
const zoneId = props.zoneId
|
|
264
|
+
? props.zoneId
|
|
265
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id;
|
|
266
|
+
const accessTag = new access_tag_1.AccessTag(scope, `${id}`, {
|
|
267
|
+
...props,
|
|
268
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
269
|
+
zoneId,
|
|
270
|
+
});
|
|
271
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessTagFriendlyUniqueId`, scope, accessTag.friendlyUniqueId);
|
|
272
|
+
(0, utils_1.createCloudflareTfOutput)(`${id}-accessTagId`, scope, accessTag.id);
|
|
273
|
+
return accessTag;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
exports.CloudflareAccessManager = CloudflareAccessManager;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AccessApplicationConfig } from '@cdktf/provider-cloudflare/lib/access-application';
|
|
2
|
+
import { AccessCaCertificateConfig } from '@cdktf/provider-cloudflare/lib/access-ca-certificate';
|
|
3
|
+
import { AccessCustomPageConfig } from '@cdktf/provider-cloudflare/lib/access-custom-page';
|
|
4
|
+
import { AccessGroupConfig } from '@cdktf/provider-cloudflare/lib/access-group';
|
|
5
|
+
import { AccessIdentityProviderConfig } from '@cdktf/provider-cloudflare/lib/access-identity-provider';
|
|
6
|
+
import { AccessMutualTlsCertificateConfig } from '@cdktf/provider-cloudflare/lib/access-mutual-tls-certificate';
|
|
7
|
+
import { AccessOrganizationConfig } from '@cdktf/provider-cloudflare/lib/access-organization';
|
|
8
|
+
import { AccessPolicyConfig } from '@cdktf/provider-cloudflare/lib/access-policy';
|
|
9
|
+
import { AccessRuleConfig } from '@cdktf/provider-cloudflare/lib/access-rule';
|
|
10
|
+
import { AccessServiceTokenConfig } from '@cdktf/provider-cloudflare/lib/access-service-token';
|
|
11
|
+
import { AccessTagConfig } from '@cdktf/provider-cloudflare/lib/access-tag';
|
|
12
|
+
export interface AccessApplicationProps extends AccessApplicationConfig {
|
|
13
|
+
}
|
|
14
|
+
export interface AccessCaCertificateProps extends AccessCaCertificateConfig {
|
|
15
|
+
}
|
|
16
|
+
export interface AccessCustomPageProps extends AccessCustomPageConfig {
|
|
17
|
+
}
|
|
18
|
+
export interface AccessGroupProps extends AccessGroupConfig {
|
|
19
|
+
}
|
|
20
|
+
export interface AccessIdentityProviderProps extends AccessIdentityProviderConfig {
|
|
21
|
+
}
|
|
22
|
+
export interface AccessMutualTlsCertificateProps extends AccessMutualTlsCertificateConfig {
|
|
23
|
+
}
|
|
24
|
+
export interface AccessOrganizationProps extends AccessOrganizationConfig {
|
|
25
|
+
}
|
|
26
|
+
export interface AccessPolicyProps extends AccessPolicyConfig {
|
|
27
|
+
}
|
|
28
|
+
export interface AccessRuleProps extends AccessRuleConfig {
|
|
29
|
+
}
|
|
30
|
+
export interface AccessServiceTokenProps extends AccessServiceTokenConfig {
|
|
31
|
+
}
|
|
32
|
+
export interface AccessTagProps extends AccessTagConfig {
|
|
33
|
+
}
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./access"), exports);
|
|
17
18
|
__exportStar(require("./api-shield"), exports);
|
|
18
19
|
__exportStar(require("./filter"), exports);
|
|
19
20
|
__exportStar(require("./firewall"), exports);
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import { TerraformStack } from 'cdktf'
|
|
|
3
3
|
import { Construct } from 'constructs'
|
|
4
4
|
import { isDevStage, isPrdStage, isTestStage, isUatStage } from '../../common'
|
|
5
5
|
import {
|
|
6
|
+
CloudflareAccessManager,
|
|
6
7
|
CloudflareApiShieldManager,
|
|
7
8
|
CloudflareFilterManager,
|
|
8
9
|
CloudflareFirewallManager,
|
|
@@ -15,6 +16,7 @@ export class CommonCloudflareConstruct extends TerraformStack {
|
|
|
15
16
|
declare props: CommonCloudflareStackProps
|
|
16
17
|
id: string
|
|
17
18
|
fullyQualifiedDomainName: string
|
|
19
|
+
accessManager: CloudflareAccessManager
|
|
18
20
|
apiShieldManager: CloudflareApiShieldManager
|
|
19
21
|
filterManager: CloudflareFilterManager
|
|
20
22
|
firewallManager: CloudflareFirewallManager
|
|
@@ -26,6 +28,7 @@ export class CommonCloudflareConstruct extends TerraformStack {
|
|
|
26
28
|
this.props = props
|
|
27
29
|
this.id = id
|
|
28
30
|
|
|
31
|
+
this.accessManager = new CloudflareAccessManager()
|
|
29
32
|
this.apiShieldManager = new CloudflareApiShieldManager()
|
|
30
33
|
this.filterManager = new CloudflareFilterManager()
|
|
31
34
|
this.firewallManager = new CloudflareFirewallManager()
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { AccessApplication } from '@cdktf/provider-cloudflare/lib/access-application'
|
|
2
|
+
import { AccessCaCertificate } from '@cdktf/provider-cloudflare/lib/access-ca-certificate'
|
|
3
|
+
import { AccessCustomPage } from '@cdktf/provider-cloudflare/lib/access-custom-page'
|
|
4
|
+
import { AccessGroup } from '@cdktf/provider-cloudflare/lib/access-group'
|
|
5
|
+
import { AccessIdentityProvider } from '@cdktf/provider-cloudflare/lib/access-identity-provider'
|
|
6
|
+
import { AccessMutualTlsCertificate } from '@cdktf/provider-cloudflare/lib/access-mutual-tls-certificate'
|
|
7
|
+
import { CommonCloudflareConstruct } from '../../common'
|
|
8
|
+
import { createCloudflareTfOutput } from '../../utils'
|
|
9
|
+
import {
|
|
10
|
+
AccessApplicationProps,
|
|
11
|
+
AccessCaCertificateProps,
|
|
12
|
+
AccessCustomPageProps,
|
|
13
|
+
AccessGroupProps,
|
|
14
|
+
AccessIdentityProviderProps,
|
|
15
|
+
AccessMutualTlsCertificateProps,
|
|
16
|
+
AccessOrganizationProps,
|
|
17
|
+
AccessPolicyProps,
|
|
18
|
+
AccessRuleProps,
|
|
19
|
+
AccessServiceTokenProps,
|
|
20
|
+
AccessTagProps,
|
|
21
|
+
} 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
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @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.
|
|
32
|
+
* @example
|
|
33
|
+
* ```
|
|
34
|
+
* import { CommonCloudflareConstruct, CommonCloudflareConstruct } from '@gradientedge/cdk-utils'
|
|
35
|
+
*
|
|
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)
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export class CloudflareAccessManager {
|
|
46
|
+
/**
|
|
47
|
+
* @summary Method to create a new Cloudflare Application Access
|
|
48
|
+
* @param id scoped id of the resource
|
|
49
|
+
* @param scope scope in which this resource is defined
|
|
50
|
+
* @param props access application properties
|
|
51
|
+
* @see [CDKTF Access Application Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessApplication.typescript.md}
|
|
52
|
+
*/
|
|
53
|
+
public createAccessApplication(id: string, scope: CommonCloudflareConstruct, props: AccessApplicationProps) {
|
|
54
|
+
if (!props) throw `Props undefined for ${id}`
|
|
55
|
+
|
|
56
|
+
const zoneId = props.zoneId
|
|
57
|
+
? props.zoneId
|
|
58
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
59
|
+
|
|
60
|
+
const accessApplication = new AccessApplication(scope, `${id}`, {
|
|
61
|
+
...props,
|
|
62
|
+
domain: `${props.domain}-${scope.props.domainName}`,
|
|
63
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
64
|
+
zoneId,
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
createCloudflareTfOutput(`${id}-accessApplicationFriendlyUniqueId`, scope, accessApplication.friendlyUniqueId)
|
|
68
|
+
createCloudflareTfOutput(`${id}-accessApplicationId`, scope, accessApplication.id)
|
|
69
|
+
|
|
70
|
+
return accessApplication
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @summary Method to create a new Cloudflare Application Access CA Certificate
|
|
75
|
+
* @param id scoped id of the resource
|
|
76
|
+
* @param scope scope in which this resource is defined
|
|
77
|
+
* @param props access ca certificate properties
|
|
78
|
+
* @see [CDKTF Access Ca Certificate Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessCaCertificate.typescript.md}
|
|
79
|
+
*/
|
|
80
|
+
public createAccessCaCertificate(id: string, scope: CommonCloudflareConstruct, props: AccessCaCertificateProps) {
|
|
81
|
+
if (!props) throw `Props undefined for ${id}`
|
|
82
|
+
|
|
83
|
+
const zoneId = props.zoneId
|
|
84
|
+
? props.zoneId
|
|
85
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
86
|
+
|
|
87
|
+
const accessCaCertificate = new AccessCaCertificate(scope, `${id}`, {
|
|
88
|
+
...props,
|
|
89
|
+
zoneId,
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
createCloudflareTfOutput(`${id}-accessCaCertificateFriendlyUniqueId`, scope, accessCaCertificate.friendlyUniqueId)
|
|
93
|
+
createCloudflareTfOutput(`${id}-accessCaCertificateId`, scope, accessCaCertificate.id)
|
|
94
|
+
|
|
95
|
+
return accessCaCertificate
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @summary Method to create a new Cloudflare Application Access Custom Page
|
|
100
|
+
* @param id scoped id of the resource
|
|
101
|
+
* @param scope scope in which this resource is defined
|
|
102
|
+
* @param props access custom page properties
|
|
103
|
+
* @see [CDKTF Access Custom Page Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessCustomPage.typescript.md}
|
|
104
|
+
*/
|
|
105
|
+
public createAccessCustomPage(id: string, scope: CommonCloudflareConstruct, props: AccessCustomPageProps) {
|
|
106
|
+
if (!props) throw `Props undefined for ${id}`
|
|
107
|
+
|
|
108
|
+
const zoneId = props.zoneId
|
|
109
|
+
? props.zoneId
|
|
110
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
111
|
+
|
|
112
|
+
const accessCustomPage = new AccessCustomPage(scope, `${id}`, {
|
|
113
|
+
...props,
|
|
114
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
115
|
+
zoneId,
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
createCloudflareTfOutput(`${id}-accessCustomPageFriendlyUniqueId`, scope, accessCustomPage.friendlyUniqueId)
|
|
119
|
+
createCloudflareTfOutput(`${id}-accessCustomPageId`, scope, accessCustomPage.id)
|
|
120
|
+
|
|
121
|
+
return accessCustomPage
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @summary Method to create a new Cloudflare Application Access Group
|
|
126
|
+
* @param id scoped id of the resource
|
|
127
|
+
* @param scope scope in which this resource is defined
|
|
128
|
+
* @param props access group properties
|
|
129
|
+
* @see [CDKTF Access Group Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessGroup.typescript.md}
|
|
130
|
+
*/
|
|
131
|
+
public createAccessGroup(id: string, scope: CommonCloudflareConstruct, props: AccessGroupProps) {
|
|
132
|
+
if (!props) throw `Props undefined for ${id}`
|
|
133
|
+
|
|
134
|
+
const zoneId = props.zoneId
|
|
135
|
+
? props.zoneId
|
|
136
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
137
|
+
|
|
138
|
+
const accessGroup = new AccessGroup(scope, `${id}`, {
|
|
139
|
+
...props,
|
|
140
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
141
|
+
zoneId,
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
createCloudflareTfOutput(`${id}-accessGroupFriendlyUniqueId`, scope, accessGroup.friendlyUniqueId)
|
|
145
|
+
createCloudflareTfOutput(`${id}-accessGroupId`, scope, accessGroup.id)
|
|
146
|
+
|
|
147
|
+
return accessGroup
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @summary Method to create a new Cloudflare Application Access Identity Provider
|
|
152
|
+
* @param id scoped id of the resource
|
|
153
|
+
* @param scope scope in which this resource is defined
|
|
154
|
+
* @param props access identity provider properties
|
|
155
|
+
* @see [CDKTF Access Identity Provider Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessIdentityProvider.typescript.md}
|
|
156
|
+
*/
|
|
157
|
+
public createAccessIdentityProvider(
|
|
158
|
+
id: string,
|
|
159
|
+
scope: CommonCloudflareConstruct,
|
|
160
|
+
props: AccessIdentityProviderProps
|
|
161
|
+
) {
|
|
162
|
+
if (!props) throw `Props undefined for ${id}`
|
|
163
|
+
|
|
164
|
+
const zoneId = props.zoneId
|
|
165
|
+
? props.zoneId
|
|
166
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
167
|
+
|
|
168
|
+
const accessIdentityProvider = new AccessIdentityProvider(scope, `${id}`, {
|
|
169
|
+
...props,
|
|
170
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
171
|
+
zoneId,
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
createCloudflareTfOutput(
|
|
175
|
+
`${id}-accessIdentityProviderFriendlyUniqueId`,
|
|
176
|
+
scope,
|
|
177
|
+
accessIdentityProvider.friendlyUniqueId
|
|
178
|
+
)
|
|
179
|
+
createCloudflareTfOutput(`${id}-accessIdentityProviderId`, scope, accessIdentityProvider.id)
|
|
180
|
+
|
|
181
|
+
return accessIdentityProvider
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @summary Method to create a new Cloudflare Application Access Mutual Tls Certificate
|
|
186
|
+
* @param id scoped id of the resource
|
|
187
|
+
* @param scope scope in which this resource is defined
|
|
188
|
+
* @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/accessMutualTlsCertificate.typescript.md}
|
|
190
|
+
*/
|
|
191
|
+
public createAccessMutualTlsCertificate(
|
|
192
|
+
id: string,
|
|
193
|
+
scope: CommonCloudflareConstruct,
|
|
194
|
+
props: AccessMutualTlsCertificateProps
|
|
195
|
+
) {
|
|
196
|
+
if (!props) throw `Props undefined for ${id}`
|
|
197
|
+
|
|
198
|
+
const zoneId = props.zoneId
|
|
199
|
+
? props.zoneId
|
|
200
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
201
|
+
|
|
202
|
+
const accessMutualTlsCertificate = new AccessMutualTlsCertificate(scope, `${id}`, {
|
|
203
|
+
...props,
|
|
204
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
205
|
+
zoneId,
|
|
206
|
+
})
|
|
207
|
+
|
|
208
|
+
createCloudflareTfOutput(
|
|
209
|
+
`${id}-accessMutualTlsCertificateFriendlyUniqueId`,
|
|
210
|
+
scope,
|
|
211
|
+
accessMutualTlsCertificate.friendlyUniqueId
|
|
212
|
+
)
|
|
213
|
+
createCloudflareTfOutput(`${id}-accessMutualTlsCertificateId`, scope, accessMutualTlsCertificate.id)
|
|
214
|
+
|
|
215
|
+
return accessMutualTlsCertificate
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* @summary Method to create a new Cloudflare Application Access Organisation
|
|
220
|
+
* @param id scoped id of the resource
|
|
221
|
+
* @param scope scope in which this resource is defined
|
|
222
|
+
* @param props access organisation properties
|
|
223
|
+
* @see [CDKTF Access Organisation Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessOrganization.typescript.md}
|
|
224
|
+
*/
|
|
225
|
+
public createAccessOrganization(id: string, scope: CommonCloudflareConstruct, props: AccessOrganizationProps) {
|
|
226
|
+
if (!props) throw `Props undefined for ${id}`
|
|
227
|
+
|
|
228
|
+
const zoneId = props.zoneId
|
|
229
|
+
? props.zoneId
|
|
230
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
231
|
+
|
|
232
|
+
const accessOrganization = new AccessOrganization(scope, `${id}`, {
|
|
233
|
+
...props,
|
|
234
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
235
|
+
zoneId,
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
createCloudflareTfOutput(`${id}-accessOrganizationFriendlyUniqueId`, scope, accessOrganization.friendlyUniqueId)
|
|
239
|
+
createCloudflareTfOutput(`${id}-accessOrganizationId`, scope, accessOrganization.id)
|
|
240
|
+
|
|
241
|
+
return accessOrganization
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* @summary Method to create a new Cloudflare Application Access Policy
|
|
246
|
+
* @param id scoped id of the resource
|
|
247
|
+
* @param scope scope in which this resource is defined
|
|
248
|
+
* @param props access policy properties
|
|
249
|
+
* @see [CDKTF Access Policy Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessPolicy.typescript.md}
|
|
250
|
+
*/
|
|
251
|
+
public createAccessPolicy(id: string, scope: CommonCloudflareConstruct, props: AccessPolicyProps) {
|
|
252
|
+
if (!props) throw `Props undefined for ${id}`
|
|
253
|
+
|
|
254
|
+
const zoneId = props.zoneId
|
|
255
|
+
? props.zoneId
|
|
256
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
257
|
+
|
|
258
|
+
const accessPolicy = new AccessPolicy(scope, `${id}`, {
|
|
259
|
+
...props,
|
|
260
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
261
|
+
zoneId,
|
|
262
|
+
})
|
|
263
|
+
|
|
264
|
+
createCloudflareTfOutput(`${id}-accessPolicyFriendlyUniqueId`, scope, accessPolicy.friendlyUniqueId)
|
|
265
|
+
createCloudflareTfOutput(`${id}-accessPolicyId`, scope, accessPolicy.id)
|
|
266
|
+
|
|
267
|
+
return accessPolicy
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* @summary Method to create a new Cloudflare Application Access Rule
|
|
272
|
+
* @param id scoped id of the resource
|
|
273
|
+
* @param scope scope in which this resource is defined
|
|
274
|
+
* @param props access rule properties
|
|
275
|
+
* @see [CDKTF Access Rule Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessRule.typescript.md}
|
|
276
|
+
*/
|
|
277
|
+
public createAccessRule(id: string, scope: CommonCloudflareConstruct, props: AccessRuleProps) {
|
|
278
|
+
if (!props) throw `Props undefined for ${id}`
|
|
279
|
+
|
|
280
|
+
const zoneId = props.zoneId
|
|
281
|
+
? props.zoneId
|
|
282
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
283
|
+
|
|
284
|
+
const accessRule = new AccessRule(scope, `${id}`, {
|
|
285
|
+
...props,
|
|
286
|
+
zoneId,
|
|
287
|
+
})
|
|
288
|
+
|
|
289
|
+
createCloudflareTfOutput(`${id}-accessRuleFriendlyUniqueId`, scope, accessRule.friendlyUniqueId)
|
|
290
|
+
createCloudflareTfOutput(`${id}-accessRuleId`, scope, accessRule.id)
|
|
291
|
+
|
|
292
|
+
return accessRule
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* @summary Method to create a new Cloudflare Application Access Service Token
|
|
297
|
+
* @param id scoped id of the resource
|
|
298
|
+
* @param scope scope in which this resource is defined
|
|
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/accessServiceToken.typescript.md}
|
|
301
|
+
*/
|
|
302
|
+
public createAccessServiceToken(id: string, scope: CommonCloudflareConstruct, props: AccessServiceTokenProps) {
|
|
303
|
+
if (!props) throw `Props undefined for ${id}`
|
|
304
|
+
|
|
305
|
+
const zoneId = props.zoneId
|
|
306
|
+
? props.zoneId
|
|
307
|
+
: scope.zoneManager.resolveZone(`${id}-data-zone`, scope, { name: scope.props.domainName })?.id
|
|
308
|
+
|
|
309
|
+
const accessServiceToken = new AccessServiceToken(scope, `${id}`, {
|
|
310
|
+
...props,
|
|
311
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
312
|
+
zoneId,
|
|
313
|
+
})
|
|
314
|
+
|
|
315
|
+
createCloudflareTfOutput(`${id}-accessServiceTokenFriendlyUniqueId`, scope, accessServiceToken.friendlyUniqueId)
|
|
316
|
+
createCloudflareTfOutput(`${id}-accessServiceTokenId`, scope, accessServiceToken.id)
|
|
317
|
+
|
|
318
|
+
return accessServiceToken
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* @summary Method to create a new Cloudflare Application Access Tag
|
|
323
|
+
* @param id scoped id of the resource
|
|
324
|
+
* @param scope scope in which this resource is defined
|
|
325
|
+
* @param props access tag properties
|
|
326
|
+
* @see [CDKTF Access Tag Token Module]{@link https://github.com/cdktf/cdktf-provider-cloudflare/blob/main/docs/accessTag.typescript.md}
|
|
327
|
+
*/
|
|
328
|
+
public createAccessTag(id: string, scope: CommonCloudflareConstruct, props: AccessTagProps) {
|
|
329
|
+
if (!props) throw `Props undefined for ${id}`
|
|
330
|
+
|
|
331
|
+
const zoneId = props.zoneId
|
|
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
|
+
...props,
|
|
337
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
338
|
+
zoneId,
|
|
339
|
+
})
|
|
340
|
+
|
|
341
|
+
createCloudflareTfOutput(`${id}-accessTagFriendlyUniqueId`, scope, accessTag.friendlyUniqueId)
|
|
342
|
+
createCloudflareTfOutput(`${id}-accessTagId`, scope, accessTag.id)
|
|
343
|
+
|
|
344
|
+
return accessTag
|
|
345
|
+
}
|
|
346
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AccessApplicationConfig } from '@cdktf/provider-cloudflare/lib/access-application'
|
|
2
|
+
import { AccessCaCertificateConfig } from '@cdktf/provider-cloudflare/lib/access-ca-certificate'
|
|
3
|
+
import { AccessCustomPageConfig } from '@cdktf/provider-cloudflare/lib/access-custom-page'
|
|
4
|
+
import { AccessGroupConfig } from '@cdktf/provider-cloudflare/lib/access-group'
|
|
5
|
+
import { AccessIdentityProviderConfig } from '@cdktf/provider-cloudflare/lib/access-identity-provider'
|
|
6
|
+
import { AccessMutualTlsCertificateConfig } from '@cdktf/provider-cloudflare/lib/access-mutual-tls-certificate'
|
|
7
|
+
import { AccessOrganizationConfig } from '@cdktf/provider-cloudflare/lib/access-organization'
|
|
8
|
+
import { AccessPolicyConfig } from '@cdktf/provider-cloudflare/lib/access-policy'
|
|
9
|
+
import { AccessRuleConfig } from '@cdktf/provider-cloudflare/lib/access-rule'
|
|
10
|
+
import { AccessServiceTokenConfig } from '@cdktf/provider-cloudflare/lib/access-service-token'
|
|
11
|
+
import { AccessTagConfig } from '@cdktf/provider-cloudflare/lib/access-tag'
|
|
12
|
+
|
|
13
|
+
export interface AccessApplicationProps extends AccessApplicationConfig {}
|
|
14
|
+
export interface AccessCaCertificateProps extends AccessCaCertificateConfig {}
|
|
15
|
+
export interface AccessCustomPageProps extends AccessCustomPageConfig {}
|
|
16
|
+
export interface AccessGroupProps extends AccessGroupConfig {}
|
|
17
|
+
export interface AccessIdentityProviderProps extends AccessIdentityProviderConfig {}
|
|
18
|
+
export interface AccessMutualTlsCertificateProps extends AccessMutualTlsCertificateConfig {}
|
|
19
|
+
export interface AccessOrganizationProps extends AccessOrganizationConfig {}
|
|
20
|
+
export interface AccessPolicyProps extends AccessPolicyConfig {}
|
|
21
|
+
export interface AccessRuleProps extends AccessRuleConfig {}
|
|
22
|
+
export interface AccessServiceTokenProps extends AccessServiceTokenConfig {}
|
|
23
|
+
export interface AccessTagProps extends AccessTagConfig {}
|