-
Notifications
You must be signed in to change notification settings - Fork 0
/
vpcSubnet.ts
43 lines (40 loc) · 1.32 KB
/
vpcSubnet.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { Subnetwork } from '@pulumi/gcp/compute/subnetwork'
import { Input, Output } from "@pulumi/pulumi"
/**
* Secondary Ip Range Struct
*/
export interface SecondaryIpRangeStruct {
rangeName: Input<string>
ipCidrRange: Input<string>
}
/**
* VPC Subnetwork Struct
*/
export interface VpcSubnetStruct {
name: string
description: Input<string>
network: Output<string>
ipCidrRange: Input<string | '10.0.0.0/24'>
region: Input<string | 'asia-southeast2'>
purpose: Input<string | 'PRIVATE_RFC_1918'>
stackType: Input<string | 'IPV4_ONLY'>
privateIpGoogleAccess: Input<boolean | true>
secondaryIpRanges: Input<Input<SecondaryIpRangeStruct>[]>
}
/**
* VPC Subnetwork
* @param struct vpcSubnetStruct
* @return Subnetwork (@pulumi/gcp/compute/subnetwork)
*/
export const VpcSubnet = (struct: VpcSubnetStruct): Subnetwork => {
return new Subnetwork(struct.name, {
description: struct.description,
ipCidrRange: struct.ipCidrRange,
network: struct.network,
region: struct.region,
purpose: struct.purpose,
privateIpGoogleAccess: struct.privateIpGoogleAccess,
stackType: struct.stackType,
secondaryIpRanges: struct.secondaryIpRanges,
})
}