Skip to content

Commit 1110e5a

Browse files
committed
update
1 parent 2b4ed56 commit 1110e5a

18 files changed

+78
-77
lines changed

Aks/Helper.ts

+9-10
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import * as containerservice from '@pulumi/azure-native/containerservice';
22
import { getAksName, getResourceGroupName } from '../Common/Naming';
33
import { createProvider } from '../KubeX/Providers';
44
import { KeyVaultInfo } from '../types';
5-
import { getSecret, getSecretVersions } from '../KeyVault/Helper';
5+
import { getSecret } from '../KeyVault/Helper';
66
import { getIdentitySecrets } from '../AzAd/Helper';
7-
import * as console from 'console';
87

98
/** Get AKS Config from Managed Cluster*/
109
export const getAksConfig = async ({
@@ -101,27 +100,27 @@ export const createAksVaultProvider = async ({
101100
version,
102101
secretName,
103102
namespace,
104-
base64Encoded,
103+
base64Encoded,
105104
vaultInfo,
106105
}: {
107106
aksName: string;
108107
secretName?: string;
109108
version?: string;
110109
vaultInfo: KeyVaultInfo;
111-
base64Encoded?:boolean;
110+
base64Encoded?: boolean;
112111
namespace?: string;
113112
}) => {
114113
const value = await getAksVaultConfig({
115-
name: secretName ?? aksName,
116-
version,
117-
formattedName: Boolean(secretName),
118-
vaultInfo,
119-
});
114+
name: secretName ?? aksName,
115+
version,
116+
formattedName: Boolean(secretName),
117+
vaultInfo,
118+
});
120119

121120
return createProvider({
122121
name: aksName,
123122
namespace,
124123
ignoreChanges: true,
125-
kubeconfig: base64Encoded? Buffer.from(value,'base64').toString() :value,
124+
kubeconfig: base64Encoded ? Buffer.from(value, 'base64').toString() : value,
126125
});
127126
};

Aks/Identity.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default async ({ name, vaultInfo }: Props) => {
1919
{ name: 'Directory.Read.All', type: 'Role' }
2020
);
2121

