damp-honey-93158
10/28/2022, 4:58 AMechoing-dinner-19531
10/28/2022, 9:38 AMdamp-honey-93158
10/28/2022, 10:17 AMpublic Output<ManagedCluster> ManagedCluster { get; }
When creating the ManagedCluster instance - I make sure to set the Parent value, so that the Parent of the ManagedCluster is AksCluster:
new CustomResourceOptions() { Parent = this }
Now, later on - I want to create a Helm release, so, I use code like this:
return MyAksCluster.ManagedCluster.Apply(managedCluster => new Release(
$"{ProjectName}-azure-workload-identity",
new ReleaseArgs()
{
Chart = "workload-identity-webhook",
Namespace = "azure-workload-identity-system",
CreateNamespace = true,
RepositoryOpts = new RepositoryOptsArgs
{
Repo = "<https://azure.github.io/azure-workload-identity/charts>"
},
Values = new InputMap<object>()
{
["azureTenantID"] = tenantId
},
SkipAwait = false
},
new CustomResourceOptions
{
DeleteBeforeReplace = true, DependsOn = managedCluster, Parent = MyAksCluster, Provider = ClusterProvider
}));
echoing-dinner-19531
10/28/2022, 12:18 PM