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

docs: Update path param aws_cloudfront_function in example #119

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

tony
Copy link
Contributor

@tony tony commented Oct 9, 2023

Description

File: example/complete/main.tf
Module: aws_cloudfront_function
Terraform version: 1.6.0

╷
│ Error: Invalid function argument
│
│   on .../main.tf line 340, in resource "aws_cloudfront_function" "example":
│  340:   code    = file("example-function.js")
│     ├────────────────
│     │ while calling file(path)
│
│ Invalid value for "path" parameter: no file exists at "example-function.js"; this function works only with files
│ that are distributed as part of the configuration source code, so if this file will be created by a resource in
│ this configuration you must instead obtain this result from an attribute of that resource.
╵

Motivation and Context

Using example/complete/main.tf of terraform-aws-cloudfront on Terraform 1.6.0

Example from aws_cloudfront_function docs @ 5.20.0 using ${path.module}:

resource "aws_cloudfront_function" "test" {
  name    = "test"
  runtime = "cloudfront-js-1.0"
  comment = "my function"
  publish = true
  code    = file("${path.module}/function.js")
}
Screenshot

via docs

image

See also: StackOverflow Answer for "Invalid value for "path" parameter: no file exists at"

Breaking Changes

None

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

Copy link
Member

@bryantbiggs bryantbiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be required for the example since its run in place, but seems ok to add - thank you

@bryantbiggs bryantbiggs changed the title fix(example): Path param aws_cloudfront_function docs: Update path param aws_cloudfront_function in example Oct 11, 2023
@bryantbiggs bryantbiggs merged commit 0b9abe7 into terraform-aws-modules:master Oct 11, 2023
11 checks passed
@tony tony deleted the patch-1 branch October 12, 2023 23:26
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 12, 2023
@antonbabenko
Copy link
Member

This PR is included in version 3.2.2 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants