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

atlantis import #3

Closed
wants to merge 17 commits into from
Closed

atlantis import #3

wants to merge 17 commits into from

Conversation

krrrr38
Copy link
Owner

@krrrr38 krrrr38 commented Dec 12, 2022

No description provided.

@krrrr38
Copy link
Owner Author

krrrr38 commented Dec 13, 2022

atlantis plan

@krrrr38
Copy link
Owner Author

krrrr38 commented Dec 13, 2022

Ran Plan for project: project dir: . workspace: default

Show Output
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create

Terraform will perform the following actions:

  # null_resource.ls1 will be created
+ resource "null_resource" "ls1" {
      + id = (known after apply)
    }

  # null_resource.ls2 will be created
+ resource "null_resource" "ls2" {
      + id = (known after apply)
    }

  # random_id.dummy will be created
+ resource "random_id" "dummy" {
      + b64_std     = (known after apply)
      + b64_url     = (known after apply)
      + byte_length = 1
      + dec         = (known after apply)
      + hex         = (known after apply)
      + id          = (known after apply)
      + keepers     = {}
    }

  # random_id.dummy2 will be created
+ resource "random_id" "dummy2" {
      + b64_std     = (known after apply)
      + b64_url     = (known after apply)
      + byte_length = 1
      + dec         = (known after apply)
      + hex         = (known after apply)
      + id          = (known after apply)
      + keepers     = {}
    }

  # random_id.dummy3 will be created
+ resource "random_id" "dummy3" {
      + b64_std     = (known after apply)
      + b64_url     = (known after apply)
      + byte_length = 1
      + dec         = (known after apply)
      + hex         = (known after apply)
      + id          = (known after apply)
      + keepers     = {}
    }

Plan: 5 to add, 0 to change, 0 to destroy.

  • ▶️ To apply this plan, comment:
    • atlantis apply -p project
  • 🚮 To delete this plan click here
  • 🔁 To plan this project again, comment:
    • atlantis plan -p project
Plan: 5 to add, 0 to change, 0 to destroy.
  • ⏩ To apply all unapplied plans from this pull request, comment:
    • atlantis apply
  • 🚮 To delete all plans and locks for the PR, comment:
    • atlantis unlock

@krrrr38
Copy link
Owner Author

krrrr38 commented Dec 13, 2022

atlantis import -- random_id.dummy2 AA

@krrrr38
Copy link
Owner Author

krrrr38 commented Dec 13, 2022

Ran Import for project: project dir: . workspace: default

random_id.dummy2: Importing from ID "AA"...
random_id.dummy2: Import prepared!
  Prepared random_id for import
random_id.dummy2: Refreshing state... [id=AA]

Import successful!

The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.

  • 🔁 To plan this project again, comment:
    • atlantis plan -p project

@krrrr38
Copy link
Owner Author

krrrr38 commented Dec 13, 2022

atlantis import -- random_id.dummy3 BB

@krrrr38
Copy link
Owner Author

krrrr38 commented Dec 13, 2022

Ran Import for project: project dir: . workspace: default

random_id.dummy3: Importing from ID "BB"...
random_id.dummy3: Import prepared!
  Prepared random_id for import
random_id.dummy3: Refreshing state... [id=BB]

Import successful!

The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.

  • 🔁 To plan this project again, comment:
    • atlantis plan -p project

@krrrr38
Copy link
Owner Author

krrrr38 commented Dec 13, 2022

atlantis plan -p project

@krrrr38
Copy link
Owner Author

krrrr38 commented Dec 13, 2022

Ran Plan for project: project dir: . workspace: default

Show Output
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create

Terraform will perform the following actions:

  # null_resource.ls1 will be created
+ resource "null_resource" "ls1" {
      + id = (known after apply)
    }

  # null_resource.ls2 will be created
+ resource "null_resource" "ls2" {
      + id = (known after apply)
    }

  # random_id.dummy will be created
+ resource "random_id" "dummy" {
      + b64_std     = (known after apply)
      + b64_url     = (known after apply)
      + byte_length = 1
      + dec         = (known after apply)
      + hex         = (known after apply)
      + id          = (known after apply)
      + keepers     = {}
    }

Plan: 3 to add, 0 to change, 0 to destroy.

  • ▶️ To apply this plan, comment:
    • atlantis apply -p project
  • 🚮 To delete this plan click here
  • 🔁 To plan this project again, comment:
    • atlantis plan -p project
Plan: 3 to add, 0 to change, 0 to destroy.
  • ⏩ To apply all unapplied plans from this pull request, comment:
    • atlantis apply
  • 🚮 To delete all plans and locks for the PR, comment:
    • atlantis unlock

