-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvpcFirewall.ts
43 lines (40 loc) · 1.2 KB
/
vpcFirewall.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 { Input, Output } from '@pulumi/pulumi'
import { Firewall } from '@pulumi/gcp/compute/firewall'
/**
* VPC Firewall Allow and Deny Struct
*/
interface VpcAllowDenyStruct {
protocol: Input<string>
ports: Input<Input<string>[]>
}
/**
* VPC Firewall Struct
*/
export interface VpcFirewallStruct {
name: string
description: Input<string>
network: Output<string>
priority: Input<number | 1000>
direction: Input<string | 'INGRESS'>
sourceRanges: Input<Input<string>[]>
destinationRanges: Input<Input<string>[]>
allows: Input<Input<VpcAllowDenyStruct>[]>
targetTags: Input<Input<string>[]>
}
/**
* VPC Firewall
* @param struct VpcFirewallStruct
* @return Firewall (@pulumi/gcp/compute/firewall)
*/
export const VpcFirewall = (struct: VpcFirewallStruct): Firewall => {
return new Firewall(struct.name, {
description: struct.description,
network: struct.network,
priority: struct.priority,
direction: struct.direction,
sourceRanges: struct.sourceRanges,
destinationRanges: struct.destinationRanges,
allows: struct.allows,
targetTags: struct.targetTags
})
}