Skip to content

Commit

Permalink
Write bicep into modules based on scope hierarchy rather than user co…
Browse files Browse the repository at this point in the history
…nstructs (#42029)

* Write bicep into modules based on scope hierarchy rather than user constructs

* Clean up

* remove dead code

* Add override logic for ManagedService

* PR fb

* deleted files

* API

* Fix getResources

* tests

* Fix outputs

* remove commented code

* remove blank refdocs

* using

* Pass recursive as true

* revert recursive change

* PR fb

* pass true as recursive arg

* Fix recursive call and don't mutate Parameter

* API

* fix comments

* readonly

* add construct tests

* Fix enumeration

* Add parameter and outputs tests

* save

* update get parameters

* update api

* update after merge

* Fix outputs/parameters

* avoid dupes

* fix test

* api

---------

Co-authored-by: m-nash <[email protected]>
  • Loading branch information
JoshLove-msft and m-nash authored Feb 20, 2024
1 parent 51102d0 commit a17e403
Show file tree
Hide file tree
Showing 52 changed files with 1,624 additions and 948 deletions.
6 changes: 6 additions & 0 deletions sdk/provisioning/Azure.Provisioning/Azure.Provisioning.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Provisioning", "src\A
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Provisioning.Tests", "tests\Azure.Provisioning.Tests.csproj", "{BC884FD9-0973-4FD2-A112-F285F041A3B2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{A93F6964-45B3-4F08-BB85-EBC3BAC40B72}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -21,6 +23,10 @@ Global
{BC884FD9-0973-4FD2-A112-F285F041A3B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC884FD9-0973-4FD2-A112-F285F041A3B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BC884FD9-0973-4FD2-A112-F285F041A3B2}.Release|Any CPU.Build.0 = Release|Any CPU
{A93F6964-45B3-4F08-BB85-EBC3BAC40B72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A93F6964-45B3-4F08-BB85-EBC3BAC40B72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A93F6964-45B3-4F08-BB85-EBC3BAC40B72}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A93F6964-45B3-4F08-BB85-EBC3BAC40B72}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public static partial class CdkExtensions
}
public abstract partial class Construct : Azure.Provisioning.IConstruct, System.ClientModel.Primitives.IPersistableModel<Azure.Provisioning.Construct>
{
protected Construct(Azure.Provisioning.IConstruct? scope, string name, Azure.Provisioning.ConstructScope constructScope = Azure.Provisioning.ConstructScope.ResourceGroup, System.Guid? tenantId = default(System.Guid?), System.Guid? subscriptionId = default(System.Guid?), string? envName = null) { }
protected Construct(Azure.Provisioning.IConstruct? scope, string name, Azure.Provisioning.ConstructScope constructScope = Azure.Provisioning.ConstructScope.ResourceGroup, System.Guid? tenantId = default(System.Guid?), System.Guid? subscriptionId = default(System.Guid?), string? envName = null, Azure.Provisioning.ResourceManager.ResourceGroup? resourceGroup = null) { }
public Azure.Provisioning.ConstructScope ConstructScope { get { throw null; } }
public string EnvironmentName { get { throw null; } }
public string Name { get { throw null; } }
Expand Down Expand Up @@ -55,12 +55,12 @@ public partial interface IConstruct
}
public abstract partial class Infrastructure : Azure.Provisioning.Construct
{
public Infrastructure(Azure.Provisioning.ConstructScope constructScope = Azure.Provisioning.ConstructScope.Subscription, System.Guid? tenantId = default(System.Guid?), System.Guid? subscriptionId = default(System.Guid?), string? envName = null) : base (default(Azure.Provisioning.IConstruct), default(string), default(Azure.Provisioning.ConstructScope), default(System.Guid?), default(System.Guid?), default(string)) { }
public Infrastructure(Azure.Provisioning.ConstructScope constructScope = Azure.Provisioning.ConstructScope.Subscription, System.Guid? tenantId = default(System.Guid?), System.Guid? subscriptionId = default(System.Guid?), string? envName = null) : base (default(Azure.Provisioning.IConstruct), default(string), default(Azure.Provisioning.ConstructScope), default(System.Guid?), default(System.Guid?), default(string), default(Azure.Provisioning.ResourceManager.ResourceGroup)) { }
public void Build(string? outputPath = null) { }
}
public partial class Output
{
public Output(string name, string value, Azure.Provisioning.IConstruct source, bool isLiteral = false, bool isSecure = false) { }
internal Output() { }
public bool IsLiteral { get { throw null; } }
public bool IsSecure { get { throw null; } }
public string Name { get { throw null; } }
Expand All @@ -71,6 +71,7 @@ public readonly partial struct Parameter
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public Parameter(Azure.Provisioning.Output output) { throw null; }
public Parameter(string name, string? description = null, object? defaultValue = null, bool isSecure = false) { throw null; }
public object? DefaultValue { get { throw null; } }
public string? Description { get { throw null; } }
Expand All @@ -82,7 +83,6 @@ public abstract partial class Resource : System.ClientModel.Primitives.IPersista
protected Resource(Azure.Provisioning.IConstruct scope, Azure.Provisioning.Resource? parent, string resourceName, Azure.Core.ResourceType resourceType, string version, System.Func<string, object> createProperties) { }
public Azure.Core.ResourceIdentifier Id { get { throw null; } }
public string Name { get { throw null; } }
public System.Collections.Generic.IList<Azure.Provisioning.Parameter> Parameters { get { throw null; } }
public Azure.Provisioning.Resource? Parent { get { throw null; } }
public Azure.Provisioning.IConstruct Scope { get { throw null; } }
public string Version { get { throw null; } }
Expand Down Expand Up @@ -116,7 +116,7 @@ namespace Azure.Provisioning.AppService
{
public partial class AppServicePlan : Azure.Provisioning.Resource<Azure.ResourceManager.AppService.AppServicePlanData>
{
public AppServicePlan(Azure.Provisioning.IConstruct scope, string resourceName, string version = "2021-02-01", Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) : base (default(Azure.Provisioning.IConstruct), default(Azure.Provisioning.Resource), default(string), default(Azure.Core.ResourceType), default(string), default(System.Func<string, Azure.ResourceManager.AppService.AppServicePlanData>)) { }
public AppServicePlan(Azure.Provisioning.IConstruct scope, string resourceName, string version = "2021-02-01", Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.Provisioning.ResourceManager.ResourceGroup? parent = null) : base (default(Azure.Provisioning.IConstruct), default(Azure.Provisioning.Resource), default(string), default(Azure.Core.ResourceType), default(string), default(System.Func<string, Azure.ResourceManager.AppService.AppServicePlanData>)) { }
protected override Azure.Provisioning.Resource? FindParentInScope(Azure.Provisioning.IConstruct scope) { throw null; }
}
public static partial class AppServicesExtensions
Expand All @@ -125,7 +125,7 @@ public static partial class AppServicesExtensions
}
public partial class WebSite : Azure.Provisioning.Resource<Azure.ResourceManager.AppService.WebSiteData>
{
public WebSite(Azure.Provisioning.IConstruct scope, string resourceName, Azure.Provisioning.AppService.AppServicePlan appServicePlan, Azure.Provisioning.AppService.WebSiteRuntime runtime, string runtimeVersion, string version = "2021-02-01", Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) : base (default(Azure.Provisioning.IConstruct), default(Azure.Provisioning.Resource), default(string), default(Azure.Core.ResourceType), default(string), default(System.Func<string, Azure.ResourceManager.AppService.WebSiteData>)) { }
public WebSite(Azure.Provisioning.IConstruct scope, string resourceName, Azure.Provisioning.AppService.AppServicePlan appServicePlan, Azure.Provisioning.AppService.WebSiteRuntime runtime, string runtimeVersion, string version = "2021-02-01", Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.Provisioning.ResourceManager.ResourceGroup? parent = null) : base (default(Azure.Provisioning.IConstruct), default(Azure.Provisioning.Resource), default(string), default(Azure.Core.ResourceType), default(string), default(System.Func<string, Azure.ResourceManager.AppService.WebSiteData>)) { }
public void AddApplicationSetting(string key, Azure.Provisioning.Parameter value) { }
public void AddApplicationSetting(string key, string value) { }
public void AddLogConfig(string resourceName) { }
Expand All @@ -150,13 +150,13 @@ namespace Azure.Provisioning.KeyVaults
{
public partial class KeyVault : Azure.Provisioning.Resource<Azure.ResourceManager.KeyVault.KeyVaultData>
{
public KeyVault(Azure.Provisioning.IConstruct scope, string name = "kv", string version = "2023-02-01", Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) : base (default(Azure.Provisioning.IConstruct), default(Azure.Provisioning.Resource), default(string), default(Azure.Core.ResourceType), default(string), default(System.Func<string, Azure.ResourceManager.KeyVault.KeyVaultData>)) { }
public KeyVault(Azure.Provisioning.IConstruct scope, string name = "kv", string version = "2023-02-01", Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.Provisioning.ResourceManager.ResourceGroup? resourceGroup = null) : base (default(Azure.Provisioning.IConstruct), default(Azure.Provisioning.Resource), default(string), default(Azure.Core.ResourceType), default(string), default(System.Func<string, Azure.ResourceManager.KeyVault.KeyVaultData>)) { }
public void AddAccessPolicy(Azure.Provisioning.Output output) { }
protected override Azure.Provisioning.Resource? FindParentInScope(Azure.Provisioning.IConstruct scope) { throw null; }
}
public static partial class KeyVaultExtensions
{
public static Azure.Provisioning.KeyVaults.KeyVault AddKeyVault(this Azure.Provisioning.IConstruct construct, Azure.Provisioning.ResourceManager.ResourceGroup? parent = null, string name = "kv") { throw null; }
public static Azure.Provisioning.KeyVaults.KeyVault AddKeyVault(this Azure.Provisioning.IConstruct construct, Azure.Provisioning.ResourceManager.ResourceGroup? resourceGroup = null, string name = "kv") { throw null; }
public static System.Collections.Generic.IEnumerable<Azure.Provisioning.KeyVaults.KeyVaultSecret> GetSecrets(this Azure.Provisioning.IConstruct construct) { throw null; }
}
public partial class KeyVaultSecret : Azure.Provisioning.Resource<Azure.ResourceManager.KeyVault.KeyVaultSecretData>
Expand All @@ -170,7 +170,7 @@ namespace Azure.Provisioning.ResourceManager
{
public partial class ResourceGroup : Azure.Provisioning.Resource<Azure.ResourceManager.Resources.ResourceGroupData>
{
public ResourceGroup(Azure.Provisioning.IConstruct scope, string name = "rg", string version = "2023-07-01", Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) : base (default(Azure.Provisioning.IConstruct), default(Azure.Provisioning.Resource), default(string), default(Azure.Core.ResourceType), default(string), default(System.Func<string, Azure.ResourceManager.Resources.ResourceGroupData>)) { }
public ResourceGroup(Azure.Provisioning.IConstruct scope, string name = "rg", string version = "2023-07-01", Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.Provisioning.ResourceManager.Subscription? parent = null) : base (default(Azure.Provisioning.IConstruct), default(Azure.Provisioning.Resource), default(string), default(Azure.Core.ResourceType), default(string), default(System.Func<string, Azure.ResourceManager.Resources.ResourceGroupData>)) { }
protected override Azure.Provisioning.Resource? FindParentInScope(Azure.Provisioning.IConstruct scope) { throw null; }
}
public static partial class ResourceManagerExtensions
Expand Down
Loading

0 comments on commit a17e403

Please sign in to comment.