Skip to content

Added route table bicep module + alignment - #104

Merged
Alexander Sehr (AlexanderSehr) merged 29 commits into
mainfrom
users/alsehr/bicep_routeTables
Oct 7, 2021
Merged

Alexander Sehr (AlexanderSehr) merged 29 commits into
mainfrom
users/alsehr/bicep_routeTables

Conversation

@AlexanderSehr

@AlexanderSehr Alexander Sehr (AlexanderSehr) commented Oct 4, 2021 •

Copy link
Copy Markdown
Contributor

Change

  • Added route table bicep module
  • Aligned RBAC naming across modules

Pipeline run: Network: Routetables

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update (Wiki)

Checklist

  • I'm sure there are no other open Pull Requests for the same update/change
  • My corresponding pipelines / checks run clean and green without any errors or warnings
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (readme)
  • I did format my code

@github-actions

github-actions Bot commented Oct 4, 2021 •

Copy link
Copy Markdown

Unit Test Results

  1 files  ±0    1 suites  ±0   7s ⏱️ ±0s
38 tests ±0  38 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
41 runs  ±0  38 ✔️ ±0  3 💤 ±0  0 ❌ ±0 

Results for commit 048f5df. ± Comparison against base commit 048f5df.

♻️ This comment has been updated with latest results.

@MariusStorhaug

Copy link
Copy Markdown
Contributor

I took the liberty to update the RBAC to be same as we discussed in chat earlier.

@MariusStorhaug

Marius Storhaug (MariusStorhaug) commented Oct 5, 2021 •

Copy link
Copy Markdown
Contributor

Do not merge, working on finalizing the testing on the RBAC approach. The approach might be flawed, as there is no way its connecting to the correct scope (resource). Tested adding scope to the module deployment, but resource is not a supported targetScope, so now it makes sense with the other type of structure that was in place before.

Finalizing testing to be sure.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good now.

@MariusStorhaug

Marius Storhaug (MariusStorhaug) commented Oct 5, 2021 •

Copy link
Copy Markdown
Contributor

Discussions offline show we want to align more RBAC/roleAssignment modules to the following:

In deploy.bicep:

...
param roleAssignments array = []
...
module <mainResourceReference>_rbac './.bicep/nested_rbac.bicep' = [for (roleAssignment, index) in roleAssignments: {
  name: 'rbac-${deployment().name}${index}'
  params: {
    roleAssignmentObj: roleAssignment
    builtInRoleNames: builtInRoleNames
    resourceName: <mainResourceReference>.name
  }
}]

In ./.bicep/nested_rbac.bicep

param roleAssignmentObj object
param builtInRoleNames object
param resourceName string

resource roleAssigment '<resourceProvider>/<resourceType>/providers/roleAssignments@2020-04-01-preview' = [for principalId in roleAssignmentObj.principalIds: {
  name: '${resourceName}/Microsoft.Authorization/${guid(resourceName, principalId, roleAssignmentObj.roleDefinitionIdOrName)}'
  properties: {
    roleDefinitionId: contains(builtInRoleNames, roleAssignmentObj.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignmentObj.roleDefinitionIdOrName] : roleAssignmentObj.roleDefinitionIdOrName
    principalId: principalId
  }
}]

@AlexanderSehr
Alexander Sehr (AlexanderSehr) deleted the users/alsehr/bicep_routeTables branch October 7, 2021 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants