@pulumi/databricks 1.90.0 → 1.91.0-alpha.1775067146
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/cluster.d.ts +4 -0
- package/cluster.js +4 -0
- package/cluster.js.map +1 -1
- package/disableLegacyAccessSetting.d.ts +4 -0
- package/disableLegacyAccessSetting.js +4 -0
- package/disableLegacyAccessSetting.js.map +1 -1
- package/getAwsAssumeRolePolicy.d.ts +10 -10
- package/getAwsAssumeRolePolicy.js +10 -10
- package/getAwsBucketPolicy.d.ts +132 -12
- package/getAwsBucketPolicy.js +132 -12
- package/getAwsBucketPolicy.js.map +1 -1
- package/getAwsUnityCatalogAssumeRolePolicy.d.ts +10 -10
- package/getAwsUnityCatalogAssumeRolePolicy.js +10 -10
- package/getAwsUnityCatalogPolicy.d.ts +10 -10
- package/getAwsUnityCatalogPolicy.js +10 -10
- package/getCurrentConfig.d.ts +4 -4
- package/getCurrentConfig.js +4 -4
- package/getMetastore.d.ts +4 -4
- package/getMetastore.js +4 -4
- package/instanceProfile.d.ts +107 -0
- package/instanceProfile.js +107 -0
- package/instanceProfile.js.map +1 -1
- package/mount.d.ts +10 -10
- package/mount.js +10 -10
- package/mwsCredentials.d.ts +4 -4
- package/mwsCredentials.js +4 -4
- package/mwsCustomerManagedKeys.d.ts +152 -0
- package/mwsCustomerManagedKeys.js +152 -0
- package/mwsCustomerManagedKeys.js.map +1 -1
- package/mwsLogDelivery.d.ts +20 -20
- package/mwsLogDelivery.js +20 -20
- package/mwsStorageConfigurations.d.ts +5 -5
- package/mwsStorageConfigurations.js +5 -5
- package/mwsVpcEndpoint.d.ts +5 -5
- package/mwsVpcEndpoint.js +5 -5
- package/mwsWorkspaces.d.ts +20 -20
- package/mwsWorkspaces.js +20 -20
- package/package.json +2 -2
- package/recipient.d.ts +1 -1
- package/recipient.js +1 -1
|
@@ -24,15 +24,15 @@ import * as pulumi from "@pulumi/pulumi";
|
|
|
24
24
|
* roleName: `${prefix}-uc-access`,
|
|
25
25
|
* externalId: "12345",
|
|
26
26
|
* });
|
|
27
|
-
* const unityMetastore = new aws.
|
|
27
|
+
* const unityMetastore = new aws.iam.Policy("unity_metastore", {
|
|
28
28
|
* name: `${prefix}-unity-catalog-metastore-access-iam-policy`,
|
|
29
|
-
* policy: _this.json,
|
|
29
|
+
* policy: _this.then(_this => _this.json),
|
|
30
30
|
* });
|
|
31
|
-
* const metastoreDataAccess = new aws.
|
|
31
|
+
* const metastoreDataAccess = new aws.iam.Role("metastore_data_access", {
|
|
32
32
|
* name: `${prefix}-uc-access`,
|
|
33
|
-
* assumeRolePolicy: thisGetAwsUnityCatalogAssumeRolePolicy.json,
|
|
33
|
+
* assumeRolePolicy: thisGetAwsUnityCatalogAssumeRolePolicy.then(thisGetAwsUnityCatalogAssumeRolePolicy => thisGetAwsUnityCatalogAssumeRolePolicy.json),
|
|
34
34
|
* });
|
|
35
|
-
* const
|
|
35
|
+
* const metastoreDataAccessRolePolicyAttachment = new aws.iam.RolePolicyAttachment("metastore_data_access", {
|
|
36
36
|
* role: metastoreDataAccess.name,
|
|
37
37
|
* policyArn: unityMetastore.arn,
|
|
38
38
|
* });
|
|
@@ -107,15 +107,15 @@ export interface GetAwsUnityCatalogPolicyResult {
|
|
|
107
107
|
* roleName: `${prefix}-uc-access`,
|
|
108
108
|
* externalId: "12345",
|
|
109
109
|
* });
|
|
110
|
-
* const unityMetastore = new aws.
|
|
110
|
+
* const unityMetastore = new aws.iam.Policy("unity_metastore", {
|
|
111
111
|
* name: `${prefix}-unity-catalog-metastore-access-iam-policy`,
|
|
112
|
-
* policy: _this.json,
|
|
112
|
+
* policy: _this.then(_this => _this.json),
|
|
113
113
|
* });
|
|
114
|
-
* const metastoreDataAccess = new aws.
|
|
114
|
+
* const metastoreDataAccess = new aws.iam.Role("metastore_data_access", {
|
|
115
115
|
* name: `${prefix}-uc-access`,
|
|
116
|
-
* assumeRolePolicy: thisGetAwsUnityCatalogAssumeRolePolicy.json,
|
|
116
|
+
* assumeRolePolicy: thisGetAwsUnityCatalogAssumeRolePolicy.then(thisGetAwsUnityCatalogAssumeRolePolicy => thisGetAwsUnityCatalogAssumeRolePolicy.json),
|
|
117
117
|
* });
|
|
118
|
-
* const
|
|
118
|
+
* const metastoreDataAccessRolePolicyAttachment = new aws.iam.RolePolicyAttachment("metastore_data_access", {
|
|
119
119
|
* role: metastoreDataAccess.name,
|
|
120
120
|
* policyArn: unityMetastore.arn,
|
|
121
121
|
* });
|
|
@@ -30,15 +30,15 @@ const utilities = require("./utilities");
|
|
|
30
30
|
* roleName: `${prefix}-uc-access`,
|
|
31
31
|
* externalId: "12345",
|
|
32
32
|
* });
|
|
33
|
-
* const unityMetastore = new aws.
|
|
33
|
+
* const unityMetastore = new aws.iam.Policy("unity_metastore", {
|
|
34
34
|
* name: `${prefix}-unity-catalog-metastore-access-iam-policy`,
|
|
35
|
-
* policy: _this.json,
|
|
35
|
+
* policy: _this.then(_this => _this.json),
|
|
36
36
|
* });
|
|
37
|
-
* const metastoreDataAccess = new aws.
|
|
37
|
+
* const metastoreDataAccess = new aws.iam.Role("metastore_data_access", {
|
|
38
38
|
* name: `${prefix}-uc-access`,
|
|
39
|
-
* assumeRolePolicy: thisGetAwsUnityCatalogAssumeRolePolicy.json,
|
|
39
|
+
* assumeRolePolicy: thisGetAwsUnityCatalogAssumeRolePolicy.then(thisGetAwsUnityCatalogAssumeRolePolicy => thisGetAwsUnityCatalogAssumeRolePolicy.json),
|
|
40
40
|
* });
|
|
41
|
-
* const
|
|
41
|
+
* const metastoreDataAccessRolePolicyAttachment = new aws.iam.RolePolicyAttachment("metastore_data_access", {
|
|
42
42
|
* role: metastoreDataAccess.name,
|
|
43
43
|
* policyArn: unityMetastore.arn,
|
|
44
44
|
* });
|
|
@@ -80,15 +80,15 @@ exports.getAwsUnityCatalogPolicy = getAwsUnityCatalogPolicy;
|
|
|
80
80
|
* roleName: `${prefix}-uc-access`,
|
|
81
81
|
* externalId: "12345",
|
|
82
82
|
* });
|
|
83
|
-
* const unityMetastore = new aws.
|
|
83
|
+
* const unityMetastore = new aws.iam.Policy("unity_metastore", {
|
|
84
84
|
* name: `${prefix}-unity-catalog-metastore-access-iam-policy`,
|
|
85
|
-
* policy: _this.json,
|
|
85
|
+
* policy: _this.then(_this => _this.json),
|
|
86
86
|
* });
|
|
87
|
-
* const metastoreDataAccess = new aws.
|
|
87
|
+
* const metastoreDataAccess = new aws.iam.Role("metastore_data_access", {
|
|
88
88
|
* name: `${prefix}-uc-access`,
|
|
89
|
-
* assumeRolePolicy: thisGetAwsUnityCatalogAssumeRolePolicy.json,
|
|
89
|
+
* assumeRolePolicy: thisGetAwsUnityCatalogAssumeRolePolicy.then(thisGetAwsUnityCatalogAssumeRolePolicy => thisGetAwsUnityCatalogAssumeRolePolicy.json),
|
|
90
90
|
* });
|
|
91
|
-
* const
|
|
91
|
+
* const metastoreDataAccessRolePolicyAttachment = new aws.iam.RolePolicyAttachment("metastore_data_access", {
|
|
92
92
|
* role: metastoreDataAccess.name,
|
|
93
93
|
* policyArn: unityMetastore.arn,
|
|
94
94
|
* });
|
package/getCurrentConfig.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ import * as outputs from "./types/output";
|
|
|
14
14
|
* import * as pulumi from "@pulumi/pulumi";
|
|
15
15
|
* import * as databricks from "@pulumi/databricks";
|
|
16
16
|
*
|
|
17
|
-
* function singleOrNone<T>(elements: pulumi.Input<T>[]): pulumi.Input<T> {
|
|
18
|
-
* if (elements.length
|
|
17
|
+
* function singleOrNone<T>(elements: pulumi.Input<T>[]): pulumi.Input<T> | undefined {
|
|
18
|
+
* if (elements.length > 1) {
|
|
19
19
|
* throw new Error("singleOrNone expected input list to have a single element");
|
|
20
20
|
* }
|
|
21
21
|
* return elements[0];
|
|
@@ -97,8 +97,8 @@ export interface GetCurrentConfigResult {
|
|
|
97
97
|
* import * as pulumi from "@pulumi/pulumi";
|
|
98
98
|
* import * as databricks from "@pulumi/databricks";
|
|
99
99
|
*
|
|
100
|
-
* function singleOrNone<T>(elements: pulumi.Input<T>[]): pulumi.Input<T> {
|
|
101
|
-
* if (elements.length
|
|
100
|
+
* function singleOrNone<T>(elements: pulumi.Input<T>[]): pulumi.Input<T> | undefined {
|
|
101
|
+
* if (elements.length > 1) {
|
|
102
102
|
* throw new Error("singleOrNone expected input list to have a single element");
|
|
103
103
|
* }
|
|
104
104
|
* return elements[0];
|
package/getCurrentConfig.js
CHANGED
|
@@ -18,8 +18,8 @@ const utilities = require("./utilities");
|
|
|
18
18
|
* import * as pulumi from "@pulumi/pulumi";
|
|
19
19
|
* import * as databricks from "@pulumi/databricks";
|
|
20
20
|
*
|
|
21
|
-
* function singleOrNone<T>(elements: pulumi.Input<T>[]): pulumi.Input<T> {
|
|
22
|
-
* if (elements.length
|
|
21
|
+
* function singleOrNone<T>(elements: pulumi.Input<T>[]): pulumi.Input<T> | undefined {
|
|
22
|
+
* if (elements.length > 1) {
|
|
23
23
|
* throw new Error("singleOrNone expected input list to have a single element");
|
|
24
24
|
* }
|
|
25
25
|
* return elements[0];
|
|
@@ -84,8 +84,8 @@ exports.getCurrentConfig = getCurrentConfig;
|
|
|
84
84
|
* import * as pulumi from "@pulumi/pulumi";
|
|
85
85
|
* import * as databricks from "@pulumi/databricks";
|
|
86
86
|
*
|
|
87
|
-
* function singleOrNone<T>(elements: pulumi.Input<T>[]): pulumi.Input<T> {
|
|
88
|
-
* if (elements.length
|
|
87
|
+
* function singleOrNone<T>(elements: pulumi.Input<T>[]): pulumi.Input<T> | undefined {
|
|
88
|
+
* if (elements.length > 1) {
|
|
89
89
|
* throw new Error("singleOrNone expected input list to have a single element");
|
|
90
90
|
* }
|
|
91
91
|
* return elements[0];
|
package/getMetastore.d.ts
CHANGED
|
@@ -15,13 +15,13 @@ import * as outputs from "./types/output";
|
|
|
15
15
|
* import * as aws from "@pulumi/aws";
|
|
16
16
|
* import * as databricks from "@pulumi/databricks";
|
|
17
17
|
*
|
|
18
|
-
* const metastore = new aws.
|
|
18
|
+
* const metastore = new aws.s3.Bucket("metastore", {
|
|
19
19
|
* bucket: `${prefix}-metastore`,
|
|
20
20
|
* forceDestroy: true,
|
|
21
21
|
* });
|
|
22
22
|
* const thisMetastore = new databricks.Metastore("this", {
|
|
23
23
|
* name: "primary",
|
|
24
|
-
* storageRoot: `s3://${metastore.id}/metastore`,
|
|
24
|
+
* storageRoot: pulumi.interpolate`s3://${metastore.id}/metastore`,
|
|
25
25
|
* owner: unityAdminGroup,
|
|
26
26
|
* forceDestroy: true,
|
|
27
27
|
* });
|
|
@@ -104,13 +104,13 @@ export interface GetMetastoreResult {
|
|
|
104
104
|
* import * as aws from "@pulumi/aws";
|
|
105
105
|
* import * as databricks from "@pulumi/databricks";
|
|
106
106
|
*
|
|
107
|
-
* const metastore = new aws.
|
|
107
|
+
* const metastore = new aws.s3.Bucket("metastore", {
|
|
108
108
|
* bucket: `${prefix}-metastore`,
|
|
109
109
|
* forceDestroy: true,
|
|
110
110
|
* });
|
|
111
111
|
* const thisMetastore = new databricks.Metastore("this", {
|
|
112
112
|
* name: "primary",
|
|
113
|
-
* storageRoot: `s3://${metastore.id}/metastore`,
|
|
113
|
+
* storageRoot: pulumi.interpolate`s3://${metastore.id}/metastore`,
|
|
114
114
|
* owner: unityAdminGroup,
|
|
115
115
|
* forceDestroy: true,
|
|
116
116
|
* });
|
package/getMetastore.js
CHANGED
|
@@ -19,13 +19,13 @@ const utilities = require("./utilities");
|
|
|
19
19
|
* import * as aws from "@pulumi/aws";
|
|
20
20
|
* import * as databricks from "@pulumi/databricks";
|
|
21
21
|
*
|
|
22
|
-
* const metastore = new aws.
|
|
22
|
+
* const metastore = new aws.s3.Bucket("metastore", {
|
|
23
23
|
* bucket: `${prefix}-metastore`,
|
|
24
24
|
* forceDestroy: true,
|
|
25
25
|
* });
|
|
26
26
|
* const thisMetastore = new databricks.Metastore("this", {
|
|
27
27
|
* name: "primary",
|
|
28
|
-
* storageRoot: `s3://${metastore.id}/metastore`,
|
|
28
|
+
* storageRoot: pulumi.interpolate`s3://${metastore.id}/metastore`,
|
|
29
29
|
* owner: unityAdminGroup,
|
|
30
30
|
* forceDestroy: true,
|
|
31
31
|
* });
|
|
@@ -69,13 +69,13 @@ exports.getMetastore = getMetastore;
|
|
|
69
69
|
* import * as aws from "@pulumi/aws";
|
|
70
70
|
* import * as databricks from "@pulumi/databricks";
|
|
71
71
|
*
|
|
72
|
-
* const metastore = new aws.
|
|
72
|
+
* const metastore = new aws.s3.Bucket("metastore", {
|
|
73
73
|
* bucket: `${prefix}-metastore`,
|
|
74
74
|
* forceDestroy: true,
|
|
75
75
|
* });
|
|
76
76
|
* const thisMetastore = new databricks.Metastore("this", {
|
|
77
77
|
* name: "primary",
|
|
78
|
-
* storageRoot: `s3://${metastore.id}/metastore`,
|
|
78
|
+
* storageRoot: pulumi.interpolate`s3://${metastore.id}/metastore`,
|
|
79
79
|
* owner: unityAdminGroup,
|
|
80
80
|
* forceDestroy: true,
|
|
81
81
|
* });
|
package/instanceProfile.d.ts
CHANGED
|
@@ -8,6 +8,73 @@ import * as outputs from "./types/output";
|
|
|
8
8
|
*
|
|
9
9
|
* > Please switch to databricks.StorageCredential with Unity Catalog to manage storage credentials, which provides a better and faster way for managing credential security.
|
|
10
10
|
*
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
13
|
+
* import * as aws from "@pulumi/aws";
|
|
14
|
+
* import * as databricks from "@pulumi/databricks";
|
|
15
|
+
*
|
|
16
|
+
* const config = new pulumi.Config();
|
|
17
|
+
* // Role that you've specified on https://accounts.cloud.databricks.com/#aws
|
|
18
|
+
* const crossaccountRoleName = config.require("crossaccountRoleName");
|
|
19
|
+
* const assumeRoleForEc2 = aws.iam.getPolicyDocument({
|
|
20
|
+
* statements: [{
|
|
21
|
+
* effect: "Allow",
|
|
22
|
+
* actions: ["sts:AssumeRole"],
|
|
23
|
+
* principals: [{
|
|
24
|
+
* identifiers: ["ec2.amazonaws.com"],
|
|
25
|
+
* type: "Service",
|
|
26
|
+
* }],
|
|
27
|
+
* }],
|
|
28
|
+
* });
|
|
29
|
+
* const roleForS3Access = new aws.iam.Role("role_for_s3_access", {
|
|
30
|
+
* name: "shared-ec2-role-for-s3",
|
|
31
|
+
* description: "Role for shared access",
|
|
32
|
+
* assumeRolePolicy: assumeRoleForEc2.then(assumeRoleForEc2 => assumeRoleForEc2.json),
|
|
33
|
+
* });
|
|
34
|
+
* const passRoleForS3Access = aws.iam.getPolicyDocumentOutput({
|
|
35
|
+
* statements: [{
|
|
36
|
+
* effect: "Allow",
|
|
37
|
+
* actions: ["iam:PassRole"],
|
|
38
|
+
* resources: [roleForS3Access.arn],
|
|
39
|
+
* }],
|
|
40
|
+
* });
|
|
41
|
+
* const passRoleForS3AccessPolicy = new aws.iam.Policy("pass_role_for_s3_access", {
|
|
42
|
+
* name: "shared-pass-role-for-s3-access",
|
|
43
|
+
* path: "/",
|
|
44
|
+
* policy: passRoleForS3Access.apply(passRoleForS3Access => passRoleForS3Access.json),
|
|
45
|
+
* });
|
|
46
|
+
* const crossAccount = new aws.iam.RolePolicyAttachment("cross_account", {
|
|
47
|
+
* policyArn: passRoleForS3AccessPolicy.arn,
|
|
48
|
+
* role: crossaccountRoleName,
|
|
49
|
+
* });
|
|
50
|
+
* const shared = new aws.iam.InstanceProfile("shared", {
|
|
51
|
+
* name: "shared-instance-profile",
|
|
52
|
+
* role: roleForS3Access.name,
|
|
53
|
+
* });
|
|
54
|
+
* const sharedInstanceProfile = new databricks.InstanceProfile("shared", {instanceProfileArn: shared.arn});
|
|
55
|
+
* const latest = databricks.getSparkVersion({});
|
|
56
|
+
* const smallest = databricks.getNodeType({
|
|
57
|
+
* localDisk: true,
|
|
58
|
+
* });
|
|
59
|
+
* const _this = new databricks.Cluster("this", {
|
|
60
|
+
* clusterName: "Shared Autoscaling",
|
|
61
|
+
* sparkVersion: latest.then(latest => latest.id),
|
|
62
|
+
* nodeTypeId: smallest.then(smallest => smallest.id),
|
|
63
|
+
* autoterminationMinutes: 20,
|
|
64
|
+
* autoscale: {
|
|
65
|
+
* minWorkers: 1,
|
|
66
|
+
* maxWorkers: 50,
|
|
67
|
+
* },
|
|
68
|
+
* awsAttributes: {
|
|
69
|
+
* instanceProfileArn: sharedInstanceProfile.id,
|
|
70
|
+
* availability: "SPOT",
|
|
71
|
+
* zoneId: "us-east-1",
|
|
72
|
+
* firstOnDemand: 1,
|
|
73
|
+
* spotBidPricePercent: 100,
|
|
74
|
+
* },
|
|
75
|
+
* });
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
11
78
|
* ## Usage with Cluster Policies
|
|
12
79
|
*
|
|
13
80
|
* It is advised to keep all common configurations in Cluster Policies to maintain control of the environments launched, so `databricks.Cluster` above could be replaced with `databricks.ClusterPolicy`:
|
|
@@ -44,6 +111,46 @@ import * as outputs from "./types/output";
|
|
|
44
111
|
* instanceProfileId: _this.id,
|
|
45
112
|
* });
|
|
46
113
|
* ```
|
|
114
|
+
*
|
|
115
|
+
* ## Usage with Databricks SQL serverless
|
|
116
|
+
*
|
|
117
|
+
* When the instance profile ARN and its associated IAM role ARN don't match and the instance profile is intended for use with Databricks SQL serverless, the `iamRoleArn` parameter can be specified.
|
|
118
|
+
*
|
|
119
|
+
* ```typescript
|
|
120
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
121
|
+
* import * as aws from "@pulumi/aws";
|
|
122
|
+
* import * as databricks from "@pulumi/databricks";
|
|
123
|
+
*
|
|
124
|
+
* const sqlServerlessAssumeRole = aws.iam.getPolicyDocument({
|
|
125
|
+
* statements: [{
|
|
126
|
+
* actions: ["sts:AssumeRole"],
|
|
127
|
+
* principals: [{
|
|
128
|
+
* type: "AWS",
|
|
129
|
+
* identifiers: ["arn:aws:iam::790110701330:role/serverless-customer-resource-role"],
|
|
130
|
+
* }],
|
|
131
|
+
* conditions: [{
|
|
132
|
+
* test: "StringEquals",
|
|
133
|
+
* variable: "sts:ExternalID",
|
|
134
|
+
* values: [
|
|
135
|
+
* "databricks-serverless-<YOUR_WORKSPACE_ID1>",
|
|
136
|
+
* "databricks-serverless-<YOUR_WORKSPACE_ID2>",
|
|
137
|
+
* ],
|
|
138
|
+
* }],
|
|
139
|
+
* }],
|
|
140
|
+
* });
|
|
141
|
+
* const _this = new aws.iam.Role("this", {
|
|
142
|
+
* name: "my-databricks-sql-serverless-role",
|
|
143
|
+
* assumeRolePolicy: sqlServerlessAssumeRole.then(sqlServerlessAssumeRole => sqlServerlessAssumeRole.json),
|
|
144
|
+
* });
|
|
145
|
+
* const thisInstanceProfile = new aws.iam.InstanceProfile("this", {
|
|
146
|
+
* name: "my-databricks-sql-serverless-instance-profile",
|
|
147
|
+
* role: _this.name,
|
|
148
|
+
* });
|
|
149
|
+
* const thisInstanceProfile2 = new databricks.InstanceProfile("this", {
|
|
150
|
+
* instanceProfileArn: thisInstanceProfile.arn,
|
|
151
|
+
* iamRoleArn: _this.arn,
|
|
152
|
+
* });
|
|
153
|
+
* ```
|
|
47
154
|
*/
|
|
48
155
|
export declare class InstanceProfile extends pulumi.CustomResource {
|
|
49
156
|
/**
|
package/instanceProfile.js
CHANGED
|
@@ -12,6 +12,73 @@ const utilities = require("./utilities");
|
|
|
12
12
|
*
|
|
13
13
|
* > Please switch to databricks.StorageCredential with Unity Catalog to manage storage credentials, which provides a better and faster way for managing credential security.
|
|
14
14
|
*
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
17
|
+
* import * as aws from "@pulumi/aws";
|
|
18
|
+
* import * as databricks from "@pulumi/databricks";
|
|
19
|
+
*
|
|
20
|
+
* const config = new pulumi.Config();
|
|
21
|
+
* // Role that you've specified on https://accounts.cloud.databricks.com/#aws
|
|
22
|
+
* const crossaccountRoleName = config.require("crossaccountRoleName");
|
|
23
|
+
* const assumeRoleForEc2 = aws.iam.getPolicyDocument({
|
|
24
|
+
* statements: [{
|
|
25
|
+
* effect: "Allow",
|
|
26
|
+
* actions: ["sts:AssumeRole"],
|
|
27
|
+
* principals: [{
|
|
28
|
+
* identifiers: ["ec2.amazonaws.com"],
|
|
29
|
+
* type: "Service",
|
|
30
|
+
* }],
|
|
31
|
+
* }],
|
|
32
|
+
* });
|
|
33
|
+
* const roleForS3Access = new aws.iam.Role("role_for_s3_access", {
|
|
34
|
+
* name: "shared-ec2-role-for-s3",
|
|
35
|
+
* description: "Role for shared access",
|
|
36
|
+
* assumeRolePolicy: assumeRoleForEc2.then(assumeRoleForEc2 => assumeRoleForEc2.json),
|
|
37
|
+
* });
|
|
38
|
+
* const passRoleForS3Access = aws.iam.getPolicyDocumentOutput({
|
|
39
|
+
* statements: [{
|
|
40
|
+
* effect: "Allow",
|
|
41
|
+
* actions: ["iam:PassRole"],
|
|
42
|
+
* resources: [roleForS3Access.arn],
|
|
43
|
+
* }],
|
|
44
|
+
* });
|
|
45
|
+
* const passRoleForS3AccessPolicy = new aws.iam.Policy("pass_role_for_s3_access", {
|
|
46
|
+
* name: "shared-pass-role-for-s3-access",
|
|
47
|
+
* path: "/",
|
|
48
|
+
* policy: passRoleForS3Access.apply(passRoleForS3Access => passRoleForS3Access.json),
|
|
49
|
+
* });
|
|
50
|
+
* const crossAccount = new aws.iam.RolePolicyAttachment("cross_account", {
|
|
51
|
+
* policyArn: passRoleForS3AccessPolicy.arn,
|
|
52
|
+
* role: crossaccountRoleName,
|
|
53
|
+
* });
|
|
54
|
+
* const shared = new aws.iam.InstanceProfile("shared", {
|
|
55
|
+
* name: "shared-instance-profile",
|
|
56
|
+
* role: roleForS3Access.name,
|
|
57
|
+
* });
|
|
58
|
+
* const sharedInstanceProfile = new databricks.InstanceProfile("shared", {instanceProfileArn: shared.arn});
|
|
59
|
+
* const latest = databricks.getSparkVersion({});
|
|
60
|
+
* const smallest = databricks.getNodeType({
|
|
61
|
+
* localDisk: true,
|
|
62
|
+
* });
|
|
63
|
+
* const _this = new databricks.Cluster("this", {
|
|
64
|
+
* clusterName: "Shared Autoscaling",
|
|
65
|
+
* sparkVersion: latest.then(latest => latest.id),
|
|
66
|
+
* nodeTypeId: smallest.then(smallest => smallest.id),
|
|
67
|
+
* autoterminationMinutes: 20,
|
|
68
|
+
* autoscale: {
|
|
69
|
+
* minWorkers: 1,
|
|
70
|
+
* maxWorkers: 50,
|
|
71
|
+
* },
|
|
72
|
+
* awsAttributes: {
|
|
73
|
+
* instanceProfileArn: sharedInstanceProfile.id,
|
|
74
|
+
* availability: "SPOT",
|
|
75
|
+
* zoneId: "us-east-1",
|
|
76
|
+
* firstOnDemand: 1,
|
|
77
|
+
* spotBidPricePercent: 100,
|
|
78
|
+
* },
|
|
79
|
+
* });
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
15
82
|
* ## Usage with Cluster Policies
|
|
16
83
|
*
|
|
17
84
|
* It is advised to keep all common configurations in Cluster Policies to maintain control of the environments launched, so `databricks.Cluster` above could be replaced with `databricks.ClusterPolicy`:
|
|
@@ -48,6 +115,46 @@ const utilities = require("./utilities");
|
|
|
48
115
|
* instanceProfileId: _this.id,
|
|
49
116
|
* });
|
|
50
117
|
* ```
|
|
118
|
+
*
|
|
119
|
+
* ## Usage with Databricks SQL serverless
|
|
120
|
+
*
|
|
121
|
+
* When the instance profile ARN and its associated IAM role ARN don't match and the instance profile is intended for use with Databricks SQL serverless, the `iamRoleArn` parameter can be specified.
|
|
122
|
+
*
|
|
123
|
+
* ```typescript
|
|
124
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
125
|
+
* import * as aws from "@pulumi/aws";
|
|
126
|
+
* import * as databricks from "@pulumi/databricks";
|
|
127
|
+
*
|
|
128
|
+
* const sqlServerlessAssumeRole = aws.iam.getPolicyDocument({
|
|
129
|
+
* statements: [{
|
|
130
|
+
* actions: ["sts:AssumeRole"],
|
|
131
|
+
* principals: [{
|
|
132
|
+
* type: "AWS",
|
|
133
|
+
* identifiers: ["arn:aws:iam::790110701330:role/serverless-customer-resource-role"],
|
|
134
|
+
* }],
|
|
135
|
+
* conditions: [{
|
|
136
|
+
* test: "StringEquals",
|
|
137
|
+
* variable: "sts:ExternalID",
|
|
138
|
+
* values: [
|
|
139
|
+
* "databricks-serverless-<YOUR_WORKSPACE_ID1>",
|
|
140
|
+
* "databricks-serverless-<YOUR_WORKSPACE_ID2>",
|
|
141
|
+
* ],
|
|
142
|
+
* }],
|
|
143
|
+
* }],
|
|
144
|
+
* });
|
|
145
|
+
* const _this = new aws.iam.Role("this", {
|
|
146
|
+
* name: "my-databricks-sql-serverless-role",
|
|
147
|
+
* assumeRolePolicy: sqlServerlessAssumeRole.then(sqlServerlessAssumeRole => sqlServerlessAssumeRole.json),
|
|
148
|
+
* });
|
|
149
|
+
* const thisInstanceProfile = new aws.iam.InstanceProfile("this", {
|
|
150
|
+
* name: "my-databricks-sql-serverless-instance-profile",
|
|
151
|
+
* role: _this.name,
|
|
152
|
+
* });
|
|
153
|
+
* const thisInstanceProfile2 = new databricks.InstanceProfile("this", {
|
|
154
|
+
* instanceProfileArn: thisInstanceProfile.arn,
|
|
155
|
+
* iamRoleArn: _this.arn,
|
|
156
|
+
* });
|
|
157
|
+
* ```
|
|
51
158
|
*/
|
|
52
159
|
class InstanceProfile extends pulumi.CustomResource {
|
|
53
160
|
/**
|
package/instanceProfile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instanceProfile.js","sourceRoot":"","sources":["../instanceProfile.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AAGzC,yCAAyC;AAEzC
|
|
1
|
+
{"version":3,"file":"instanceProfile.js","sourceRoot":"","sources":["../instanceProfile.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AAGzC,yCAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsJG;AACH,MAAa,eAAgB,SAAQ,MAAM,CAAC,cAAc;IACtD;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAA4B,EAAE,IAAmC;QAC1H,OAAO,IAAI,eAAe,CAAC,IAAI,EAAO,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC;IAKD;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,GAAQ;QAC7B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE;YACnC,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,eAAe,CAAC,YAAY,CAAC;IAChE,CAAC;IA+BD,YAAY,IAAY,EAAE,WAAwD,EAAE,IAAmC;QACnH,IAAI,cAAc,GAAkB,EAAE,CAAC;QACvC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAClB,IAAI,IAAI,CAAC,EAAE,EAAE;YACT,MAAM,KAAK,GAAG,WAA+C,CAAC;YAC9D,cAAc,CAAC,YAAY,CAAC,GAAG,KAAK,EAAE,UAAU,CAAC;YACjD,cAAc,CAAC,oBAAoB,CAAC,GAAG,KAAK,EAAE,kBAAkB,CAAC;YACjE,cAAc,CAAC,uBAAuB,CAAC,GAAG,KAAK,EAAE,qBAAqB,CAAC;YACvE,cAAc,CAAC,gBAAgB,CAAC,GAAG,KAAK,EAAE,cAAc,CAAC;YACzD,cAAc,CAAC,gBAAgB,CAAC,GAAG,KAAK,EAAE,cAAc,CAAC;SAC5D;aAAM;YACH,MAAM,IAAI,GAAG,WAA8C,CAAC;YAC5D,IAAI,IAAI,EAAE,kBAAkB,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;gBACrD,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;aACrE;YACD,cAAc,CAAC,YAAY,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC;YAChD,cAAc,CAAC,oBAAoB,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC;YAChE,cAAc,CAAC,uBAAuB,CAAC,GAAG,IAAI,EAAE,qBAAqB,CAAC;YACtE,cAAc,CAAC,gBAAgB,CAAC,GAAG,IAAI,EAAE,cAAc,CAAC;YACxD,cAAc,CAAC,gBAAgB,CAAC,GAAG,IAAI,EAAE,cAAc,CAAC;SAC3D;QACD,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;QACnE,KAAK,CAAC,eAAe,CAAC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IACpE,CAAC;;AAhFL,0CAiFC;AAnEG,gBAAgB;AACO,4BAAY,GAAG,kDAAkD,CAAC"}
|
package/mount.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ import * as outputs from "./types/output";
|
|
|
72
72
|
*
|
|
73
73
|
* ```typescript
|
|
74
74
|
* import * as pulumi from "@pulumi/pulumi";
|
|
75
|
-
* import * as
|
|
75
|
+
* import * as azure from "@pulumi/azure";
|
|
76
76
|
* import * as databricks from "@pulumi/databricks";
|
|
77
77
|
*
|
|
78
78
|
* const config = new pulumi.Config();
|
|
@@ -80,7 +80,7 @@ import * as outputs from "./types/output";
|
|
|
80
80
|
* const resourceGroup = config.require("resourceGroup");
|
|
81
81
|
* // Name of the Databricks Workspace
|
|
82
82
|
* const workspaceName = config.require("workspaceName");
|
|
83
|
-
* const _this =
|
|
83
|
+
* const _this = azure.databricks.getWorkspace({
|
|
84
84
|
* name: workspaceName,
|
|
85
85
|
* resourceGroupName: resourceGroup,
|
|
86
86
|
* });
|
|
@@ -161,7 +161,7 @@ import * as outputs from "./types/output";
|
|
|
161
161
|
*
|
|
162
162
|
* ```typescript
|
|
163
163
|
* import * as pulumi from "@pulumi/pulumi";
|
|
164
|
-
* import * as
|
|
164
|
+
* import * as azure from "@pulumi/azure";
|
|
165
165
|
* import * as databricks from "@pulumi/databricks";
|
|
166
166
|
*
|
|
167
167
|
* const terraform = new databricks.SecretScope("terraform", {
|
|
@@ -173,7 +173,7 @@ import * as outputs from "./types/output";
|
|
|
173
173
|
* stringValue: ARM_CLIENT_SECRET,
|
|
174
174
|
* scope: terraform.name,
|
|
175
175
|
* });
|
|
176
|
-
* const _this = new
|
|
176
|
+
* const _this = new azure.storage.Account("this", {
|
|
177
177
|
* name: `${prefix}datalake`,
|
|
178
178
|
* resourceGroupName: resourceGroupName,
|
|
179
179
|
* location: resourceGroupLocation,
|
|
@@ -182,19 +182,19 @@ import * as outputs from "./types/output";
|
|
|
182
182
|
* accountKind: "StorageV2",
|
|
183
183
|
* isHnsEnabled: true,
|
|
184
184
|
* });
|
|
185
|
-
* const
|
|
185
|
+
* const thisAssignment = new azure.authorization.Assignment("this", {
|
|
186
186
|
* scope: _this.id,
|
|
187
187
|
* roleDefinitionName: "Storage Blob Data Contributor",
|
|
188
188
|
* principalId: current.objectId,
|
|
189
189
|
* });
|
|
190
|
-
* const
|
|
190
|
+
* const thisContainer = new azure.storage.Container("this", {
|
|
191
191
|
* name: "marketing",
|
|
192
192
|
* storageAccountName: _this.name,
|
|
193
193
|
* containerAccessType: "private",
|
|
194
194
|
* });
|
|
195
195
|
* const marketing = new databricks.Mount("marketing", {
|
|
196
196
|
* name: "marketing",
|
|
197
|
-
* resourceId:
|
|
197
|
+
* resourceId: thisContainer.resourceManagerId,
|
|
198
198
|
* abfs: {
|
|
199
199
|
* clientId: current.clientId,
|
|
200
200
|
* clientSecretScope: terraform.name,
|
|
@@ -273,10 +273,10 @@ import * as outputs from "./types/output";
|
|
|
273
273
|
*
|
|
274
274
|
* ```typescript
|
|
275
275
|
* import * as pulumi from "@pulumi/pulumi";
|
|
276
|
-
* import * as
|
|
276
|
+
* import * as azure from "@pulumi/azure";
|
|
277
277
|
* import * as databricks from "@pulumi/databricks";
|
|
278
278
|
*
|
|
279
|
-
* const blobaccount = new
|
|
279
|
+
* const blobaccount = new azure.storage.Account("blobaccount", {
|
|
280
280
|
* name: `${prefix}blob`,
|
|
281
281
|
* resourceGroupName: resourceGroupName,
|
|
282
282
|
* location: resourceGroupLocation,
|
|
@@ -284,7 +284,7 @@ import * as outputs from "./types/output";
|
|
|
284
284
|
* accountReplicationType: "LRS",
|
|
285
285
|
* accountKind: "StorageV2",
|
|
286
286
|
* });
|
|
287
|
-
* const marketing = new
|
|
287
|
+
* const marketing = new azure.storage.Container("marketing", {
|
|
288
288
|
* name: "marketing",
|
|
289
289
|
* storageAccountName: blobaccount.name,
|
|
290
290
|
* containerAccessType: "private",
|
package/mount.js
CHANGED
|
@@ -76,7 +76,7 @@ const utilities = require("./utilities");
|
|
|
76
76
|
*
|
|
77
77
|
* ```typescript
|
|
78
78
|
* import * as pulumi from "@pulumi/pulumi";
|
|
79
|
-
* import * as
|
|
79
|
+
* import * as azure from "@pulumi/azure";
|
|
80
80
|
* import * as databricks from "@pulumi/databricks";
|
|
81
81
|
*
|
|
82
82
|
* const config = new pulumi.Config();
|
|
@@ -84,7 +84,7 @@ const utilities = require("./utilities");
|
|
|
84
84
|
* const resourceGroup = config.require("resourceGroup");
|
|
85
85
|
* // Name of the Databricks Workspace
|
|
86
86
|
* const workspaceName = config.require("workspaceName");
|
|
87
|
-
* const _this =
|
|
87
|
+
* const _this = azure.databricks.getWorkspace({
|
|
88
88
|
* name: workspaceName,
|
|
89
89
|
* resourceGroupName: resourceGroup,
|
|
90
90
|
* });
|
|
@@ -165,7 +165,7 @@ const utilities = require("./utilities");
|
|
|
165
165
|
*
|
|
166
166
|
* ```typescript
|
|
167
167
|
* import * as pulumi from "@pulumi/pulumi";
|
|
168
|
-
* import * as
|
|
168
|
+
* import * as azure from "@pulumi/azure";
|
|
169
169
|
* import * as databricks from "@pulumi/databricks";
|
|
170
170
|
*
|
|
171
171
|
* const terraform = new databricks.SecretScope("terraform", {
|
|
@@ -177,7 +177,7 @@ const utilities = require("./utilities");
|
|
|
177
177
|
* stringValue: ARM_CLIENT_SECRET,
|
|
178
178
|
* scope: terraform.name,
|
|
179
179
|
* });
|
|
180
|
-
* const _this = new
|
|
180
|
+
* const _this = new azure.storage.Account("this", {
|
|
181
181
|
* name: `${prefix}datalake`,
|
|
182
182
|
* resourceGroupName: resourceGroupName,
|
|
183
183
|
* location: resourceGroupLocation,
|
|
@@ -186,19 +186,19 @@ const utilities = require("./utilities");
|
|
|
186
186
|
* accountKind: "StorageV2",
|
|
187
187
|
* isHnsEnabled: true,
|
|
188
188
|
* });
|
|
189
|
-
* const
|
|
189
|
+
* const thisAssignment = new azure.authorization.Assignment("this", {
|
|
190
190
|
* scope: _this.id,
|
|
191
191
|
* roleDefinitionName: "Storage Blob Data Contributor",
|
|
192
192
|
* principalId: current.objectId,
|
|
193
193
|
* });
|
|
194
|
-
* const
|
|
194
|
+
* const thisContainer = new azure.storage.Container("this", {
|
|
195
195
|
* name: "marketing",
|
|
196
196
|
* storageAccountName: _this.name,
|
|
197
197
|
* containerAccessType: "private",
|
|
198
198
|
* });
|
|
199
199
|
* const marketing = new databricks.Mount("marketing", {
|
|
200
200
|
* name: "marketing",
|
|
201
|
-
* resourceId:
|
|
201
|
+
* resourceId: thisContainer.resourceManagerId,
|
|
202
202
|
* abfs: {
|
|
203
203
|
* clientId: current.clientId,
|
|
204
204
|
* clientSecretScope: terraform.name,
|
|
@@ -277,10 +277,10 @@ const utilities = require("./utilities");
|
|
|
277
277
|
*
|
|
278
278
|
* ```typescript
|
|
279
279
|
* import * as pulumi from "@pulumi/pulumi";
|
|
280
|
-
* import * as
|
|
280
|
+
* import * as azure from "@pulumi/azure";
|
|
281
281
|
* import * as databricks from "@pulumi/databricks";
|
|
282
282
|
*
|
|
283
|
-
* const blobaccount = new
|
|
283
|
+
* const blobaccount = new azure.storage.Account("blobaccount", {
|
|
284
284
|
* name: `${prefix}blob`,
|
|
285
285
|
* resourceGroupName: resourceGroupName,
|
|
286
286
|
* location: resourceGroupLocation,
|
|
@@ -288,7 +288,7 @@ const utilities = require("./utilities");
|
|
|
288
288
|
* accountReplicationType: "LRS",
|
|
289
289
|
* accountKind: "StorageV2",
|
|
290
290
|
* });
|
|
291
|
-
* const marketing = new
|
|
291
|
+
* const marketing = new azure.storage.Container("marketing", {
|
|
292
292
|
* name: "marketing",
|
|
293
293
|
* storageAccountName: blobaccount.name,
|
|
294
294
|
* containerAccessType: "private",
|
package/mwsCredentials.d.ts
CHANGED
|
@@ -21,16 +21,16 @@ import * as pulumi from "@pulumi/pulumi";
|
|
|
21
21
|
* const _this = databricks.getAwsAssumeRolePolicy({
|
|
22
22
|
* externalId: databricksAccountId,
|
|
23
23
|
* });
|
|
24
|
-
* const crossAccountRole = new aws.
|
|
24
|
+
* const crossAccountRole = new aws.iam.Role("cross_account_role", {
|
|
25
25
|
* name: `${prefix}-crossaccount`,
|
|
26
|
-
* assumeRolePolicy: _this.json,
|
|
26
|
+
* assumeRolePolicy: _this.then(_this => _this.json),
|
|
27
27
|
* tags: tags,
|
|
28
28
|
* });
|
|
29
29
|
* const thisGetAwsCrossAccountPolicy = databricks.getAwsCrossAccountPolicy({});
|
|
30
|
-
* const
|
|
30
|
+
* const thisRolePolicy = new aws.iam.RolePolicy("this", {
|
|
31
31
|
* name: `${prefix}-policy`,
|
|
32
32
|
* role: crossAccountRole.id,
|
|
33
|
-
* policy: thisGetAwsCrossAccountPolicy.json,
|
|
33
|
+
* policy: thisGetAwsCrossAccountPolicy.then(thisGetAwsCrossAccountPolicy => thisGetAwsCrossAccountPolicy.json),
|
|
34
34
|
* });
|
|
35
35
|
* const thisMwsCredentials = new databricks.MwsCredentials("this", {
|
|
36
36
|
* credentialsName: `${prefix}-creds`,
|
package/mwsCredentials.js
CHANGED
|
@@ -27,16 +27,16 @@ const utilities = require("./utilities");
|
|
|
27
27
|
* const _this = databricks.getAwsAssumeRolePolicy({
|
|
28
28
|
* externalId: databricksAccountId,
|
|
29
29
|
* });
|
|
30
|
-
* const crossAccountRole = new aws.
|
|
30
|
+
* const crossAccountRole = new aws.iam.Role("cross_account_role", {
|
|
31
31
|
* name: `${prefix}-crossaccount`,
|
|
32
|
-
* assumeRolePolicy: _this.json,
|
|
32
|
+
* assumeRolePolicy: _this.then(_this => _this.json),
|
|
33
33
|
* tags: tags,
|
|
34
34
|
* });
|
|
35
35
|
* const thisGetAwsCrossAccountPolicy = databricks.getAwsCrossAccountPolicy({});
|
|
36
|
-
* const
|
|
36
|
+
* const thisRolePolicy = new aws.iam.RolePolicy("this", {
|
|
37
37
|
* name: `${prefix}-policy`,
|
|
38
38
|
* role: crossAccountRole.id,
|
|
39
|
-
* policy: thisGetAwsCrossAccountPolicy.json,
|
|
39
|
+
* policy: thisGetAwsCrossAccountPolicy.then(thisGetAwsCrossAccountPolicy => thisGetAwsCrossAccountPolicy.json),
|
|
40
40
|
* });
|
|
41
41
|
* const thisMwsCredentials = new databricks.MwsCredentials("this", {
|
|
42
42
|
* credentialsName: `${prefix}-creds`,
|