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

Ephemeral inputs are not used in apply step #363

Open
1 task done
erzz opened this issue Jan 10, 2025 · 2 comments
Open
1 task done

Ephemeral inputs are not used in apply step #363

erzz opened this issue Jan 10, 2025 · 2 comments
Labels

Comments

@erzz
Copy link

erzz commented Jan 10, 2025

Problem description

With the introduction of ephemeral inputs in terraform 1.10 we finally have a way to utilise sensitive values such as passwords and keys in a plan without them entering the state file.

However - we discovered they do not quite work when using the apply action.

The action itself performs a plan step followed by an apply step. It seems to me that the value for the ephemeral input is present during the plan step, but then not present during the apply step.

Terraform version

1.10

Backend

gcp

Workflow YAML

- name: Terraform Apply
  uses: dflook/terraform-apply@v1
  id: apply
  with:
    path: terraform
    workspace: production
    backend_config: |
      bucket=${{ secrets.state-bucket }}
    auto_approve: true
    variables: |
      cloudflare_api_token = "${{ secrets.CLOUDFLARE_API_TOKEN }}"    # this input is ephemeral

Workflow log

....<plan output which obviously meant that the ephemeral input was used during plan phase>
Plan: 0 to add, 0 to change, 2 to destroy.
Automatically approving plan
Releasing state lock. This may take a few moments...

Error: No value for required variable

  on variables.tf line 3:
   3: variable "cloudflare_api_token" {

The root module input variable "cloudflare_api_token" is not set, and has no
default value. Use a -var or -var-file command line argument to provide a
value for this variable.

Has debug logging been enabled?

  • Yes, the ACTIONS_STEP_DEBUG secret was set to true when capturing the workflow log above. I understand that if I have not done this, I may not recieve a response.
@erzz erzz added the problem label Jan 10, 2025
@dflook
Copy link
Owner

dflook commented Jan 14, 2025

Hi @erzz, thanks for creating an issue. Support for ephemeral input variables has been added in v1.46.0 😄

@erzz
Copy link
Author

erzz commented Jan 14, 2025

Absolutely awesome! Keep up the fantastic work!

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

No branches or pull requests

2 participants