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

Added disableTags Property #307

Merged
merged 9 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ properties:
source: string
tokens: {string: variable}
parameters: {string: variable}
disableTags: bool

dependsOn: [string]
```

Expand All @@ -105,6 +107,7 @@ dependsOn: [string]
|source|depends on ingredient|source file/option for some ingredients|
|tokens|depends on ingredient|Token values typically used to update configuration files when deployed. Check ingredient docs for token options|
|parameters|depends on ingredient|check ingredient docs for parameter options|
|disableTags|no|If true, disables tags for resources that don't support tags (e.g. Azure storage retention policy)|
|dependsOn|no|list of ingredient blocks that must be deployed before this block|

*note: ingredients are always deployed in parallel when possible, depending on dependency requirements*
Expand Down
11 changes: 8 additions & 3 deletions arm-helper/src/arm-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ export class ARMHelper {

const logger = new Logger(this._ctx.Logger.getPre().concat(deploymentName), this._ctx.Environment.logLevel);

try {
//now iterate through all resources in the template and append our standard tags to any existing tags in the ARM template.
try {
const shouldDisableTags: boolean = await this._ingredient.properties.disableTags || false;

if (!shouldDisableTags)
{
//now iterate through all resources in the template and append our standard tags to any existing tags in the ARM template.
logger.log('appending standard tags');
template = this.AppendStandardTags(template);
template = this.AppendStandardTags(template);
}

logger.log('starting arm deployment for template');

Expand Down
2 changes: 2 additions & 0 deletions core/src/bake-interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export interface IIngredientProperties {
parameters: Map<string,BakeVariable>,
tokens: Map<string,BakeVariable>,
alerts: Map<string,BakeVariable>
disableTags?: boolean

}

export interface IIngredientType {
Expand Down
Loading