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

Add support for ssh target #264

Merged
merged 5 commits into from
Sep 13, 2022
Merged

Add support for ssh target #264

merged 5 commits into from
Sep 13, 2022

Conversation

louisruch
Copy link
Contributor

I could not add unit tests for SSH but I did manually configure an SSH target locally:

tf file ssh target section:

resource "boundary_target" "ssh" {
  type                     = "ssh"
  name                     = "ssh"
  description              = "SSH server"
  scope_id                 = boundary_scope.project.id
  session_connection_limit = -1
  session_max_seconds      = 1000
  default_port             = 220
  host_source_ids = [
    boundary_host_set.local.id
  ]
  injected_application_credential_source_ids = [
    boundary_credential_ssh_private_key.example.id
  ]
}

Output fromterraform apply:

  # boundary_target.ssh will be created
  + resource "boundary_target" "ssh" {
      + application_credential_source_ids = (known after apply)
      + default_port                      = 22
      + description                       = "SSH server"
      + host_source_ids                   = (known after apply)
      + id                                = (known after apply)
      + name                              = "ssh"
      + scope_id                          = (known after apply)
      + session_connection_limit          = -1
      + session_max_seconds               = 1000
      + type                              = "ssh"
    }

And an update of the default port:

terraform apply
boundary_scope.global: Refreshing state... [id=global]
boundary_scope.org: Refreshing state... [id=o_yjabwKr6tJ]
boundary_role.global_anon_listing: Refreshing state... [id=r_esFqOwnTrY]
boundary_scope.project: Refreshing state... [id=p_dmluKuEzr6]
boundary_auth_method.password: Refreshing state... [id=ampw_gRJoZpZfDU]
boundary_role.org_anon_listing: Refreshing state... [id=r_1XpXBcEvH9]
boundary_host_catalog.databases: Refreshing state... [id=hcst_TIRfsJUUXl]
boundary_credential_store_static.example: Refreshing state... [id=csst_Ke8sqRb3YE]
boundary_account_password.user["jasper"]: Refreshing state... [id=acctpw_W9LdBtZqsd]
boundary_account_password.user["swati"]: Refreshing state... [id=acctpw_wiPvV8yVPu]
boundary_credential_ssh_private_key.example: Refreshing state... [id=credspk_N54Ez9jqP2]
boundary_host.localhost: Refreshing state... [id=hst_x9KDEBEaXk]
boundary_user.user["swati"]: Refreshing state... [id=u_tPvSHZe3Wv]
boundary_user.user["jasper"]: Refreshing state... [id=u_aAV0HspqK6]
boundary_host_set.local: Refreshing state... [id=hsst_CAChHk3AlW]
boundary_role.proj_admin: Refreshing state... [id=r_2XtzMPM15w]
boundary_role.org_admin: Refreshing state... [id=r_uLdXKX6I9r]
boundary_target.ssh: Refreshing state... [id=tssh_muUfGTnf1m]

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:

  # boundary_target.ssh will be updated in-place
  ~ resource "boundary_target" "ssh" {
      ~ default_port                               = 22 -> 220
        id                                         = "tssh_muUfGTnf1m"
        name                                       = "ssh"
        # (9 unchanged attributes hidden)
    }

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


Warning: Deprecated Resource

  on main.tf line 120, in resource "boundary_host_catalog" "databases":
 120: resource "boundary_host_catalog" "databases" {

Deprecated: use `boundary_host_catalog_static` instead.

(and 2 more similar warnings elsewhere)

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

boundary_target.ssh: Modifying... [id=tssh_muUfGTnf1m]
boundary_target.ssh: Modifications complete after 0s [id=tssh_muUfGTnf1m]

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

Copy link
Contributor

@ddebko ddebko left a comment

Choose a reason for hiding this comment

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

LGTM

internal/provider/resource_target.go Outdated Show resolved Hide resolved
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.

2 participants