terraform-import-github-organization icon indicating copy to clipboard operation
terraform-import-github-organization copied to clipboard

import fail on jbangdev org

Open maxandersen opened this issue 3 years ago • 1 comments

Trying to use this on jbangdev which is quite simple org but it eventually fails:

Warning: Interpolation-only expressions are deprecated

  on github-team-memberships-jbang-catalog.tf line 3, in resource "github_team_membership" "jbang-catalog-maxandersen":
   3:   team_id     = "${github_team.jbang-catalog.id}"

Terraform 0.11 and earlier required all non-constant expressions to be
provided via interpolation syntax, but this pattern is now deprecated. To
silence this warning, remove the "${ sequence from the start and the }"
sequence from the end of this expression, leaving just the inner expression.

Template interpolation syntax is still used to construct strings from
expressions when the template includes multiple interpolation sequences or a
mixture of literal strings and interpolations. This deprecation applies only
to templates that consist entirely of a single interpolation sequence.

(and 3 more similar warnings elsewhere)

parse error: Invalid numeric literal at line 1, column 5
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 55957    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

Warning: Interpolation-only expressions are deprecated

  on github-team-memberships-jbang-catalog.tf line 3, in resource "github_team_membership" "jbang-catalog-maxandersen":
   3:   team_id     = "${github_team.jbang-catalog.id}"

Terraform 0.11 and earlier required all non-constant expressions to be
provided via interpolation syntax, but this pattern is now deprecated. To
silence this warning, remove the "${ sequence from the start and the }"
sequence from the end of this expression, leaving just the inner expression.

Template interpolation syntax is still used to construct strings from
expressions when the template includes multiple interpolation sequences or a
mixture of literal strings and interpolations. This deprecation applies only
to templates that consist entirely of a single interpolation sequence.

(and one more similar warning elsewhere)

Error: resource address "github_team_repository.jbang-catalog-jbang-catalog" does not exist in the configuration.

Before importing this resource, please create its configuration in the root module. For example:

resource "github_team_repository" "jbang-catalog-jbang-catalog" {
  # (resource arguments)
}

any idea on what to go look for ?

maxandersen avatar Jul 25 '20 07:07 maxandersen

You use a more recent version of Terraform than the one which was used, so in your case, as explained in the error message, you can remove the ${ and }' that appear after team_id = , leaving just : team_id = "github_team.jbang-catalog.id"for instance you will have to make those changes interraform-import-github-org.sh` that creates those resources

In the code, you can replace all instances of team_id = "\${github_team.${TEAM_NAME}.id}" with team_id = "github_team.${TEAM_NAME}.id"

SansGuidon avatar Jul 25 '20 08:07 SansGuidon