|
| 1 | +--- |
| 2 | +title: SNFR26 - Output - Parameters - Decorators |
| 3 | +description: Module Specification for the Azure Verified Modules (AVM) program |
| 4 | +url: /spec/SNFR26 |
| 5 | +type: default |
| 6 | +tags: [ |
| 7 | + Class-Resource, # MULTIPLE VALUES: this can be "Class-Resource" AND/OR "Class-Pattern" AND/OR "Class-Utility" |
| 8 | + Class-Pattern, # MULTIPLE VALUES: this can be "Class-Resource" AND/OR "Class-Pattern" AND/OR "Class-Utility" |
| 9 | + Type-NonFunctional, # SINGLE VALUE: this can be "Type-Functional" OR "Type-NonFunctional" |
| 10 | + Category-Inputs/Outputs, # SINGLE VALUE: this can be "Category-Testing" OR "Category-Telemetry" OR "Category-Contribution/Support" OR "Category-Documentation" OR "Category-CodeStyle" OR "Category-Naming/Composition" OR "Category-Inputs/Outputs" OR "Category-Release/Publishing" |
| 11 | + Language-Bicep, # MULTIPLE VALUES: this can be "Language-Bicep" AND/OR "Language-Terraform" |
| 12 | + Language-Terraform, # MULTIPLE VALUES: this can be "Language-Bicep" AND/OR "Language-Terraform" |
| 13 | + Severity-MUST, # SINGLE VALUE: this can be "Severity-MUST" OR "Severity-SHOULD" OR "Severity-MAY" |
| 14 | + Persona-Owner, # MULTIPLE VALUES: this can be "Persona-Owner" AND/OR "Persona-Contributor" |
| 15 | + Persona-Contributor, # MULTIPLE VALUES: this can be "Persona-Owner" AND/OR "Persona-Contributor" |
| 16 | + Lifecycle-BAU, # SINGLE VALUE: this can be "Lifecycle-Initial" OR "Lifecycle-BAU" OR "Lifecycle-EOL" |
| 17 | + Validation-TBD # SINGLE VALUE: this can be "Validation-Manual" OR "Validation-CI/Informational" OR "CI/Enforced" |
| 18 | +] |
| 19 | +priority: 1250 |
| 20 | +--- |
| 21 | + |
| 22 | +## ID: SNFR26 - Output-Parameters - Decorators |
| 23 | + |
| 24 | +Output parameters **MUST** implement: |
| 25 | + |
| 26 | +- [Decorators in Bicep](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/parameters#use-decorators) such as `description` & `secure` (if sensitive) |
| 27 | +- [Arguments in Terraform](https://developer.hashicorp.com/terraform/language/values/outputs#optional-arguments) such as `description` & `sensitive` (if sensitive) |
| 28 | + |
| 29 | +{{% tabs title="Output parameters" groupid="scriptlanguage" %}} |
| 30 | + {{% tab title="Bicep" %}} |
| 31 | + |
| 32 | +```bicep |
| 33 | +@description('The resourceId of your resource.') |
| 34 | +output sampleResourceId string = sampleResource.id |
| 35 | +
|
| 36 | +@description('The key of your resource.') |
| 37 | +@secure() |
| 38 | +output sampleResourceKey string = sampleResource.key |
| 39 | +``` |
| 40 | + |
| 41 | + {{% /tab %}} |
| 42 | + {{% tab title="Terraform" %}} |
| 43 | + |
| 44 | +```terraform |
| 45 | +# Resource output |
| 46 | +output "foo" { |
| 47 | + description = "MyResource foo attribute" |
| 48 | + value = azurerm_resource_myresource.foo |
| 49 | +} |
| 50 | +
|
| 51 | +# Output of a sensitive attribute |
| 52 | +output "bar" { |
| 53 | + description = "MyResource bar attribute" |
| 54 | + value = azurerm_resource_myresource.bar |
| 55 | + sensitive = true |
| 56 | +} |
| 57 | +``` |
| 58 | + |
| 59 | + {{% /tab %}} |
| 60 | +{{% /tabs %}} |
0 commit comments