Skip to content

Commit 0cde850

Browse files
committed
data-plane-controller: add azure_byoc property
1 parent 5575340 commit 0cde850

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

Diff for: crates/data-plane-controller/src/data_plane_fixture.json

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
"location": "eastus"
3333
}
3434
],
35+
"azure_byoc": {
36+
"subscription_id": "12345678",
37+
"tenant_id": "910111213"
38+
},
3539
"control_plane_api": "https://agent-api.app/"
3640
}
3741
}

Diff for: crates/data-plane-controller/src/stack.rs

+21-5
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ pub struct DataPlane {
9898

9999
#[serde(default, skip_serializing_if = "Option::is_none")]
100100
pub aws_assume_role: Option<AWSAssumeRole>,
101+
#[serde(default, skip_serializing_if = "Option::is_none")]
102+
pub azure_byoc: Option<AzureBYOC>,
101103
pub builds_root: url::Url,
102104
pub builds_kms_keys: Vec<String>,
103105
pub control_plane_api: url::Url,
@@ -115,6 +117,12 @@ pub struct AWSAssumeRole {
115117
pub external_id: String,
116118
}
117119

120+
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
121+
pub struct AzureBYOC {
122+
pub tenant_id: String,
123+
pub subscription_id: String,
124+
}
125+
118126
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
119127
#[serde(untagged)]
120128
pub enum PrivateLink {
@@ -492,17 +500,25 @@ mod test {
492500
service_name: "service".to_string(),
493501
}),
494502
);
503+
504+
let azure_parsed = serde_json::from_value::<DataPlane>(
505+
fixtures.get("azure_private_link").unwrap().clone(),
506+
)
507+
.unwrap();
495508
assert_eq!(
496-
serde_json::from_value::<DataPlane>(
497-
fixtures.get("azure_private_link").unwrap().clone()
498-
)
499-
.unwrap()
500-
.private_links[0],
509+
azure_parsed.private_links[0],
501510
PrivateLink::Azure(AzurePrivateLink {
502511
location: "eastus".to_string(),
503512
service_name: "service".to_string(),
504513
}),
505514
);
515+
assert_eq!(
516+
azure_parsed.azure_byoc,
517+
Some(AzureBYOC {
518+
subscription_id: "12345678".to_string(),
519+
tenant_id: "910111213".to_string(),
520+
}),
521+
);
506522
}
507523

508524
#[test]

Diff for: crates/data-plane-controller/src/state_fixture.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@
7676
"data_plane_id": "1122334455667788",
7777
"deploy_branch": "main",
7878
"last_pulumi_up": "2025-02-26T15:46:19.720962982Z"
79-
}
79+
}

0 commit comments

Comments
 (0)