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

Add Output: output_path #368

Closed
1 task done
BenCoffeed opened this issue Sep 13, 2024 · 1 comment
Closed
1 task done

Add Output: output_path #368

BenCoffeed opened this issue Sep 13, 2024 · 1 comment

Comments

@BenCoffeed
Copy link

Terraform CLI and Provider Versions

terraform version
Terraform v1.7.3
on darwin_arm64
+ provider registry.terraform.io/hashicorp/archive v2.4.2
+ provider registry.terraform.io/hashicorp/aws v5.38.0
+ provider registry.terraform.io/hashicorp/null v3.2.2
+ provider registry.terraform.io/hashicorp/random v3.5.1
+ provider registry.terraform.io/hashicorp/tls v4.0.5

Your version of Terraform is out of date! The latest version
is 1.9.5. You can update by downloading from https://www.terraform.io/downloads.html

Use Cases or Problem Statement

When using archive_file for resources such as AWS Lambda functions, current methods require referencing the zipped file directly by path/name. It would be advantageous to have this path reference-able for things like Lambda function source files. This way, should the file path change, it only has to be modified in one place.

ie:

data "archive_file" "payload" {
  type        = "zip"
  source_file = "./payload.py"
  output_path = "payload.zip"
}

. . .

resource "aws_lambda_function" "message_grouper" {
  filename      = data.archive_file.payload.output_path
  function_name = "payload"
  role          = aws_iam_role.payload_role.arn
  handler       = "payload.lambda_handler"
}

Proposal

Add an output parameter that simply echoes the value

How much impact is this issue causing?

Low

Additional Information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@BenCoffeed
Copy link
Author

Closing this after realizing from code that I can simply reference the input variables.

"output_path": schema.StringAttribute{
Description: "The output of the archive file.",
Required: true,
},

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant