Skip to content

data source returns empty tuple when module is disabled #30

@brian-skafte

Description

@brian-skafte

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

When setting enabled to false, terraform errors out, due to data source is referenced in locals, but it disabled a few lines below.

Expected Behavior

Ability to disable the module, without errors appearing when doing terraform plan & apply

Steps to Reproduce

Steps to reproduce the behavior:
Set parameter "enabled" to false and do terraform plan

Screenshots

│ Error: Invalid template interpolation value
│
│   on .terraform/modules/aws_transfer_service_sftp/main.tf line 4, in locals:
│    4:   s3_arn_prefix = "arn:${one(data.aws_partition.default[*].partition)}:s3:::"
│     ├────────────────
│     │ data.aws_partition.default is empty tuple
│
│ The expression result is null. Cannot include a null value in a string template.

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

  • OS: Mac OS 12.15.1 or using official docker image hashicorp/terraform:1.2.8
  • Version: Terraform v1.0.1 & Terraform v1.2.8, AWS Provider: v3.71.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions