Skip to content

Commit

Permalink
Merge pull request #4 from qnrl/feature/refactor
Browse files Browse the repository at this point in the history
Move child resources to ref parent
  • Loading branch information
rohancragg committed Jul 7, 2023
2 parents 1753c8b + e88c884 commit 85aee7c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"msazurermtools.azurerm-vscode-tools",
"ms-azuretools.vscode-bicep",
"ms-azure-devops.azure-pipelines",
"github.vscode-github-actions",
"shuworks.vscode-table-formatter",
"streetsidesoftware.code-spell-checker",
"wmaurer.change-case",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# For action details see:
# https://aka.ms/ps-rule-action

name: Analyze repository
name: Analyze with PsRule

# Run for main or PRs against main
on:
Expand All @@ -18,6 +18,7 @@ on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
analyze:
Expand All @@ -27,7 +28,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

# Run analysis by using the PSRule GitHub action.
- name: Run PSRule analysis
uses: Microsoft/[email protected]
uses: microsoft/[email protected]
with:
modules: PSRule.Rules.Azure
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"msazurermtools.azurerm-vscode-tools",
"ms-azuretools.vscode-bicep",
"ms-azure-devops.azure-pipelines",
"github.vscode-github-actions",
"shuworks.vscode-table-formatter",
"streetsidesoftware.code-spell-checker",
"wmaurer.change-case",
Expand Down
35 changes: 24 additions & 11 deletions modules/storage/v1/storage.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,30 @@ resource sa 'Microsoft.Storage/storageAccounts@2022-09-01' = {
environment: 'Production'
costCode: '123456'
}
resource blobs 'blobServices@2022-09-01' = {
name: 'default'
properties: {
deleteRetentionPolicy: {
enabled: true
days: 7
}
containerDeleteRetentionPolicy: {
enabled: true
days: 7
}
}

resource blobs 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = {
name: 'default'
parent: sa
properties: {
deleteRetentionPolicy: {
enabled: true
days: 7
}
containerDeleteRetentionPolicy: {
enabled: true
days: 7
}
}
}

resource files 'Microsoft.Storage/storageAccounts/fileServices@2022-09-01' = {
name: 'default'
parent: sa
properties: {
shareDeleteRetentionPolicy: {
enabled: true
days: 7
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions ps-rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ input:

# Exclude bicepconfig.json
- 'bicepconfig.json'

# ignore all bicep files except the ones that have been created to test modules
- 'modules/**/*.bicep'
- '!modules/**/*.tests.bicep'

rule:
exclude:
- "Azure.Storage.UseReplication"
- Azure.Storage.UseReplication

include:
module:
Expand Down

0 comments on commit 85aee7c

Please sign in to comment.