-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
atlantis import
does not set terraform.workspace
#2930
Comments
Note: upon further investigation, I think this happened because the plan for that workspace had not yet completed. After a successful plan, I was able to import, but without any approvals. |
Note2:
Server logs:
|
Thank you for trying import feature and raise a issue. I will check the behaviour. |
reason
|
import_requirements is another issue, so move into #2933 |
I'm trying to reproduce the issue, but it works fine with following diff. https://github.com/runatlantis/atlantis/pull/2932/files
resource "random_id" "dummy1" {
count = terraform.workspace == "ops" ? 1 : 0
keepers = {}
byte_length = 1
} @drmaciej If you notice something is invalid in my reproduce step, let me know.
If atlantis says |
ah, I got the issue and fix it soon. |
atlantis import
does not set terraform.workspace
@krrrr38 sounds great, thanks! |
Community Note
Overview of the Issue
When using
atlantis import
, it looks like the workspace is not set correctly.Reproduction Steps
Here's a sample Route53 record I am trying to import (I have created it manually in the Route53 console):
I have tried importing using
atlantis import -p route53-ops aws_route53_record.txt_drmaciej_example_com[0] 123456789_drmaciej.example.com_TXT
andatlantis import -d route53 -w ops 'aws_route53_record.txt_drmaciej_example_com[0]' 123456789_drmaciej.example.com_TXT
.Both attempts fail when my code does a lookup based on
terraform.workspace
. Atlantis actually logsRan Import for project: route53-ops dir: route53 workspace: ops
but then terraform fails with (partial output):plan
still works fine.Environment details
v0.22.1, on k8s, with
In the actual repo:
The text was updated successfully, but these errors were encountered: