Comments (4)
To add to this, I think the SSH API is broken generally.
When trying to add a tfe_ssh_key
name = "bitbucket-ssh-key"
organization = "twl"
key = "mtkeyhere"
}
I get the following (debug output) - and obviously the key has been changed :)
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: 2019/11/20 11:00:23 [DEBUG] Create new SSH key for organization: twl
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: 2019/11/20 11:00:23 [DEBUG] TFE API Request Details:
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: ---[ REQUEST ]---------------------------------------
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: POST /api/v2/organizations/twl/ssh-keys HTTP/1.1
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: Host: app.terraform.io
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: User-Agent: go-tfe
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: Content-Length: 91
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: Accept: application/vnd.api+json
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: Authorization: Bearer XXXXXXXXXXX
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: Content-Type: application/vnd.api+json
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: Accept-Encoding: gzip
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4:
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: {
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: "data": {
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: "type": "ssh-keys",
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: "attributes": {
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: "name": "bitbucket-ssh-key",
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: "value": "mtkeyhere"
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: }
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: }
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: }
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4:
2019-11-20T11:00:23.334+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: -----------------------------------------------------
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: 2019/11/20 11:00:23 [DEBUG] TFE API Response Details:
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: ---[ RESPONSE ]--------------------------------------
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: HTTP/2.0 404 Not Found
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: Content-Length: 49
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: Cache-Control: no-cache
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: Content-Type: application/vnd.api+json; charset=utf-8
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: Date: Tue, 19 Nov 2019 22:00:23 GMT
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: Vary: Accept-Encoding
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: Vary: Origin
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: X-Content-Type-Options: nosniff
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: X-Frame-Options: SAMEORIGIN
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: X-Ratelimit-Limit: 30
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: X-Ratelimit-Remaining: 28
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: X-Ratelimit-Reset: 0.48
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: X-Request-Id: e690272e-0dc3-eaf6-addc-6093a0635fed
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: X-Xss-Protection: 1; mode=block
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4:
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: {
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: "errors": [
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: {
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: "status": "404",
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: "title": "not found"
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: }
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: ]
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: }
2019-11-20T11:00:23.626+1300 [DEBUG] plugin.terraform-provider-tfe_v0.11.1_x4: -----------------------------------------------------
2019/11/20 11:00:23 [DEBUG] tfe_ssh_key.bitbucket: apply errored, but we're indicating that via the Error pointer rather than returning it: Error creating SSH key bitbucket-ssh-key for organization twl: resource not found
2019/11/20 11:00:23 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2019/11/20 11:00:23 [TRACE] EvalMaybeTainted: tfe_ssh_key.bitbucket encountered an error during creation, so it is now marked as tainted
2019/11/20 11:00:23 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: Error creating SSH key bitbucket-ssh-key for organization twl: resource not found
2019/11/20 11:00:23 [ERROR] <root>: eval: *terraform.EvalSequence, err: Error creating SSH key bitbucket-ssh-key for organization twl: resource not found
from terraform-provider-tfe.
Note: This endpoint cannot be accessed with organization tokens. You must access it with a user token or team token.
https://www.terraform.io/docs/cloud/api/ssh-keys.html
Just hit this with using data
to pull the SSH key id. Just use a team or user token.
from terraform-provider-tfe.
johncblandii is correct, the token is likely actually unauthorized. Closing this, but if it's still a problem please feel free to reopen. Thanks!
from terraform-provider-tfe.
Hi! Re opening as I'm having the same issue while creating a new SSH key with the TFE provider:
Something similar happens when trying to assign to a workspace an existing SSH key:
And even while using the data source trying to retrieve an existing key from the CLI:
-> UPDATE: nevermind, it seems all is related to using an "Organization" level token, that can't manage SSH keys. A bit paradoxical if you ask me as it's the recommended one for managing workspaces but the docs clearly says it so switched to a "Team" level and worked OK.
from terraform-provider-tfe.
Related Issues (20)
- Data sources errors are not self-descriptive in the nature of the error HOT 1
- Data source for the current user/account
- tfe_workspace failing - Resource not found HOT 5
- ```tfe_team``` visibility not being set as defined in Terraform Cloud HOT 5
- `tfe_workspace` Repository doesn't exist or isn't accessible for `github_app_installation_id`
- Add an option for tfe_registry_module to wait for version ingress
- tfe_variable unable create with value from file with hcl content HOT 3
- tfe_saml_settings Error: Provider produced inconsistent result after apply
- Unclear what "HCP Terraform for Business" means [tfe_agent_pool_allowed_workspaces]
- `tfe_organization_run_task` - Add Support for Global Toggle
- `tfe_notification_configuration` - Add Support for Auto Destroy Triggers
- Importing `tfe_team` resource in Terraform Cloud does not import
- tfe_policy does not actually alter enforce_mode on OPA policies
- Workspace URL not updating after changing workspace name and running Terraform apply again.
- The title of the No-Code module is incorrect
- `tfe_github_app_installation` called `tfe_github_installation` in catalog sidebar
- Add `tfe_github_app_installations` Data Source
- Add support for Audit trail tokens
- Managing the membership of the `owners` team tries to remove hidden Hashicorp-owned members
- Not detecting auto_destroy_activity_duration drift
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-tfe.