22-
const serverIdentity = await identityCreator({
22+
const serverIdentity = identityCreator({
2323
name,
2424
createClientSecret: true,
2525
createPrincipal: true,
@@ -29,7 +29,7 @@ export default async ({ name, vaultInfo }: Props) => {
2929
vaultInfo,
3030
});
3131

32-
await roleAssignment({
32+
roleAssignment({
3333
name: `${name}-aks-identity-acr-pull`,
3434
principalId: serverIdentity.principalId!,
3535
principalType: 'ServicePrincipal',

Aks/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ export default async ({
636636
// }
637637

638638
if (acrScope && identityProfile && identityProfile['kubeletidentity']) {
639-
await roleAssignment({
639+
roleAssignment({
640640
name: `${name}-aks-identity-profile-pull`,
641641
principalId: identityProfile['kubeletidentity'].objectId!,
642642
principalType: 'ServicePrincipal',
@@ -666,7 +666,7 @@ export default async ({
666666
// }
667667

668668
if (network.subnetId && identity) {
669-
await roleAssignment({
669+
roleAssignment({
670670
name: `${name}-system-net`,
671671
principalId: identity.principalId,
672672
roleName: 'Contributor',
@@ -678,7 +678,7 @@ export default async ({
678678
}
679679

680680
if (privateZone && identity) {
681-
await roleAssignment({
681+
roleAssignment({
682682
name: `${name}-private-dns`,
683683
principalId: identity.principalId,
684684
roleName: 'Private DNS Zone Contributor',
@@ -689,7 +689,7 @@ export default async ({
689689
});
690690

691691
//Apply monitoring for VMScale Sets
692-
await vmsDiagnostic({
692+
vmsDiagnostic({
693693
group: { resourceGroupName: nodeResourceGroup },
694694
...log,
695695
vaultInfo,

Apps/LogicApp.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { getCertOrderName } from '../Common/Naming';
99

1010
interface Props extends BasicResourceArgs, DefaultResourceArgs {}
1111

12-
export default ({ name, group, ...others }: Props) => {
12+
export default ({ name, ...others }: Props) => {
1313
const n = getCertOrderName(name);
1414

1515
const order = creator(logic.Workflow, {

AzAd/Group.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import * as azuread from '@pulumi/azuread';
22
import { Input, Output } from '@pulumi/pulumi';
3-
43
import { defaultScope } from '../Common/AzureEnv';
54
import { roleAssignment } from './RoleAssignment';
6-
import { testMode } from '../Common/StackEnv';
75

86
export interface GroupPermissionProps {
97
/** The name of the roles would like to assign to this group*/
@@ -43,7 +41,7 @@ export default async ({ name, permissions, members, owners }: AdGroupProps) => {
4341

4442
if (permissions) {
4543
await Promise.all(
46-
permissions.map((p, i) =>
44+
permissions.map((p) =>
4745
roleAssignment({
4846
name,
4947
principalId: group.objectId,

AzAd/Identity.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import * as azureAD from '@pulumi/azuread';
2+
import { ServicePrincipal } from '@pulumi/azuread';
23
import * as pulumi from '@pulumi/pulumi';
4+
import { Input, Output } from '@pulumi/pulumi';
35
import { getIdentityName } from '../Common/Naming';
46
import {
7+
ApplicationApiOauth2PermissionScope,
58
ApplicationAppRole,
69
ApplicationRequiredResourceAccess,
7-
ApplicationApiOauth2PermissionScope,
810
} from '@pulumi/azuread/types/input';
911

1012
import { KeyVaultInfo } from '../types';
11-
import { Input, Output } from '@pulumi/pulumi';
12-
import { ServicePrincipal } from '@pulumi/azuread';
13-
import { randomPassword } from '../Core/Random';
1413
import { roleAssignment } from './RoleAssignment';
1514
import { defaultScope } from '../Common/AzureEnv';
1615
import { addCustomSecret } from '../KeyVault/CustomHelper';

AzAd/Role.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import adGroupCreator, { GroupPermissionProps } from './Group';
2-
import { currentEnv, Environments } from '../Common/AzureEnv';
2+
import { Environments } from '../Common/AzureEnv';
33
import { Input } from '@pulumi/pulumi';
44
import { organization } from '../Common/StackEnv';
55

Cdn/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default async ({
3939
});
4040

4141
if (vaultAccess.enableRbacAccess) {
42-
await grantVaultRbacPermission({
42+
grantVaultRbacPermission({
4343
name: n,
4444
objectId: sp.objectId,
4545
permission: 'ReadOnly',

Certificate/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import fs from 'fs';
33
import * as pem from './p12';
44
import { KeyVaultInfo } from '../types';
55
import { addCustomSecret } from '../KeyVault/CustomHelper';
6-
import forge from 'node-forge';
76

87
export const defaultAllowedUses = [
98
'data_encipherment',

ContainerRegistry/index.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import * as containerregistry from '@pulumi/azure-native/containerregistry';
22
import {
3-
BasicResourceArgs,
3+
DefaultResourceArgs,
44
KeyVaultInfo,
55
NetworkRulesProps,
66
ResourceGroupInfo,
7-
} from './../types.d';
8-
import { DefaultResourceArgs } from '../types';
7+
} from '../types';
98
import creator from '../Core/ResourceCreator';
109
import * as global from '../Common/GlobalEnv';
1110
import {

Core/Random.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export const randomSsh = ({
161161
};
162162
};
163163

164-
export const randomLogin = async ({
164+
export const randomLogin = ({
165165
name,
166166
loginPrefix,
167167
maxUserNameLength,

CosmosDb/index.ts

+29-26
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import * as documentdb from "@pulumi/azure-native/documentdb";
2-
import { getCosmosDbName } from "../Common/Naming";
3-
import { DefaultResourceArgs, KeyVaultInfo, ResourceGroupInfo } from "../types";
4-
import ResourceCreator from "../Core/ResourceCreator";
5-
import { defaultTags, isPrd } from "../Common/AzureEnv";
6-
import { createThreatProtection } from "../Logs/Helpers";
7-
import { Input } from "@pulumi/pulumi";
1+
import * as documentdb from '@pulumi/azure-native/documentdb';
2+
import { getCosmosDbName } from '../Common/Naming';
3+
import { DefaultResourceArgs, KeyVaultInfo, ResourceGroupInfo } from '../types';
4+
import ResourceCreator from '../Core/ResourceCreator';
5+
import { defaultTags, isPrd } from '../Common/AzureEnv';
6+
import { createThreatProtection } from '../Logs/Helpers';
7+
import { Input } from '@pulumi/pulumi';
88

99
interface CosmosDbProps {
1010
name: string;
1111
group: ResourceGroupInfo;
1212
vaultInfo?: KeyVaultInfo;
1313
locations?: Input<string>[];
1414
enableMultipleWriteLocations?: boolean;
15-
capabilities?: Array<"EnableCassandra" | "EnableTable" | "EnableGremlin">;
16-
kind?: documentdb.DatabaseAccountKind,
17-
enableThreatProtection?:boolean;
15+
capabilities?: Array<'EnableCassandra' | 'EnableTable' | 'EnableGremlin'>;
16+
kind?: documentdb.DatabaseAccountKind;
17+
enableThreatProtection?: boolean;
1818
network?: {
1919
publicNetworkAccess?: boolean;
2020
allowAzureServicesAccess?: boolean;
@@ -47,7 +47,7 @@ export default async ({
4747
enableThreatProtection,
4848
network,
4949
sqlDbs,
50-
kind= documentdb.DatabaseAccountKind.GlobalDocumentDB,
50+
kind = documentdb.DatabaseAccountKind.GlobalDocumentDB,
5151
}: CosmosDbProps) => {
5252
name = getCosmosDbName(name);
5353

@@ -70,7 +70,7 @@ export default async ({
7070
...group,
7171
databaseAccountOfferType: documentdb.DatabaseAccountOfferType.Standard,
7272
kind,
73-
identity: { type: "SystemAssigned" },
73+
identity: { type: 'SystemAssigned' },
7474

7575
capabilities: capabilities
7676
? capabilities.map((n) => ({ name: n }))
@@ -80,7 +80,7 @@ export default async ({
8080

8181
backupPolicy: isPrd
8282
? {
83-
type: "Periodic",
83+
type: 'Periodic',
8484
periodicModeProperties: {
8585
backupIntervalInMinutes: 30,
8686
backupRetentionIntervalInHours: 4,
@@ -126,21 +126,24 @@ export default async ({
126126
//keyVaultKeyId: encryptKey?.properties.id,
127127
monitoring: {
128128
logsCategories: [
129-
"CassandraRequests",
130-
"PartitionKeyStatistics",
131-
"ControlPlaneRequests",
132-
"MongoRequests",
133-
"QueryRuntimeStatistics",
134-
"GremlinRequests",
135-
"PartitionKeyRUConsumption",
136-
"DataPlaneRequests",
129+
'CassandraRequests',
130+
'PartitionKeyStatistics',
131+
'ControlPlaneRequests',
132+
'MongoRequests',
133+
'QueryRuntimeStatistics',
134+
'GremlinRequests',
135+
'PartitionKeyRUConsumption',
136+
'DataPlaneRequests',
137137
],
138-
metricsCategories: ["Requests"],
138+
metricsCategories: ['Requests'],
139139
},
140140
tags: defaultTags,
141141
} as unknown as documentdb.DatabaseAccountArgs & DefaultResourceArgs);
142142

143-
if(enableThreatProtection && kind!== documentdb.DatabaseAccountKind.MongoDB) {
143+
if (
144+
enableThreatProtection &&
145+
kind !== documentdb.DatabaseAccountKind.MongoDB
146+
) {
144147
//Thread Protection
145148
createThreatProtection({
146149
name,
@@ -150,7 +153,7 @@ export default async ({
150153

151154
//Vault variables
152155
if (vaultInfo) {
153-
const keys = resource.id.apply(async (id) => {
156+
resource.id.apply(async (id) => {
154157
if (!id) return undefined;
155158
return await documentdb.listDatabaseAccountKeys({
156159
accountName: name,
@@ -162,7 +165,7 @@ export default async ({
162165
//Database and Containers
163166
if (sqlDbs) {
164167
sqlDbs.forEach((db) => {
165-
const database = new documentdb.SqlResourceSqlDatabase(
168+
new documentdb.SqlResourceSqlDatabase(
166169
db.name,
167170
{
168171
databaseName: db.name,
@@ -184,7 +187,7 @@ export default async ({
184187
resource: {
185188
id: c.name,
186189
defaultTtl: c.ttl,
187-
partitionKey: { paths: [c.partitionKeyPath || "/id"] },
190+
partitionKey: { paths: [c.partitionKeyPath || '/id'] },
188191
},
189192
})
190193
);

CustomProviders/ApimSignInSettings.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as pulumi from '@pulumi/pulumi';
2-
import { AxiosInstance } from 'axios';
3-
import {createAxios} from '../Tools/Axios';
2+
import { createAxios } from '../Tools/Axios';
43

54
import {
65
BaseOptions,

CustomProviders/AppConfigDisableAccessKeys.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as pulumi from '@pulumi/pulumi';
2-
import { AxiosInstance } from 'axios';
3-
import {createAxios} from '../Tools/Axios';
2+
import { createAxios } from '../Tools/Axios';
43

54
import {
65
BaseOptions,

KubeX/CloudFlare/DynamicDns.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export default ({
2828
const name = 'cloudflare-ddns';
2929
const image = 'baoduy2412/cloudflare-ddns:latest';
3030

31-
const configMap: any = {};
32-
const secrets: any = {};
31+
const configMap: Record<string, Input<string>> = {};
32+
const secrets: Record<string, Input<string>> = {};
3333

3434
cloudFlare.forEach((c, ci) => {
3535
secrets[`Cloudflare__${ci}__ApiKey`] = c.apiKey;
@@ -62,6 +62,7 @@ export default ({
6262
secrets,
6363

6464
podConfig: {
65+
ports: { http: 8080 },
6566
image,
6667
resources: { requests: { memory: '1Mi', cpu: '1m' } },
6768
},

KubeX/CloudFlare/Tunnel-Helm.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { DefaultK8sArgs } from '../types';
2-
import Deployment from '../Deployment';
32
import { Input } from '@pulumi/pulumi';
43
import * as k8s from '@pulumi/kubernetes';
54

0 commit comments

Comments
 (0)