Skip to main content

winterbaume_networkfirewall/
types.rs

1/// A subnet mapping for a firewall.
2#[derive(Debug, Clone)]
3pub struct SubnetMapping {
4    pub subnet_id: String,
5}
6
7/// Sync state for a firewall attachment.
8#[derive(Debug, Clone)]
9pub struct SyncState {
10    pub subnet_id: String,
11    pub status: String,
12}
13
14/// Firewall status.
15#[derive(Debug, Clone)]
16pub struct FirewallStatus {
17    pub status: String,
18    pub configuration_sync_state_summary: String,
19}
20
21impl Default for FirewallStatus {
22    fn default() -> Self {
23        Self {
24            status: "READY".to_string(),
25            configuration_sync_state_summary: "IN_SYNC".to_string(),
26        }
27    }
28}
29
30/// A Network Firewall firewall resource.
31#[derive(Debug, Clone)]
32pub struct Firewall {
33    pub firewall_name: String,
34    pub firewall_arn: String,
35    pub firewall_id: String,
36    pub firewall_policy_arn: String,
37    pub vpc_id: String,
38    pub subnet_mappings: Vec<SubnetMapping>,
39    pub delete_protection: bool,
40    pub subnet_change_protection: bool,
41    pub firewall_policy_change_protection: bool,
42    pub availability_zone_change_protection: bool,
43    pub description: Option<String>,
44    pub tags: Vec<(String, String)>,
45    pub encryption_configuration: Option<serde_json::Value>,
46}
47
48/// Metadata for listing firewalls.
49#[derive(Debug, Clone)]
50pub struct FirewallMetadata {
51    pub firewall_name: String,
52    pub firewall_arn: String,
53}
54
55/// A Network Firewall rule group resource.
56#[derive(Debug, Clone)]
57pub struct RuleGroup {
58    pub rule_group_name: String,
59    pub rule_group_arn: String,
60    pub rule_group_id: String,
61    pub rule_group_type: String,
62    pub capacity: i32,
63    pub description: Option<String>,
64    pub tags: Vec<(String, String)>,
65    /// Raw rule group body stored as JSON value.
66    pub rule_group_body: Option<serde_json::Value>,
67    /// Raw rules string (Suricata format).
68    pub rules: Option<String>,
69    pub encryption_configuration: Option<serde_json::Value>,
70}
71
72/// Metadata for listing rule groups.
73#[derive(Debug, Clone)]
74pub struct RuleGroupMetadata {
75    pub name: String,
76    pub arn: String,
77}
78
79/// A Network Firewall firewall policy resource.
80#[derive(Debug, Clone)]
81pub struct FirewallPolicy {
82    pub firewall_policy_name: String,
83    pub firewall_policy_arn: String,
84    pub firewall_policy_id: String,
85    pub description: Option<String>,
86    pub tags: Vec<(String, String)>,
87    /// Raw firewall policy body stored as JSON value.
88    pub firewall_policy_body: serde_json::Value,
89    pub encryption_configuration: Option<serde_json::Value>,
90}
91
92/// Metadata for listing firewall policies.
93#[derive(Debug, Clone)]
94pub struct FirewallPolicyMetadata {
95    pub name: String,
96    pub arn: String,
97}
98
99/// A resource policy (used for sharing rule groups / policies cross-account).
100#[derive(Debug, Clone)]
101pub struct ResourcePolicy {
102    pub resource_arn: String,
103    pub policy: String,
104}
105
106/// A TLS inspection configuration resource.
107#[derive(Debug, Clone)]
108pub struct TlsInspectionConfiguration {
109    pub name: String,
110    pub arn: String,
111    pub id: String,
112    pub description: Option<String>,
113    pub tags: Vec<(String, String)>,
114    /// Raw body stored as JSON value.
115    pub body: serde_json::Value,
116}
117
118/// Metadata for listing TLS inspection configurations.
119#[derive(Debug, Clone)]
120pub struct TlsInspectionConfigurationMetadata {
121    pub name: String,
122    pub arn: String,
123}
124
125/// A VPC endpoint association resource.
126#[derive(Debug, Clone)]
127pub struct VpcEndpointAssociation {
128    pub vpc_endpoint_association_arn: String,
129    pub vpc_endpoint_association_id: String,
130    pub firewall_arn: String,
131    pub vpc_id: String,
132    pub subnet_id: String,
133    pub description: Option<String>,
134    pub tags: Vec<(String, String)>,
135}
136
137/// An availability zone mapping for a firewall.
138#[derive(Debug, Clone)]
139pub struct AvailabilityZoneMapping {
140    pub availability_zone: String,
141}
142
143/// A transit gateway attachment tracked by the firewall.
144#[derive(Debug, Clone)]
145pub struct TransitGatewayAttachment {
146    pub transit_gateway_attachment_id: String,
147    pub status: String,
148}
149
150/// A proxy resource.
151#[derive(Debug, Clone)]
152pub struct NfwProxy {
153    pub proxy_name: String,
154    pub proxy_arn: String,
155    pub nat_gateway_id: String,
156    pub proxy_configuration_arn: Option<String>,
157    pub proxy_configuration_name: Option<String>,
158    pub proxy_state: String,
159    pub tags: Vec<(String, String)>,
160    /// Raw body stored as JSON value.
161    pub body: serde_json::Value,
162}
163
164/// A proxy configuration resource.
165#[derive(Debug, Clone)]
166pub struct NfwProxyConfiguration {
167    pub proxy_configuration_name: String,
168    pub proxy_configuration_arn: String,
169    pub description: Option<String>,
170    pub tags: Vec<(String, String)>,
171    /// Raw body stored as JSON value.
172    pub body: serde_json::Value,
173}
174
175/// A proxy rule group resource.
176#[derive(Debug, Clone)]
177pub struct NfwProxyRuleGroup {
178    pub proxy_rule_group_name: String,
179    pub proxy_rule_group_arn: String,
180    pub description: Option<String>,
181    pub tags: Vec<(String, String)>,
182    /// Raw body stored as JSON value.
183    pub body: serde_json::Value,
184}
185
186/// A flow operation resource.
187#[derive(Debug, Clone)]
188pub struct FlowOperation {
189    pub flow_operation_id: String,
190    pub firewall_arn: String,
191    pub flow_operation_type: String,
192    pub flow_operation_status: String,
193    /// Raw body stored as JSON value.
194    pub body: serde_json::Value,
195}
196
197/// An analysis report resource.
198#[derive(Debug, Clone)]
199pub struct AnalysisReport {
200    pub analysis_report_id: String,
201    pub firewall_arn: String,
202    pub analysis_type: String,
203    pub status: String,
204}
205
206/// Encryption configuration stored on a firewall.
207#[derive(Debug, Clone)]
208pub struct EncryptionConfig {
209    pub key_id: Option<String>,
210    pub config_type: String,
211}
212
213impl Default for EncryptionConfig {
214    fn default() -> Self {
215        Self {
216            key_id: None,
217            config_type: "AWS_OWNED_KMS_KEY".to_string(),
218        }
219    }
220}