Skip to content

Commit bfe4d94

Browse files
feat: remove examples in favor of readme
the examples were incomplete terraform configurations and did not pass a `terraform validate` anyway. Providing this information via readme makes more sense than an incomplete example.
1 parent 77f6bbd commit bfe4d94

File tree

7 files changed

+56
-241
lines changed

7 files changed

+56
-241
lines changed

README.md

Lines changed: 56 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Terraform module to integrate Azure as a meshPlatform into meshStack instance. With this module, service principals used by meshStack are created with the required permissions. The output of this module is a set of credentials that need to be configured in meshStack as described in [meshcloud public docs](https://docs.meshcloud.io/docs/meshstack.how-to.integrate-meshplatform.html).
44

5-
We currently support [Microsoft Enterprise Agreements](https://www.microsoft.com/en-us/licensing/licensing-programs/enterprise?activetab=enterprise-tab%3aprimaryr2) and [Microsoft Customer Agreements](https://www.microsoft.com/en-us/licensing/how-to-buy/microsoft-customer-agreement) when integrating Azure as a meshPlatform.
5+
We currently support [Microsoft Enterprise Agreements](https://www.microsoft.com/en-us/licensing/licensing-programs/enterprise?activetab=enterprise-tab%3aprimaryr2) and [Microsoft Customer Agreements](https://www.microsoft.com/en-us/licensing/how-to-buy/microsoft-customer-agreement) as well as pre-provisioned subscriptions when integrating Azure as a meshPlatform.
66

77
<p align="center">
88
<img src="https://github.com/meshcloud/terraform-azure-meshplatform/assets/96071919/b18a128b-8a43-44ea-80da-bf42e58fd61a" width="250">
@@ -19,14 +19,6 @@ To run this module, you need the following:
1919
2. Privileged Role Administrator AND (Cloud) Application Administrator
2020
- Permissions on Azure Resource Level: User Access Administrator on the Management Group that should be managed by meshStack
2121

22-
### If using an Enterprise Agreement
23-
24-
- Permissions on [Enterprise Agreement level](https://learn.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles): Account Owner for the enrollment account that should be used for creating subscriptions
25-
26-
### If using a Microsoft Customer Agreement
27-
28-
- Permissions in Source Tenant for granting access to the billing account used for subscription creation: Account Administrator
29-
3022
## How to Use This Module
3123

3224
### Using Azure Portal
@@ -63,14 +55,30 @@ To run this module, you need the following:
6355
terraform output -json
6456
```
6557
66-
#### If Using an Enterprise Agreement
58+
### Using CLI
59+
60+
1. Login with az CLI
61+
62+
```sh
63+
az login --tenant TENANT_ID
64+
```
65+
66+
2. Follow the instructions for Azure Portal
67+
68+
## Configuring the Azure meshPlatform module
6769

68-
1. Grant access on the enrollment account as described in the section [Use an Enteprise Enrollment](https://docs.meshcloud.io/docs/meshstack.how-to.integrate-meshplatform-azure-manually.html#use-an-enterprise-enrollment).
70+
### Using an Enterprise Agreement
6971

70-
#### If Using Microsoft Customer Agreement
71-
>
72-
> Until <https://github.com/hashicorp/terraform-provider-azurerm/issues/15211> is resolved, MCA service principal setup can only be done manually.
72+
> Using an Enterprise Agreement enrollment account requires manual steps outside of terraform.
7373
74+
1. Ensure you have permissions on [Enterprise Agreement level](https://learn.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles): `Account Owner` for the enrollment account that should be used for creating subscriptions
75+
2. Grant access on the enrollment account as described in the section [Use an Enteprise Enrollment](https://docs.meshcloud.io/docs/meshstack.how-to.integrate-meshplatform-azure-manually.html#use-an-enterprise-enrollment).
76+
77+
### Using Microsoft Customer Agreement
78+
79+
> Until <https://github.com/hashicorp/terraform-provider-azurerm/issues/15211> is resolved, MCA service principal setup can only be done manually outside of terraform.
80+
81+
1. Ensure you have permissions in the source AAD Tenant for granting access to the billing account used for subscription creation using the `Account Administrator` role
7482
1. Switch to the Tenant Directory that contains your Billing Account and follow the steps to [Register an Application](https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app#register-an-application) and [Add Credentials](https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app#add-credentials). Make sure to copy down the **Directory (tenant) ID**, **Application (client) ID**, **Object ID** and the **App Secret** value that was generated. The App Secret is only visible during the creation process.
7583
2. You must grant the Enterprise Application permissions on the Billing Account, Billing Profile, or Invoice Section so that it can generate new subscriptions. Follow the steps in [this guide](https://learn.microsoft.com/en-us/azure/cost-management-billing/manage/understand-mca-roles#manage-billing-roles-in-the-azure-portal) to grant the necessary permissions. You must grant one of the following permissions
7684
- Billing Account or Billing Profile: Owner, Contributor
@@ -83,19 +91,40 @@ To run this module, you need the following:
8391
- Billing Account Principal Client ID (Application Client ID that will be used to create new subscriptions)
8492
- Principal Client Secret (Application Secret created in the Source Tenant)
8593

86-
### Using CLI
87-
88-
1. Login with az CLI
89-
90-
```sh
91-
az login --tenant TENANT_ID
92-
```
93-
94-
2. Follow the instructions for Azure Portal
95-
96-
## Example Usages
97-
98-
Check [examples](./examples/) for different use cases. As a quick start we recommend using [basic-azure-integration](./examples/basic-azure-integration) example.
94+
### Using Pre-provisioned Subscriptions
95+
96+
meshStack will need to be able to read subscriptions at the source location
97+
(typically the root of your management group hierarchy) and then have permission to rename them.
98+
Please include the following `additional_permission` when configuring this terraform module.
99+
100+
```hcl
101+
additional_permissions = ["Microsoft.Subscription/rename/action"]
102+
```
103+
104+
### Enabling Azure Functions for Landing Zones
105+
106+
In order to enable meshStack to call Azure Functions as part of tenant replication for your landing zones, you must
107+
provide the SPN with access to the function.
108+
109+
```hcl
110+
111+
additional_required_resource_accesses = [
112+
# The block below configures replicator access
113+
# to the app with id `fe81736c-99c6-4fca-8cc2-2818a2365451` with the appRole with id `e29066a1-ecb1-4a8e-af2d-1627fae35711`
114+
#
115+
# This example configures access to an azure function
116+
{
117+
resource_app_id = "fe81736c-99c6-4fca-8cc2-2818a2365451" # https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/application#resource_app_id
118+
resource_accesses = [
119+
# https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/application#resource_access
120+
{
121+
id = "e29066a1-ecb1-4a8e-af2d-1627fae35711"
122+
type = "Role"
123+
},
124+
]
125+
},
126+
]
127+
```
99128

100129
<!-- BEGIN_TF_DOCS -->
101130
## Requirements

examples/azure-integration-preprovisioned-subscriptions/main.tf

Lines changed: 0 additions & 30 deletions
This file was deleted.

examples/azure-integration-preprovisioned-subscriptions/outputs.tf

Lines changed: 0 additions & 38 deletions
This file was deleted.

examples/azure-integration-with-additional-resource-access/main.tf

Lines changed: 0 additions & 43 deletions
This file was deleted.

examples/azure-integration-with-additional-resource-access/outputs.tf

Lines changed: 0 additions & 33 deletions
This file was deleted.

examples/basic-azure-integration/main.tf

Lines changed: 0 additions & 32 deletions
This file was deleted.

examples/basic-azure-integration/outputs.tf

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)