@krrrr38
Copy link
Owner Author

krrrr38 commented Dec 13, 2022

atlantis import invalid usage

@krrrr38
Copy link
Owner Author

krrrr38 commented Dec 13, 2022

Error: unknown argument(s) – invalid usage.
Usage of import -- ADDR ID:
  -d, --dir string         Which directory to run plan in relative to root of repo,
                           ex. 'child/dir'.
  -p, --project string     Which project to run plan for. Refers to the name of the
                           project configured in atlantis.yaml. Cannot be used at
                           same time as workspace or dir flags.
      --verbose            Append Atlantis log to comment.
  -w, --workspace string   Switch to this Terraform workspace before planning.

@krrrr38
Copy link
Owner Author

krrrr38 commented Dec 13, 2022

atlantis import -- lack-arg

@krrrr38
Copy link
Owner Author

krrrr38 commented Dec 13, 2022

Ran Import for project: project dir: . workspace: default

Import Error

Show Output
running "/usr/local/bin/terraform import \\l\\a\\c\\k\\-\\a\\r\\g" in "/Users/krrrr38/.atlantis/repos/krrrr38/atlantis-debug/3/default": exit status 1
The import command expects two arguments.
Usage: terraform [global options] import [options] ADDR ID

  Import existing infrastructure into your Terraform state.

  This will find and import the specified resource into your Terraform
  state, allowing existing infrastructure to come under Terraform
  management without having to be initially created by Terraform.

  The ADDR specified is the address to import the resource to. Please
  see the documentation online for resource addresses. The ID is a
  resource-specific ID to identify that resource being imported. Please
  reference the documentation for the resource type you're importing to
  determine the ID syntax to use. It typically matches directly to the ID
  that the provider uses.

  The current implementation of Terraform import can only import resources
  into the state. It does not generate configuration. A future version of
  Terraform will also generate configuration.

  Because of this, prior to running terraform import it is necessary to write
  a resource configuration block for the resource manually, to which the
  imported object will be attached.

  This command will not modify your infrastructure, but it will make
  network requests to inspect parts of your infrastructure relevant to
  the resource being imported.

Options:

  -config=path            Path to a directory of Terraform configuration files
                          to use to configure the provider. Defaults to pwd.
                          If no config files are present, they must be provided
                          via the input prompts or env vars.

  -allow-missing-config   Allow import when no resource configuration block exists.

  -input=false            Disable interactive input prompts.

  -lock=false             Don't hold a state lock during the operation. This is
                          dangerous if others might concurrently run commands
                          against the same workspace.

  -lock-timeout=0s        Duration to retry a state lock.

  -no-color               If specified, output won't contain any color.

  -var 'foo=bar'          Set a variable in the Terraform configuration. This
                          flag can be set multiple times. This is only useful
                          with the "-config" flag.

  -var-file=foo           Set variables in the Terraform configuration from
                          a file. If "terraform.tfvars" or any ".auto.tfvars"
                          files are present, they will be automatically loaded.

  -ignore-remote-version  A rare option used for the remote backend only. See
                          the remote backend documentation for more information.

  -state, state-out, and -backup are legacy options supported for the local
  backend only. For more information, see the local backend's documentation.

@krrrr38
Copy link
Owner Author

krrrr38 commented Dec 13, 2022

atlantis import -- notfound resource

@krrrr38
Copy link
Owner Author

krrrr38 commented Dec 13, 2022

Ran Import for project: project dir: . workspace: default

Import Error

running "/usr/local/bin/terraform import \\n\\o\\t\\f\\o\\u\\n\\d \\r\\e\\s\\o\\u\\r\\c\\e" in "/Users/krrrr38/.atlantis/repos/krrrr38/atlantis-debug/3/default": exit status 1
For information on valid syntax, see:
https://www.terraform.io/docs/cli/state/resource-addressing.html
╷
│ Error: Invalid address
│ 
│   on <import-address> line 1:
│    1: notfound
│ 
│ Resource specification must include a resource type and name.
╵


@krrrr38 krrrr38 closed this Dec 22, 2022
@krrrr38 krrrr38 mentioned this pull request Jan 7, 2023
@krrrr38
Copy link
Owner Author

krrrr38 commented Jan 7, 2023

atlantis unlock

@krrrr38
Copy link
Owner Author

krrrr38 commented Jan 7, 2023

Atlantis commands can't be run on closed pull requests

@krrrr38
Copy link
Owner Author

krrrr38 commented Jan 7, 2023

Warning: The plan for dir: . workspace: default was discarded via the Atlantis UI.

To apply this plan you must run plan again.

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

Successfully merging this pull request may close these issues.

1 participant