terraform-azurerm-caf-enterprise-scale icon indicating copy to clipboard operation
terraform-azurerm-caf-enterprise-scale copied to clipboard

Add practical code examples

Open DevSecNinja opened this issue 2 years ago โ€ข 1 comments

Overview/Summary

Adding practical examples to the Docs

As part of this Pull Request I have

  • [ ] Checked for duplicate Pull Requests
  • [ ] Associated it with relevant issues, for tracking and closure.
  • [ ] Ensured my code/branch is up-to-date with the latest changes in the main branch
  • [ ] Performed testing and provided evidence.
  • [ ] Updated relevant and associated documentation.
  • [ ] Updated the "What's New?" wiki page (located in the Enterprise-Scale repo in the directory: /docs/wiki/whats-new.md)

Related: #186

DevSecNinja avatar Jun 14 '22 08:06 DevSecNinja

Thank you for your contribution @DevSecNinja ๐Ÿ‘๐Ÿป

As discussed offline, if we can expand this to cover off some of our related issues, that would be awesome.

I think the following would be good ones to consider closing off with this:

  • #359
  • #186

To deliver this I think it would be good to create a dedicated level 200 example page showing how to set custom parameters on policy assignments, covering the following available ways:

  • Within an archetype definition
  • Setting static parameter values within a policy assignment template (within the custom lib folder)
  • Within the archetype_config_overrides input variable
  • Within the custom_landing_zones input variable

If we can build examples showing how to disable the policies mentioned in #186, we can then link to these from the Getting Started page (which also needs updating to identify Deny-Subnet-Without-Udr as another policy which may conflict with Terraform.

Finally, we can also update the Archetype Definitions page to point to these examples when talking about the parameters object within the archetype_config object.

If you have any further questions on this, please let me know ๐Ÿš€

krowlandson avatar Oct 13 '22 15:10 krowlandson

Closes #359 #186

DevSecNinja avatar Oct 24 '22 15:10 DevSecNinja

Thank you for your contribution @DevSecNinja ๐Ÿ‘๐Ÿป

As discussed offline, if we can expand this to cover off some of our related issues, that would be awesome.

I think the following would be good ones to consider closing off with this:

To deliver this I think it would be good to create a dedicated level 200 example page showing how to set custom parameters on policy assignments, covering the following available ways:

  • Within an archetype definition
  • Setting static parameter values within a policy assignment template (within the custom lib folder)
  • Within the archetype_config_overrides input variable
  • Within the custom_landing_zones input variable

If we can build examples showing how to disable the policies mentioned in #186, we can then link to these from the Getting Started page (which also needs updating to identify Deny-Subnet-Without-Udr as another policy which may conflict with Terraform.

Finally, we can also update the Archetype Definitions page to point to these examples when talking about the parameters object within the archetype_config object.

If you have any further questions on this, please let me know ๐Ÿš€

All points done in latest commit, except for your point on Deny-Subnet-Without-Udr. What's the matter with that one? Similar issue as Deny-Subnet-Without-Nsg as the subnet creation + NSG linking can't be done in one API call, causing the deployment to fail with a policy validation error?

DevSecNinja avatar Oct 24 '22 16:10 DevSecNinja

Thank you for the updates @DevSecNinja ...

All points done in latest commit, except for your point on Deny-Subnet-Without-Udr. What's the matter with that one? Similar issue as Deny-Subnet-Without-Nsg as the subnet creation + NSG linking can't be done in one API call, causing the deployment to fail with a policy validation error?

Yes, as Terraform links UDRs to subnets using the azurerm_subnet_route_table_association resource, it's not possible to create a subnet with the UDR attached.

I've fixed a couple of linting errors and will review the PR now ๐Ÿ‘๐Ÿป

krowlandson avatar Oct 25 '22 12:10 krowlandson

/azp run unit

krowlandson avatar Oct 26 '22 06:10 krowlandson

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Oct 26 '22 06:10 azure-pipelines[bot]