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

[BUG] Sensitive output #6

Open
joaolms opened this issue Feb 18, 2024 · 1 comment · Fixed by big-picture/terraform-azurerm-function-app#1
Open

[BUG] Sensitive output #6

joaolms opened this issue Feb 18, 2024 · 1 comment · Fixed by big-picture/terraform-azurerm-function-app#1
Labels
bug Something isn't working

Comments

@joaolms
Copy link

joaolms commented Feb 18, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

The sensitive parameter is required for the output.

Error:

Error: Output refers to sensitive values

  on outputs.tf line 1:
   1: output "linux_function_app" {

Solution: Add sensitive = true to the output

output "linux_function_app" {
  description = "Linux Function App output object if Linux is chosen. Please refer to `./modules/linux-function/README.md`"
  value       = try(module.linux_function["enabled"], null)
  sensitive   = true
}

output "windows_function_app" {
  description = "Windows Function App output object if Windows is chosen. Please refer to `./modules/windows-function/README.md`"
  value       = try(module.windows_function["enabled"], null)
  sensitive   = true
}

Terraform Version

1.3.9

AzureRM Provider Version

3.92.0

Affected Resource(s)/Data Source(s)

azurerm_linux_function_app.linux_function

Terraform Configuration Files

module "azure_region" {
  source  = "claranet/regions/azurerm"
  version = "x.x.x"

  azure_region = var.azure_region
}

module "rg" {
  source  = "claranet/rg/azurerm"
  version = "x.x.x"

  location    = module.azure_region.location
  client_name = var.client_name
  environment = var.environment
  stack       = var.stack
}

module "logs" {
  source  = "claranet/run/azurerm//modules/logs"
  version = "x.x.x"

  client_name         = var.client_name
  environment         = var.environment
  stack               = var.stack
  location            = module.azure_region.location
  location_short      = module.azure_region.location_short
  resource_group_name = module.rg.resource_group_name
}

### Linux
module "function_app_linux" {
  source  = "claranet/function-app/azurerm"
  version = "x.x.x"

  client_name         = var.client_name
  environment         = var.environment
  stack               = var.stack
  location            = module.azure_region.location
  location_short      = module.azure_region.location_short
  resource_group_name = module.rg.resource_group_name

  name_prefix = "hello"

  os_type              = "Linux"
  function_app_version = 4
  function_app_site_config = {
    application_stack = {
      python_version = "3.9"
    }
  }

  function_app_application_settings = {
    "tracker_id"      = "AJKGDFJKHFDS"
    "backend_api_url" = "https://backend.domain.tld/api"
  }

  storage_account_identity_type = "SystemAssigned"

  logs_destinations_ids = [
    module.logs.logs_storage_account_id,
    module.logs.log_analytics_workspace_id
  ]

  extra_tags = {
    foo = "bar"
  }
}

Debug Output/Panic Output

Error: Output refers to sensitive values

  on outputs.tf line 1:
   1: output "linux_function_app" {

To reduce the risk of accidentally exporting sensitive data that was intended
to be only internal, Terraform requires that any root module output
containing sensitive data be explicitly marked as sensitive, to confirm your
intent.

If you do intend to export this data, annotate the output value as sensitive
by adding the following argument:
    sensitive = true

Expected Behaviour

No response

Actual Behaviour

No response

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@joaolms joaolms added the bug Something isn't working label Feb 18, 2024
@joaolms joaolms mentioned this issue Feb 18, 2024
4 tasks
@kayahk
Copy link

kayahk commented Jun 24, 2024

I see the same issue here as with other claranet modules (like eventhub) where our Terragrunt/Terraform pipeline complains about the missing sensitive = true argument:

module.linux_function["enabled"].module.diagnostics.azurerm_monitor_diagnostic_setting.main[0]: Creation complete after 4s [id=/subscriptions/f7c1a591-6b7c-4aee-b0aa-3ef509b9218a/resourceGroups/rg-sgc-sus-ops1-germanywestcentral/providers/Microsoft.Web/sites/fun-sgc-sus-ops1-germanywestcentral|default]
╷
│ Error: Output refers to sensitive values
│ 
│   on outputs.tf line 1:
│    1: output "linux_function_app" {
│ 
│ To reduce the risk of accidentally exporting sensitive data that was
│ intended to be only internal, Terraform requires that any root module
│ output containing sensitive data be explicitly marked as sensitive, to
│ confirm your intent.
│ 
│ If you do intend to export this data, annotate the output value as
│ sensitive by adding the following argument:
│     sensitive = true

Would be great to have this argument added so we can continue to use the otherwise excellent modules. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants