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

-target apply no longer works #399

Closed
imsky opened this issue Dec 18, 2018 · 2 comments
Closed

-target apply no longer works #399

imsky opened this issue Dec 18, 2018 · 2 comments
Labels
waiting-on-response Waiting for a response from the user

Comments

@imsky
Copy link

imsky commented Dec 18, 2018

We're running Atlantis 0.4.12 and we're no longer able to run targeted atlantis apply.

Given this plan:

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place

Terraform will perform the following actions:

~ aws_s3_bucket.foo
      versioning.0.enabled: "false" => "true"

~ aws_s3_bucket.bar
      versioning.0.enabled: "false" => "true"
Plan: 0 to add, 2 to change, 0 to destroy.

and this comment:

atlantis apply -p project -- -target=aws_s3_bucket.foo

this is the output:

aws_s3_bucket.foo Modifying... (ID: foo)
  versioning.0.enabled: "false" => "true"
aws_s3_bucket.bar: Modifying... (ID: bar)
  versioning.0.enabled: "false" => "true"
aws_s3_bucket.foo: Modifications complete after 2s (ID: foo)
aws_s3_bucket.bar: Modifications complete after 2s (ID: bar)

Apply complete! Resources: 0 added, 2 changed, 0 destroyed.

Are we doing something wrong? This syntax used to work recently.

@lkysow
Copy link
Member

lkysow commented Dec 19, 2018

Hi, with Atlantis -target only works when specified on the atlantis plan command. This is because we generate a planfile with -out and then run terraform apply {planfile}. Terraform ignores the -target flag in this case.

We should really just give you an error if you're using -target with apply.

I don't think this was working previously because I don't think this ever worked with Terraform. Maybe you were using it with atlantis plan before?

@lkysow lkysow added the waiting-on-response Waiting for a response from the user label Dec 19, 2018
lkysow added a commit that referenced this issue Dec 19, 2018
-target doesn't work with terraform apply when the apply is being run on
a planfile (which is how Atlantis runs plan). We should give the user an
error if they attempt this.

Fixes #399
@imsky
Copy link
Author

imsky commented Dec 20, 2018

i see @lkysow that makes sense. i think you're right - we were using plan before. thanks for the explanation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-response Waiting for a response from the user
Projects
None yet
Development

No branches or pull requests

2 participants