Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optional policy assignment module in root deployment #490

Merged
merged 2 commits into from
Oct 27, 2021

Conversation

glennmusa
Copy link
Contributor

@glennmusa glennmusa commented Oct 27, 2021

Description

Adds a deployPolicy boolean that defaults to false to the root deployment to conditionally deploy policyAssignment modules to hub and spoke resource groups.

To demo this without policy:

az deployment sub create \
  --name withoutPolicy \
  --location eastus \
  --template-file mlz.bicep

To demo this with policy:

az deployment sub create \
  --name withPolicy \
  --location eastus \
  --template-file mlz.bicep \
  --parameters deployPolicy=true \
  --parameters policy=NIST

Issue reference

The issue this PR will close: #489

Checklist

Please make sure you've completed the relevant tasks for this PR out of the following list:

  • All acceptance criteria in the backlog item are met
  • The documentation is updated to cover any new or changed features
  • Manual tests have passed
  • Relevant issues are linked to this PR

@jjansen23
Copy link
Contributor

@glennmusa - Deploying the branch in commercial and saw a Warning:
"missionlz/src/bicep> az deployment sub create --name withoutPolicy --location eastus --template-file mlz.bicep
A new Bicep release is available: v0.4.1008. Upgrade now by running "az bicep upgrade".
/home/jerome/missionlz/src/bicep/modules/securityCenter.bicep(73,34) : Warning BCP081: Resource type "Microsoft.Security/policies@2015-06-01-preview" does not have types available.
"
It still deployed successfully . Any concerns ?

@glennmusa
Copy link
Contributor Author

@glennmusa - Deploying the branch in commercial and saw a Warning: "missionlz/src/bicep> az deployment sub create --name withoutPolicy --location eastus --template-file mlz.bicep A new Bicep release is available: v0.4.1008. Upgrade now by running "az bicep upgrade". /home/jerome/missionlz/src/bicep/modules/securityCenter.bicep(73,34) : Warning BCP081: Resource type "Microsoft.Security/policies@2015-06-01-preview" does not have types available. " It still deployed successfully . Any concerns ?

Nope! No concerns w/r/t optionally deploying policy. That's a warning from changes unrelated to these.

There's already an issue out to remediate this warning, but it should not affect a deployment: #485

@glennmusa glennmusa merged commit b74db11 into main Oct 27, 2021
@glennmusa glennmusa deleted the glenn/optionalPolicyModule branch October 27, 2021 17:53
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.

Update the policyAssignment module in the root deployment so that it is optional
2 participants